Clean up var names in Laser Table
This commit is contained in:
parent
a989d00223
commit
6169b8b9b5
1 changed files with 40 additions and 40 deletions
|
@ -50,14 +50,14 @@ public class TileAdvancedCraftingTable extends TileEntity implements IInventory,
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int par1) {
|
||||
if (par1 >= 0 && par1 < 9) {
|
||||
public ItemStack getStackInSlot(int slot) {
|
||||
if (slot >= 0 && slot < 9) {
|
||||
if (useRecipeStack || tempStacks == null) {
|
||||
return craftingSlots.getStackInSlot(par1);
|
||||
return craftingSlots.getStackInSlot(slot);
|
||||
} else {
|
||||
|
||||
if (bindings[par1] >= 0) {
|
||||
return tempStacks[bindings[par1]];
|
||||
if (bindings[slot] >= 0) {
|
||||
return tempStacks[bindings[slot]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -67,18 +67,18 @@ public class TileAdvancedCraftingTable extends TileEntity implements IInventory,
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int par1, ItemStack par2ItemStack) {
|
||||
public void setInventorySlotContents(int slot, ItemStack par2ItemStack) {
|
||||
if (tempStacks != null) {
|
||||
tempStacks[bindings[par1]] = par2ItemStack;
|
||||
tempStacks[bindings[slot]] = par2ItemStack;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int par1, int par2) {
|
||||
public ItemStack decrStackSize(int slot, int amount) {
|
||||
if (tempStacks != null) {
|
||||
ItemStack result = tempStacks[bindings[par1]].splitStack(par2);
|
||||
if (tempStacks[bindings[par1]].stackSize <= 0) {
|
||||
tempStacks[bindings[par1]] = null;
|
||||
ItemStack result = tempStacks[bindings[slot]].splitStack(amount);
|
||||
if (tempStacks[bindings[slot]].stackSize <= 0) {
|
||||
tempStacks[bindings[slot]] = null;
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
|
@ -136,28 +136,28 @@ public class TileAdvancedCraftingTable extends TileEntity implements IInventory,
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int var1) {
|
||||
if (var1 < storageSlots.length) {
|
||||
return storageSlots[var1];
|
||||
public ItemStack getStackInSlot(int slot) {
|
||||
if (slot < storageSlots.length) {
|
||||
return storageSlots[slot];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int var1, int var2) {
|
||||
if (var1 < storageSlots.length && storageSlots[var1] != null) {
|
||||
public ItemStack decrStackSize(int slot, int amount) {
|
||||
if (slot < storageSlots.length && storageSlots[slot] != null) {
|
||||
ItemStack var3;
|
||||
|
||||
if (this.storageSlots[var1].stackSize <= var2) {
|
||||
var3 = this.storageSlots[var1];
|
||||
this.storageSlots[var1] = null;
|
||||
if (this.storageSlots[slot].stackSize <= amount) {
|
||||
var3 = this.storageSlots[slot];
|
||||
this.storageSlots[slot] = null;
|
||||
this.onInventoryChanged();
|
||||
return var3;
|
||||
} else {
|
||||
var3 = this.storageSlots[var1].splitStack(var2);
|
||||
var3 = this.storageSlots[slot].splitStack(amount);
|
||||
|
||||
if (this.storageSlots[var1].stackSize == 0) {
|
||||
this.storageSlots[var1] = null;
|
||||
if (this.storageSlots[slot].stackSize == 0) {
|
||||
this.storageSlots[slot] = null;
|
||||
}
|
||||
|
||||
this.onInventoryChanged();
|
||||
|
@ -169,13 +169,13 @@ public class TileAdvancedCraftingTable extends TileEntity implements IInventory,
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int var1) {
|
||||
if (var1 >= storageSlots.length) {
|
||||
public ItemStack getStackInSlotOnClosing(int slot) {
|
||||
if (slot >= storageSlots.length) {
|
||||
return null;
|
||||
}
|
||||
if (this.storageSlots[var1] != null) {
|
||||
ItemStack var2 = this.storageSlots[var1];
|
||||
this.storageSlots[var1] = null;
|
||||
if (this.storageSlots[slot] != null) {
|
||||
ItemStack var2 = this.storageSlots[slot];
|
||||
this.storageSlots[slot] = null;
|
||||
return var2;
|
||||
} else {
|
||||
return null;
|
||||
|
@ -183,14 +183,14 @@ public class TileAdvancedCraftingTable extends TileEntity implements IInventory,
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int var1, ItemStack var2) {
|
||||
if (var1 >= storageSlots.length) {
|
||||
public void setInventorySlotContents(int slot, ItemStack stack) {
|
||||
if (slot >= storageSlots.length) {
|
||||
return;
|
||||
}
|
||||
this.storageSlots[var1] = var2;
|
||||
this.storageSlots[slot] = stack;
|
||||
|
||||
if (var2 != null && var2.stackSize > this.getInventoryStackLimit()) {
|
||||
var2.stackSize = this.getInventoryStackLimit();
|
||||
if (stack != null && stack.stackSize > this.getInventoryStackLimit()) {
|
||||
stack.stackSize = this.getInventoryStackLimit();
|
||||
}
|
||||
|
||||
this.onInventoryChanged();
|
||||
|
@ -250,7 +250,7 @@ public class TileAdvancedCraftingTable extends TileEntity implements IInventory,
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer var1) {
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
return worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) == this;
|
||||
}
|
||||
|
||||
|
@ -427,22 +427,22 @@ public class TileAdvancedCraftingTable extends TileEntity implements IInventory,
|
|||
return true;
|
||||
}
|
||||
|
||||
public void getGUINetworkData(int i, int j) {
|
||||
public void getGUINetworkData(int id, int data) {
|
||||
int currentStored = (int) (storedEnergy * 100.0);
|
||||
switch (i) {
|
||||
switch (id) {
|
||||
case 1:
|
||||
currentStored = (currentStored & 0xFFFF0000) | (j & 0xFFFF);
|
||||
currentStored = (currentStored & 0xFFFF0000) | (data & 0xFFFF);
|
||||
storedEnergy = (currentStored / 100.0f);
|
||||
break;
|
||||
case 3:
|
||||
currentStored = (currentStored & 0xFFFF) | ((j & 0xFFFF) << 16);
|
||||
currentStored = (currentStored & 0xFFFF) | ((data & 0xFFFF) << 16);
|
||||
storedEnergy = (currentStored / 100.0f);
|
||||
break;
|
||||
case 4:
|
||||
recentEnergyAverage = recentEnergyAverage & 0xFFFF0000 | (j & 0xFFFF);
|
||||
recentEnergyAverage = recentEnergyAverage & 0xFFFF0000 | (data & 0xFFFF);
|
||||
break;
|
||||
case 5:
|
||||
recentEnergyAverage = (recentEnergyAverage & 0xFFFF) | ((j & 0xFFFF) << 16);
|
||||
recentEnergyAverage = (recentEnergyAverage & 0xFFFF) | ((data & 0xFFFF) << 16);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -466,7 +466,7 @@ public class TileAdvancedCraftingTable extends TileEntity implements IInventory,
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isStackValidForSlot(int i, ItemStack itemstack) {
|
||||
public boolean isStackValidForSlot(int slot, ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue