mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-15 19:43:42 +01:00
Fix spectator can interact with blocks
This commit is contained in:
parent
2c3a866494
commit
92a1395b14
4 changed files with 6 additions and 4 deletions
|
@ -48,6 +48,9 @@ public class ArmInteractionPointHandler {
|
|||
World world = event.getWorld();
|
||||
if (!world.isRemote)
|
||||
return;
|
||||
PlayerEntity player = event.getPlayer();
|
||||
if (player != null && player.isSpectator())
|
||||
return;
|
||||
|
||||
ArmInteractionPoint selected = getSelected(pos);
|
||||
|
||||
|
@ -60,7 +63,6 @@ public class ArmInteractionPointHandler {
|
|||
}
|
||||
|
||||
selected.cycleMode();
|
||||
PlayerEntity player = event.getPlayer();
|
||||
if (player != null) {
|
||||
String key = selected.mode == Mode.DEPOSIT ? "mechanical_arm.deposit_to" : "mechanical_arm.extract_from";
|
||||
TextFormatting colour = selected.mode == Mode.DEPOSIT ? TextFormatting.GOLD : TextFormatting.AQUA;
|
||||
|
|
|
@ -37,7 +37,7 @@ public class EdgeInteractionHandler {
|
|||
Hand hand = event.getHand();
|
||||
ItemStack heldItem = player.getHeldItem(hand);
|
||||
|
||||
if (player.isSneaking())
|
||||
if (player.isSneaking() || player.isSpectator())
|
||||
return;
|
||||
EdgeInteractionBehaviour behaviour = TileEntityBehaviour.get(world, pos, EdgeInteractionBehaviour.TYPE);
|
||||
if (behaviour == null)
|
||||
|
|
|
@ -43,7 +43,7 @@ public class FilteringHandler {
|
|||
PlayerEntity player = event.getPlayer();
|
||||
Hand hand = event.getHand();
|
||||
|
||||
if (player.isSneaking())
|
||||
if (player.isSneaking() || player.isSpectator())
|
||||
return;
|
||||
|
||||
FilteringBehaviour behaviour = TileEntityBehaviour.get(world, pos, FilteringBehaviour.TYPE);
|
||||
|
|
|
@ -28,7 +28,7 @@ public class LinkHandler {
|
|||
PlayerEntity player = event.getPlayer();
|
||||
Hand hand = event.getHand();
|
||||
|
||||
if (player.isSneaking())
|
||||
if (player.isSneaking() || player.isSpectator())
|
||||
return;
|
||||
|
||||
LinkBehaviour behaviour = TileEntityBehaviour.get(world, pos, LinkBehaviour.TYPE);
|
||||
|
|
Loading…
Reference in a new issue