Depricated Container
I am planning to make the crafter not require a GUI.
This commit is contained in:
parent
a1caf9acf3
commit
38a391c496
1 changed files with 71 additions and 75 deletions
|
@ -7,6 +7,12 @@ import net.minecraft.src.Item;
|
|||
import net.minecraft.src.ItemStack;
|
||||
import net.minecraft.src.Slot;
|
||||
|
||||
/**
|
||||
* I am planning to make the crafter not use a GUI.
|
||||
* @author Calclavia
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public class ContainerCrafter extends Container
|
||||
{
|
||||
private TileEntityAutoCrafter tileEntity;
|
||||
|
@ -14,11 +20,11 @@ public class ContainerCrafter extends Container
|
|||
public ContainerCrafter(InventoryPlayer par1InventoryPlayer, TileEntityAutoCrafter tileEntity)
|
||||
{
|
||||
this.tileEntity = tileEntity;
|
||||
for(int r = 0; r < 3; r++)
|
||||
for (int r = 0; r < 3; r++)
|
||||
{
|
||||
for(int i = 0; i < 3; i++)
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(tileEntity, i+ r*3, 33 + i*18, 34 + r * 18));
|
||||
//this.addSlotToContainer(new Slot(tileEntity, i + r * 3, 33 + i * 18, 34 + r * 18));
|
||||
}
|
||||
}
|
||||
int var3;
|
||||
|
@ -44,13 +50,15 @@ public class ContainerCrafter extends Container
|
|||
}
|
||||
|
||||
/**
|
||||
* Called to transfer a stack from one inventory to the other eg. when shift clicking.
|
||||
* Called to transfer a stack from one
|
||||
* inventory to the other eg. when shift
|
||||
* clicking.
|
||||
*/
|
||||
@Override
|
||||
public ItemStack func_82846_b(EntityPlayer par1EntityPlayer, int par1)
|
||||
{
|
||||
ItemStack itemStack3 = null;
|
||||
Slot itemStack = (Slot)this.inventorySlots.get(par1);
|
||||
Slot itemStack = (Slot) this.inventorySlots.get(par1);
|
||||
|
||||
if (itemStack != null && itemStack.getHasStack())
|
||||
{
|
||||
|
@ -61,34 +69,22 @@ public class ContainerCrafter extends Container
|
|||
{
|
||||
if (itemStack2.itemID == Item.coal.shiftedIndex)
|
||||
{
|
||||
if (!this.mergeItemStack(itemStack2, 0, 1, false))
|
||||
{
|
||||
return null;
|
||||
if (!this.mergeItemStack(itemStack2, 0, 1, false)) { return null; }
|
||||
}
|
||||
else if (par1 >= 30 && par1 < 37 && !this.mergeItemStack(itemStack2, 3, 30, false)) { return null; }
|
||||
}
|
||||
else if (par1 >= 30 && par1 < 37 && !this.mergeItemStack(itemStack2, 3, 30, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(itemStack2, 3, 37, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else if (!this.mergeItemStack(itemStack2, 3, 37, false)) { return null; }
|
||||
|
||||
if (itemStack2.stackSize == 0)
|
||||
{
|
||||
itemStack.putStack((ItemStack)null);
|
||||
itemStack.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
itemStack.onSlotChanged();
|
||||
}
|
||||
|
||||
if (itemStack2.stackSize == itemStack3.stackSize)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (itemStack2.stackSize == itemStack3.stackSize) { return null; }
|
||||
|
||||
itemStack.func_82870_a(par1EntityPlayer, itemStack2);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue