diff options
Diffstat (limited to 'src/Java')
3 files changed, 64 insertions, 5 deletions
diff --git a/src/Java/gtPlusPlus/core/container/Container_ModularityTable.java b/src/Java/gtPlusPlus/core/container/Container_ModularityTable.java index edc84a8c5f..244212ccb2 100644 --- a/src/Java/gtPlusPlus/core/container/Container_ModularityTable.java +++ b/src/Java/gtPlusPlus/core/container/Container_ModularityTable.java @@ -24,6 +24,7 @@ public class Container_ModularityTable extends Container { protected TileEntityModularityTable tile_entity; public final InventoryModularMain inventoryGrid; public final InventoryModularOutput inventoryOutputs; + public int mRecipeTime; private final World worldObj; private final int posX; @@ -39,6 +40,7 @@ public class Container_ModularityTable extends Container { this.inventoryGrid = tile.inventoryGrid; this.inventoryOutputs = tile.inventoryOutputs; this.tile_entity.setContainer(this); + this.mRecipeTime = this.tile_entity.getRecipeTime(); int var6; int var7; @@ -56,6 +58,19 @@ public class Container_ModularityTable extends Container { this.addSlotToContainer(new SlotNoInput(this.inventoryOutputs, 2, 26+(18*6), 44)); int o = 0; + + //Storage Side + for (var6 = 0; var6 < 3; ++var6) + { + 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 SlotModularBaubleUpgrades(this.inventoryGrid, nextFreeSlot, 8+18 + (var7 * 18), 17 + (var6 * 18))); + this.slotGrid[o] = nextFreeSlot; + nextFreeSlot++; + o++; + } + } //Player Inventory for (var6 = 0; var6 < 3; ++var6) @@ -98,6 +113,13 @@ public class Container_ModularityTable extends Container { }*/ } } + + public TileEntityModularityTable getTileentityViaContainer(){ + if (this.tile_entity != null){ + return this.tile_entity; + } + return null; + } @Override public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer){ diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java index 41ab5cce49..a6fc8e70af 100644 --- a/src/Java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java +++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java @@ -9,23 +9,37 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; @SideOnly(Side.CLIENT) public class GUI_ModularityTable extends GuiContainer { - private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/ProjectTable.png"); - + private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/ModularityTable.png"); + private Container_ModularityTable mThisContainer; + private TileEntityModularityTable mThisTile; + private int mRecipeTime = -1; + public GUI_ModularityTable(final InventoryPlayer player_inventory, final TileEntityModularityTable tile){ super(new Container_ModularityTable(player_inventory, tile)); + this.mThisContainer = tile.getContainer(); + this.mThisTile = tile; + if (this.mThisTile.getRecipeTime() > -1){ + this.mRecipeTime = this.mThisTile.getRecipeTime(); + } } @Override protected void drawGuiContainerForegroundLayer(final int i, final int j){ - //this.fontRendererObj.drawString(I18n.format("Workbench", new Object[0]), 28, 6, 4210752); - //this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + this.fontRendererObj.drawString(I18n.format("Modularity Table", new Object[0]), 8, 6, 4210752); + if (mRecipeTime > -1){ + this.fontRendererObj.drawString(I18n.format("Time", new Object[0]), 8, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("Remaining", new Object[0]), 8, 6, 4210752); + this.fontRendererObj.drawString(I18n.format(""+this.mRecipeTime, new Object[0]), 8, 6, 4210752); + } + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); } diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java index be2421b307..406d1c9fa2 100644 --- a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java +++ b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java @@ -27,6 +27,7 @@ public class TileEntityModularityTable extends TileEntity { public InventoryModularMain inventoryGrid; public InventoryModularOutput inventoryOutputs; private Container_ModularityTable container; + private int mRecipeTimeRemaining = 0; public TileEntityModularityTable() { this.inventoryGrid = new InventoryModularMain(); @@ -38,6 +39,14 @@ public class TileEntityModularityTable extends TileEntity { public void setContainer(Container_ModularityTable container_ModularityTable) { this.container = container_ModularityTable; } + + public Container_ModularityTable getContainer() { + return this.container; + } + + public int getRecipeTime(){ + return this.mRecipeTimeRemaining; + } @SuppressWarnings("static-method") public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) { @@ -50,13 +59,16 @@ public class TileEntityModularityTable extends TileEntity { @Override public void writeToNBT(final NBTTagCompound nbt) { super.writeToNBT(nbt); + nbt.setInteger("mRecipeTime", this.mRecipeTimeRemaining); this.inventoryOutputs.writeToNBT(this.getTag(nbt, "ContentsOutput")); + } @Override public void readFromNBT(final NBTTagCompound nbt) { super.readFromNBT(nbt); + this.mRecipeTimeRemaining = nbt.getInteger("mRecipeTime"); this.inventoryOutputs.readFromNBT(nbt.getCompoundTag("ContentsOutput")); } @@ -87,13 +99,24 @@ public class TileEntityModularityTable extends TileEntity { this.inventoryOutputs.setInventorySlotContents(1, null); } this.inventoryOutputs.setInventorySlotContents(0, null); - this.inventoryOutputs.setInventorySlotContents(2, tBauble); + this.mRecipeTimeRemaining = 500; } else { Utils.LOG_INFO("1: " + removeInputA + " | 2: " + removeInputB); } } } } + + if (mRecipeTimeRemaining == 0){ + this.inventoryOutputs.setInventorySlotContents(2, tBauble); + } + else if (mRecipeTimeRemaining == -1){ + mRecipeTimeRemaining = -1; + } + else if (mRecipeTimeRemaining > 0){ + mRecipeTimeRemaining--; + } + } super.updateEntity(); } |