Fixed rocks and muffins not breaking glass when thrown. Closes #497

This commit is contained in:
Sollace 2024-10-29 16:22:01 +00:00
parent 935cc95ea2
commit e00bc4feca
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -226,7 +226,7 @@ public class PhysicsBodyProjectileEntity extends PersistentProjectileEntity impl
boolean ownerCanModify = !getWorld().isClient && Caster.of(getOwner()).filter(pony -> pony.canModifyAt(hit.getBlockPos())).isPresent();
if (ownerCanModify && getWorld().getGameRules().getBoolean(GameRules.DO_MOB_GRIEFING)) {
if ((!isBouncy() || getWorld().random.nextInt(200) == 0) && state.isIn(UTags.Blocks.FRAGILE)) {
if ((!isBouncy() || getWorld().random.nextInt(200) == 0) && getWorld().getBlockState(hit.getBlockPos()).isIn(UTags.Blocks.FRAGILE)) {
getWorld().breakBlock(hit.getBlockPos(), true);
}
}