mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-28 16:06:48 +01:00
Ejectors placed by Schematicannon keep their targets
This commit is contained in:
parent
d94a7faaa5
commit
550b456396
1 changed files with 8 additions and 1 deletions
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue