aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/container
diff options
context:
space:
mode:
authorAlkalus <draknyte1@hotmail.com>2017-09-12 17:04:35 +1000
committerAlkalus <draknyte1@hotmail.com>2017-09-12 17:04:35 +1000
commitcdc728c5b606d6d3d49dce77c18f875a1f8379c6 (patch)
tree8e48d0e8fe2aa88547b9a00b56bce51a3022ea3f /src/Java/gtPlusPlus/core/container
parent72905a7d18b0c5fca8a8edf3ed38b17d7f11f415 (diff)
downloadGT5-Unofficial-cdc728c5b606d6d3d49dce77c18f875a1f8379c6.tar.gz
GT5-Unofficial-cdc728c5b606d6d3d49dce77c18f875a1f8379c6.tar.bz2
GT5-Unofficial-cdc728c5b606d6d3d49dce77c18f875a1f8379c6.zip
+ Auto Crafter now consumes items when found for a recipe.
+ Auto Crafter now outputs item when all 9 inputs are valid. + Added Read & Write to NBT functions to NBTUtils class. % Project Table now stores inputs and output to a Data Stick.
Diffstat (limited to 'src/Java/gtPlusPlus/core/container')
-rw-r--r--src/Java/gtPlusPlus/core/container/Container_ProjectTable.java30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/Java/gtPlusPlus/core/container/Container_ProjectTable.java b/src/Java/gtPlusPlus/core/container/Container_ProjectTable.java
index 0100a422c1..3a256d07a9 100644
--- a/src/Java/gtPlusPlus/core/container/Container_ProjectTable.java
+++ b/src/Java/gtPlusPlus/core/container/Container_ProjectTable.java
@@ -37,6 +37,7 @@ public class Container_ProjectTable extends Container {
this.tile_entity = tile;
this.inventoryGrid = tile.inventoryGrid;
this.inventoryOutputs = tile.inventoryOutputs;
+ this.tile_entity.setContainer(this);
int var6;
int var7;
@@ -49,10 +50,10 @@ public class Container_ProjectTable extends Container {
//Output slots
- this.addSlotToContainer(new SlotDataStick(this.inventoryOutputs, 0, 26+(18*4), 7));
- this.addSlotToContainer(new SlotNoInput(this.inventoryOutputs, 1, 26+(18*4), 43));
+ this.addSlotToContainer(new SlotDataStick(this.inventoryOutputs, 0, 26+(18*6), 7));
+ this.addSlotToContainer(new SlotNoInput(this.inventoryOutputs, 1, 26+(18*6), 43));
- this.addSlotToContainer(new SlotCraftingNoCollect(inventory.player, this.craftMatrix, this.craftResult, 0, 26+(18*3), 25));
+ this.addSlotToContainer(new SlotCraftingNoCollect(inventory.player, this.craftMatrix, this.craftResult, 0, 26+(18*4), 25));
int o = 0;
@@ -62,7 +63,7 @@ public class Container_ProjectTable extends Container {
for (var7 = 0; var7 < 3; ++var7)
{
//Utils.LOG_WARNING("Adding slots at var:"+(var7 + var6 * 4)+" x:"+(8 + var7 * 18)+" y:"+(7 + var6 * 18));
- this.addSlotToContainer(new Slot(this.craftMatrix, nextFreeSlot, 8 + (var7 * 18), 7 + (var6 * 18)));
+ this.addSlotToContainer(new Slot(this.craftMatrix, nextFreeSlot, 8+18 + (var7 * 18), 8 + (var6 * 18)));
this.slotGrid[o] = nextFreeSlot;
nextFreeSlot++;
o++;
@@ -105,9 +106,9 @@ public class Container_ProjectTable extends Container {
if (!this.worldObj.isRemote){
for (int i = 0; i < 9; ++i){
ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i);
- /* if (itemstack != null){
+ if (itemstack != null){
p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false);
- }*/
+ }
}
}
}
@@ -214,6 +215,23 @@ public class Container_ProjectTable extends Container {
public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_){
return p_94530_2_.inventory != this.craftResult && super.func_94530_a(p_94530_1_, p_94530_2_);
}
+
+ public ItemStack getOutputContent(){
+ ItemStack output = this.craftResult.getStackInSlot(0);
+ if (output != null){
+ return output;
+ }
+ return null;
+ }
+
+ public ItemStack[] getInputComponents(){
+ ItemStack inputs[] = new ItemStack[9];
+ for (int r=0;r<this.craftMatrix.getSizeInventory();r++){
+ ItemStack temp = this.craftMatrix.getStackInSlot(r);
+ inputs[r] = temp;
+ }
+ return inputs;
+ }
} \ No newline at end of file