diff options
| author | Draknyte1 <Draknyte1@hotmail.com> | 2016-06-19 14:53:32 +1000 |
|---|---|---|
| committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-06-19 14:53:32 +1000 |
| commit | d4f11459f2e78e954a4c060c92861614c114d1cb (patch) | |
| tree | a9d22e4f658e25163ae0fdbe4a1e3395da9efac9 /src/Java/miscutil/core/container | |
| parent | 2615992e7d0d4ed3ac205800be71c831029b2dc5 (diff) | |
| download | GT5-Unofficial-d4f11459f2e78e954a4c060c92861614c114d1cb.tar.gz GT5-Unofficial-d4f11459f2e78e954a4c060c92861614c114d1cb.tar.bz2 GT5-Unofficial-d4f11459f2e78e954a4c060c92861614c114d1cb.zip | |
+More classes stolen from GT to implement my own items on a metaitem.
+Added LuV -> Max Voltage Machine components.
+Added Rocket Engines, High tier diesel generators.
+Added new textures for everything.
+Added BedLocator_Base.java - Debug item for testing and NBT data storage.
+Added Machine_Charger.java - Another Debug machine for testing NBT value manipulation.
Diffstat (limited to 'src/Java/miscutil/core/container')
| -rw-r--r-- | src/Java/miscutil/core/container/Container_Charger.java | 81 | ||||
| -rw-r--r-- | src/Java/miscutil/core/container/Container_NHG.java | 2 |
2 files changed, 82 insertions, 1 deletions
diff --git a/src/Java/miscutil/core/container/Container_Charger.java b/src/Java/miscutil/core/container/Container_Charger.java new file mode 100644 index 0000000000..cbe7156d0e --- /dev/null +++ b/src/Java/miscutil/core/container/Container_Charger.java @@ -0,0 +1,81 @@ +package miscutil.core.container; + +import miscutil.core.tileentities.machines.TileEntityCharger; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class Container_Charger extends Container +{ + private TileEntityCharger te; + + public static final int INPUT_1 = 0; + + private int slotID = 0; + + public Container_Charger(TileEntityCharger te, EntityPlayer player) + { + this.te = te; + + //Fuel Slot A + addSlotToContainer(new Slot(te, slotID++, 80, 53)); + + + + //Inventory + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 9; j++) + { + addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + // Hotbar + for (int i = 0; i < 9; i++) + { + addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw) + { + ItemStack stack = null; + Slot slot = (Slot)inventorySlots.get(slotRaw); + + if (slot != null && slot.getHasStack()) + { + ItemStack stackInSlot = slot.getStack(); + stack = stackInSlot.copy(); + + if (slotRaw < 3 * 9) + { + if (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true)) + { + return null; + } + } + else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false)) + { + return null; + } + + if (stackInSlot.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + } + return stack; + } + + @Override + public boolean canInteractWith(EntityPlayer player) + { + return te.isUseableByPlayer(player); + } +}
\ No newline at end of file diff --git a/src/Java/miscutil/core/container/Container_NHG.java b/src/Java/miscutil/core/container/Container_NHG.java index 8baed3f5bd..78461ad2b7 100644 --- a/src/Java/miscutil/core/container/Container_NHG.java +++ b/src/Java/miscutil/core/container/Container_NHG.java @@ -1,6 +1,6 @@ package miscutil.core.container; -import miscutil.core.tileentities.TileEntityNHG; +import miscutil.core.tileentities.machines.TileEntityNHG; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; |
