mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-15 21:23:41 +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();
|
World world = event.getWorld();
|
||||||
if (!world.isRemote)
|
if (!world.isRemote)
|
||||||
return;
|
return;
|
||||||
|
PlayerEntity player = event.getPlayer();
|
||||||
|
if (player != null && player.isSpectator())
|
||||||
|
return;
|
||||||
|
|
||||||
ArmInteractionPoint selected = getSelected(pos);
|
ArmInteractionPoint selected = getSelected(pos);
|
||||||
|
|
||||||
|
@ -60,7 +63,6 @@ public class ArmInteractionPointHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
selected.cycleMode();
|
selected.cycleMode();
|
||||||
PlayerEntity player = event.getPlayer();
|
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
String key = selected.mode == Mode.DEPOSIT ? "mechanical_arm.deposit_to" : "mechanical_arm.extract_from";
|
String key = selected.mode == Mode.DEPOSIT ? "mechanical_arm.deposit_to" : "mechanical_arm.extract_from";
|
||||||
TextFormatting colour = selected.mode == Mode.DEPOSIT ? TextFormatting.GOLD : TextFormatting.AQUA;
|
TextFormatting colour = selected.mode == Mode.DEPOSIT ? TextFormatting.GOLD : TextFormatting.AQUA;
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class EdgeInteractionHandler {
|
||||||
Hand hand = event.getHand();
|
Hand hand = event.getHand();
|
||||||
ItemStack heldItem = player.getHeldItem(hand);
|
ItemStack heldItem = player.getHeldItem(hand);
|
||||||
|
|
||||||
if (player.isSneaking())
|
if (player.isSneaking() || player.isSpectator())
|
||||||
return;
|
return;
|
||||||
EdgeInteractionBehaviour behaviour = TileEntityBehaviour.get(world, pos, EdgeInteractionBehaviour.TYPE);
|
EdgeInteractionBehaviour behaviour = TileEntityBehaviour.get(world, pos, EdgeInteractionBehaviour.TYPE);
|
||||||
if (behaviour == null)
|
if (behaviour == null)
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class FilteringHandler {
|
||||||
PlayerEntity player = event.getPlayer();
|
PlayerEntity player = event.getPlayer();
|
||||||
Hand hand = event.getHand();
|
Hand hand = event.getHand();
|
||||||
|
|
||||||
if (player.isSneaking())
|
if (player.isSneaking() || player.isSpectator())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
FilteringBehaviour behaviour = TileEntityBehaviour.get(world, pos, FilteringBehaviour.TYPE);
|
FilteringBehaviour behaviour = TileEntityBehaviour.get(world, pos, FilteringBehaviour.TYPE);
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class LinkHandler {
|
||||||
PlayerEntity player = event.getPlayer();
|
PlayerEntity player = event.getPlayer();
|
||||||
Hand hand = event.getHand();
|
Hand hand = event.getHand();
|
||||||
|
|
||||||
if (player.isSneaking())
|
if (player.isSneaking() || player.isSpectator())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LinkBehaviour behaviour = TileEntityBehaviour.get(world, pos, LinkBehaviour.TYPE);
|
LinkBehaviour behaviour = TileEntityBehaviour.get(world, pos, LinkBehaviour.TYPE);
|
||||||
|
|
Loading…
Reference in a new issue