Fix up method override.

This commit is contained in:
Christian Weeks 2012-03-08 23:59:01 -05:00
parent dd542c0c48
commit 9aa53eec37
2 changed files with 166 additions and 163 deletions

View File

@ -47,6 +47,7 @@ public class TileEntityIronChest extends TileEntity implements IInventory {
public byte getFacing() { public byte getFacing() {
return this.facing; return this.facing;
} }
@Override @Override
public String getInvName() { public String getInvName() {
return type.name(); return type.name();
@ -55,6 +56,7 @@ public class TileEntityIronChest extends TileEntity implements IInventory {
public IronChestType getType() { public IronChestType getType() {
return type; return type;
} }
@Override @Override
public ItemStack getStackInSlot(int i) { public ItemStack getStackInSlot(int i) {
inventoryTouched = true; inventoryTouched = true;
@ -74,8 +76,7 @@ public class TileEntityIronChest extends TileEntity implements IInventory {
ItemStack[] tempCopy = new ItemStack[getSizeInventory()]; ItemStack[] tempCopy = new ItemStack[getSizeInventory()];
boolean hasStuff = false; boolean hasStuff = false;
int compressedIdx = 0; int compressedIdx = 0;
mainLoop: mainLoop: for (int i = 0; i < getSizeInventory(); i++) {
for (int i=0; i<getSizeInventory(); i++) {
if (chestContents[i] != null) { if (chestContents[i] != null) {
for (int j = 0; j < compressedIdx; j++) { for (int j = 0; j < compressedIdx; j++) {
if (tempCopy[j].isItemEqual(chestContents[i])) { if (tempCopy[j].isItemEqual(chestContents[i])) {
@ -269,14 +270,16 @@ public class TileEntityIronChest extends TileEntity implements IInventory {
@Override @Override
public void openChest() { public void openChest() {
if (worldObj==null) return; if (worldObj == null)
return;
numUsingPlayers++; numUsingPlayers++;
worldObj.playNoteAt(xCoord, yCoord, zCoord, 1, numUsingPlayers); worldObj.playNoteAt(xCoord, yCoord, zCoord, 1, numUsingPlayers);
} }
@Override @Override
public void closeChest() { public void closeChest() {
if (worldObj==null) return; if (worldObj == null)
return;
numUsingPlayers--; numUsingPlayers--;
worldObj.playNoteAt(xCoord, yCoord, zCoord, 1, numUsingPlayers); worldObj.playNoteAt(xCoord, yCoord, zCoord, 1, numUsingPlayers);
} }

View File

@ -98,7 +98,7 @@ public class mod_IronChest extends BaseModMp {
proxy.showGUI(te,player); proxy.showGUI(te,player);
} }
public void HandleTileEntityPacket(int x, int y, int z, int type, int[] intData, float[] floatData, String[] stringData) { public void handleTileEntityPacket(int x, int y, int z, int type, int[] intData, float[] floatData, String[] stringData) {
proxy.handleTileEntityPacket(x,y,z,type,intData,floatData,stringData); proxy.handleTileEntityPacket(x,y,z,type,intData,floatData,stringData);
} }
} }