Fix large swath of warnings, fix most render-methods

This commit is contained in:
skyboy
2013-11-06 18:15:30 -05:00
parent d849071e8e
commit 4cfd5475de
74 changed files with 797 additions and 808 deletions

View File

@@ -12,99 +12,90 @@ import net.minecraftforge.common.ForgeChunkManager.Type;
public class TileEntityDimDoorGold extends TileEntityDimDoor implements IChunkLoader
{
private Ticket chunkTicket;
public boolean canUpdate()
{
return true;
}
public void updateEntity()
{
if(PocketManager.getDimensionData(this.worldObj)!=null&&PocketManager.getDimensionData(this.worldObj).isPocketDimension()&&!this.worldObj.isRemote)
{
if(this.chunkTicket==null)
{
chunkTicket = ForgeChunkManager.requestTicket(mod_pocketDim.instance, worldObj, Type.NORMAL);
}
chunkTicket.getModData().setInteger("goldDimDoorX", xCoord);
chunkTicket.getModData().setInteger("goldDimDoorY", yCoord);
chunkTicket.getModData().setInteger("goldDimDoorZ", zCoord);
ForgeChunkManager.forceChunk(chunkTicket, new ChunkCoordIntPair(xCoord >> 4, zCoord >> 4));
forceChunkLoading(chunkTicket,this.xCoord,this.zCoord);
}
}
public void forceChunkLoading(Ticket chunkTicket,int x,int z)
{
if(PocketManager.getDimensionData(chunkTicket.world)==null)
{
return;
}
if(!PocketManager.getDimensionData(chunkTicket.world).isPocketDimension())
{
return;
}
for(int chunks = (PocketBuilder.DEFAULT_POCKET_SIZE/16)+1;chunks>0;chunks--)
@Override
public boolean canUpdate()
{
return true;
}
@Override
public void updateEntity()
{ // every tick?
if (PocketManager.getDimensionData(this.worldObj) != null &&
PocketManager.getDimensionData(this.worldObj).isPocketDimension() &&
!this.worldObj.isRemote)
{
if (this.chunkTicket == null)
{
ForgeChunkManager.forceChunk(chunkTicket, new ChunkCoordIntPair((xCoord >> 4)+chunks, (zCoord >> 4)+chunks));
chunkTicket = ForgeChunkManager.requestTicket(mod_pocketDim.instance, worldObj, Type.NORMAL);
}
}
}
@Override
public void invalidate()
{
ForgeChunkManager.releaseTicket(chunkTicket);
super.invalidate();
chunkTicket.getModData().setInteger("goldDimDoorX", xCoord);
chunkTicket.getModData().setInteger("goldDimDoorY", yCoord);
chunkTicket.getModData().setInteger("goldDimDoorZ", zCoord);
ForgeChunkManager.forceChunk(chunkTicket, new ChunkCoordIntPair(xCoord >> 4, zCoord >> 4));
forceChunkLoading(chunkTicket,this.xCoord,this.zCoord);
}
}
@Override
public void forceChunkLoading(Ticket chunkTicket,int x,int z)
{
if (PocketManager.getDimensionData(chunkTicket.world) == null)
{
return;
}
if (!PocketManager.getDimensionData(chunkTicket.world).isPocketDimension())
{
return;
}
for(int chunks = (PocketBuilder.DEFAULT_POCKET_SIZE/16) + 1; chunks > 0; --chunks)
{
ForgeChunkManager.forceChunk(chunkTicket, new ChunkCoordIntPair((xCoord >> 4) + chunks,
(zCoord >> 4) + chunks));
}
}
@Override
public void invalidate()
{
ForgeChunkManager.releaseTicket(chunkTicket);
super.invalidate();
}
@Override
public void readFromNBT(NBTTagCompound nbt)
{ // this and write both call user, and super saves/reads all the same data. why override at all?
super.readFromNBT(nbt);
@SuppressWarnings("unused") // ???
int i = nbt.getInteger(("Size"));
try
{
this.openOrClosed = nbt.getBoolean("openOrClosed");
this.orientation = nbt.getInteger("orientation");
this.hasExit = nbt.getBoolean("hasExit");
this.isDungeonChainLink = nbt.getBoolean("isDungeonChainLink");
}
catch (Exception e) // ???
{
}
}
@Override
public void writeToNBT(NBTTagCompound nbt)
{
@SuppressWarnings("unused") // ?????
int i = 0;
super.writeToNBT(nbt);
@Override
public void readFromNBT(NBTTagCompound nbt)
{
super.readFromNBT(nbt);
int i = nbt.getInteger(("Size"));
try
{
this.openOrClosed = nbt.getBoolean("openOrClosed");
this.orientation = nbt.getInteger("orientation");
this.hasExit = nbt.getBoolean("hasExit");
this.isDungeonChainLink = nbt.getBoolean("isDungeonChainLink");
}
catch (Exception e)
{
}
}
@Override
public void writeToNBT(NBTTagCompound nbt)
{
int i = 0;
super.writeToNBT(nbt);
nbt.setBoolean("openOrClosed", this.openOrClosed);
nbt.setBoolean("hasExit", this.hasExit);
nbt.setInteger("orientation", this.orientation);
nbt.setBoolean("isDungeonChainLink", isDungeonChainLink);
}
nbt.setBoolean("openOrClosed", this.openOrClosed);
nbt.setBoolean("hasExit", this.hasExit);
nbt.setInteger("orientation", this.orientation);
nbt.setBoolean("isDungeonChainLink", isDungeonChainLink);
}
}