From 2c3a866494bdd238ac50cbffab753cb2b00e4754 Mon Sep 17 00:00:00 2001 From: Snownee Date: Tue, 26 Jan 2021 14:43:33 +0800 Subject: [PATCH 1/9] Fix contraption sticky block connectivity. Add support to PUSH_ONLY push reaction --- .../BlockMovementTraits.java | 6 ++++++ .../structureMovement/Contraption.java | 20 +++++++++++++++---- .../piston/PistonContraption.java | 3 +++ 3 files changed, 25 insertions(+), 4 deletions(-) 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 bf4a6124f..bb4dadb7f 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 @@ -59,6 +59,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; @@ -240,7 +241,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); @@ -296,14 +297,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; } @@ -313,8 +313,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)); 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 2895fb9bd..1e101fd94 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; From 92a1395b147cbf1e204eb3ba480694836c2f9357 Mon Sep 17 00:00:00 2001 From: Snownee Date: Tue, 26 Jan 2021 15:26:01 +0800 Subject: [PATCH 2/9] Fix spectator can interact with blocks --- .../block/mechanicalArm/ArmInteractionPointHandler.java | 4 +++- .../behaviour/edgeInteraction/EdgeInteractionHandler.java | 2 +- .../tileEntity/behaviour/filtering/FilteringHandler.java | 2 +- .../foundation/tileEntity/behaviour/linked/LinkHandler.java | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) 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/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..d542f5039 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); 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); From 8f7945ff4eff59d0de5f1eaab668bfb999d2e538 Mon Sep 17 00:00:00 2001 From: Snownee Date: Tue, 26 Jan 2021 16:48:03 +0800 Subject: [PATCH 3/9] Fix rope pulley breaking bedrock --- .../structureMovement/pulley/PulleyTileEntity.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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) From b958be07123f136b33a9ae333641a31173f218bf Mon Sep 17 00:00:00 2001 From: Snownee Date: Tue, 26 Jan 2021 18:00:47 +0800 Subject: [PATCH 4/9] Fix desync of FilteringBehaviour --- .../tileEntity/behaviour/filtering/FilteringHandler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 d542f5039..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 @@ -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); From 08a20972aa7f93bee34bf8b1f042b8628a646cf1 Mon Sep 17 00:00:00 2001 From: Snownee Date: Sat, 30 Jan 2021 18:51:44 +0800 Subject: [PATCH 5/9] Fix broken render state in RenderWorldLastEvent --- src/main/java/com/simibubi/create/events/ClientEvents.java | 2 ++ 1 file changed, 2 insertions(+) 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(); } From c77e7c28d7fc666051ab27e0550501690322c491 Mon Sep 17 00:00:00 2001 From: Snownee Date: Sat, 30 Jan 2021 21:14:58 +0800 Subject: [PATCH 6/9] Fix gauge not rendering behind door --- .../create/content/contraptions/relays/gauge/GaugeBlock.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; From 7436ceb209ed53df82c366f96297b6a895c16e60 Mon Sep 17 00:00:00 2001 From: Snownee Date: Sun, 31 Jan 2021 19:24:44 +0800 Subject: [PATCH 7/9] Fix stabilized contraption moving bearing block --- .../components/structureMovement/Contraption.java | 4 ++-- .../structureMovement/TranslatingContraption.java | 3 +-- .../structureMovement/bearing/BearingContraption.java | 7 ++++--- .../structureMovement/bearing/ClockworkContraption.java | 9 +++++---- .../bearing/StabilizedBearingMovementBehaviour.java | 2 +- .../structureMovement/bearing/StabilizedContraption.java | 2 +- .../structureMovement/mounted/MountedContraption.java | 2 +- 7 files changed, 15 insertions(+), 14 deletions(-) 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 bb4dadb7f..54bab2c8d 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 @@ -135,7 +135,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 AllContraptionTypes getType(); @@ -338,7 +338,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 7e473df3b..9d889227b 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 76db5bd8b..9559d8c90 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 31b7709f3..ee625cc63 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 f54d09beb..a6b3ec837 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 3d6a28dd8..8846e24b0 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; } From d1e9b76a248163f8fc109c58e80e3c335b64d4b8 Mon Sep 17 00:00:00 2001 From: Snownee Date: Sun, 31 Jan 2021 19:54:27 +0800 Subject: [PATCH 8/9] Make deployer still activate when it is triggering advancement --- .../contraptions/components/deployer/DeployerTileEntity.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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; From fc459732fc274e69a643dcad245c82fef638c2f8 Mon Sep 17 00:00:00 2001 From: Snownee Date: Mon, 1 Feb 2021 16:46:36 +0800 Subject: [PATCH 9/9] Fix chute item dupe (#939) --- .../content/contraptions/components/fan/AirCurrent.java | 2 +- .../components/press/MechanicalPressTileEntity.java | 4 +++- .../create/content/logistics/block/chute/ChuteTileEntity.java | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) 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/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;