diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java index 65beab8e3..1aa3a0330 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java @@ -183,8 +183,7 @@ public class DeployerTileEntity extends KineticTileEntity { if (state == State.EXPANDING) { if (boop) triggerBoop(); - else - activate(); + activate(); state = State.RETRACTING; timer = 1000; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/fan/AirCurrent.java b/src/main/java/com/simibubi/create/content/contraptions/components/fan/AirCurrent.java index ca4693b1a..8f499bce8 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/fan/AirCurrent.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/fan/AirCurrent.java @@ -82,7 +82,7 @@ public class AirCurrent { protected void tickAffectedEntities(World world, Direction facing) { for (Iterator iterator = caughtEntities.iterator(); iterator.hasNext();) { Entity entity = iterator.next(); - if (!entity.getBoundingBox() + if (!entity.isAlive() || !entity.getBoundingBox() .intersects(bounds)) { iterator.remove(); continue; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java index 3d320743a..ca52ae3a6 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java @@ -153,6 +153,8 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity { for (ItemEntity itemEntity : world.getEntitiesWithinAABB(ItemEntity.class, new AxisAlignedBB(pos.down()).shrink(.125f))) { + if (!itemEntity.isAlive() || !itemEntity.onGround) + continue; ItemStack stack = itemEntity.getItem(); Optional recipe = getRecipe(stack); if (!recipe.isPresent()) @@ -233,7 +235,7 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity { for (Entity entity : world.getEntitiesWithinAABBExcludingEntity(null, bb)) { if (!(entity instanceof ItemEntity)) continue; - if (!entity.isAlive()) + if (!entity.isAlive() || !entity.onGround) continue; ItemEntity itemEntity = (ItemEntity) entity; pressedItems.add(itemEntity.getItem()); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementTraits.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementTraits.java index 93a4dac0d..ad25a1b97 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementTraits.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/BlockMovementTraits.java @@ -227,6 +227,12 @@ public class BlockMovementTraits { if (state.getBlock() instanceof SailBlock) return facing.getAxis() == state.get(SailBlock.FACING) .getAxis(); + if (AllBlocks.PISTON_EXTENSION_POLE.has(state)) + return facing.getAxis() != state.get(BlockStateProperties.FACING) + .getAxis(); + if (AllBlocks.MECHANICAL_PISTON_HEAD.has(state)) + return facing.getAxis() != state.get(BlockStateProperties.FACING) + .getAxis(); return isBrittle(state); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java index 91daa8f04..63b6e4407 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java @@ -63,6 +63,7 @@ import net.minecraft.block.ChestBlock; import net.minecraft.block.DoorBlock; import net.minecraft.block.IWaterLoggable; import net.minecraft.block.PressurePlateBlock; +import net.minecraft.block.material.PushReaction; import net.minecraft.entity.Entity; import net.minecraft.fluid.Fluids; import net.minecraft.fluid.IFluidState; @@ -139,7 +140,7 @@ public abstract class Contraption { public abstract boolean assemble(World world, BlockPos pos); - protected abstract boolean canAxisBeStabilized(Axis axis); + public abstract boolean canBeStabilized(Direction facing, BlockPos localPos); protected abstract ContraptionType getType(); @@ -245,7 +246,7 @@ public abstract class Contraption { fluidStorage.forEach((pos, mfs) -> mfs.tick(entity, pos, world.isRemote)); } - protected boolean moveBlock(World world, BlockPos pos, Direction forcedDirection, List frontier, + protected boolean moveBlock(World world, BlockPos pos, @Nullable Direction forcedDirection, List frontier, Set visited) { visited.add(pos); frontier.remove(pos); @@ -311,14 +312,13 @@ public abstract class Contraption { Map superglue = SuperGlueHandler.gatherGlue(world, pos); // Slime blocks and super glue drag adjacent blocks if possible - boolean isStickyBlock = state.isStickyBlock(); for (Direction offset : Iterate.directions) { BlockPos offsetPos = pos.offset(offset); BlockState blockState = world.getBlockState(offsetPos); if (isAnchoringBlockAt(offsetPos)) continue; if (!movementAllowed(world, offsetPos)) { - if (offset == forcedDirection && isStickyBlock) + if (offset == forcedDirection) return false; continue; } @@ -328,8 +328,20 @@ public abstract class Contraption { boolean blockAttachedTowardsFace = BlockMovementTraits.isBlockAttachedTowards(world, offsetPos, blockState, offset.getOpposite()); boolean brittle = BlockMovementTraits.isBrittle(blockState); + boolean canStick = !brittle && state.canStickTo(blockState) && blockState.canStickTo(state); + if (canStick) { + if (state.getPushReaction() == PushReaction.PUSH_ONLY || blockState.getPushReaction() == PushReaction.PUSH_ONLY) { + canStick = false; + } + if (BlockMovementTraits.notSupportive(state, offset)) { + canStick = false; + } + if (BlockMovementTraits.notSupportive(blockState, offset.getOpposite())) { + canStick = false; + } + } - if (!wasVisited && ((isStickyBlock && !brittle) || blockAttachedTowardsFace || faceHasGlue)) + if (!wasVisited && (canStick || blockAttachedTowardsFace || faceHasGlue || (offset == forcedDirection && !BlockMovementTraits.notSupportive(state, forcedDirection)))) frontier.add(offsetPos); if (faceHasGlue) addGlue(superglue.get(offset)); @@ -418,7 +430,7 @@ public abstract class Contraption { private void moveBearing(BlockPos pos, List frontier, Set visited, BlockState state) { Direction facing = state.get(MechanicalBearingBlock.FACING); - if (!canAxisBeStabilized(facing.getAxis())) { + if (!canBeStabilized(facing, pos.subtract(anchor))) { BlockPos offset = pos.offset(facing); if (!visited.contains(offset)) frontier.add(offset); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/TranslatingContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/TranslatingContraption.java index 82d1f89ce..a692a112a 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/TranslatingContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/TranslatingContraption.java @@ -5,7 +5,6 @@ import java.util.HashSet; import java.util.Set; import net.minecraft.util.Direction; -import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.gen.feature.template.Template.BlockInfo; @@ -48,7 +47,7 @@ public abstract class TranslatingContraption extends Contraption { } @Override - protected boolean canAxisBeStabilized(Axis axis) { + public boolean canBeStabilized(Direction facing, BlockPos localPos) { return false; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java index fc99cd432..8215a87c2 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java @@ -9,7 +9,6 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Con import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; -import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.gen.feature.template.Template.BlockInfo; @@ -84,8 +83,10 @@ public class BearingContraption extends Contraption { } @Override - protected boolean canAxisBeStabilized(Axis axis) { - return axis == facing.getAxis(); + public boolean canBeStabilized(Direction facing, BlockPos localPos) { + if (facing.getOpposite() == this.facing && BlockPos.ZERO.equals(localPos)) + return false; + return facing.getAxis() == this.facing.getAxis(); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkContraption.java index 94f889bd3..4a9c61992 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkContraption.java @@ -12,7 +12,6 @@ import com.simibubi.create.foundation.utility.NBTHelper; import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.Direction; -import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -110,15 +109,17 @@ public class ClockworkContraption extends Contraption { @Override public void readNBT(World world, CompoundNBT tag, boolean spawnData) { - facing = Direction.byIndex(tag.getInt("Facing")); + facing = Direction.byIndex(tag.getInt("facing")); handType = NBTHelper.readEnum(tag, "HandType", HandType.class); offset = tag.getInt("offset"); super.readNBT(world, tag, spawnData); } @Override - protected boolean canAxisBeStabilized(Axis axis) { - return axis == facing.getAxis(); + public boolean canBeStabilized(Direction facing, BlockPos localPos) { + if (BlockPos.ZERO.equals(localPos) || BlockPos.ZERO.equals(localPos.offset(facing))) + return false; + return facing.getAxis() == this.facing.getAxis(); } public static enum HandType { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedBearingMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedBearingMovementBehaviour.java index 35df5d517..3bec0cedf 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedBearingMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedBearingMovementBehaviour.java @@ -45,7 +45,7 @@ public class StabilizedBearingMovementBehaviour extends MovementBehaviour { AbstractContraptionEntity entity = context.contraption.entity; if (entity instanceof ControlledContraptionEntity) { ControlledContraptionEntity controlledCE = (ControlledContraptionEntity) entity; - if (controlledCE.getRotationAxis() == axis) + if (context.contraption.canBeStabilized(facing, context.localPos)) offset = -controlledCE.getAngle(renderPartialTicks); } else if (entity instanceof OrientedContraptionEntity) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java index 15f8b40d7..c8281b7c0 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java @@ -55,7 +55,7 @@ public class StabilizedContraption extends Contraption { } @Override - protected boolean canAxisBeStabilized(Axis axis) { + public boolean canBeStabilized(Direction facing, BlockPos localPos) { return false; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java index 8386ae8f3..15e973052 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java @@ -149,7 +149,7 @@ public class MountedContraption extends Contraption { } @Override - protected boolean canAxisBeStabilized(Axis axis) { + public boolean canBeStabilized(Direction facing, BlockPos localPos) { return true; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java index bcca6e574..965bfe588 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java @@ -8,6 +8,7 @@ import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.block.BlockState; import net.minecraft.block.CarpetBlock; +import net.minecraft.block.material.PushReaction; import net.minecraft.nbt.CompoundNBT; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.PistonType; @@ -164,6 +165,8 @@ public class PistonContraption extends TranslatingContraption { return true; if (!BlockMovementTraits.movementAllowed(world, currentPos)) return retracting; + if (retracting && state.getPushReaction() == PushReaction.PUSH_ONLY) + return true; frontier.add(currentPos); if (BlockMovementTraits.notSupportive(state, orientation)) return true; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyTileEntity.java index a416edadc..e2d4b7c0d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyTileEntity.java @@ -48,6 +48,17 @@ public class PulleyTileEntity extends LinearActuatorTileEntity { return; if (speed == 0) return; + int maxLength = AllConfigs.SERVER.kinetics.maxRopeLength.get(); + int i = 1; + while (i <= maxLength) { + BlockPos ropePos = pos.down(i); + BlockState ropeState = world.getBlockState(ropePos); + if (!AllBlocks.ROPE.has(ropeState) && !AllBlocks.PULLEY_MAGNET.has(ropeState)) { + break; + } + ++i; + } + offset = i - 1; if (offset >= getExtensionRange() && getSpeed() > 0) return; if (offset <= 0 && getSpeed() < 0) @@ -70,7 +81,7 @@ public class PulleyTileEntity extends LinearActuatorTileEntity { if (!canAssembleStructure && getSpeed() > 0) return; - for (int i = ((int) offset); i > 0; i--) { + for (i = ((int) offset); i > 0; i--) { BlockPos offset = pos.down(i); BlockState oldState = world.getBlockState(offset); if (oldState.getBlock() instanceof IWaterLoggable && oldState.has(BlockStateProperties.WATERLOGGED) diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeBlock.java index 1580b553e..fa8fe2f0b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeBlock.java @@ -14,7 +14,6 @@ import com.simibubi.create.foundation.utility.worldWrappers.WrappedWorld; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; -import net.minecraft.block.material.Material; import net.minecraft.block.material.MaterialColor; import net.minecraft.item.BlockItemUseContext; import net.minecraft.particles.RedstoneParticleData; @@ -114,6 +113,7 @@ public class GaugeBlock extends DirectionalAxisKineticBlock { return context.getFace(); } + @Override protected boolean getAxisAlignmentForPlacement(BlockItemUseContext context) { return context.getPlacementHorizontalFacing().getAxis() != Axis.X; } @@ -127,8 +127,7 @@ public class GaugeBlock extends DirectionalAxisKineticBlock { return false; if (getRotationAxis(state) == Axis.Y && face != state.get(FACING)) return false; - BlockState blockState = world.getBlockState(pos.offset(face)); - if (Block.hasSolidSide(blockState, world, pos, face.getOpposite()) && blockState.getMaterial() != Material.GLASS + if (!Block.shouldSideBeRendered(state, world, pos, face) && !(world instanceof WrappedWorld)) return false; return true; diff --git a/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java index 006097715..943f8345e 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java @@ -223,6 +223,8 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor AxisAlignedBB searchArea = new AxisAlignedBB(center.add(0, -bottomPullDistance - 0.5, 0), center.add(0, -0.5, 0)).grow(.45f); for (ItemEntity itemEntity : world.getEntitiesWithinAABB(ItemEntity.class, searchArea)) { + if (!itemEntity.isAlive()) + continue; ItemStack entityItem = itemEntity.getItem(); if (!canAcceptItem(entityItem)) continue; diff --git a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmInteractionPointHandler.java b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmInteractionPointHandler.java index 7cf1e883b..a6d305883 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmInteractionPointHandler.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmInteractionPointHandler.java @@ -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; diff --git a/src/main/java/com/simibubi/create/events/ClientEvents.java b/src/main/java/com/simibubi/create/events/ClientEvents.java index e3399d191..6ff99a9dc 100644 --- a/src/main/java/com/simibubi/create/events/ClientEvents.java +++ b/src/main/java/com/simibubi/create/events/ClientEvents.java @@ -1,6 +1,7 @@ package com.simibubi.create.events; import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.systems.RenderSystem; import com.simibubi.create.AllFluids; import com.simibubi.create.Create; import com.simibubi.create.CreateClient; @@ -124,6 +125,7 @@ public class ClientEvents { CreateClient.outliner.renderOutlines(ms, buffer); // CollisionDebugger.render(ms, buffer); buffer.draw(); + RenderSystem.enableCull(); ms.pop(); } diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionHandler.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionHandler.java index 3c7c90323..53124201c 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionHandler.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionHandler.java @@ -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) diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringHandler.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringHandler.java index dd605d425..b71159441 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringHandler.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringHandler.java @@ -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); @@ -75,12 +75,12 @@ public class FilteringHandler { if (event.getSide() != LogicalSide.CLIENT) { if (!player.isCreative()) { - if (behaviour.getFilter() - .getItem() instanceof FilterItem) - player.inventory.placeItemBackInInventory(world, behaviour.getFilter()); if (toApply.getItem() instanceof FilterItem) player.getHeldItem(hand) .shrink(1); + if (behaviour.getFilter() + .getItem() instanceof FilterItem) + player.inventory.placeItemBackInInventory(world, behaviour.getFilter()); } if (toApply.getItem() instanceof FilterItem) toApply.setCount(1); diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/linked/LinkHandler.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/linked/LinkHandler.java index b7538fdd7..30a88de18 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/linked/LinkHandler.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/linked/LinkHandler.java @@ -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);