diff options
author | Connor-Colenso <52056774+Connor-Colenso@users.noreply.github.com> | 2023-09-04 03:05:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-04 03:05:22 +0100 |
commit | 76719d65a90d98e228a914774d3b11ed9f01ac8e (patch) | |
tree | ce0d35f954e441e9cc4aa95aa347073728e6f4ee /src/main/java/gtPlusPlus/core/container | |
parent | 0393b582eb3edcb5c575330804b6747577a55e27 (diff) | |
download | GT5-Unofficial-76719d65a90d98e228a914774d3b11ed9f01ac8e.tar.gz GT5-Unofficial-76719d65a90d98e228a914774d3b11ed9f01ac8e.tar.bz2 GT5-Unofficial-76719d65a90d98e228a914774d3b11ed9f01ac8e.zip |
Clean-up v2 (#729)
* Remove test items from NEI with no texture
* Add number formatting to hand pumps
* Remove heavy plates (no recipes & completely unused).
* Remove helium generator (no texture, no recipe)
* Remove fire pit and fire starter (no use, no recipe, no textures)
* Remove giant chicken and associated unused stuff, has no texture and is unobtainable. Used to be relevant but isn't anymore.
* Remove villagers with silly trades like 1 motor + 1 hull = 1 hull. Why?
* Remove trade bench, no recipe, missing textures. Unused.
* Remove farm processors, no texture, no recipe. Unused.
* Remove MAX tier components, these exist in GT now, have no recipe here and are unused.
* Hide untextured light block from NEI
* Update buildscript
* Remove unused backpacks, no recipe and contains dupe bugs. Bad.
* Remove eatotronic, universal toolbox and magic tool bag. All 3 are missing textures and uncraftable.
* Remove eatotronic, universal toolbox and magic tool bag. All 3 are missing textures and uncraftable. part 2
* Remove dragon catcher (what?), no texture, no recipe, unused.
* Remove empty item, does nothing, has no recipe, no idea why it is here.
* Empty item v2 removal
* Revert "Empty item v2 removal"
This reverts commit 75bcd3ccfaf55bbfe2c12b2e4167d5c37636030d.
* Revert "Remove empty item, does nothing, has no recipe, no idea why it is here."
This reverts commit e41a9f484392776331c58530ab1faa5ef978ef36.
* Remove debug square. No recipe, unused.
* Number formatting overflow covers
* Remove JVM garbage collection block. Unused, no recipe.
* Remove nanotubes, no recipe for them. Unused.
* Remove "git" item, doesn't seem to work. Has no recipe.
* Remove uncraftable food with awful textures.
* Remove "bat king" mob, unused content. Does not spawn.
* Remove uncraftable doors with bad textures. Unused content.
* Remove uncraftable, unlocalised redstone stuff that crashes game when placed.
* Remove weird spawner item. No recipe, does not exist in world.
* Remove sunnarium bit, no recipe, no usage.
* Remove unused modularity table and some misc uncraftable, unused items.
* Remove Interconnecting Storage Crate, no recipe, unused.
* Delete worse debug power gen, this already exists as part of GT. Unneeded duplication.
* Delete unused placeholder circuit
* Delete uncraftable generator hatches.
* Spotless
* Remove XP tank thing, unused and uncraftable.
* Remove null item, this fluid registry only seemed to register one null fluid. All others exist?
* Remove EU -> RF battery. Unused in GTNH.
* Remove some shelf nonsense, why is this in this mod?
* Remove some weird random tools. These have no realistic usage in GTNH.
* Remove firemaker. Useless in GTNH.
* Removed helium blob. Deprecated item, not used anymore, uncraftable.
* spotlessApply (#730)
Co-authored-by: GitHub GTNH Actions <>
* Stop modulators generating unused blocks with no textures
* Remove more unused untextured casings
* Remove more unused untextured casings
* Remove more unused untextured casings
* Remove more unused untextured casings
* Remove more unused untextured casings
* Remove some weird methods and uncraftable mining parts, probably part of deprecated multiblock.
* spotlessApply (#732)
Co-authored-by: GitHub GTNH Actions <>
* Remove gem shards, unused.
* Remove unused atoms
* Remove unused gum
* Remove unused elements/materials
* Bye bye
* Remove some unused reflection stuff
* Remove control cores, obsolete now.
* Remove mob killing thing with no texture and no recipe.
* Remove uncraftable covers
* Remove pizza gloves
* Net and rope removal, unused
* Remove force crop
* Removal of some old event stuff
* Remove unused nuclear chem items
* Remove player safe, mostly because of the horrible event code that was intercepting every block break. I can't see any real usage of this via discord.
* Remove Force material and associated other nonsense. Also remove some nuclear chem stuff.
* Remove force for realsies
* Skookum Chooker purge.
* Remove some enderio compat, these plates/dusts are added via GT5 anyway now. This is obsolete.
* spotlessApply (#733)
Co-authored-by: GitHub GTNH Actions <>
* Unused textures
* Bump dep
* Revert "Remove force for realsies"
This reverts commit 0d288912a99f9dabce56d2a2623d4d3510f4804e.
* Revert "Remove Force material and associated other nonsense. Also remove some nuclear chem stuff."
This reverts commit 3455e6e916defe1f2aef923be6f9696a6cf3095b.
* Remove nuclear items that are unused
* spotlessApply (#734)
Co-authored-by: GitHub GTNH Actions <>
---------
Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com>
Co-authored-by: Connor Colenso <colen@CONNORSPC>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gtPlusPlus/core/container')
9 files changed, 0 insertions, 1032 deletions
diff --git a/src/main/java/gtPlusPlus/core/container/Container_BackpackBase.java b/src/main/java/gtPlusPlus/core/container/Container_BackpackBase.java deleted file mode 100644 index 1fc2981722..0000000000 --- a/src/main/java/gtPlusPlus/core/container/Container_BackpackBase.java +++ /dev/null @@ -1,184 +0,0 @@ -package gtPlusPlus.core.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -import gtPlusPlus.core.inventories.BaseInventoryBackpack; -import gtPlusPlus.core.slots.SlotBlockedInv; -import gtPlusPlus.core.slots.SlotItemBackpackInv; - -public class Container_BackpackBase extends Container { - - /** The Item Inventory for this Container, only needed if you want to reference isUseableByPlayer */ - public final BaseInventoryBackpack inventory; - - /** - * Using these will make transferStackInSlot easier to understand and implement INV_START is the index of the first - * slot in the Player's Inventory, so our BaseInventoryBackpack's number of slots (e.g. 5 slots is array indices - * 0-4, so start at 5) Notice how we don't have to remember how many slots we made? We can just use - * BaseInventoryBackpack.INV_SIZE and if we ever change it, the Container updates automatically. - */ - private static final int INV_START = BaseInventoryBackpack.INV_SIZE, INV_END = INV_START + 26, - HOTBAR_START = INV_END + 1, HOTBAR_END = HOTBAR_START + 8; - - // If you're planning to add armor slots, put those first like this: - // ARMOR_START = BaseInventoryBackpack.INV_SIZE, ARMOR_END = ARMOR_START+3, - // INV_START = ARMOR_END+1, and then carry on like above. - - public Container_BackpackBase(final EntityPlayer par1Player, final InventoryPlayer inventoryPlayer, - final BaseInventoryBackpack inventoryItem) { - this.inventory = inventoryItem; - - int i; - - // ITEM INVENTORY - you'll need to adjust the slot locations to match your texture file - // I have them set vertically in columns of 4 to the right of the player model - for (i = 0; i < BaseInventoryBackpack.INV_SIZE; ++i) { - // You can make a custom Slot if you need different behavior, - // such as only certain item types can be put into this slot - // We made a custom slot to prevent our inventory-storing item - // from being stored within itself, but if you want to allow that and - // you followed my advice at the end of the above step, then you - // could get away with using the vanilla Slot class - this.addSlotToContainer( - new SlotItemBackpackInv(this.inventory, i, 80 + (18 * (i / 4)), 8 + (18 * (i % 4)))); - } - - // If you want, you can add ARMOR SLOTS here as well, but you need to - // make a public version of SlotArmor. I won't be doing that in this tutorial. - /* - * for (i = 0; i < 4; ++i) { // These are the standard positions for survival inventory layout - * this.addSlotToContainer(new SlotArmor(this.player, inventoryPlayer, inventoryPlayer.getSizeInventory() - 1 - - * i, 8, 8 + i * 18, i)); } - */ - - // PLAYER INVENTORY - uses default locations for standard inventory texture file - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(inventoryPlayer, j + (i * 9) + 9, 8 + (j * 18), 84 + (i * 18))); - } - } - - // PLAYER ACTION BAR - uses default locations for standard action bar texture file - for (i = 0; i < 9; ++i) { - if (i == par1Player.inventory.currentItem) { - this.addSlotToContainer(new SlotBlockedInv(inventoryPlayer, i, 8 + (i * 18), 142)); - } else { - this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + (i * 18), 142)); - } - } - } - - @Override - public boolean canInteractWith(final EntityPlayer entityplayer) { - // be sure to return the inventory's isUseableByPlayer method - // if you defined special behavior there: - return this.inventory.isUseableByPlayer(entityplayer); - } - - /** - * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. - */ - @Override - public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int index) { - ItemStack itemstack = null; - final Slot slot = (Slot) this.inventorySlots.get(index); - - if ((slot != null) && slot.getHasStack()) { - final ItemStack itemstack1 = slot.getStack(); - itemstack = itemstack1.copy(); - - // If item is in our custom Inventory or armor slot - if (index < INV_START) { - // try to place in player inventory / action bar - if (!this.mergeItemStack(itemstack1, INV_START, HOTBAR_END + 1, true)) { - return null; - } - - slot.onSlotChange(itemstack1, itemstack); - } - // Item is in inventory / hotbar, try to place in custom inventory or armor slots - else { - /* - * If your inventory only stores certain instances of Items, you can implement shift-clicking to your - * inventory like this: // Check that the item is the right type if (itemstack1.getItem() instanceof - * ItemCustom) { // Try to merge into your custom inventory slots // We use - * 'BaseInventoryBackpack.INV_SIZE' instead of INV_START just in case // you also add armor or other - * custom slots if (!this.mergeItemStack(itemstack1, 0, BaseInventoryBackpack.INV_SIZE, false)) { return - * null; } } // If you added armor slots, check them here as well: // Item being shift-clicked is armor - * - try to put in armor slot if (itemstack1.getItem() instanceof ItemArmor) { int type = ((ItemArmor) - * itemstack1.getItem()).armorType; if (!this.mergeItemStack(itemstack1, ARMOR_START + type, ARMOR_START - * + type + 1, false)) { return null; } } Otherwise, you have basically 2 choices: 1. shift-clicking - * between player inventory and custom inventory 2. shift-clicking between action bar and inventory Be - * sure to choose only ONE of the following implementations!!! - */ - /** - * Implementation number 1: Shift-click into your custom inventory - */ - if (index >= INV_START) { - // place in custom inventory - if (!this.mergeItemStack(itemstack1, 0, INV_START, false)) { - return null; - } - } - - /** - * Implementation number 2: Shift-click items between action bar and inventory - */ - // item is in player's inventory, but not in action bar - if ((index >= INV_START) && (index < HOTBAR_START)) { - // place in action bar - if (!this.mergeItemStack(itemstack1, HOTBAR_START, HOTBAR_END + 1, false)) { - return null; - } - } - // item in action bar - place in player inventory - else if ((index >= HOTBAR_START) && (index < (HOTBAR_END + 1))) { - if (!this.mergeItemStack(itemstack1, INV_START, INV_END + 1, false)) { - return null; - } - } - } - - if (itemstack1.stackSize == 0) { - slot.putStack((ItemStack) null); - } else { - slot.onSlotChanged(); - } - - if (itemstack1.stackSize == itemstack.stackSize) { - return null; - } - - slot.onPickupFromSlot(par1EntityPlayer, itemstack1); - } - - return itemstack; - } - - /** - * You should override this method to prevent the player from moving the stack that opened the inventory, otherwise - * if the player moves it, the inventory will not be able to save properly - */ - @Override - public ItemStack slotClick(final int slot, final int button, final int flag, final EntityPlayer player) { - // this will prevent the player from interacting with the item that opened the inventory: - if ((slot >= 0) && (this.getSlot(slot) != null) && (this.getSlot(slot).getStack() == player.getHeldItem())) { - return null; - } - - // Keybind for moving from hotbar slot to hovered slot, make we don't move the currently held backpack. - if (flag == 2 && button >= 0 && button < 9) { - int hotbarIndex = HOTBAR_START + button; - Slot hotbarSlot = getSlot(hotbarIndex); - if (hotbarSlot instanceof SlotBlockedInv) { - return null; - } - } - - return super.slotClick(slot, button, flag, player); - } -} diff --git a/src/main/java/gtPlusPlus/core/container/Container_EggBox.java b/src/main/java/gtPlusPlus/core/container/Container_EggBox.java deleted file mode 100644 index 17a72135ec..0000000000 --- a/src/main/java/gtPlusPlus/core/container/Container_EggBox.java +++ /dev/null @@ -1,133 +0,0 @@ -package gtPlusPlus.core.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.inventories.Inventory_EggBox; -import gtPlusPlus.core.tileentities.general.TileEntityEggBox; - -public class Container_EggBox extends Container { - - protected TileEntityEggBox tile_entity; - public final Inventory_EggBox inventoryChest; - - private final World worldObj; - private final int posX; - private final int posY; - private final int posZ; - - public static int StorageSlotNumber = 15; // Number of slots in storage area - public static int InventorySlotNumber = 36; // Inventory Slots (Inventory - // and Hotbar) - public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All - // slots - - private final int[] slotStorage = new int[15]; - - public Container_EggBox(final InventoryPlayer inventory, final TileEntityEggBox te) { - this.tile_entity = te; - this.inventoryChest = te.getInventory(); - te.openInventory(); - - int var6; - int var7; - this.worldObj = te.getWorldObj(); - this.posX = te.xCoord; - this.posY = te.yCoord; - this.posZ = te.zCoord; - - int o = 0; - - // Storage Side - for (var6 = 0; var6 < 3; var6++) { - for (var7 = 0; var7 < 5; var7++) { - this.slotStorage[o] = o; - this.addSlotToContainer(new Slot(this.inventoryChest, o++, 44 + (var7 * 18), 15 + (var6 * 18))); - } - } - - // Player Inventory - for (var6 = 0; var6 < 3; ++var6) { - for (var7 = 0; var7 < 9; ++var7) { - this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18))); - } - } - - // Player Hotbar - for (var6 = 0; var6 < 9; ++var6) { - this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142)); - } - } - - @Override - public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, - final EntityPlayer aPlayer) { - - if (!aPlayer.worldObj.isRemote) { - if ((aSlotIndex == 999) || (aSlotIndex == -999)) { - // Utils.LOG_WARNING("??? - "+aSlotIndex); - } - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public void onContainerClosed(final EntityPlayer par1EntityPlayer) { - super.onContainerClosed(par1EntityPlayer); - tile_entity.closeInventory(); - } - - @Override - public boolean canInteractWith(final EntityPlayer par1EntityPlayer) { - if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockEggBox) { - return false; - } - - return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D; - } - - @Override - public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) { - ItemStack var3 = null; - final Slot var4 = (Slot) this.inventorySlots.get(par2); - - if ((var4 != null) && var4.getHasStack()) { - final ItemStack var5 = var4.getStack(); - var3 = var5.copy(); - - /* - * if (par2 == 0) { if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true)) { return null; - * } var4.onSlotChange(var5, var3); } else if (par2 >= InOutputSlotNumber && par2 < InventoryOutSlotNumber) - * { if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false)) { return null; } } else - * if (par2 >= InventoryOutSlotNumber && par2 < FullSlotNumber) { if (!this.mergeItemStack(var5, - * InOutputSlotNumber, InventoryOutSlotNumber, false)) { return null; } } else if - * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, false)) { return null; } - */ - - if (var5.stackSize == 0) { - var4.putStack((ItemStack) null); - } else { - var4.onSlotChanged(); - } - - if (var5.stackSize == var3.stackSize) { - return null; - } - - var4.onPickupFromSlot(par1EntityPlayer, var5); - } - - return var3; - } - - // Can merge Slot - @Override - public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) { - return super.func_94530_a(p_94530_1_, p_94530_2_); - } -} diff --git a/src/main/java/gtPlusPlus/core/container/Container_Grindle.java b/src/main/java/gtPlusPlus/core/container/Container_Grindle.java deleted file mode 100644 index f49d840819..0000000000 --- a/src/main/java/gtPlusPlus/core/container/Container_Grindle.java +++ /dev/null @@ -1,137 +0,0 @@ -package gtPlusPlus.core.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -import gtPlusPlus.core.inventories.BaseInventoryGrindle; -import gtPlusPlus.core.slots.SlotDataStick; - -public class Container_Grindle extends Container { - - /** - * The Item Inventory for this Container, only needed if you want to reference isUseableByPlayer - */ - public final BaseInventoryGrindle inventory; - - /** - * Using these will make transferStackInSlot easier to understand and implement INV_START is the index of the first - * slot in the Player's Inventory, so our BaseInventoryBackpack's number of slots (e.g. 5 slots is array indices - * 0-4, so start at 5) Notice how we don't have to remember how many slots we made? We can just use - * BaseInventoryBackpack.INV_SIZE and if we ever change it, the Container updates automatically. - */ - private static final int INV_START = BaseInventoryGrindle.INV_SIZE, INV_END = INV_START + 0, HOTBAR_START = INV_END, - HOTBAR_END = HOTBAR_START + 8; - - public Container_Grindle(final EntityPlayer par1Player, final InventoryPlayer inventoryPlayer, - final BaseInventoryGrindle inventoryItem) { - this.inventory = inventoryItem; - - int i; - - // Actual Scan Slot - this.addSlotToContainer(new SlotDataStick(this.inventory, 0, 152, 5)); - - for (i = 1; i < BaseInventoryGrindle.INV_SIZE; ++i) { - this.addSlotToContainer(new SlotDataStick(this.inventory, i, 153, 30 + (18 * i))); - } - - // PLAYER ACTION BAR - uses default locations for standard action bar texture - // file - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + (i * 18), 142)); - } - } - - @Override - public boolean canInteractWith(final EntityPlayer entityplayer) { - return this.inventory.isUseableByPlayer(entityplayer); - } - - /** - * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. - */ - @Override - public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int index) { - ItemStack itemstack = null; - final Slot slot = (Slot) this.inventorySlots.get(index); - - if ((slot != null) && slot.getHasStack()) { - final ItemStack itemstack1 = slot.getStack(); - itemstack = itemstack1.copy(); - - // If item is in our custom Inventory or armor slot - if (index < INV_START) { - // try to place in player inventory / action bar - if (!this.mergeItemStack(itemstack1, INV_START, HOTBAR_END + 1, true)) { - return null; - } - - slot.onSlotChange(itemstack1, itemstack); - } - // Item is in inventory / hotbar, try to place in custom inventory or armor - // slots - else { - /* - * If your inventory only stores certain instances of Items, you can implement shift-clicking to your - * inventory like this: // Check that the item is the right type if (itemstack1.getItem() instanceof - * ItemCustom) { // Try to merge into your custom inventory slots // We use - * 'BaseInventoryBackpack.INV_SIZE' instead of INV_START just in case // you also add armor or other - * custom slots if (!this.mergeItemStack(itemstack1, 0, BaseInventoryBackpack.INV_SIZE, false)) { return - * null; } } // If you added armor slots, check them here as well: // Item being shift-clicked is armor - * - try to put in armor slot if (itemstack1.getItem() instanceof ItemArmor) { int type = ((ItemArmor) - * itemstack1.getItem()).armorType; if (!this.mergeItemStack(itemstack1, ARMOR_START + type, ARMOR_START - * + type + 1, false)) { return null; } } Otherwise, you have basically 2 choices: 1. shift-clicking - * between player inventory and custom inventory 2. shift-clicking between action bar and inventory Be - * sure to choose only ONE of the following implementations!!! - */ - /** - * Implementation number 1: Shift-click into your custom inventory - */ - /* - * if (index >= INV_START) { // place in custom inventory if (!this.mergeItemStack(itemstack1, 0, - * INV_START, false)) { return null; } } - */ - /** - * Implementation number 2: Shift-click items between action bar and inventory - */ - /* - * // item is in player's inventory, but not in action bar if ((index >= INV_START) && (index < - * HOTBAR_START)) { // place in action bar if (!this.mergeItemStack(itemstack1, HOTBAR_START, HOTBAR_END - * + 1, false)) { return null; } } // item in action bar - place in player inventory else if ((index >= - * HOTBAR_START) && (index < (HOTBAR_END + 1))) { if (!this.mergeItemStack(itemstack1, INV_START, - * INV_END + 1, false)) { return null; } } - */ } - - if (itemstack1.stackSize == 0) { - slot.putStack((ItemStack) null); - } else { - slot.onSlotChanged(); - } - - if (itemstack1.stackSize == itemstack.stackSize) { - return null; - } - - slot.onPickupFromSlot(par1EntityPlayer, itemstack1); - } - - return itemstack; - } - - /** - * You should override this method to prevent the player from moving the stack that opened the inventory, otherwise - * if the player moves it, the inventory will not be able to save properly - */ - @Override - public ItemStack slotClick(final int slot, final int button, final int flag, final EntityPlayer player) { - // this will prevent the player from interacting with the item that opened the - // inventory: - if ((slot >= 0) && (this.getSlot(slot) != null) && (this.getSlot(slot).getStack() == player.getHeldItem())) { - return null; - } - return super.slotClick(slot, button, flag, player); - } -} diff --git a/src/main/java/gtPlusPlus/core/container/Container_HeliumGenerator.java b/src/main/java/gtPlusPlus/core/container/Container_HeliumGenerator.java deleted file mode 100644 index 1ab23ed315..0000000000 --- a/src/main/java/gtPlusPlus/core/container/Container_HeliumGenerator.java +++ /dev/null @@ -1,152 +0,0 @@ -package gtPlusPlus.core.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.inventories.InventoryHeliumGenerator; -import gtPlusPlus.core.slots.SlotFuelRod; -import gtPlusPlus.core.slots.SlotNoInput; -import gtPlusPlus.core.tileentities.general.TileEntityHeliumGenerator; - -public class Container_HeliumGenerator extends Container { - - protected TileEntityHeliumGenerator tile_entity; - public final InventoryHeliumGenerator inventoryChest; - - private final World worldObj; - private final int posX; - private final int posY; - private final int posZ; - - public static int StorageSlotNumber = 19; // Number of slots in storage area - public static int InventorySlotNumber = 36; // Inventory Slots (Inventory and Hotbar) - public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All slots - - // 0 Is output, 1-18 are input. - private final int[] slotStorage = new int[19]; - - public Container_HeliumGenerator(final InventoryPlayer inventory, final TileEntityHeliumGenerator te) { - this.tile_entity = te; - this.inventoryChest = te.getInventory(); - - int var6; - int var7; - this.worldObj = te.getWorldObj(); - this.posX = te.xCoord; - this.posY = te.yCoord; - this.posZ = te.zCoord; - - int o = 0; - - // Output - this.addSlotToContainer(new SlotNoInput(this.inventoryChest, 0, 80, 53)); - this.slotStorage[o] = o; - o++; - - // Side A - for (var6 = 0; var6 < 3; ++var6) { - for (var7 = 0; var7 < 3; ++var7) { - Logger.INFO("Adding slots at var:" + (o) + " x:" + (8 + var7 * 18) + " y:" + (9 + var6 * 18)); - this.addSlotToContainer(new SlotFuelRod(this.inventoryChest, o, 8 + (var7 * 18), 18 + (var6 * 18))); - this.slotStorage[o] = o; - o++; - } - } - - // Side B - for (var6 = 0; var6 < 3; ++var6) { - for (var7 = 0; var7 < 3; ++var7) { - Logger.INFO("Adding slots at var:" + (o) + " x:" + (90 + 8 + (var7 * 18)) + " y:" + (9 + var6 * 18)); - this.addSlotToContainer(new SlotFuelRod(this.inventoryChest, o, 116 + (var7 * 18), 18 + (var6 * 18))); - this.slotStorage[o] = o; - o++; - } - } - - o = 0; - - // Player Inventory - for (var6 = 0; var6 < 3; ++var6) { - for (var7 = 0; var7 < 9; ++var7) { - this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18))); - } - } - - // Player Hotbar - for (var6 = 0; var6 < 9; ++var6) { - this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142)); - } - } - - @Override - public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, - final EntityPlayer aPlayer) { - - if (!aPlayer.worldObj.isRemote) { - if ((aSlotIndex == 999) || (aSlotIndex == -999)) { - // Utils.LOG_WARNING("??? - "+aSlotIndex); - } - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public void onContainerClosed(final EntityPlayer par1EntityPlayer) { - super.onContainerClosed(par1EntityPlayer); - } - - @Override - public boolean canInteractWith(final EntityPlayer par1EntityPlayer) { - if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockHeliumGenerator) { - return false; - } - - return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D; - } - - @Override - public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) { - ItemStack var3 = null; - final Slot var4 = (Slot) this.inventorySlots.get(par2); - - if ((var4 != null) && var4.getHasStack()) { - final ItemStack var5 = var4.getStack(); - var3 = var5.copy(); - - /* - * if (par2 == 0) { if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true)) { return null; - * } var4.onSlotChange(var5, var3); } else if (par2 >= InOutputSlotNumber && par2 < InventoryOutSlotNumber) - * { if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false)) { return null; } } else - * if (par2 >= InventoryOutSlotNumber && par2 < FullSlotNumber) { if (!this.mergeItemStack(var5, - * InOutputSlotNumber, InventoryOutSlotNumber, false)) { return null; } } else if - * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, false)) { return null; } - */ - - if (var5.stackSize == 0) { - var4.putStack((ItemStack) null); - } else { - var4.onSlotChanged(); - } - - if (var5.stackSize == var3.stackSize) { - return null; - } - - var4.onPickupFromSlot(par1EntityPlayer, var5); - } - - return var3; - } - - // Can merge Slot - @Override - public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) { - return super.func_94530_a(p_94530_1_, p_94530_2_); - } -} diff --git a/src/main/java/gtPlusPlus/core/container/Container_ModularityTable.java b/src/main/java/gtPlusPlus/core/container/Container_ModularityTable.java deleted file mode 100644 index 3a615675b5..0000000000 --- a/src/main/java/gtPlusPlus/core/container/Container_ModularityTable.java +++ /dev/null @@ -1,193 +0,0 @@ -package gtPlusPlus.core.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.inventories.modulartable.InventoryModularMain; -import gtPlusPlus.core.inventories.modulartable.InventoryModularOutput; -import gtPlusPlus.core.slots.SlotModularBauble; -import gtPlusPlus.core.slots.SlotModularBaubleUpgrades; -import gtPlusPlus.core.slots.SlotNoInput; -import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable; - -public class Container_ModularityTable extends Container { - - /** The crafting matrix inventory (3x3). */ - protected TileEntityModularityTable tile_entity; - - public final InventoryModularMain inventoryGrid; - public final InventoryModularOutput inventoryOutputs; - public int mRecipeTime; - - private final World worldObj; - private final int posX; - private final int posY; - private final int posZ; - - private final int[] slotOutputs = new int[3]; - private final int[] slotGrid = new int[9]; - - public Container_ModularityTable(final InventoryPlayer inventory, final TileEntityModularityTable tile) { - this.tile_entity = tile; - this.inventoryGrid = tile.inventoryGrid; - this.inventoryOutputs = tile.inventoryOutputs; - this.tile_entity.setContainer(this); - this.mRecipeTime = this.tile_entity.getRecipeTime(); - Logger.INFO("Container: " + this.mRecipeTime); - - int var6; - int var7; - this.worldObj = tile.getWorldObj(); - this.posX = tile.xCoord; - this.posY = tile.yCoord; - this.posZ = tile.zCoord; - - int nextFreeSlot = 0; - - // Output slots - this.addSlotToContainer(new SlotModularBauble(this.inventoryOutputs, 0, 26 + (18 * 6), 8)); - this.addSlotToContainer(new SlotModularBaubleUpgrades(this.inventoryOutputs, 1, 26 + (18 * 5), 8)); - 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) { - for (var7 = 0; var7 < 9; ++var7) { - this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18))); - } - } - - // Player Hotbar - for (var6 = 0; var6 < 9; ++var6) { - this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142)); - } - - // this.onCraftMatrixChanged(this.craftMatrix); - - } - - /** - * Callback for when the crafting matrix is changed. - */ - /* - * public void onCraftMatrixChanged(IInventory p_75130_1_) { this.craftResult.setInventorySlotContents(0, - * CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); } - */ - - /** - * Called when the container is closed. - */ - @Override - public void onContainerClosed(EntityPlayer p_75134_1_) { - super.onContainerClosed(p_75134_1_); - if (!this.worldObj.isRemote) { - /* - * for (int i = 0; i < 9; ++i){ ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i); if - * (itemstack != null){ p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false); } } - */ - } - } - - 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) { - - if (!aPlayer.worldObj.isRemote) { - if ((aSlotIndex == 999) || (aSlotIndex == -999)) { - // Utils.LOG_WARNING("??? - "+aSlotIndex); - } - - if (aSlotIndex == 0) { - Logger.INFO("Player Clicked on the bauble slot"); - // TODO - } else if (aSlotIndex == 1) { - Logger.INFO("Player Clicked on the upgrade slot"); - // TODO - } else if (aSlotIndex == 2) { - Logger.INFO("Player Clicked on the output slot"); - // TODO - } else { - for (final int x : this.slotGrid) { - if (aSlotIndex == x) { - Logger.INFO("Player Clicked slot " + aSlotIndex + " in the crafting Grid"); - } - } - } - } - // Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid"); - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public boolean canInteractWith(final EntityPlayer par1EntityPlayer) { - if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockModularTable) { - return false; - } - - return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D; - } - - @Override - public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) { - - return null; - - /* - * ItemStack var3 = null; final Slot var4 = (Slot)this.inventorySlots.get(par2); if ((var4 != null) && - * var4.getHasStack()) { final ItemStack var5 = var4.getStack(); var3 = var5.copy(); if (par2 == 0) { if - * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true)) { return null; } - * var4.onSlotChange(var5, var3); } else if ((par2 >= InOutputSlotNumber) && (par2 < InventoryOutSlotNumber)) { - * if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false)) { return null; } } else if - * ((par2 >= InventoryOutSlotNumber) && (par2 < FullSlotNumber)) { if (!this.mergeItemStack(var5, - * InOutputSlotNumber, InventoryOutSlotNumber, false)) { return null; } } else if (!this.mergeItemStack(var5, - * InOutputSlotNumber, FullSlotNumber, false)) { return null; } if (var5.stackSize == 0) { - * var4.putStack((ItemStack)null); } else { var4.onSlotChanged(); } if (var5.stackSize == var3.stackSize) { - * return null; } var4.onPickupFromSlot(par1EntityPlayer, var5); } return var3; - */ - } - - // Can merge Slot - /* - * 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; } - */ - -} diff --git a/src/main/java/gtPlusPlus/core/container/Container_TradeTable.java b/src/main/java/gtPlusPlus/core/container/Container_TradeTable.java deleted file mode 100644 index ff19730c20..0000000000 --- a/src/main/java/gtPlusPlus/core/container/Container_TradeTable.java +++ /dev/null @@ -1,174 +0,0 @@ -package gtPlusPlus.core.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.inventories.tradetable.InventoryTradeMain; -import gtPlusPlus.core.inventories.tradetable.InventoryTradeOutput; -import gtPlusPlus.core.slots.SlotGeneric; -import gtPlusPlus.core.slots.SlotNoInput; -import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable; - -public class Container_TradeTable extends Container { - - protected TileEntityTradeTable tile_entity; - public final InventoryTradeMain inventoryChest; - public final InventoryTradeOutput inventoryOutputs; - - private final World worldObj; - private final int posX; - private final int posY; - private final int posZ; - - private final int[] slotOutputs = new int[2]; - private final int[] slotGrid = new int[9]; - - public Container_TradeTable(final InventoryPlayer inventory, final TileEntityTradeTable te) { - - this.tile_entity = te; - this.inventoryChest = te.inventoryGrid; - this.inventoryOutputs = te.inventoryOutputs; - this.tile_entity.setContainer(this); - - if (te.isServerSide()) Logger.INFO("Container - " + te.mOwnerName); - - int var6; - int var7; - this.worldObj = te.getWorldObj(); - this.posX = te.xCoord; - this.posY = te.yCoord; - this.posZ = te.zCoord; - - int nextFreeSlot = 0; - - // Output slots - this.addSlotToContainer(new SlotGeneric(this.inventoryOutputs, 0, 26 + (18 * 6), 8)); - this.addSlotToContainer(new SlotNoInput(this.inventoryOutputs, 1, 26 + (18 * 6), 44)); - - // this.addSlotToContainer(new SlotCraftingNoCollect(inventory.player, this.craftMatrix, this.craftResult, 0, - // 26+(18*4), 25)); - - 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 Slot(this.inventoryChest, nextFreeSlot, 8 + 18 + (var7 * 18), 8 + (var6 * 18))); - this.slotGrid[o] = nextFreeSlot; - nextFreeSlot++; - o++; - } - } - - // Player Inventory - for (var6 = 0; var6 < 3; ++var6) { - for (var7 = 0; var7 < 9; ++var7) { - this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18))); - } - } - - // Player Hotbar - for (var6 = 0; var6 < 9; ++var6) { - this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142)); - } - - // this.onCraftMatrixChanged(this.craftMatrix); - } - - /** - * Called when the container is closed. - */ - @Override - public void onContainerClosed(EntityPlayer p_75134_1_) { - super.onContainerClosed(p_75134_1_); - if (!this.worldObj.isRemote) { - for (int i = 0; i < 9; ++i) { - ItemStack itemstack = this.inventoryChest.getStackInSlotOnClosing(i); - if (itemstack != null) { - p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false); - } - } - } - } - - @Override - public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, - final EntityPlayer aPlayer) { - - if (!aPlayer.worldObj.isRemote) { - if ((aSlotIndex == 999) || (aSlotIndex == -999)) { - // Utils.LOG_WARNING("??? - "+aSlotIndex); - } - - if (aSlotIndex == 0) { - Logger.INFO("Player Clicked on the Data Stick slot"); - // TODO - } - if (aSlotIndex == 1) { - Logger.INFO("Player Clicked on the output slot"); - // TODO - } - - for (final int x : this.slotGrid) { - if (aSlotIndex == x) { - Logger.INFO("Player Clicked slot " + aSlotIndex + " in the crafting Grid"); - } - } - } - // Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid"); - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public boolean canInteractWith(final EntityPlayer par1EntityPlayer) { - if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockTradeTable) { - return false; - } - - return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D; - } - - @Override - public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) { - - return null; - - /* - * ItemStack var3 = null; final Slot var4 = (Slot)this.inventorySlots.get(par2); if ((var4 != null) && - * var4.getHasStack()) { final ItemStack var5 = var4.getStack(); var3 = var5.copy(); if (par2 == 0) { if - * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true)) { return null; } - * var4.onSlotChange(var5, var3); } else if ((par2 >= InOutputSlotNumber) && (par2 < InventoryOutSlotNumber)) { - * if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false)) { return null; } } else if - * ((par2 >= InventoryOutSlotNumber) && (par2 < FullSlotNumber)) { if (!this.mergeItemStack(var5, - * InOutputSlotNumber, InventoryOutSlotNumber, false)) { return null; } } else if (!this.mergeItemStack(var5, - * InOutputSlotNumber, FullSlotNumber, false)) { return null; } if (var5.stackSize == 0) { - * var4.putStack((ItemStack)null); } else { var4.onSlotChanged(); } if (var5.stackSize == var3.stackSize) { - * return null; } var4.onPickupFromSlot(par1EntityPlayer, var5); } return var3; - */ - } - - public ItemStack getOutputContent() { - ItemStack output = this.inventoryOutputs.getStackInSlot(0); - if (output != null) { - return output; - } - return null; - } - - public ItemStack[] getInputComponents() { - ItemStack inputs[] = new ItemStack[9]; - for (int r = 0; r < this.inventoryChest.getSizeInventory(); r++) { - ItemStack temp = this.inventoryChest.getStackInSlot(r); - inputs[r] = temp; - } - return inputs; - } -} diff --git a/src/main/java/gtPlusPlus/core/container/box/LunchBoxContainer.java b/src/main/java/gtPlusPlus/core/container/box/LunchBoxContainer.java deleted file mode 100644 index 9bd740a5a2..0000000000 --- a/src/main/java/gtPlusPlus/core/container/box/LunchBoxContainer.java +++ /dev/null @@ -1,21 +0,0 @@ -package gtPlusPlus.core.container.box; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; - -import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase; -import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory; -import gtPlusPlus.core.slots.SlotLunchBox; - -public class LunchBoxContainer extends ContainerBoxBase { - - public LunchBoxContainer(EntityPlayer par1Player, InventoryPlayer inventoryPlayer, - CustomBoxInventory CustomBoxInventory) { - super( - par1Player, - inventoryPlayer, - CustomBoxInventory, - SlotLunchBox.class, - gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS); - } -} diff --git a/src/main/java/gtPlusPlus/core/container/box/MagicBagContainer.java b/src/main/java/gtPlusPlus/core/container/box/MagicBagContainer.java deleted file mode 100644 index 3158631610..0000000000 --- a/src/main/java/gtPlusPlus/core/container/box/MagicBagContainer.java +++ /dev/null @@ -1,21 +0,0 @@ -package gtPlusPlus.core.container.box; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; - -import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase; -import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory; -import gtPlusPlus.core.slots.SlotMagicToolBag; - -public class MagicBagContainer extends ContainerBoxBase { - - public MagicBagContainer(EntityPlayer par1Player, InventoryPlayer inventoryPlayer, - CustomBoxInventory CustomBoxInventory) { - super( - par1Player, - inventoryPlayer, - CustomBoxInventory, - SlotMagicToolBag.class, - gtPlusPlus.core.item.tool.misc.box.MagicToolBag.SLOTS); - } -} diff --git a/src/main/java/gtPlusPlus/core/container/box/ToolBoxContainer.java b/src/main/java/gtPlusPlus/core/container/box/ToolBoxContainer.java deleted file mode 100644 index 6af27082fa..0000000000 --- a/src/main/java/gtPlusPlus/core/container/box/ToolBoxContainer.java +++ /dev/null @@ -1,17 +0,0 @@ -package gtPlusPlus.core.container.box; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; - -import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase; -import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory; -import gtPlusPlus.core.item.tool.misc.box.UniversalToolBox; -import gtPlusPlus.core.slots.SlotToolBox; - -public class ToolBoxContainer extends ContainerBoxBase { - - public ToolBoxContainer(EntityPlayer par1Player, InventoryPlayer inventoryPlayer, - CustomBoxInventory CustomBoxInventory) { - super(par1Player, inventoryPlayer, CustomBoxInventory, SlotToolBox.class, UniversalToolBox.SLOTS); - } -} |