mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-03-01 15:54:34 +01:00
Prevent sombra from breaking blocks when mob griefing is off
This commit is contained in:
parent
5a83227d2c
commit
30f5c73609
1 changed files with 5 additions and 3 deletions
|
@ -279,11 +279,13 @@ public class SombraEntity extends HostileEntity implements ArenaCombatant, Parti
|
||||||
if (getWorld().isClient) {
|
if (getWorld().isClient) {
|
||||||
generateBodyParticles();
|
generateBodyParticles();
|
||||||
} else {
|
} else {
|
||||||
|
if (getWorld().getGameRules().get(GameRules.DO_MOB_GRIEFING).get()) {
|
||||||
for (BlockPos p : BlockPos.iterateOutwards(getBlockPos(), 2, 1, 2)) {
|
for (BlockPos p : BlockPos.iterateOutwards(getBlockPos(), 2, 1, 2)) {
|
||||||
if (getWorld().getBlockState(p).getLuminance() > 13) {
|
if (getWorld().getBlockState(p).getLuminance() > 13) {
|
||||||
destroyLightSource(p);
|
destroyLightSource(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
float healthPercentage = 100 * (getHealth() / getMaxHealth());
|
float healthPercentage = 100 * (getHealth() / getMaxHealth());
|
||||||
float difference = MathHelper.abs(healthPercentage - MathHelper.floor(healthPercentage));
|
float difference = MathHelper.abs(healthPercentage - MathHelper.floor(healthPercentage));
|
||||||
|
|
Loading…
Reference in a new issue