mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-01 03:26:44 +01:00
Fixed block ghosting when breaking glass by throwing rocks
This commit is contained in:
parent
eed112ef4a
commit
9601109a21
2 changed files with 2 additions and 2 deletions
|
@ -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)) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue