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
This commit is contained in:
simibubi 2020-06-08 13:34:51 +02:00
parent e4b3d58a88
commit 752bcf06c0
10 changed files with 78 additions and 65 deletions

View file

@ -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

View file

@ -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"

View file

@ -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.",

View file

@ -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() {

View file

@ -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,7 +55,8 @@ 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))
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);
@ -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;
});

View file

@ -46,12 +46,13 @@ public class PulleyBlock extends HorizontalAxisKineticBlock implements ITE<Pulle
@Override
public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) {
if (state.hasTileEntity() && state.getBlock() != newState.getBlock()) {
if (state.getBlock() != newState.getBlock()) {
if (!worldIn.isRemote) {
BlockState below = worldIn.getBlockState(pos.down());
if (below.getBlock() instanceof RopeBlockBase)
worldIn.destroyBlock(pos.down(), true);
}
if (state.hasTileEntity())
worldIn.removeTileEntity(pos);
}
}
@ -62,7 +63,8 @@ public class PulleyBlock extends HorizontalAxisKineticBlock implements ITE<Pulle
return ActionResultType.PASS;
if (player.isSneaking())
return ActionResultType.PASS;
if (player.getHeldItem(handIn).isEmpty()) {
if (player.getHeldItem(handIn)
.isEmpty()) {
withTileEntityDo(worldIn, pos, te -> te.assembleNextTick = true);
return ActionResultType.SUCCESS;
}

View file

@ -119,7 +119,7 @@ public class BeltMovementHandler {
Direction.getFacingFromAxis(POSITIVE, beltFacing.rotateY().getAxis()).getDirectionVec();
Vec3d movement = new Vec3d(movementDirection.getDirectionVec()).scale(movementSpeed);
double diffCenter = axis == Axis.Z ? (pos.getX() + .5f - entityIn.getZ()) : (pos.getZ() + .5f - entityIn.getZ());
double diffCenter = axis == Axis.Z ? (pos.getX() + .5f - entityIn.getX()) : (pos.getZ() + .5f - entityIn.getZ());
if (Math.abs(diffCenter) > 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;

View file

@ -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;
}

View file

@ -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;

View file

@ -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",