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

@@ -1,78 +1,57 @@
package StevenDimDoors.mod_pocketDim.tileentities;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import StevenDimDoors.mod_pocketDim.core.PocketManager;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class TileEntityDimDoor extends TileEntity
{
public boolean openOrClosed;
public int orientation;
public boolean hasExit;
public boolean isDungeonChainLink;
public boolean hasGennedPair=false;
public boolean canUpdate()
{
return false;
}
public void updateEntity()
{
}
@Override
public void readFromNBT(NBTTagCompound nbt)
{
super.readFromNBT(nbt);
int i = nbt.getInteger(("Size"));
@Override
public boolean canUpdate()
{
return false;
}
try
{
this.openOrClosed = nbt.getBoolean("openOrClosed");
this.orientation = nbt.getInteger("orientation");
this.hasExit = nbt.getBoolean("hasExit");
this.isDungeonChainLink = nbt.getBoolean("isDungeonChainLink");
@Override
public void updateEntity() { }
this.hasGennedPair = nbt.getBoolean("hasGennedPair");
@Override
public void readFromNBT(NBTTagCompound nbt)
{
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");
this.hasGennedPair = nbt.getBoolean("hasGennedPair");
}
catch (Exception e) // ???
{
}
}
}
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("hasGennedPair", hasGennedPair);
}
@Override
public void writeToNBT(NBTTagCompound nbt)
{
@SuppressWarnings("unused") // ?????
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("hasGennedPair", hasGennedPair);
}
}

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);
}
}

View File

@@ -38,10 +38,12 @@ public class TileEntityRift extends TileEntity
public int age = 0;
public HashMap<Integer, double[]> renderingCenters = new HashMap<Integer, double[]>();
@SuppressWarnings("deprecation")
public DimLink nearestRiftData;
public int spawnedEndermenID=0;
DataWatcher watcher = new DataWatcher();
@Override
public void updateEntity()
{
//Invalidate this tile entity if it shouldn't exist
@@ -92,6 +94,7 @@ public class TileEntityRift extends TileEntity
}
}
@Override
public boolean canUpdate()
{
return true;
@@ -143,7 +146,7 @@ public class TileEntityRift extends TileEntity
if (random.nextInt(30) == 0)
{
@SuppressWarnings("unchecked")
List<Entity> list = (List<Entity>) worldObj.getEntitiesWithinAABB(EntityEnderman.class,
List<Entity> list = worldObj.getEntitiesWithinAABB(EntityEnderman.class,
AxisAlignedBB.getBoundingBox(xCoord - 9, yCoord - 3, zCoord - 9, xCoord + 9, yCoord + 3, zCoord + 9));
if (list.isEmpty())

View File

@@ -1,10 +1,7 @@
package StevenDimDoors.mod_pocketDim.tileentities;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import StevenDimDoors.mod_pocketDim.core.PocketManager;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class TileEntityTransTrapdoor extends TileEntity
{