diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionCollider.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionCollider.java index df0fd313f..0c0bee7e1 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionCollider.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionCollider.java @@ -13,7 +13,6 @@ import org.apache.commons.lang3.mutable.MutableInt; import org.apache.commons.lang3.mutable.MutableObject; import com.google.common.base.Predicates; -import com.google.common.collect.ImmutableSet; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllMovementBehaviours; import com.simibubi.create.content.contraptions.components.actors.BlockBreakingMovementBehaviour; @@ -285,13 +284,16 @@ public class ContraptionCollider { } if (bounce == 0 && slide > 0 && hasNormal && anyCollision && rotation.hasVerticalRotation()) { - Vector3d motionIn = entityMotionNoTemporal.mul(0, 1, 0) + double slideFactor = collisionNormal.mul(1, 0, 1) + .length() * 1.25f; + Vector3d motionIn = entityMotionNoTemporal.mul(0, .9, 0) .add(0, -.01f, 0); Vector3d slideNormal = collisionNormal.crossProduct(motionIn.crossProduct(collisionNormal)) .normalize(); - entity.setMotion(entityMotion.mul(.8, 0, .8) - .add(slideNormal.scale((.2f + slide) * motionIn.length()) - .add(0, -0.1, 0))); + Vector3d newMotion = entityMotion.mul(.85, 0, .85) + .add(slideNormal.scale((.2f + slide) * motionIn.length() * slideFactor) + .add(0, -.1f - collisionNormal.y * .125f, 0)); + entity.setMotion(newMotion); entityMotion = entity.getMotion(); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryCarriageBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryCarriageBlock.java index b2cf779a8..60e0fe8f5 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryCarriageBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryCarriageBlock.java @@ -42,7 +42,7 @@ public class GantryCarriageBlock extends DirectionalAxisKineticBlock implements super.updateDiagonalNeighbors(stateIn, worldIn, pos, flags, count); withTileEntityDo(worldIn, pos, GantryCarriageTileEntity::checkValidGantryShaft); } - + @Override public void onBlockAdded(BlockState state, World worldIn, BlockPos pos, BlockState oldState, boolean isMoving) { super.onBlockAdded(state, worldIn, pos, oldState, isMoving); @@ -81,9 +81,10 @@ public class GantryCarriageBlock extends DirectionalAxisKineticBlock implements } @Override - public void neighborChanged(BlockState state, World world, BlockPos pos, Block p_220069_4_, BlockPos p_220069_5_, + public void neighborChanged(BlockState state, World world, BlockPos pos, Block p_220069_4_, BlockPos updatePos, boolean p_220069_6_) { - if (!isValidPosition(state, world, pos)) + if (updatePos.equals(pos.offset(state.get(FACING) + .getOpposite())) && !isValidPosition(state, world, pos)) world.destroyBlock(pos, true); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryCarriageTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryCarriageTileEntity.java index 10e5a986f..0cb588fdd 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryCarriageTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryCarriageTileEntity.java @@ -35,6 +35,13 @@ public class GantryCarriageTileEntity extends KineticTileEntity implements IDisp if (shouldAssemble()) queueAssembly(); } + + @Override + public void initialize() { + super.initialize(); + if (!getBlockState().isValidPosition(world, pos)) + world.destroyBlock(pos, true); + } public void queueAssembly() { assembleNextTick = true;