Prevent sombra from breaking blocks when mob griefing is off

This commit is contained in:
Sollace 2023-09-04 23:36:51 +01:00
parent 5a83227d2c
commit 30f5c73609
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -279,9 +279,11 @@ public class SombraEntity extends HostileEntity implements ArenaCombatant, Parti
if (getWorld().isClient) { if (getWorld().isClient) {
generateBodyParticles(); generateBodyParticles();
} else { } else {
for (BlockPos p : BlockPos.iterateOutwards(getBlockPos(), 2, 1, 2)) { if (getWorld().getGameRules().get(GameRules.DO_MOB_GRIEFING).get()) {
if (getWorld().getBlockState(p).getLuminance() > 13) { for (BlockPos p : BlockPos.iterateOutwards(getBlockPos(), 2, 1, 2)) {
destroyLightSource(p); if (getWorld().getBlockState(p).getLuminance() > 13) {
destroyLightSource(p);
}
} }
} }