From 752bcf06c0e90e3587d331762b7fff2775561b41 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Mon, 8 Jun 2020 13:34:51 +0200 Subject: [PATCH] Bug fixes - Fixed encoding of generated degree symbols in lang - Fixed pistons along x moving at inconsistent speeds, overshooting their bounds - Fixed belts along x not moving entities - Fixed diagonal belts along z teleporting entities miles away - Fixed tree fertilizer not working --- src/generated/resources/.cache/cache | 4 +- .../create/blockstates/radial_chassis.json | 72 +++++++++---------- .../resources/assets/create/lang/en_us.json | 4 +- .../structureMovement/ContraptionEntity.java | 2 +- .../piston/MechanicalPistonTileEntity.java | 34 +++++---- .../structureMovement/pulley/PulleyBlock.java | 14 ++-- .../belt/transport/BeltMovementHandler.java | 4 +- .../PlacementSimulationServerWorld.java | 2 +- .../worldWrappers/WrappedServerWorld.java | 5 ++ .../assets/create/lang/default/messages.json | 2 +- 10 files changed, 78 insertions(+), 65 deletions(-) diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 61ce819ce..2642168e8 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -273,7 +273,7 @@ b7829c2ef2c47188713f8cab21b2c9bc7f9c5b79 assets\create\blockstates\portable_stor e8b0a401c10d1ba67ed71ba31bd5f9bc28571b65 assets\create\blockstates\powered_toggle_latch.json 3a739f9d4276828d83f2d2750bf3227c87bcd438 assets\create\blockstates\pulley_magnet.json 469e430d96cb0a5e1aaf6b7cc5d401d488c9e600 assets\create\blockstates\pulse_repeater.json -5d1b30c2bab556f57c78e7780fd445b08f541a50 assets\create\blockstates\radial_chassis.json +4e1fb033316e9230d2f024d67c27940ea731643a assets\create\blockstates\radial_chassis.json 8929677f2cc5354aa19ef182af69f9f0b41eb242 assets\create\blockstates\redstone_contact.json c29213b77ac0c78d8979c5f6188d2b265696f9b9 assets\create\blockstates\redstone_link.json e2990fe70ad5d10437a376e70e167d1856277cc1 assets\create\blockstates\rope.json @@ -325,7 +325,7 @@ c77b46d8b459e5c7cc495393546f3fcca8a1fa1d assets\create\blockstates\weathered_lim 7f39521b211441f5c3e06d60c5978cebe16cacfb assets\create\blockstates\zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets\create\blockstates\zinc_ore.json 4311c87a21caccb97b693bf914c8ce79de3f814b assets\create\lang\en_ud.json -076a6cd28a3c1020cf0080a5107718576eeb13e1 assets\create\lang\en_us.json +67a3e70e553c0b079967fd1142049641a3d3aa3f assets\create\lang\en_us.json 846200eb548d3bfa2e77b41039de159b4b6cfb45 assets\create\models\block\acacia_window.json 1930fa3a3c98d53dd19e4ee7f55bc27fd47aa281 assets\create\models\block\acacia_window_pane_noside.json 1763ea2c9b981d187f5031ba608f3d5d3be3986a assets\create\models\block\acacia_window_pane_noside_alt.json diff --git a/src/generated/resources/assets/create/blockstates/radial_chassis.json b/src/generated/resources/assets/create/blockstates/radial_chassis.json index 04e5c08ae..80ab92133 100644 --- a/src/generated/resources/assets/create/blockstates/radial_chassis.json +++ b/src/generated/resources/assets/create/blockstates/radial_chassis.json @@ -89,8 +89,8 @@ }, { "when": { - "axis": "x", - "sticky_west": "true" + "sticky_west": "true", + "axis": "x" }, "apply": { "model": "create:block/radial_chassis_side_x_sticky", @@ -99,8 +99,8 @@ }, { "when": { - "axis": "y", - "sticky_west": "true" + "sticky_west": "true", + "axis": "y" }, "apply": { "model": "create:block/radial_chassis_side_y_sticky", @@ -109,8 +109,8 @@ }, { "when": { - "axis": "z", - "sticky_west": "true" + "sticky_west": "true", + "axis": "z" }, "apply": { "model": "create:block/radial_chassis_side_z_sticky", @@ -119,8 +119,8 @@ }, { "when": { - "axis": "x", - "sticky_west": "false" + "sticky_west": "false", + "axis": "x" }, "apply": { "model": "create:block/radial_chassis_side_x", @@ -129,8 +129,8 @@ }, { "when": { - "axis": "y", - "sticky_west": "false" + "sticky_west": "false", + "axis": "y" }, "apply": { "model": "create:block/radial_chassis_side_y", @@ -139,8 +139,8 @@ }, { "when": { - "axis": "z", - "sticky_west": "false" + "sticky_west": "false", + "axis": "z" }, "apply": { "model": "create:block/radial_chassis_side_z", @@ -149,8 +149,8 @@ }, { "when": { - "axis": "x", - "sticky_north": "true" + "sticky_north": "true", + "axis": "x" }, "apply": { "model": "create:block/radial_chassis_side_x_sticky" @@ -158,8 +158,8 @@ }, { "when": { - "axis": "y", - "sticky_north": "true" + "sticky_north": "true", + "axis": "y" }, "apply": { "model": "create:block/radial_chassis_side_y_sticky", @@ -168,8 +168,8 @@ }, { "when": { - "axis": "z", - "sticky_north": "true" + "sticky_north": "true", + "axis": "z" }, "apply": { "model": "create:block/radial_chassis_side_x_sticky", @@ -178,8 +178,8 @@ }, { "when": { - "axis": "x", - "sticky_north": "false" + "sticky_north": "false", + "axis": "x" }, "apply": { "model": "create:block/radial_chassis_side_x" @@ -187,8 +187,8 @@ }, { "when": { - "axis": "y", - "sticky_north": "false" + "sticky_north": "false", + "axis": "y" }, "apply": { "model": "create:block/radial_chassis_side_y", @@ -197,8 +197,8 @@ }, { "when": { - "axis": "z", - "sticky_north": "false" + "sticky_north": "false", + "axis": "z" }, "apply": { "model": "create:block/radial_chassis_side_x", @@ -207,8 +207,8 @@ }, { "when": { - "sticky_east": "true", - "axis": "x" + "axis": "x", + "sticky_east": "true" }, "apply": { "model": "create:block/radial_chassis_side_x_sticky", @@ -217,8 +217,8 @@ }, { "when": { - "sticky_east": "true", - "axis": "y" + "axis": "y", + "sticky_east": "true" }, "apply": { "model": "create:block/radial_chassis_side_y_sticky", @@ -227,8 +227,8 @@ }, { "when": { - "sticky_east": "true", - "axis": "z" + "axis": "z", + "sticky_east": "true" }, "apply": { "model": "create:block/radial_chassis_side_z_sticky" @@ -236,8 +236,8 @@ }, { "when": { - "sticky_east": "false", - "axis": "x" + "axis": "x", + "sticky_east": "false" }, "apply": { "model": "create:block/radial_chassis_side_x", @@ -246,8 +246,8 @@ }, { "when": { - "sticky_east": "false", - "axis": "y" + "axis": "y", + "sticky_east": "false" }, "apply": { "model": "create:block/radial_chassis_side_y", @@ -256,8 +256,8 @@ }, { "when": { - "sticky_east": "false", - "axis": "z" + "axis": "z", + "sticky_east": "false" }, "apply": { "model": "create:block/radial_chassis_side_z" diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index 514e65a52..c8e2ea581 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -517,7 +517,7 @@ "create.generic.unit.minutes": "Minutes", "create.generic.unit.rpm": "RPM", "create.generic.unit.stress": "su", - "create.generic.unit.degrees": "\u00C2\u00B0", + "create.generic.unit.degrees": "\u00B0", "create.action.scroll": "Scroll", "create.action.confirm": "Confirm", @@ -1060,7 +1060,7 @@ "block.create.furnace_engine.tooltip.behaviour1": "_Starts_ _powering_ a _Flywheel_ placed in front of it (1m apart). Use a Blast Furnace for higher speeds.", "block.create.flywheel.tooltip": "FLYWHEEL", - "block.create.flywheel.tooltip.summary": "A large metal wheel to _harness_ _and_ _stabilize_ generated force by an _attached_ _Engine_. Flywheels connect to engines if they are _1m_ _apart_ and at a _90\u00C2\u00B0_ _Angle_ from each other.", + "block.create.flywheel.tooltip.summary": "A large metal wheel to _harness_ _and_ _stabilize_ generated force by an _attached_ _Engine_. Flywheels connect to engines if they are _1m_ _apart_ and at a _90\u00B0_ _Angle_ from each other.", "block.create.flywheel.tooltip.condition1": "When Attached to Running Engine", "block.create.flywheel.tooltip.behaviour1": "Provides _Rotational_ _Force_ to a connected contraption based on the generator's strength and speed.", diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntity.java index 27e8cd5ae..af3528114 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntity.java @@ -343,7 +343,7 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD } public void move(double x, double y, double z) { - setPosition(x + getX() + x, getY() + y, getZ() + z); + setPosition(x + getX(), getY() + y, getZ() + z); } private Vec3d getAnchorVec() { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java index 72d966c48..7433a9407 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java @@ -42,7 +42,8 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity { @Override public void assemble() { - if (!(world.getBlockState(pos).getBlock() instanceof MechanicalPistonBlock)) + if (!(world.getBlockState(pos) + .getBlock() instanceof MechanicalPistonBlock)) return; Direction direction = getBlockState().get(BlockStateProperties.FACING); @@ -54,9 +55,10 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity { getSpeed() > 0 ^ direction.getAxis() != Axis.Z ? positive : positive.getOpposite(); if (contraption != null) { - BlockPos anchor = contraption.getAnchor().offset(direction, contraption.initialExtensionProgress); + BlockPos anchor = contraption.getAnchor() + .offset(direction, contraption.initialExtensionProgress); if (ContraptionCollider.isCollidingWithWorld(world, contraption, anchor.offset(movementDirection), - movementDirection)) + movementDirection)) contraption = null; } @@ -78,7 +80,8 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity { BlockPos startPos = BlockPos.ZERO.offset(direction, contraption.initialExtensionProgress); contraption.removeBlocksFromWorld(world, startPos); - movedContraption = ContraptionEntity.createStationary(getWorld(), contraption).controlledBy(this); + movedContraption = ContraptionEntity.createStationary(getWorld(), contraption) + .controlledBy(this); applyContraptionPosition(); forceMove = true; world.addEntity(movedContraption); @@ -90,7 +93,7 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity { return; if (!removed) getWorld().setBlockState(pos, getBlockState().with(MechanicalPistonBlock.STATE, PistonState.EXTENDED), - 3 | 16); + 3 | 16); if (movedContraption != null) { applyContraptionPosition(); movedContraption.disassemble(); @@ -100,7 +103,8 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity { sendData(); if (removed) - AllBlocks.MECHANICAL_PISTON.get().onBlockHarvested(world, pos, getBlockState(), null); + AllBlocks.MECHANICAL_PISTON.get() + .onBlockHarvested(world, pos, getBlockState(), null); } @Override @@ -116,8 +120,8 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity { if (world.isRemote) movementSpeed *= ServerSpeedProvider.get(); Direction pistonDirection = getBlockState().get(BlockStateProperties.FACING); - int movementModifier = - pistonDirection.getAxisDirection().getOffset() * (pistonDirection.getAxis() == Axis.Z ? -1 : 1); + int movementModifier = pistonDirection.getAxisDirection() + .getOffset() * (pistonDirection.getAxis() == Axis.Z ? -1 : 1); movementSpeed = movementSpeed * -movementModifier + clientOffsetDiff / 2f; int extensionRange = getExtensionRange(); @@ -131,8 +135,7 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity { } @Override - protected void visitNewPosition() { - } + protected void visitNewPosition() {} @Override protected Vec3d toMotionVector(float speed) { @@ -142,15 +145,18 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity { @Override protected Vec3d toPosition(float offset) { - Vec3d position = new Vec3d(getBlockState().get(BlockStateProperties.FACING).getDirectionVec()).scale(offset); - return position.add(new Vec3d(movedContraption.getContraption().getAnchor())); + Vec3d position = new Vec3d(getBlockState().get(BlockStateProperties.FACING) + .getDirectionVec()).scale(offset); + return position.add(new Vec3d(movedContraption.getContraption() + .getAnchor())); } @Override protected ValueBoxTransform getMovementModeSlot() { return new DirectionalExtenderScrollOptionSlot((state, d) -> { Axis axis = d.getAxis(); - Axis extensionAxis = state.get(MechanicalPistonBlock.FACING).getAxis(); + Axis extensionAxis = state.get(MechanicalPistonBlock.FACING) + .getAxis(); Axis shaftAxis = ((IRotate) state.getBlock()).getRotationAxis(state); return extensionAxis != axis && shaftAxis != axis; }); @@ -159,7 +165,7 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity { @Override protected int getInitialOffset() { return movedContraption == null ? 0 - : ((PistonContraption) movedContraption.getContraption()).initialExtensionProgress; + : ((PistonContraption) movedContraption.getContraption()).initialExtensionProgress; } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyBlock.java index 4489d5225..405fafb74 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyBlock.java @@ -29,7 +29,7 @@ import net.minecraft.world.World; public class PulleyBlock extends HorizontalAxisKineticBlock implements ITE { public static EnumProperty HORIZONTAL_AXIS = BlockStateProperties.HORIZONTAL_AXIS; - + public PulleyBlock(Properties properties) { super(properties); } @@ -46,23 +46,25 @@ public class PulleyBlock extends HorizontalAxisKineticBlock implements ITE te.assembleNextTick = true); return ActionResultType.SUCCESS; } @@ -99,7 +101,7 @@ public class PulleyBlock extends HorizontalAxisKineticBlock implements ITE 48 / 64f) return; @@ -187,7 +187,7 @@ public class BeltMovementHandler { || AllBlocks.BELT.has(world.getBlockState(entityIn.getPosition().down()))); if (movedPastEndingSlope && !movingDown && Math.abs(movementSpeed) > 0) - entityIn.setPosition(entityIn.getY(), entityIn.getY() + movement.y, entityIn.getZ()); + entityIn.setPosition(entityIn.getX(), entityIn.getY() + movement.y, entityIn.getZ()); if (movedPastEndingSlope) { entityIn.setMotion(movement); entityIn.velocityChanged = true; diff --git a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/PlacementSimulationServerWorld.java b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/PlacementSimulationServerWorld.java index 121d645b2..60b82a4e5 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/PlacementSimulationServerWorld.java +++ b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/PlacementSimulationServerWorld.java @@ -22,7 +22,7 @@ public class PlacementSimulationServerWorld extends WrappedServerWorld { @Override public boolean setBlockState(BlockPos pos, BlockState newState, int flags) { - blocksAdded.put(pos, newState); + blocksAdded.put(pos.toImmutable(), newState); return true; } diff --git a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedServerWorld.java b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedServerWorld.java index c656b67cb..b38fbbe9e 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedServerWorld.java +++ b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedServerWorld.java @@ -35,6 +35,11 @@ public class WrappedServerWorld extends ServerWorld { return world; } + @Override + public float getCelestialAngle(float p_72826_1_) { + return 0; + } + @Override public int getLight(BlockPos pos) { return 15; diff --git a/src/main/resources/assets/create/lang/default/messages.json b/src/main/resources/assets/create/lang/default/messages.json index f06e64927..3d64ffaeb 100644 --- a/src/main/resources/assets/create/lang/default/messages.json +++ b/src/main/resources/assets/create/lang/default/messages.json @@ -44,7 +44,7 @@ "create.generic.unit.minutes": "Minutes", "create.generic.unit.rpm": "RPM", "create.generic.unit.stress": "su", - "create.generic.unit.degrees": "°", + "create.generic.unit.degrees": "\u00B0", "create.action.scroll": "Scroll", "create.action.confirm": "Confirm",