aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2022-01-07 16:24:37 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2022-01-07 16:24:37 +0000
commit53da73a35860acd285baa0ccab5aef4ff4f6bd98 (patch)
tree8a8ed6df5de3a8a94884e182a59122e87bc9f222 /src/main/java
parentd579f2d2b41922dbee4c2146833b257bfeab4ecd (diff)
downloadGT5-Unofficial-53da73a35860acd285baa0ccab5aef4ff4f6bd98.tar.gz
GT5-Unofficial-53da73a35860acd285baa0ccab5aef4ff4f6bd98.tar.bz2
GT5-Unofficial-53da73a35860acd285baa0ccab5aef4ff4f6bd98.zip
Rewrote and readded Bronze/Advanced Workbenches using GT Meta Tile system.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/gtPlusPlus/core/block/ModBlocks.java17
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/Machine_Workbench.java152
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java111
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_Workbench.java413
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java377
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_Workbench.java81
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_WorkbenchAdvanced.java42
-rw-r--r--src/main/java/gtPlusPlus/core/handler/GuiHandler.java43
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemBlueprint.java6
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java14
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbench.java172
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbenchAdvanced.java245
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_AdvancedWorkbench.java124
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_BronzeWorkbench.java120
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_AdvancedWorkbench.java84
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_BronzeWorkbench.java13
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java17
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java163
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_AdvancedCraftingTable.java550
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_BronzeCraftingTable.java91
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java17
21 files changed, 1227 insertions, 1625 deletions
diff --git a/src/main/java/gtPlusPlus/core/block/ModBlocks.java b/src/main/java/gtPlusPlus/core/block/ModBlocks.java
index fdbb2bdf5b..a716366601 100644
--- a/src/main/java/gtPlusPlus/core/block/ModBlocks.java
+++ b/src/main/java/gtPlusPlus/core/block/ModBlocks.java
@@ -13,11 +13,22 @@ import gtPlusPlus.core.block.general.PlayerDoors;
import gtPlusPlus.core.block.general.antigrief.BlockWitherProof;
import gtPlusPlus.core.block.general.redstone.BlockGenericRedstoneDetector;
import gtPlusPlus.core.block.general.redstone.BlockGenericRedstoneTest;
-import gtPlusPlus.core.block.machine.*;
+import gtPlusPlus.core.block.machine.CircuitProgrammer;
+import gtPlusPlus.core.block.machine.DecayablesChest;
+import gtPlusPlus.core.block.machine.EggBox;
+import gtPlusPlus.core.block.machine.FishTrap;
+import gtPlusPlus.core.block.machine.HeliumGenerator;
+import gtPlusPlus.core.block.machine.Machine_ModularityTable;
+import gtPlusPlus.core.block.machine.Machine_PestKiller;
+import gtPlusPlus.core.block.machine.Machine_PooCollector;
+import gtPlusPlus.core.block.machine.Machine_ProjectTable;
+import gtPlusPlus.core.block.machine.Machine_RoundRobinator;
+import gtPlusPlus.core.block.machine.Machine_SuperJukebox;
+import gtPlusPlus.core.block.machine.Machine_TradeTable;
+import gtPlusPlus.core.block.machine.VolumetricFlaskSetter;
import gtPlusPlus.core.block.machine.bedrock.Mining_Head_Fake;
import gtPlusPlus.core.block.machine.bedrock.Mining_Pipe_Fake;
import gtPlusPlus.core.fluids.FluidRegistryHandler;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
@@ -110,8 +121,6 @@ public final class ModBlocks {
FluidRegistryHandler.registerFluids();
//Workbench
- blockWorkbench = new Machine_Workbench().setHardness(1.5F);
- blockWorkbenchAdvanced = new Machine_WorkbenchAdvanced().setHardness(2.5F);
blockHeliumGenerator = new HeliumGenerator();
blockFirePit = new FirePit();
blockFishTrap = new FishTrap();
diff --git a/src/main/java/gtPlusPlus/core/block/machine/Machine_Workbench.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_Workbench.java
deleted file mode 100644
index 5c08612042..0000000000
--- a/src/main/java/gtPlusPlus/core/block/machine/Machine_Workbench.java
+++ /dev/null
@@ -1,152 +0,0 @@
-package gtPlusPlus.core.block.machine;
-
-import cpw.mods.fml.common.Optional;
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.common.registry.LanguageRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.block.BlockContainer;
-import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.EnumCreatureType;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.lib.LoadedMods;
-import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
-import ic2.core.item.tool.ItemToolWrench;
-
-@Optional.Interface(iface = "crazypants.enderio.api.tool.ITool", modid = "EnderIO")
-public class Machine_Workbench extends BlockContainer
-{
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
-
- @SuppressWarnings("deprecation")
- public Machine_Workbench()
- {
- super(Material.iron);
- this.setBlockName("blockWorkbenchGT");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, "blockWorkbenchGT");
- LanguageRegistry.addName(this, "Bronze Workbench");
-
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int p_149691_1_, final int p_149691_2_)
- {
- return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_)
- {
- this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_side_cabinet");
- this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_top_crafting");
- this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_side");
- this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_side_cabinet");
- }
-
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz)
- {
-
- ItemStack heldItem = null;
- if (world.isRemote){
- heldItem = PlayerUtils.getItemStackInPlayersHand();
- }
-
- boolean holdingWrench = false;
-
- if (heldItem != null){
- holdingWrench = isWrench(heldItem);
- }
-
- if (world.isRemote) {
- return true;
- }
-
- final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntityWorkbench))
- {
- if (!holdingWrench){
- player.openGui(GTplusplus.instance, 3, world, x, y, z);
- return true;
- }
- Logger.INFO("Holding a Wrench, doing wrench things instead.");
- }
- return false;
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityWorkbench();
- }
-
- public static boolean isWrench(final ItemStack item){
- if (item.getItem() instanceof ItemToolWrench){
- return true;
- }
- if (LoadedMods.BuildCraft){
- return checkBuildcraftWrench(item);
- }
- if (LoadedMods.EnderIO){
- return checkEnderIOWrench(item);
- }
- return false;
- }
-
- @Optional.Method(modid = "EnderIO")
- private static boolean checkEnderIOWrench(final ItemStack item) {
- if (ReflectionUtils.doesClassExist("crazypants.enderio.api.tool.ITool")) {
- Class<?> wrenchClass;
- wrenchClass = ReflectionUtils.getClass("crazypants.enderio.api.tool.ITool");
- if (wrenchClass.isInstance(item.getItem())) {
- return true;
- }
- }
- return false;
- }
-
- @Optional.Method(modid = "Buildcraft")
- private static boolean checkBuildcraftWrench(final ItemStack item) {
- if (ReflectionUtils.doesClassExist("buildcraft.api.tools.IToolWrench")) {
- Class<?> wrenchClass;
- wrenchClass = ReflectionUtils.getClass("buildcraft.api.tools.IToolWrench");
- if (wrenchClass.isInstance(item.getItem())) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) {
- return false;
- }
-
-} \ No newline at end of file
diff --git a/src/main/java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java
deleted file mode 100644
index af2f9f82e0..0000000000
--- a/src/main/java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package gtPlusPlus.core.block.machine;
-
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.common.registry.LanguageRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-
-import net.minecraft.block.BlockContainer;
-import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.World;
-
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced;
-
-public class Machine_WorkbenchAdvanced extends BlockContainer
-{
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
-
- @SuppressWarnings("deprecation")
- public Machine_WorkbenchAdvanced()
- {
- super(Material.iron);
- this.setBlockName("blockWorkbenchGTAdvanced");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, "blockWorkbenchGTAdvanced");
- LanguageRegistry.addName(this, "Advanced Workbench");
-
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int p_149691_1_, final int p_149691_2_)
- {
- return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_)
- {
- this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top");
- this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "cover_crafting");
- this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top");
- this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top");
- }
-
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz)
- {
-
- /*final ItemStack heldItem = PlayerUtils.getItemStackInPlayersHand(player);
- if (world.isRemote) {
- return true;
- }
- boolean holdingWrench = false;
-
- if (heldItem != null){
- if (heldItem.getItem() instanceof ItemToolWrench){
- holdingWrench = true;
- }
- else if (heldItem.getItem() instanceof IToolWrench){
- holdingWrench = true;
- }
- else if (heldItem.getItem() instanceof ITool){
- holdingWrench = true;
- }
- else if (heldItem.getItem() instanceof GT_MetaGenerated_Tool){
- GT_MetaGenerated_Tool testTool = (GT_MetaGenerated_Tool) heldItem.getItem();
- if (testTool.canWrench(player, x, y, z)){
- holdingWrench = true;
- }
- }
- else {
- holdingWrench = false;
- }
- }
-
-
- final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntityWorkbenchAdvanced))
- {
- if (!holdingWrench){
- player.openGui(GTplusplus.instance, 4, world, x, y, z);
- return true;
- }
- Utils.LOG_INFO("Holding a Wrench, doing wrench things instead.");
- }*/
- return false;
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityWorkbenchAdvanced(128000, 2);
- }
-} \ No newline at end of file
diff --git a/src/main/java/gtPlusPlus/core/container/Container_Workbench.java b/src/main/java/gtPlusPlus/core/container/Container_Workbench.java
deleted file mode 100644
index 55ef1a3d0c..0000000000
--- a/src/main/java/gtPlusPlus/core/container/Container_Workbench.java
+++ /dev/null
@@ -1,413 +0,0 @@
-package gtPlusPlus.core.container;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.*;
-import net.minecraft.item.ItemStack;
-import net.minecraft.item.crafting.CraftingManager;
-import net.minecraft.world.World;
-
-import gregtech.api.gui.GT_Slot_Holo;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.interfaces.IItemBlueprint;
-import gtPlusPlus.core.inventories.InventoryWorkbenchChest;
-import gtPlusPlus.core.inventories.InventoryWorkbenchHoloSlots;
-import gtPlusPlus.core.inventories.InventoryWorkbenchTools;
-import gtPlusPlus.core.item.general.ItemBlueprint;
-import gtPlusPlus.core.slots.*;
-import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
-public class Container_Workbench extends Container {
-
- protected TileEntityWorkbench tile_entity;
- public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3);
- public final InventoryWorkbenchChest inventoryChest;
- public final InventoryWorkbenchTools inventoryTool;
- public final InventoryWorkbenchHoloSlots inventoryHolo;
- //public final InventoryWorkbenchHoloCrafting inventoryCrafting;
-
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
-
- public static int HoloSlotNumber = 6;
- public static int InputSlotNumber = 0; //Number of Slots in the Crafting Grid
- public static int StorageSlotNumber = 16; //Number of slots in storage area
- public static int ToolSlotNumber = 5; // Number of slots in the tool area up top
- public static int InOutputSlotNumber = InputSlotNumber + StorageSlotNumber + ToolSlotNumber + HoloSlotNumber; //Same plus Output Slot
- public static int InventorySlotNumber = 36; //Inventory Slots (Inventory and Hotbar)
- public static int InventoryOutSlotNumber = InventorySlotNumber + 1; //Inventory Slot Number + Output
- public static int FullSlotNumber = InventorySlotNumber + InOutputSlotNumber; //All slots
-
- private final int slotOutput = 0;
- private final int[] slotHolo = new int[5];
- private final int[] slotCrafting = new int[9];
- private final int[] slotStorage = new int[16];
- private final int[] slotTools = new int[5];
-
- public void moveCraftingToChest(){
- //Check Chest Space
- for (int i=0;i<9;i++){
- if (this.craftMatrix.getStackInSlot(i) != null){
- for (int r=0;r<16;r++){
- if ((this.inventoryChest.getStackInSlot(r) == null) || ((this.inventoryChest.getStackInSlot(r).getItem() == this.craftMatrix.getStackInSlot(i).getItem()) && ((64-this.craftMatrix.getStackInSlot(i).stackSize) <= (64-this.craftMatrix.getStackInSlot(i).stackSize)))){
- this.inventoryChest.setInventorySlotContents(r, this.craftMatrix.getStackInSlot(i));
- this.craftMatrix.setInventorySlotContents(i, null);
- break;
- }
- }
- }
- }
- //For Each Space or already existing itemstack, move one itemstack or fill current partial stack
- //Remove old itemstack or partial stack from crafting grid
- }
-
- public void moveChestToCrafting(){
- //Check Crafting items and slots
- for (int i=0;i<9;i++){
- if ((this.craftMatrix.getStackInSlot(i) == null) || (this.craftMatrix.getStackInSlot(i).stackSize > 0)){
- for (int r=0;r<16;r++){
- if (this.inventoryChest.getStackInSlot(r) != null){
- this.craftMatrix.setInventorySlotContents(i, this.craftMatrix.getStackInSlot(r));
- this.inventoryChest.setInventorySlotContents(r, null);
- }
- }
- }
- }
- //For Each already existing itemstack, fill current partial stack
- //Remove partial stack from chest area
- }
-
-
- public Container_Workbench(final InventoryPlayer inventory, final TileEntityWorkbench tile){
- this.tile_entity = tile;
- this.inventoryChest = tile.inventoryChest;
- this.inventoryTool = tile.inventoryTool;
- this.inventoryHolo = tile.inventoryHolo;
- //this.inventoryCrafting = tile.inventoryCrafting;
-
- int var6;
- int var7;
- this.worldObj = tile.getWorldObj();
- this.posX = tile.xCoord;
- this.posY = tile.yCoord;
- this.posZ = tile.zCoord;
-
- int o=0;
-
- //Output slot
- this.addSlotToContainer(new SlotOutput(inventory.player, this.craftMatrix, tile.inventoryCraftResult, 0, 136, 64));
- //Util Slots
- this.addSlotToContainer(new SlotBlueprint(this.inventoryHolo, 1, 136, 28)); //Blueprint
- this.addSlotToContainer(new SlotNoInput(this.inventoryHolo, 2, 154, 28)); //Hopper
- this.addSlotToContainer(new GT_Slot_Holo(this.inventoryHolo, 3, 154, 64, false, false, 64)); //Parking
- //Holo Slots
- this.addSlotToContainer(new GT_Slot_Holo(this.inventoryHolo, 4, 154, 46, false, false, 1));
- this.addSlotToContainer(new GT_Slot_Holo(this.inventoryHolo, 5, 136, 46, false, false, 1));
-
- for (int i=1; i<6; i++){
- this.slotHolo[o] = o+1;
- o++;
- }
-
- o=0;
-
- this.updateCraftingMatrix();
-
- //Crafting Grid
- for (var6 = 0; var6 < 3; ++var6)
- {
- for (var7 = 0; var7 < 3; ++var7)
- {
- //this.addSlotToContainer(new Slot(this.craftMatrix, var7 + (var6 * 3), 82 + (var7 * 18), 28 + (var6 * 18)));
-
- /*if (this.inventoryCrafting.getStackInSlot(o) != null){
- this.craftMatrix.setInventorySlotContents(o, inventoryCrafting.getStackInSlot(o));
- this.inventoryCrafting.setInventorySlotContents(o, null);
- } */
- this.slotCrafting[o] = o+6;
- o++;
- }
- }
-
- o=0;
-
- //Storage Side
- for (var6 = 0; var6 < 4; ++var6)
- {
- for (var7 = 0; var7 < 4; ++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, var7 + (var6 * 4), 8 + (var7 * 18), 7 + (var6 * 18)));
- this.slotStorage[o] = o+15;
- o++;
- }
- }
-
- o=0;
-
- //Tool Slots
- for (var6 = 0; var6 < 1; ++var6)
- {
- for (var7 = 0; var7 < 5; ++var7)
- {
- this.addSlotToContainer(new SlotGtTool(this.inventoryTool, var7 + (var6 * 3), 82 + (var7 * 18), 8 + (var6 * 18)));
- this.slotTools[o] = o+31;
- 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);
-
- }
-
- @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 == this.slotOutput){
- Logger.WARNING("Player Clicked on the output slot");
- //TODO
- }
-
- for (final int x : this.slotHolo){
- if (aSlotIndex == x){
- Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the Holo Grid");
- if (x == 1){
- Logger.WARNING("Player Clicked Blueprint slot in the Holo Grid");
- }
- else if (x == 2){
- Logger.WARNING("Player Clicked Right Arrow slot in the Holo Grid");
- if (this.inventoryHolo.getStackInSlot(1) != null){
- Logger.WARNING("Found an ItemStack.");
- if (this.inventoryHolo.getStackInSlot(1).getItem() instanceof IItemBlueprint){
- Logger.WARNING("Found a blueprint.");
- final ItemStack tempBlueprint = this.inventoryHolo.getStackInSlot(1);
- final ItemBlueprint tempItemBlueprint = (ItemBlueprint) tempBlueprint.getItem();
- if ((this.inventoryHolo.getStackInSlot(0) != null) && !tempItemBlueprint.hasBlueprint(tempBlueprint)){
- Logger.WARNING("Output slot was not empty.");
- Logger.WARNING("Trying to manipulate NBT data on the blueprint stack, then replace it with the new one.");
- tempItemBlueprint.setBlueprint(this.inventoryHolo.getStackInSlot(1), this.craftMatrix, this.inventoryHolo.getStackInSlot(0));
- final ItemStack newTempBlueprint = ItemUtils.getSimpleStack(tempItemBlueprint);
- this.inventoryHolo.setInventorySlotContents(1, newTempBlueprint);
- Logger.WARNING(ItemUtils.getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint)));
- }
- else {
- if (tempItemBlueprint.hasBlueprint(tempBlueprint)){
- Logger.WARNING("Blueprint already holds a recipe.");
- }
- else {
- Logger.WARNING("Output slot was empty.");
- }
- }
- }
- else {
- Logger.WARNING("ItemStack found was not a blueprint.");
- }
- }
- else {
- Logger.WARNING("No ItemStack found in Blueprint slot.");
- }
- }
- else if (x == 3){
- Logger.WARNING("Player Clicked Big [P] slot in the Holo Grid");
- }
- else if (x == 4){
- Logger.WARNING("Player Clicked Transfer to Crafting Grid slot in the Holo Grid");
- }
- else if (x == 5){
- Logger.WARNING("Player Clicked Transfer to Storage Grid slot in the Holo Grid");
- }
- }
- }
-
- for (final int x : this.slotCrafting){
- if (aSlotIndex == x){
- Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the crafting Grid");
- }
- }
- for (final int x : this.slotStorage){
- if (aSlotIndex == x){
- Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the storage Grid");
- }
- }
- for (final int x : this.slotTools){
- if (aSlotIndex == x){
- Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the tool Grid");
- }
- }
- }
- //Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid");
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- private void updateCraftingMatrix() {
- for (int i = 0; i < this.craftMatrix.getSizeInventory(); i++) {
- //this.craftMatrix.setInventorySlotContents(i, this.tile_entity.inventoryCrafting.getStackInSlot(i));
- }
- }
-
- @Override
- public void onCraftMatrixChanged(final IInventory iiventory) {
- this.tile_entity.inventoryCraftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj));
- }
-
- @Override
- public void onContainerClosed(final EntityPlayer par1EntityPlayer)
- {
- super.onContainerClosed(par1EntityPlayer);
- this.saveCraftingMatrix();
- }
-
- private void saveCraftingMatrix() {
- for (int i = 0; i < this.craftMatrix.getSizeInventory(); i++) {
- //this.tile_entity.inventoryCrafting.setInventorySlotContents(i, this.craftMatrix.getStackInSlot(i));
- }
- }
-
-
-
-
- /*@Override
- public void onCraftMatrixChanged(IInventory par1IInventory){
- //Custom Recipe Handler
- //craftResult.setInventorySlotContents(0, Workbench_CraftingHandler.getInstance().findMatchingRecipe(craftMatrix, worldObj));
-
- //Vanilla CraftingManager
- Utils.LOG_WARNING("checking crafting grid for a valid output.");
- ItemStack temp = CraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj);
- if (temp != null){
- Utils.LOG_WARNING("Output found. "+temp.getDisplayName()+" x"+temp.stackSize);
- craftResult.setInventorySlotContents(slotOutput, temp);
- }
- else {
- Utils.LOG_WARNING("No Valid output found.");
- craftResult.setInventorySlotContents(slotOutput, null);
- }
- }*/
-
- /*@Override
- public void onContainerClosed(EntityPlayer par1EntityPlayer)
- {
- for (int o=0; o<craftMatrix.getSizeInventory(); o++){
- this.inventoryCrafting.setInventorySlotContents(o, craftMatrix.getStackInSlot(o));
- this.craftMatrix.setInventorySlotContents(o, null);
- }*/
-
- //super.onContainerClosed(par1EntityPlayer);
-
- /*if (worldObj.isRemote)
- {
- return;
- }
-
- for (int i = 0; i < InputSlotNumber; i++)
- {
- ItemStack itemstack = craftMatrix.getStackInSlotOnClosing(i);
-
- if (itemstack != null)
- {
- par1EntityPlayer.dropPlayerItemWithRandomChoice(itemstack, false);
- }
- }*/
-
- @Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer){
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockWorkbench){
- 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 (p_94530_2_.inventory != this.tile_entity.inventoryCraftResult) && super.func_94530_a(p_94530_1_, p_94530_2_);
- }
-
-
-} \ No newline at end of file
diff --git a/src/main/java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java b/src/main/java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java
deleted file mode 100644
index dc499c570f..0000000000
--- a/src/main/java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java
+++ /dev/null
@@ -1,377 +0,0 @@
-package gtPlusPlus.core.container;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.*;
-import net.minecraft.item.ItemStack;
-import net.minecraft.item.crafting.CraftingManager;
-import net.minecraft.world.World;
-
-import gregtech.api.gui.GT_Slot_Holo;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.interfaces.IItemBlueprint;
-import gtPlusPlus.core.inventories.*;
-import gtPlusPlus.core.item.general.ItemBlueprint;
-import gtPlusPlus.core.slots.*;
-import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
-public class Container_WorkbenchAdvanced extends Container {
-
- protected TileEntityWorkbenchAdvanced tile_entity;
- public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3);
- public final InventoryWorkbenchChest inventoryChest;
- public final InventoryWorkbenchToolsElectric inventoryTool;
- public final InventoryWorkbenchHoloSlots inventoryHolo;
- public final InventoryWorkbenchHoloCrafting inventoryCrafting;
-
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
-
- public static int HoloSlotNumber = 6;
- public static int InputSlotNumber = 9; //Number of Slots in the Crafting Grid
- public static int StorageSlotNumber = 16; //Number of slots in storage area
- public static int ToolSlotNumber = 5; // Number of slots in the tool area up top
- public static int InOutputSlotNumber = InputSlotNumber + StorageSlotNumber + ToolSlotNumber + HoloSlotNumber; //Same plus Output Slot
- public static int InventorySlotNumber = 36; //Inventory Slots (Inventory and Hotbar)
- public static int InventoryOutSlotNumber = InventorySlotNumber + 1; //Inventory Slot Number + Output
- public static int FullSlotNumber = InventorySlotNumber + InOutputSlotNumber; //All slots
-
- private final int slotOutput = 0;
- private final int[] slotHolo = new int[5];
- private final int[] slotCrafting = new int[9];
- private final int[] slotStorage = new int[16];
- private final int[] slotTools = new int[5];
-
- public Container_WorkbenchAdvanced(final InventoryPlayer inventory, final TileEntityWorkbenchAdvanced tile){
- this.tile_entity = tile;
- this.inventoryChest = tile.inventoryChest;
- this.inventoryTool = tile.inventoryTool;
- this.inventoryHolo = tile.inventoryHolo;
- this.inventoryCrafting = tile.inventoryCrafting;
-
- int var6;
- int var7;
- this.worldObj = tile.getWorldObj();
- this.posX = tile.xCoord;
- this.posY = tile.yCoord;
- this.posZ = tile.zCoord;
-
- int o=0;
-
- //Output slot
- this.addSlotToContainer(new SlotOutput(inventory.player, this.craftMatrix, tile.inventoryCraftResult, 0, 136, 64));
- //Util Slots
- this.addSlotToContainer(new SlotBlueprint(this.inventoryHolo, 1, 136, 28)); //Blueprint
- this.