fix laser stuff
All checks were successful
/ Auto-Build-App (push) Successful in 1m21s

This commit is contained in:
pietru 2025-02-26 10:51:20 +01:00
parent 45c4e939a8
commit a8891729d4

View file

@ -27,6 +27,7 @@ public class EntityLaserProjectileMixin extends EntityMixin {
@Inject(method = "onCollideWithBlock", at = @At("HEAD"), cancellable = true)
private void event_collide_block(Axis axis, BlockState block, int bx, int by, int bz, CallbackInfo ci){
if (GameSingletons.isHost && ServerSingletons.SERVER != null){
BlockPosition blockPos = BlockPosition.ofGlobal(this.zone, bx, by, bz);
Player plr = null;
for (Player p : GameSingletons.world.players) {
@ -46,8 +47,9 @@ public class EntityLaserProjectileMixin extends EntityMixin {
}else {
if (sourceEntityId==null && !can_edit_block(blockPos, "be_laser"))
ci.cancel();
else if (!can_edit_block(blockPos, "laser"))
else if (sourceEntityId!=null &&!can_edit_block(blockPos, "laser"))
ci.cancel();
}
}
}
}