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
|
@Override
|
||||||
protected void fromTag(BlockState blockState, CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState blockState, CompoundNBT compound, boolean clientPacket) {
|
||||||
super.fromTag(blockState, compound, clientPacket);
|
super.fromTag(blockState, compound, clientPacket);
|
||||||
int horizontalDistance = compound.getInt("HorizontalDistance");
|
int horizontalDistance = compound.getInt("HorizontalDistance");
|
||||||
int verticalDistance = compound.getInt("VerticalDistance");
|
int verticalDistance = compound.getInt("VerticalDistance");
|
||||||
|
|
||||||
if (launcher == null || launcher.getHorizontalDistance() != horizontalDistance
|
if (launcher.getHorizontalDistance() != horizontalDistance
|
||||||
|| launcher.getVerticalDistance() != verticalDistance) {
|
|| launcher.getVerticalDistance() != verticalDistance) {
|
||||||
launcher.set(horizontalDistance, verticalDistance);
|
launcher.set(horizontalDistance, verticalDistance);
|
||||||
launcher.clamp(AllConfigs.SERVER.kinetics.maxEjectorDistance.get());
|
launcher.clamp(AllConfigs.SERVER.kinetics.maxEjectorDistance.get());
|
||||||
|
|
Loading…
Reference in a new issue