Fixed block ghosting when breaking glass by throwing rocks

This commit is contained in:
Sollace 2022-12-19 21:24:09 +01:00
parent eed112ef4a
commit 9601109a21
2 changed files with 2 additions and 2 deletions

View file

@ -128,7 +128,7 @@ public class PhysicsBodyProjectileEntity extends PersistentProjectileEntity impl
BlockState state = world.getBlockState(hit.getBlockPos());
if (getVelocity().length() > 0.2F) {
boolean ownerCanModify = Caster.of(getOwner()).filter(pony -> pony.canModifyAt(hit.getBlockPos())).isPresent();
boolean ownerCanModify = !world.isClient && Caster.of(getOwner()).filter(pony -> pony.canModifyAt(hit.getBlockPos())).isPresent();
if (ownerCanModify && world.getGameRules().getBoolean(GameRules.DO_MOB_GRIEFING)) {
if ((!isBouncy() || world.random.nextInt(200) == 0) && state.isIn(UTags.FRAGILE)) {

View file

@ -53,7 +53,7 @@ public class HeavyProjectileItem extends ProjectileItem implements ProjectileDel
@Override
public void onImpact(MagicProjectileEntity projectile, BlockHitResult hit) {
if (projectile.world.getGameRules().getBoolean(GameRules.DO_MOB_GRIEFING)) {
if (!projectile.world.isClient && projectile.world.getGameRules().getBoolean(GameRules.DO_MOB_GRIEFING)) {
float damage = projectile instanceof FlyingItemEntity ? getProjectileDamage(((FlyingItemEntity)projectile).getStack()) : 0;
if (damage > 0 && projectile.world.random.nextInt(90) == 0) {