mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 08:39:58 +03:00
168 lines
6.0 KiB
Diff
168 lines
6.0 KiB
Diff
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityStructure.java
|
|
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityStructure.java
|
|
@@ -36,20 +36,20 @@
|
|
|
|
public class TileEntityStructure extends TileEntity
|
|
{
|
|
- private String name = "";
|
|
- private String author = "";
|
|
- private String metadata = "";
|
|
- private BlockPos position = new BlockPos(0, 1, 0);
|
|
- private BlockPos size = BlockPos.ORIGIN;
|
|
- private Mirror mirror = Mirror.NONE;
|
|
- private Rotation rotation = Rotation.NONE;
|
|
- private TileEntityStructure.Mode mode = TileEntityStructure.Mode.DATA;
|
|
- private boolean ignoreEntities = true;
|
|
- private boolean powered;
|
|
- private boolean showAir;
|
|
- private boolean showBoundingBox = true;
|
|
- private float integrity = 1.0F;
|
|
- private long seed;
|
|
+ public String name = "";
|
|
+ public String author = "";
|
|
+ public String metadata = "";
|
|
+ public BlockPos position = new BlockPos(0, 1, 0);
|
|
+ public BlockPos size = BlockPos.ORIGIN;
|
|
+ public Mirror mirror = Mirror.NONE;
|
|
+ public Rotation rotation = Rotation.NONE;
|
|
+ public Mode mode = Mode.DATA;
|
|
+ public boolean ignoreEntities = true;
|
|
+ public boolean powered;
|
|
+ public boolean showAir;
|
|
+ public boolean showBoundingBox = true;
|
|
+ public float integrity = 1.0F;
|
|
+ public long seed;
|
|
|
|
public NBTTagCompound writeToNBT(NBTTagCompound compound)
|
|
{
|
|
@@ -110,11 +110,11 @@
|
|
|
|
try
|
|
{
|
|
- this.mode = TileEntityStructure.Mode.valueOf(compound.getString("mode"));
|
|
+ this.mode = Mode.valueOf(compound.getString("mode"));
|
|
}
|
|
catch (IllegalArgumentException var9)
|
|
{
|
|
- this.mode = TileEntityStructure.Mode.DATA;
|
|
+ this.mode = Mode.DATA;
|
|
}
|
|
|
|
this.ignoreEntities = compound.getBoolean("ignoreEntities");
|
|
@@ -257,12 +257,12 @@
|
|
return this.metadata;
|
|
}
|
|
|
|
- public TileEntityStructure.Mode getMode()
|
|
+ public Mode getMode()
|
|
{
|
|
return this.mode;
|
|
}
|
|
|
|
- public void setMode(TileEntityStructure.Mode modeIn)
|
|
+ public void setMode(Mode modeIn)
|
|
{
|
|
this.mode = modeIn;
|
|
IBlockState iblockstate = this.world.getBlockState(this.getPos());
|
|
@@ -294,16 +294,16 @@
|
|
switch (this.getMode())
|
|
{
|
|
case SAVE:
|
|
- this.setMode(TileEntityStructure.Mode.LOAD);
|
|
+ this.setMode(Mode.LOAD);
|
|
break;
|
|
case LOAD:
|
|
- this.setMode(TileEntityStructure.Mode.CORNER);
|
|
+ this.setMode(Mode.CORNER);
|
|
break;
|
|
case CORNER:
|
|
- this.setMode(TileEntityStructure.Mode.DATA);
|
|
+ this.setMode(Mode.DATA);
|
|
break;
|
|
case DATA:
|
|
- this.setMode(TileEntityStructure.Mode.SAVE);
|
|
+ this.setMode(Mode.SAVE);
|
|
}
|
|
}
|
|
|
|
@@ -327,7 +327,7 @@
|
|
|
|
public boolean detectSize()
|
|
{
|
|
- if (this.mode != TileEntityStructure.Mode.SAVE)
|
|
+ if (this.mode != Mode.SAVE)
|
|
{
|
|
return false;
|
|
}
|
|
@@ -371,7 +371,7 @@
|
|
{
|
|
public boolean apply(@Nullable TileEntityStructure p_apply_1_)
|
|
{
|
|
- return p_apply_1_.mode == TileEntityStructure.Mode.CORNER && TileEntityStructure.this.name.equals(p_apply_1_.name);
|
|
+ return p_apply_1_.mode == Mode.CORNER && TileEntityStructure.this.name.equals(p_apply_1_.name);
|
|
}
|
|
});
|
|
return Lists.newArrayList(iterable);
|
|
@@ -463,7 +463,7 @@
|
|
|
|
public boolean save(boolean writeToDisk)
|
|
{
|
|
- if (this.mode == TileEntityStructure.Mode.SAVE && !this.world.isRemote && !StringUtils.isNullOrEmpty(this.name))
|
|
+ if (this.mode == Mode.SAVE && !this.world.isRemote && !StringUtils.isNullOrEmpty(this.name))
|
|
{
|
|
BlockPos blockpos = this.getPos().add(this.position);
|
|
WorldServer worldserver = (WorldServer)this.world;
|
|
@@ -487,7 +487,7 @@
|
|
|
|
public boolean load(boolean requireMatchingSize)
|
|
{
|
|
- if (this.mode == TileEntityStructure.Mode.LOAD && !this.world.isRemote && !StringUtils.isNullOrEmpty(this.name))
|
|
+ if (this.mode == Mode.LOAD && !this.world.isRemote && !StringUtils.isNullOrEmpty(this.name))
|
|
{
|
|
BlockPos blockpos = this.getPos();
|
|
BlockPos blockpos1 = blockpos.add(this.position);
|
|
@@ -551,7 +551,7 @@
|
|
|
|
public boolean isStructureLoadable()
|
|
{
|
|
- if (this.mode == TileEntityStructure.Mode.LOAD && !this.world.isRemote)
|
|
+ if (this.mode == Mode.LOAD && !this.world.isRemote)
|
|
{
|
|
WorldServer worldserver = (WorldServer)this.world;
|
|
MinecraftServer minecraftserver = this.world.getMinecraftServer();
|
|
@@ -599,7 +599,7 @@
|
|
@Nullable
|
|
public ITextComponent getDisplayName()
|
|
{
|
|
- return new TextComponentTranslation("structure_block.hover." + this.mode.modeName, new Object[] {this.mode == TileEntityStructure.Mode.DATA ? this.metadata : this.name});
|
|
+ return new TextComponentTranslation("structure_block.hover." + this.mode.modeName, new Object[] {this.mode == Mode.DATA ? this.metadata : this.name});
|
|
}
|
|
|
|
public static enum Mode implements IStringSerializable
|
|
@@ -609,7 +609,7 @@
|
|
CORNER("corner", 2),
|
|
DATA("data", 3);
|
|
|
|
- private static final TileEntityStructure.Mode[] MODES = new TileEntityStructure.Mode[values().length];
|
|
+ private static final Mode[] MODES = new Mode[values().length];
|
|
private final String modeName;
|
|
private final int modeId;
|
|
|
|
@@ -629,14 +629,14 @@
|
|
return this.modeId;
|
|
}
|
|
|
|
- public static TileEntityStructure.Mode getById(int id)
|
|
+ public static Mode getById(int id)
|
|
{
|
|
return id >= 0 && id < MODES.length ? MODES[id] : MODES[0];
|
|
}
|
|
|
|
static
|
|
{
|
|
- for (TileEntityStructure.Mode tileentitystructure$mode : values())
|
|
+ for (Mode tileentitystructure$mode : values())
|
|
{
|
|
MODES[tileentitystructure$mode.getModeId()] = tileentitystructure$mode;
|
|
}
|