From 550b4563965b30b2c4a69f672a5fffc112d2ed08 Mon Sep 17 00:00:00 2001 From: reidbhuntley Date: Mon, 14 Jun 2021 22:29:29 -0400 Subject: [PATCH] Ejectors placed by Schematicannon keep their targets --- .../content/logistics/block/depot/EjectorTileEntity.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/simibubi/create/content/logistics/block/depot/EjectorTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/depot/EjectorTileEntity.java index 5188e1ab0..1b94d5d7a 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/depot/EjectorTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/depot/EjectorTileEntity.java @@ -482,13 +482,20 @@ public class EjectorTileEntity extends KineticTileEntity { } } + @Override + public void writeSafe(CompoundNBT compound, boolean clientPacket) { + super.writeSafe(compound, clientPacket); + compound.putInt("HorizontalDistance", launcher.getHorizontalDistance()); + compound.putInt("VerticalDistance", launcher.getVerticalDistance()); + } + @Override protected void fromTag(BlockState blockState, CompoundNBT compound, boolean clientPacket) { super.fromTag(blockState, compound, clientPacket); int horizontalDistance = compound.getInt("HorizontalDistance"); int verticalDistance = compound.getInt("VerticalDistance"); - if (launcher == null || launcher.getHorizontalDistance() != horizontalDistance + if (launcher.getHorizontalDistance() != horizontalDistance || launcher.getVerticalDistance() != verticalDistance) { launcher.set(horizontalDistance, verticalDistance); launcher.clamp(AllConfigs.SERVER.kinetics.maxEjectorDistance.get());