Finished Merging Changes to Trapdoor
Merged together the different changes we had made to Transdimensional Trapdoors. Cleaned up the rendering and tile entity code a bit, it should be a little more understandable now.
This commit is contained in:
@@ -7,72 +7,49 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityTransTrapdoor extends TileEntity
|
||||
|
||||
{
|
||||
public boolean hasRift;
|
||||
public boolean isShut;
|
||||
public int metaData;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldRefresh(int oldID, int newID, int oldMeta, int newMeta, World world, int x, int y, int z)
|
||||
{
|
||||
if(newID==0&&PocketManager.getLink(x, y, z, world)!=null)
|
||||
{
|
||||
if (newID == 0 && PocketManager.getLink(x, y, z, world) != null)
|
||||
{
|
||||
world.setBlock(x, y, z, mod_pocketDim.blockRift.blockID);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void updateEntity()
|
||||
{
|
||||
System.out.println(this.worldObj.getBlockMetadata(xCoord, yCoord, zCoord));
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.readFromNBT(nbt);
|
||||
int i = nbt.getInteger(("Size"));
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
this.hasRift = nbt.getBoolean("hasRift");
|
||||
this.isShut = nbt.getBoolean("isShut");
|
||||
|
||||
this.metaData = nbt.getInteger("metaData");
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void updateEntity()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.readFromNBT(nbt);
|
||||
try
|
||||
{
|
||||
this.hasRift = nbt.getBoolean("hasRift");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt)
|
||||
{
|
||||
int i = 0;
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setBoolean("hasRift", this.hasRift);
|
||||
nbt.setBoolean("isShut", this.isShut);
|
||||
|
||||
|
||||
nbt.setInteger("metaData", this.metaData);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setBoolean("hasRift", this.hasRift);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user