This commit is contained in:
parent
45c4e939a8
commit
a8891729d4
1 changed files with 20 additions and 18 deletions
|
@ -27,6 +27,7 @@ public class EntityLaserProjectileMixin extends EntityMixin {
|
||||||
|
|
||||||
@Inject(method = "onCollideWithBlock", at = @At("HEAD"), cancellable = true)
|
@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){
|
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);
|
BlockPosition blockPos = BlockPosition.ofGlobal(this.zone, bx, by, bz);
|
||||||
Player plr = null;
|
Player plr = null;
|
||||||
for (Player p : GameSingletons.world.players) {
|
for (Player p : GameSingletons.world.players) {
|
||||||
|
@ -46,8 +47,9 @@ public class EntityLaserProjectileMixin extends EntityMixin {
|
||||||
}else {
|
}else {
|
||||||
if (sourceEntityId==null && !can_edit_block(blockPos, "be_laser"))
|
if (sourceEntityId==null && !can_edit_block(blockPos, "be_laser"))
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
else if (!can_edit_block(blockPos, "laser"))
|
else if (sourceEntityId!=null &&!can_edit_block(blockPos, "laser"))
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue