|
17 | 17 | import net.minecraft.state.properties.StructureMode; |
18 | 18 | import net.minecraft.tileentity.StructureBlockTileEntity; |
19 | 19 | import net.minecraft.tileentity.TileEntity; |
| 20 | +import net.minecraft.tileentity.TileEntityType; |
20 | 21 | import net.minecraft.util.Mirror; |
21 | 22 | import net.minecraft.util.ResourceLocation; |
22 | 23 | import net.minecraft.util.ResourceLocationException; |
@@ -54,6 +55,38 @@ public class StructureBlockExTileEntity extends StructureBlockTileEntity { |
54 | 55 | private static int SIZE_MAX = 1000; |
55 | 56 | private static int SIZE_MIN = -1000; |
56 | 57 |
|
| 58 | + public StructureBlockExTileEntity() { |
| 59 | + super(); |
| 60 | + } |
| 61 | + |
| 62 | + @OnlyIn(Dist.CLIENT) |
| 63 | + public double getMaxRenderDistanceSquared() { |
| 64 | + return 96.0D; |
| 65 | + } |
| 66 | + |
| 67 | + public CompoundNBT write(CompoundNBT compound) { |
| 68 | + super.write(compound); |
| 69 | + compound.putString("name", this.getName()); |
| 70 | + compound.putString("author", this.author); |
| 71 | + compound.putString("metadata", this.metadata); |
| 72 | + compound.putInt("posX", this.position.getX()); |
| 73 | + compound.putInt("posY", this.position.getY()); |
| 74 | + compound.putInt("posZ", this.position.getZ()); |
| 75 | + compound.putInt("sizeX", this.size.getX()); |
| 76 | + compound.putInt("sizeY", this.size.getY()); |
| 77 | + compound.putInt("sizeZ", this.size.getZ()); |
| 78 | + compound.putString("rotation", this.rotation.toString()); |
| 79 | + compound.putString("mirror", this.mirror.toString()); |
| 80 | + compound.putString("mode", this.mode.toString()); |
| 81 | + compound.putBoolean("ignoreEntities", this.ignoreEntities); |
| 82 | + compound.putBoolean("powered", this.powered); |
| 83 | + compound.putBoolean("showair", this.showAir); |
| 84 | + compound.putBoolean("showboundingbox", this.showBoundingBox); |
| 85 | + compound.putFloat("integrity", this.integrity); |
| 86 | + compound.putLong("seed", this.seed); |
| 87 | + return compound; |
| 88 | + } |
| 89 | + |
57 | 90 | public void func_230337_a_(BlockState p_230337_1_, CompoundNBT p_230337_2_) { |
58 | 91 | super.func_230337_a_(p_230337_1_, p_230337_2_); |
59 | 92 | this.setName(p_230337_2_.getString("name")); |
|
0 commit comments