diff options
author | Alkalus <draknyte1@hotmail.com> | 2016-10-03 23:33:28 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-03 23:33:28 +1000 |
commit | e3f4a410ef0867359cab3ade72a20c3679aaad06 (patch) | |
tree | 2f008c251c080a216b0fcf3d03667f7233edceca /src | |
parent | 10aee9adf7a1ab793a05fd9327cec6fcc1b267d2 (diff) | |
parent | bdb6fc4a5410d68cf517dbe90fa49cec45bbda5a (diff) | |
download | GT5-Unofficial-e3f4a410ef0867359cab3ade72a20c3679aaad06.tar.gz GT5-Unofficial-e3f4a410ef0867359cab3ade72a20c3679aaad06.tar.bz2 GT5-Unofficial-e3f4a410ef0867359cab3ade72a20c3679aaad06.zip |
Merge pull request #19 from draknyte1/DesktopPC
+ Added some Buttons to the workbench (WIP)
$ Workbench now uses the vanilla recipe handler.
$ Fixed the tool slots on the Workbench accepting the wrong items in certain cases.
+ Added hundreds of new machine recipes for all of the materials, due to below.
$ Rewrote recipe generation classes, things like plate bending and extrusion recipes now fall in line with GT tiering.
+ Added more functions to Materials.java, now you can get any item from them. (getDustSmall(5))
% Changed tool handling to better support older versions of Gregtech that don't allow Wrenchs to work as a BC/EIO wrench.
% Moved more GT related content to HANDLER_GT.
+ Added a basic re-implementation of the Meta Tile Entity system for GT Machines, using my own blocks as a base. In a feeble attempt to store NBT data to Itemblocks on drop/break.
% Changed lots of debug logging to only show in debug mode, if I missed anything, let me know.
Diffstat (limited to 'src')
27 files changed, 525 insertions, 278 deletions
diff --git a/src/Java/gtPlusPlus/core/block/ModBlocks.java b/src/Java/gtPlusPlus/core/block/ModBlocks.java index e8334af98b..b7a2526e30 100644 --- a/src/Java/gtPlusPlus/core/block/ModBlocks.java +++ b/src/Java/gtPlusPlus/core/block/ModBlocks.java @@ -5,7 +5,6 @@ import gtPlusPlus.core.block.machine.Machine_Workbench; import gtPlusPlus.core.fluids.FluidRegistryHandler; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraftforge.fluids.Fluid; @@ -20,6 +19,7 @@ public final class ModBlocks { // WIP TODO public static Block blockToolBuilder; public static Block blockGriefSaver; public static Block blockCasingsMisc; + public static Block blockMetaTileEntity; public static Block blockHeliumGenerator; public static Block blockNHG; public static Block blockCharger; @@ -43,10 +43,6 @@ public final class ModBlocks { Utils.LOG_INFO("Registering Blocks."); GameRegistry.registerBlock(MatterFabricatorEffectBlock = new LightGlass(Material.glass, false).setHardness(0.1F).setBlockTextureName(CORE.MODID + ":" + "blockMFEffect").setStepSound(Block.soundTypeGlass), "blockMFEffect"); - - //Casing Blocks - blockCasingsMisc = new GregtechMetaCasingBlocks(); - //Fluids FluidRegistryHandler.registerFluids(); diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java b/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java index 92ba4a11cc..308413d81f 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java @@ -24,7 +24,8 @@ public class Machine_Workbench extends BlockContainer @SideOnly(Side.CLIENT) private IIcon textureFront; - public Machine_Workbench() + @SuppressWarnings("deprecation") + public Machine_Workbench() { super(Material.iron); this.setBlockName("blockWorkbenchGT"); diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java index c6dc1b0b73..53c4256ed6 100644 --- a/src/Java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java @@ -91,7 +91,6 @@ public class CommonProxy { //Compat Handling COMPAT_HANDLER.registerMyModsOreDictEntries(); - COMPAT_HANDLER.registerGregtechMachines(); COMPAT_HANDLER.intermodOreDictionarySupport(); COMPAT_IntermodStaging.init(); } diff --git a/src/Java/gtPlusPlus/core/container/Container_Workbench.java b/src/Java/gtPlusPlus/core/container/Container_Workbench.java index 09abd8e23a..3c12e860bc 100644 --- a/src/Java/gtPlusPlus/core/container/Container_Workbench.java +++ b/src/Java/gtPlusPlus/core/container/Container_Workbench.java @@ -1,7 +1,6 @@ package gtPlusPlus.core.container; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.handler.workbench.Workbench_CraftingHandler; import gtPlusPlus.core.inventories.InventoryWorkbenchChest; import gtPlusPlus.core.inventories.InventoryWorkbenchTools; import gtPlusPlus.core.slots.SlotGtTool; @@ -15,6 +14,7 @@ import net.minecraft.inventory.InventoryCrafting; import net.minecraft.inventory.Slot; import net.minecraft.inventory.SlotCrafting; import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; import net.minecraft.world.World; public class Container_Workbench extends Container { @@ -28,6 +28,9 @@ public class Container_Workbench extends Container { private int posX; private int posY; private int posZ; + + public boolean movingChest; + public boolean movingCrafting; public static int StorageSlotNumber = 12; //Number of slots in storage area public static int ToolSlotNumber = 5; // Number of slots in the tool area up top @@ -36,11 +39,42 @@ public class Container_Workbench extends Container { 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 + + public void moveCraftingToChest(){ + //Check Chest Space + for (int i=0;i<9;i++){ + if (craftMatrix.getStackInSlot(i) != null){ + for (int r=0;r<16;r++){ + if (inventoryChest.getStackInSlot(r) == null || (inventoryChest.getStackInSlot(r).getItem() == craftMatrix.getStackInSlot(i).getItem() && (64-craftMatrix.getStackInSlot(i).stackSize) <= (64-craftMatrix.getStackInSlot(i).stackSize))){ + inventoryChest.setInventorySlotContents(r, craftMatrix.getStackInSlot(i)); + 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 (craftMatrix.getStackInSlot(i) == null || craftMatrix.getStackInSlot(i).stackSize > 0){ + for (int r=0;r<16;r++){ + if (inventoryChest.getStackInSlot(r) != null){ + craftMatrix.setInventorySlotContents(i, craftMatrix.getStackInSlot(r)); + inventoryChest.setInventorySlotContents(r, null); + } + } + } + } + //For Each already existing itemstack, fill current partial stack + //Remove partial stack from chest area + } public Container_Workbench(InventoryPlayer inventory, TileEntityWorkbench tile){ - this.tile_entity = tile; this.inventoryChest = tile.inventoryChest; this.inventoryTool = tile.inventoryTool; @@ -64,25 +98,7 @@ public class Container_Workbench extends Container { { this.addSlotToContainer(new Slot(this.craftMatrix, var7 + var6 * 3, 82 + var7 * 18, 28 + var6 * 18)); } - } - - //Storage Side - for (var6 = 0; var6 < 4; ++var6) - { - for (var7 = 0; var7 < 4; ++var7) - { - this.addSlotToContainer(new Slot(inventoryChest, var7 + var6 * 3, 8 + var7 * 18, 7 + var6 * 18)); - } } - - //Tool Slots - for (var6 = 0; var6 < 1; ++var6) - { - for (var7 = 0; var7 < 5; ++var7) - { - this.addSlotToContainer(new SlotGtTool(inventoryTool, var7 + var6 * 3, 82 + var7 * 18, 8 + var6 * 18)); - } - } //Player Inventory for (var6 = 0; var6 < 3; ++var6) @@ -99,6 +115,27 @@ public class Container_Workbench extends Container { this.addSlotToContainer(new Slot(inventory, var6, 8 + var6 * 18, 142)); } + + + //Storage Side + for (var6 = 0; var6 < 4; ++var6) + { + for (var7 = 0; var7 < 4; ++var7) + { + //Utils.LOG_INFO("Adding slots at var:"+(var7 + var6 * 4)+" x:"+(8 + var7 * 18)+" y:"+(7 + var6 * 18)); + this.addSlotToContainer(new Slot(inventoryChest, var7 + var6 * 4, 8 + var7 * 18, 7 + var6 * 18)); + } + } + + //Tool Slots + for (var6 = 0; var6 < 1; ++var6) + { + for (var7 = 0; var7 < 5; ++var7) + { + this.addSlotToContainer(new SlotGtTool(inventoryTool, var7 + var6 * 3, 82 + var7 * 18, 8 + var6 * 18)); + } + } + this.onCraftMatrixChanged(this.craftMatrix); } @@ -106,7 +143,11 @@ public class Container_Workbench extends Container { @Override public void onCraftMatrixChanged(IInventory par1IInventory){ - craftResult.setInventorySlotContents(0, Workbench_CraftingHandler.getInstance().findMatchingRecipe(craftMatrix, worldObj)); + //Custom Recipe Handler + //craftResult.setInventorySlotContents(0, Workbench_CraftingHandler.getInstance().findMatchingRecipe(craftMatrix, worldObj)); + + //Vanilla CraftingManager + craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj)); } diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_Workbench.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_Workbench.java index c1b6904cb4..2da4c7bc7c 100644 --- a/src/Java/gtPlusPlus/core/gui/machine/GUI_Workbench.java +++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_Workbench.java @@ -3,6 +3,7 @@ package gtPlusPlus.core.gui.machine; import gtPlusPlus.core.container.Container_Workbench; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench; +import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; @@ -14,28 +15,66 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GUI_Workbench extends GuiContainer { - + private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/Workbench.png"); - + + public boolean moveItemsToChest = false; + public boolean moveItemsToCrafting = false; + public GUI_Workbench(InventoryPlayer player_inventory, TileEntityWorkbench tile){ - super(new Container_Workbench(player_inventory, tile)); -} + super(new Container_Workbench(player_inventory, tile)); + } @Override protected void drawGuiContainerForegroundLayer(int i, 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("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } @Override protected void drawGuiContainerBackgroundLayer(float f, int i, int j){ - GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - this.mc.renderEngine.bindTexture(craftingTableGuiTextures); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.mc.renderEngine.bindTexture(craftingTableGuiTextures); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } + + + //This method is called when the Gui is first called! + @Override + public void initGui() + { + //You have to add this line for the Gui to function properly! + super.initGui(); + + //The parameters of GuiButton are(id, x, y, width, height, text); + this.buttonList.add(new GuiButton( 1, 367, 132, 18, 18, "X")); + this.buttonList.add(new GuiButton( 2, 385, 132, 18, 18, "Y")); + //NOTE: the id always has to be different or else it might get called twice or never! + + //Add any other buttons here too! } + + @Override + protected void actionPerformed(GuiButton B) + { + //If the button id is different, or you have mrs buttons, create another if block for that too! + if(B.id == 1){ + System.out.println("Trying to empty crafting grid to the storage compartment."); + moveItemsToChest = true; + ((Container_Workbench) this.inventorySlots).moveCraftingToChest(); + } + else if(B.id == 2){ + System.out.println("Trying to move items into the crafting grid."); + moveItemsToCrafting = true; + ((Container_Workbench) this.inventorySlots).moveChestToCrafting(); + } + + + } + }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/handler/GuiHandler.java b/src/Java/gtPlusPlus/core/handler/GuiHandler.java index b9b3229f13..dc1903e83d 100644 --- a/src/Java/gtPlusPlus/core/handler/GuiHandler.java +++ b/src/Java/gtPlusPlus/core/handler/GuiHandler.java @@ -32,7 +32,7 @@ public class GuiHandler implements IGuiHandler { public static final int GUI6 = 5; // public static final int GUI7 = 6; // public static final int GUI8 = 7; // - + public static void init(){ @@ -60,25 +60,27 @@ public class GuiHandler implements IGuiHandler { } - + if (ID == GUI3) { // Use the player's held item to create the inventory return new Container_BackpackBase(player, player.inventory, new BaseInventoryBackpack(player.getHeldItem())); } - + if (te != null){ if (ID == GUI4){ + return new Container_Workbench(player.inventory, (TileEntityWorkbench)te); + } } - - - - - - - + + + + + + + return null; } @@ -98,20 +100,20 @@ public class GuiHandler implements IGuiHandler { //return new GUI_RTG((TileEntityRTG) te.); } } - + if (ID == GUI3) { // We have to cast the new container as our custom class // and pass in currently held item for the inventory return new GuiBaseBackpack((Container_BackpackBase) new Container_BackpackBase(player, player.inventory, new BaseInventoryBackpack(player.getHeldItem()))); } - + if (te != null){ if (ID == GUI4){ return new GUI_Workbench(player.inventory, (TileEntityWorkbench)te); } } - + return null; } diff --git a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchChest.java b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchChest.java index 569f99b078..8d147ad21c 100644 --- a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchChest.java +++ b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchChest.java @@ -146,7 +146,12 @@ public class InventoryWorkbenchChest implements IInventory{ { for (int i = 0; i < getSizeInventory(); ++i) { - if (getStackInSlot(i) != null && getStackInSlot(i).stackSize == 0) { + ItemStack temp = getStackInSlot(i); + if (temp != null){ + //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize); + } + + if (temp != null && temp.stackSize == 0) { inventory[i] = null; } } diff --git a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchCrafting.java b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchCrafting.java index 72454d75ed..333bb5c847 100644 --- a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchCrafting.java +++ b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchCrafting.java @@ -1,7 +1,9 @@ package gtPlusPlus.core.inventories; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; @@ -15,13 +17,30 @@ public class InventoryWorkbenchCrafting implements IInventory{ /** Inventory's size must be same as number of slots you add to the Container class */ private ItemStack[] inventory = new ItemStack[INV_SIZE]; + public final InventoryCrafting craftMatrix; + public final Container parentContainer; + + public InventoryCrafting getCrafting(){ + return craftMatrix; + } /** * @param itemstack - the ItemStack to which this inventory belongs */ - public InventoryWorkbenchCrafting() + public InventoryWorkbenchCrafting(Container containerR) { - + this.parentContainer = containerR; + this.craftMatrix = new InventoryCrafting(parentContainer, 3, 3); + } + + private ItemStack[] getArrayOfCraftingItems(){ + ItemStack[] array = new ItemStack[9]; + for (int i=0; i<craftMatrix.getSizeInventory();i++){ + if(craftMatrix.getStackInSlot(i) != null){ + array[i] = craftMatrix.getStackInSlot(i); + } + } + return array; } public void readFromNBT(NBTTagCompound nbt) @@ -34,7 +53,7 @@ public class InventoryWorkbenchCrafting implements IInventory{ int slot = data.getInteger("Slot"); if(slot >= 0 && slot < INV_SIZE) { - inventory[slot] = ItemStack.loadItemStackFromNBT(data); + getInventory()[slot] = ItemStack.loadItemStackFromNBT(data); } } } @@ -44,7 +63,7 @@ public class InventoryWorkbenchCrafting implements IInventory{ NBTTagList list = new NBTTagList(); for(int i = 0;i<INV_SIZE;i++) { - ItemStack stack = inventory[i]; + ItemStack stack = getInventory()[i]; if(stack != null) { NBTTagCompound data = new NBTTagCompound(); @@ -59,17 +78,17 @@ public class InventoryWorkbenchCrafting implements IInventory{ @Override public int getSizeInventory() { - return inventory.length; + return getInventory().length; } public ItemStack[] getInventory(){ - return inventory; + return getArrayOfCraftingItems(); } @Override public ItemStack getStackInSlot(int slot) { - return inventory[slot]; + return getInventory()[slot]; } @Override @@ -104,7 +123,7 @@ public class InventoryWorkbenchCrafting implements IInventory{ @Override public void setInventorySlotContents(int slot, ItemStack stack) { - inventory[slot] = stack; + getInventory()[slot] = stack; if (stack != null && stack.stackSize > getInventoryStackLimit()) { @@ -147,7 +166,7 @@ public class InventoryWorkbenchCrafting implements IInventory{ for (int i = 0; i < getSizeInventory(); ++i) { if (getStackInSlot(i) != null && getStackInSlot(i).stackSize == 0) { - inventory[i] = null; + getInventory()[i] = null; } } } diff --git a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchTools.java b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchTools.java index 00ecd94574..7e3e7c3aef 100644 --- a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchTools.java +++ b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchTools.java @@ -1,6 +1,6 @@ package gtPlusPlus.core.inventories; -import gregtech.api.interfaces.IToolStats; +import gregtech.api.items.GT_MetaGenerated_Tool; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -178,7 +178,10 @@ public class InventoryWorkbenchTools implements IInventory{ // Don't want to be able to store the inventory item within itself // Bad things will happen, like losing your inventory // Actually, this needs a custom Slot to work - return (itemstack.getItem() instanceof IToolStats); + if (itemstack.getItem() instanceof GT_MetaGenerated_Tool){ + return true; + } + return false; } }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java b/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java index 0f56730177..3d56307f39 100644 --- a/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java +++ b/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java @@ -5,6 +5,7 @@ import gregtech.api.enums.ItemList; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.core.util.math.MathUtils; @@ -19,22 +20,19 @@ import cpw.mods.fml.common.registry.GameRegistry; public class BaseItemBolt extends Item{ - protected int colour; - protected String materialName; - protected String unlocalName; - private int mTier; + final Material boltMaterial; + final String materialName; + final String unlocalName; - public BaseItemBolt(String unlocalizedName, String materialName, int colour, int tier) { - setUnlocalizedName(unlocalizedName); + public BaseItemBolt(Material material) { + this.boltMaterial = material; + this.unlocalName = "itemBolt"+material.getUnlocalizedName(); + this.materialName = material.getLocalizedName(); this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalizedName); - this.unlocalName = unlocalizedName; + this.setUnlocalizedName(unlocalName); this.setMaxStackSize(64); this.setTextureName(CORE.MODID + ":" + "itemBolt"); - this.colour = colour; - this.mTier = tier; - this.materialName = materialName; - GameRegistry.registerItem(this, unlocalizedName); + GameRegistry.registerItem(this, unlocalName); GT_OreDictUnificator.registerOre(unlocalName.replace("itemB", "b"), UtilsItems.getSimpleStack(this)); addExtruderRecipe(); } @@ -59,10 +57,10 @@ public class BaseItemBolt extends Item{ @Override public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (colour == 0){ + if (boltMaterial.getRgbAsHex() == 0){ return MathUtils.generateSingularRandomHexValue(); } - return colour; + return boltMaterial.getRgbAsHex(); } @@ -74,9 +72,10 @@ public class BaseItemBolt extends Item{ GT_Values.RA.addExtruderRecipe(tempOutputStack, ItemList.Shape_Extruder_Bolt.get(1), UtilsItems.getSimpleStack(this, 8), - 30*mTier*20, - 24*mTier); - } + (int) Math.max(boltMaterial.getMass() * 2L * 1, 1), + 8 * boltMaterial.vVoltageMultiplier); + } + } } diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index 0342f7f104..236edca24d 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -26,13 +26,12 @@ public class BaseItemDust extends Item{ protected int colour; protected String materialName; protected String pileType; - protected boolean useBlastFurnace; String name = ""; private int mTier; private Material dustInfo; private String oredictName; - public BaseItemDust(String unlocalizedName, String materialName, Material matInfo, int colour, String pileSize, boolean blastFurnaceRequired, int tier, int sRadioactivity) { + public BaseItemDust(String unlocalizedName, String materialName, Material matInfo, int colour, String pileSize, int tier, int sRadioactivity) { setUnlocalizedName(unlocalizedName); this.setUnlocalizedName(unlocalizedName); this.setMaxStackSize(64); @@ -44,7 +43,6 @@ public class BaseItemDust extends Item{ this.colour = colour; this.mTier = tier; this.materialName = materialName; - this.useBlastFurnace = blastFurnaceRequired; this.dustInfo = matInfo; this.sRadiation = sRadioactivity; GameRegistry.registerItem(this, unlocalizedName); @@ -272,7 +270,7 @@ public class BaseItemDust extends Item{ temp = temp.replace("itemDust", "ingot"); if (temp != null && temp != ""){ - if (this.useBlastFurnace){ + if (dustInfo.requiresBlastFurnace()){ Utils.LOG_WARNING("Adding recipe for Hot "+materialName+" Ingots in a Blast furnace."); String tempIngot = temp.replace("ingot", "ingotHot"); ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); @@ -286,10 +284,10 @@ public class BaseItemDust extends Item{ ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1); Utils.LOG_WARNING("This will produce an ingot of "+tempOutputStack.getDisplayName() + " Debug: "+temp); if (null != tempOutputStack){ - if (mTier < 5){ + if (mTier < 5 || !dustInfo.requiresBlastFurnace()){ CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(UtilsItems.getSimpleStack(this), tempOutputStack); } - else if (mTier >= 5){ + else if (mTier >= 5 || dustInfo.requiresBlastFurnace()){ Utils.LOG_WARNING("Adding recipe for "+materialName+" Ingots in a Blast furnace."); Utils.LOG_WARNING("This will produce "+tempOutputStack.getDisplayName()); if (null != tempOutputStack){ diff --git a/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java b/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java index ba41625b25..47ce5b7815 100644 --- a/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java +++ b/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java @@ -5,6 +5,7 @@ import gregtech.api.enums.ItemList; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.core.util.math.MathUtils; @@ -19,22 +20,19 @@ import cpw.mods.fml.common.registry.GameRegistry; public class BaseItemGear extends Item{ - protected int colour; - protected String materialName; - protected String unlocalName; - private int mTier; + final Material gearMaterial; + final String materialName; + final String unlocalName; - public BaseItemGear(String unlocalizedName, String materialName, int colour, int tier) { - setUnlocalizedName(unlocalizedName); + public BaseItemGear(Material material) { + this.gearMaterial = material; + this.unlocalName = "itemGear"+material.getUnlocalizedName(); + this.materialName = material.getLocalizedName(); this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalizedName); - this.unlocalName = unlocalizedName; + this.setUnlocalizedName(unlocalName); this.setMaxStackSize(64); this.setTextureName(CORE.MODID + ":" + "itemGear"); - this.colour = colour; - this.mTier = tier; - this.materialName = materialName; - GameRegistry.registerItem(this, unlocalizedName); + GameRegistry.registerItem(this, unlocalName); GT_OreDictUnificator.registerOre(unlocalName.replace("itemG", "g"), UtilsItems.getSimpleStack(this)); addExtruderRecipe(); } @@ -42,7 +40,7 @@ public class BaseItemGear extends Item{ @Override public String getItemStackDisplayName(ItemStack p_77653_1_) { - return (materialName+ " Gear"); + return (gearMaterial.getLocalizedName()+ " Gear"); } @Override @@ -59,23 +57,24 @@ public class BaseItemGear extends Item{ @Override public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (colour == 0){ + if (gearMaterial.getRgbAsHex() == 0){ return MathUtils.generateSingularRandomHexValue(); } - return colour; + return gearMaterial.getRgbAsHex(); } private void addExtruderRecipe(){ Utils.LOG_WARNING("Adding recipe for "+materialName+" Gears"); - String tempIngot = unlocalName.replace("itemGear", "ingot"); - ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 8); + ItemStack tempOutputStack = gearMaterial.getIngot(8); if (null != tempOutputStack){ - GT_Values.RA.addExtruderRecipe(tempOutputStack, + + GT_Values.RA.addExtruderRecipe( + tempOutputStack, ItemList.Shape_Extruder_Gear.get(1), UtilsItems.getSimpleStack(this), - 40*mTier*20, - 24*mTier); + (int) Math.max(gearMaterial.getMass() * 5L, 1), + 8 * gearMaterial.vVoltageMultiplier); } } diff --git a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java index 9d21198033..103198a395 100644 --- a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java +++ b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java @@ -38,7 +38,7 @@ public class BaseItemPlate extends Item{ this.sRadiation = sRadioactivity; GameRegistry.registerItem(this, unlocalizedName); GT_OreDictUnificator.registerOre(unlocalName.replace("itemP", "p"), UtilsItems.getSimpleStack(this)); - addBendingRecipe(); + //addBendingRecipe(); } @Override diff --git a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java index 47ffe70cd7..e6bfc1253a 100644 --- a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java +++ b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java @@ -40,8 +40,8 @@ public class BaseItemPlateDouble extends Item{ this.sRadiation = sRadioactivity; GameRegistry.registerItem(this, unlocalizedName); GT_OreDictUnificator.registerOre(unlocalName.replace("itemP", "p"), UtilsItems.getSimpleStack(this)); - addBendingRecipe(); - addCraftingRecipe(); + //addBendingRecipe(); + //addCraftingRecipe(); } @Override diff --git a/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java b/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java index d5c513c37d..d03b2b4e2f 100644 --- a/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java +++ b/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java @@ -5,9 +5,11 @@ import gregtech.api.enums.ItemList; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.util.recipe.UtilsRecipe; import java.util.List; @@ -19,22 +21,19 @@ import cpw.mods.fml.common.registry.GameRegistry; public class BaseItemRing extends Item{ - protected int colour; - protected String materialName; - protected String unlocalName; - private int mTier; + final Material ringMaterial; + final String materialName; + final String unlocalName; - public BaseItemRing(String unlocalizedName, String materialName, int colour, int tier) { - setUnlocalizedName(unlocalizedName); + public BaseItemRing(Material material) { + this.ringMaterial = material; + this.unlocalName = "itemRing"+material.getUnlocalizedName(); + this.materialName = material.getLocalizedName(); this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalizedName); - this.unlocalName = unlocalizedName; + this.setUnlocalizedName(unlocalName); this.setMaxStackSize(64); this.setTextureName(CORE.MODID + ":" + "itemRing"); - this.colour = colour; - this.mTier = tier; - this.materialName = materialName; - GameRegistry.registerItem(this, unlocalizedName); + GameRegistry.registerItem(this, unlocalName); GT_OreDictUnificator.registerOre(unlocalName.replace("itemR", "r"), UtilsItems.getSimpleStack(this)); addExtruderRecipe(); } @@ -59,24 +58,37 @@ public class BaseItemRing extends Item{ @Override public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (colour == 0){ + if (ringMaterial.getRgbAsHex() == 0){ return MathUtils.generateSingularRandomHexValue(); } - return colour; + return ringMaterial.getRgbAsHex(); } private void addExtruderRecipe(){ Utils.LOG_WARNING("Adding recipe for "+materialName+" Rings"); + + //Extruder Recipe String tempIngot = unlocalName.replace("itemRing", "ingot"); ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); if (null != tempOutputStack){ GT_Values.RA.addExtruderRecipe(tempOutputStack, ItemList.Shape_Extruder_Ring.get(1), UtilsItems.getSimpleStack(this, 4), - 12*mTier*20, - 24*mTier); - } + (int) Math.max(ringMaterial.getMass() * 2L * 1, 1), + 6 * ringMaterial.vVoltageMultiplier); + } + + //Shaped Recipe + tempIngot = unlocalName.replace("itemRing", "stick"); + tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); + if (null != tempOutputStack){ + UtilsRecipe.addShapedGregtechRecipe( + "craftingToolWrench", null, null, + null, tempOutputStack, null, + null, null, null, + UtilsItems.getSimpleStack(this, 1)); + } } } diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java index 320b398f22..0e4802ad0c 100644 --- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java +++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java @@ -5,6 +5,8 @@ import gregtech.api.enums.ItemList; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.ELEMENT; +import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.core.util.math.MathUtils; @@ -22,25 +24,26 @@ import cpw.mods.fml.common.registry.GameRegistry; public class BaseItemRod extends Item{ - protected int colour; - protected String materialName; - protected String unlocalName; - private int mTier; + final Material rodMaterial; + final String materialName; + final String unlocalName; - public BaseItemRod(String unlocalizedName, String materialName, int colour, int tier, int sRadioactivity) { - setUnlocalizedName(unlocalizedName); + public BaseItemRod(Material material, int sRadioactivity) { + this.rodMaterial = material; + this.unlocalName = "itemRod"+material.getUnlocalizedName(); + this.materialName = material.getLocalizedName(); this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalizedName); - this.unlocalName = unlocalizedName; + this.setUnlocalizedName(unlocalName); this.setTextureName(CORE.MODID + ":" + "itemRod"); this.setMaxStackSize(64); - this.colour = colour; - this.mTier = tier; - this.materialName = materialName; this.sRadiation = sRadioactivity; - GameRegistry.registerItem(this, unlocalizedName); + GameRegistry.registerItem(this, unlocalName); GT_OreDictUnificator.registerOre(unlocalName.replace("itemRod", "stick"), UtilsItems.getSimpleStack(this)); - addExtruderRecipe(); + + if (!material.equals(ELEMENT.URANIUM233)){ + addExtruderRecipe(); + } + } @Override @@ -56,7 +59,7 @@ public class BaseItemRod extends Item{ } if (sRadiation > 0){ list.add(CORE.GT_Tooltip_Radioactive); - } + } super.addInformation(stack, aPlayer, list, bool); } @@ -66,37 +69,73 @@ public class BaseItemRod extends Item{ @Override public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (colour == 0){ + if (rodMaterial.getRgbAsHex() == 0){ return MathUtils.generateSingularRandomHexValue(); } - return colour; + return rodMaterial.getRgbAsHex(); } - + protected final int sRadiation; - @Override - public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) { - Utils.applyRadiationDamageToEntity(sRadiation, world, entityHolding); - } - + @Override + public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) { + Utils.applyRadiationDamageToEntity(sRadiation, world, entityHolding); + } + private void addExtruderRecipe(){ Utils.LOG_WARNING("Adding recipe for "+materialName+" Rods"); - String tempIngot = unlocalName.replace("itemRod", "ingot"); - ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); - if (null != tempOutputStack){ - GT_Values.RA.addExtruderRecipe(tempOutputStack, - ItemList.Shape_Extruder_Rod.get(1), - UtilsItems.getSimpleStack(this, 2), - 12*mTier*20, 24*mTier); - } - ItemStack rods = UtilsItems.getSimpleStack(this, 1); + + String tempStick = unlocalName.replace("itemRod", "stick"); + String tempStickLong = unlocalName.replace("itemRod", "stickLong"); + String tempBolt = unlocalName.replace("itemRod", "bolt"); + ItemStack stackStick = UtilsItems.getItemStackOfAmountFromOreDict(tempStick, 1); + ItemStack stackStick2 = UtilsItems.getItemStackOfAmountFromOreDict(tempStick, 2); + ItemStack stackBolt = UtilsItems.getItemStackOfAmountFromOreDict(tempBolt, 4); + ItemStack stackStickLong = UtilsItems.getItemStackOfAmountFromOreDict(tempStickLong, 1); + ItemStack stackIngot = rodMaterial.getIngot(1); + + + GT_Values.RA.addExtruderRecipe( + stackIngot, + ItemList.Shape_Extruder_Rod.get(1), + stackStick2, + (int) Math.max(rodMaterial.getMass() * 2L * 1, 1), + 6 * rodMaterial.vVoltageMultiplier); + + GT_Values.RA.addCutterRecipe( + stackStick, + stackBolt, + null, + (int) Math.max(rodMaterial.getMass() * 2L, 1L), + 4); + if (sRadiation == 0){ - UtilsRecipe.addShapedGregtechRecipe( - rods, rods, rods, - rods, "craftingToolWrench", rods, - rods, rods, rods, + UtilsRecipe.recipeBuilder( + stackStick, stackStick, stackStick, + stackStick, "craftingToolWrench", stackStick, + stackStick, stackStick, stackStick, UtilsItems.getItemStackOfAmountFromOreDict(unlocalName.replace("itemRod", "frameGt"), 2)); } + + //Shaped Recipe - Bolts + stackBolt = UtilsItems.getItemStackOfAmountFromOreDict(tempBolt, 2); + if (null != stackBolt){ + UtilsRecipe.recipeBuilder( + "craftingToolSaw", null, null, + null, stackStick, null, + null, null, null, + stackBolt); + } + + //Shaped Recipe - Ingot to Rod + if (null != stackIngot){ + UtilsRecipe.recipeBuilder( + "craftingToolFile", null, null, + null, stackIngot, null, + null, null, null, + stackStick); + } + } } diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java index 4e157d22b1..6d87fd5872 100644 --- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java +++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java @@ -4,6 +4,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.core.util.math.MathUtils; @@ -21,23 +22,20 @@ import cpw.mods.fml.common.registry.GameRegistry; public class BaseItemRodLong extends Item{ - protected int colour; - protected String materialName; - protected String unlocalName; - private int mTier; + final Material rodLongMaterial; + final String materialName; + final String unlocalName; - public BaseItemRodLong(String unlocalizedName, String materialName, int colour, int tier, int sRadioactivity) { - setUnlocalizedName(unlocalizedName); + public BaseItemRodLong(Material material, int sRadioactivity) { + this.rodLongMaterial = material; + this.unlocalName = "itemRodLong"+material.getUnlocalizedName(); + this.materialName = material.getLocalizedName(); this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalizedName); - this.unlocalName = unlocalizedName; + this.setUnlocalizedName(material.getUnlocalizedName()); this.setTextureName(CORE.MODID + ":" + "itemRodLong"); this.setMaxStackSize(64); - this.colour = colour; - this.mTier = tier; - this.materialName = materialName; this.sRadiation = sRadioactivity; - GameRegistry.registerItem(this, unlocalizedName); + GameRegistry.registerItem(this, unlocalName); GT_OreDictUnificator.registerOre(unlocalName.replace("itemRod", "stick"), UtilsItems.getSimpleStack(this)); addExtruderRecipe(); } @@ -65,10 +63,10 @@ public class BaseItemRodLong extends Item{ @Override public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (colour == 0){ + if (rodLongMaterial.getRgbAsHex() == 0){ return MathUtils.generateSingularRandomHexValue(); } - return colour; + return rodLongMaterial.getRgbAsHex(); } @@ -80,20 +78,43 @@ public class BaseItemRodLong extends Item{ private void addExtruderRecipe(){ Utils.LOG_WARNING("Adding recipe for Long "+materialName+" Rods"); - String tempIngot = unlocalName.replace("itemRodLong", "stick"); - ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 2); - if (null != tempOutputStack){ - GT_Values.RA.addForgeHammerRecipe(tempOutputStack, - UtilsItems.getSimpleStack(this, 1), - 12*mTier*20, 24*mTier); - } - ItemStack rods = UtilsItems.getSimpleStack(this, 1); - ItemStack tempOutputStack2 = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); + + String tempStick = unlocalName.replace("itemRodLong", "stick"); + String tempStickLong = unlocalName.replace("itemRodLong", "stickLong"); + ItemStack stackStick = UtilsItems.getItemStackOfAmountFromOreDict(tempStick, 1); + ItemStack stackLong = UtilsItems.getItemStackOfAmountFromOreDict(tempStickLong, 1); + UtilsRecipe.addShapedGregtechRecipe( - tempOutputStack2, "craftingToolHardHammer", tempOutputStack2, + stackStick, "craftingToolHardHammer", stackStick, null, null, null, null, null, null, - rods); + stackLong); + + ItemStack temp = stackStick; + temp.stackSize = 2; + + GT_Values.RA.addForgeHammerRecipe( + temp, + stackLong, + (int) Math.max(rodLongMaterial.getMass(), 1L), + 16); + + GT_Values.RA.addCutterRecipe( + stackLong, + temp, + null, + (int) Math.max(rodLongMaterial.getMass(), 1L), + 4); + + //Shaped Recipe - Long Rod to two smalls + if (null != stackLong){ + stackStick.stackSize = 2; + UtilsRecipe.recipeBuilder( + "craftingToolSaw", null, null, + stackLong, null, null, + null, null, null, + stackStick); + } } } diff --git a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java index 953c3a99a3..8d727770ce 100644 --- a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java +++ b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java @@ -4,6 +4,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.core.util.math.MathUtils; @@ -19,23 +20,19 @@ import cpw.mods.fml.common.registry.GameRegistry; public class BaseItemScrew extends Item{ - protected int colour; - protected String materialName; - protected String unlocalName; - private int mTier; + final Material screwMaterial; + final String materialName; + final String unlocalName; - public BaseItemScrew(String unlocalizedName, String materialName, int colour, int tier) { - setUnlocalizedName(unlocalizedName); + public BaseItemScrew(Material material) { + this.screwMaterial = material; + this.unlocalName = "itemScrew"+material.getUnlocalizedName(); + this.materialName = material.getLocalizedName(); this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalizedName); - this.unlocalName = unlocalizedName; + this.setUnlocalizedName(unlocalName); this.setMaxStackSize(64); this.setTextureName(CORE.MODID + ":" + "itemScrew"); - this.setMaxStackSize(64); - this.colour = colour; - this.mTier = tier; - this.materialName = materialName; - GameRegistry.registerItem(this, unlocalizedName); + GameRegistry.registerItem(this, unlocalName); GT_OreDictUnificator.registerOre(unlocalName.replace("itemS", "s"), UtilsItems.getSimpleStack(this)); addLatheRecipe(); } @@ -60,21 +57,26 @@ public class BaseItemScrew extends Item{ @Override public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (colour == 0){ + if (screwMaterial.getRgbAsHex() == 0){ return MathUtils.generateSingularRandomHexValue(); } - return colour; + return screwMaterial.getRgbAsHex(); } private void addLatheRecipe(){ Utils.LOG_WARNING("Adding recipe for "+materialName+" Screws"); ItemStack boltStack = UtilsItems.getItemStackOfAmountFromOreDict(unlocalName.replace("itemScrew", "bolt"), 1); - if (null != boltStack){ - GT_Values.RA.addLatheRecipe(boltStack, - UtilsItems.getSimpleStack(this), null, - 60*mTier, 16*mTier); - UtilsRecipe.addShapedGregtechRecipe( + if (null != boltStack){ + GT_Values.RA.addLatheRecipe( + boltStack, + UtilsItems.getSimpleStack(this), + null, + (int) Math.max(screwMaterial.getMass() / 8L, 1L), + 4); + + + UtilsRecipe.recipeBuilder( "craftingToolFile", boltStack, null, boltStack, null, null, null, null, null, diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 2939016798..0902bf62f9 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -23,9 +23,11 @@ public class Material { final long vProtons; final long vNeutrons; final long vMass; + public final int vTier; + public final int vVoltageMultiplier; public Material(String materialName, short[] rgba, int meltingPoint, int boilingPoint, long protons, long neutrons, boolean blastFurnace, MaterialStack[] inputs){ - + this.unlocalizedName = Utils.sanitizeString(materialName); this.localizedName = materialName; this.RGBA = rgba; @@ -39,7 +41,43 @@ public class Material { this.vProtons = protons; this.vNeutrons = neutrons; this.vMass = getMass(); + + if (getMeltingPoint_K() >= 0 && getMeltingPoint_K() <= 750){ + this.vTier = 1; + } + else if(getMeltingPoint_K() >= 751 && getMeltingPoint_K() <= 1250){ + this.vTier = 2; + } + else if(getMeltingPoint_K() >= 1251 && getMeltingPoint_K() <= 1750){ + this.vTier = 3; + } + else if(getMeltingPoint_K() >= 1751 && getMeltingPoint_K() <= 2250){ + this.vTier = 4; + } + else if(getMeltingPoint_K() >= 2251 && getMeltingPoint_K() <= 2750){ + this.vTier = 5; + } + else if(getMeltingPoint_K() >= 2751 && getMeltingPoint_K() <= 3250){ + this.vTier = 6; + } + else if(getMeltingPoint_K() >= 3251 && getMeltingPoint_K() <= 3750){ + this.vTier = 7; + } + else if(getMeltingPoint_K() >= 3751 && getMeltingPoint_K() <= 4250){ + this.vTier = 8; + } + else if(getMeltingPoint_K() >= 4251 && getMeltingPoint_K() <= 4750){ + this.vTier = 9; + } + else if(getMeltingPoint_K() >= 4751 && getMeltingPoint_K() <= 9999){ + this.vTier = 10; + } + else { + this.vTier = 0; + } + this.usesBlastFurnace = blastFurnace; + this.vVoltageMultiplier = this.getMeltingPoint_K() >= 2800 ? 64 : 16; if (inputs == null){ this.materialInput = null; @@ -72,6 +110,10 @@ public class Material { public short[] getRGBA(){ return RGBA; } + + public int getRgbAsHex(){ + return Utils.rgbtoHexValue(RGBA[0], RGBA[1], RGBA[2]); + } public long getProtons() { return vProtons; @@ -93,6 +135,14 @@ public class Material { return boilingPointC; } + public int getMeltingPoint_K() { + return meltingPointK; + } + + public int getBoilingPoint_K() { + return boilingPointK; + } + public boolean requiresBlastFurnace(){ return usesBlastFurnace; } @@ -100,11 +150,11 @@ public class Material { public ItemStack getDust(int stacksize){ return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+unlocalizedName, stacksize); } - + public ItemStack getSmallDust(int stacksize){ return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustSmall"+unlocalizedName, stacksize); } - + public ItemStack getTinyDust(int stacksize){ return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustTiny"+unlocalizedName, stacksize); } @@ -113,6 +163,18 @@ public class Material { return UtilsItems.validItemsForOreDict(unlocalizedName); } + public ItemStack getIngot(int stacksize){ + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("ingot"+unlocalizedName, stacksize); + } + + public ItemStack getPlate(int stacksize){ + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("plate"+unlocalizedName, stacksize); + } + + public ItemStack getPlateDouble(int stacksize){ + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("plateDouble"+unlocalizedName, stacksize); + } + public ItemStack[] getMaterialComposites(){ //Utils.LOG_INFO("Something requested the materials needed for "+localizedName); if (materialInput != null && materialInput.length >= 1){ @@ -121,16 +183,16 @@ public class Material { //Utils.LOG_INFO("i:"+i); ItemStack testNull = null; try { - testNull = materialInput[i].getDustStack(); + testNull = materialInput[i].getDustStack(); } catch (Throwable r){ Utils.LOG_INFO("Failed gathering material stack for "+localizedName+"."); Utils.LOG_INFO("What Failed: Length:"+materialInput.length+" current:"+i); } try { - if (testNull != null){ - //Utils.LOG_INFO("not null"); - temp[i] = materialInput[i].getDustStack(); - } + if (testNull != null){ + //Utils.LOG_INFO("not null"); + temp[i] = materialInput[i].getDustStack(); + } } catch (Throwable r){ Utils.LOG_INFO("Failed setting slot "+i+", using "+localizedName); } diff --git a/src/Java/gtPlusPlus/core/slots/SlotGtTool.java b/src/Java/gtPlusPlus/core/slots/SlotGtTool.java index ec77aa10bd..cdea2fa43f 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotGtTool.java +++ b/src/Java/gtPlusPlus/core/slots/SlotGtTool.java @@ -1,6 +1,7 @@ package gtPlusPlus.core.slots; -import gregtech.api.interfaces.IToolStats; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gtPlusPlus.core.util.Utils; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -14,7 +15,12 @@ public class SlotGtTool extends Slot{ @Override public boolean isItemValid(ItemStack itemstack) { - return itemstack.getItem() instanceof IToolStats; + if (itemstack.getItem() instanceof GT_MetaGenerated_Tool){ + Utils.LOG_WARNING(itemstack.getDisplayName()+" is a valid Tool."); + return true; + } + Utils.LOG_WARNING(itemstack.getDisplayName()+" is not a valid Tool."); + return false; } @Override diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbench.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbench.java index df06f92811..49ade0a10a 100644 --- a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbench.java +++ b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbench.java @@ -1,7 +1,6 @@ package gtPlusPlus.core.tileentities.machines; import gtPlusPlus.core.inventories.InventoryWorkbenchChest; -import gtPlusPlus.core.inventories.InventoryWorkbenchCrafting; import gtPlusPlus.core.inventories.InventoryWorkbenchTools; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -10,11 +9,9 @@ public class TileEntityWorkbench extends TileEntity { public InventoryWorkbenchChest inventoryChest; public InventoryWorkbenchTools inventoryTool; - public InventoryWorkbenchCrafting inventoryCrafting; - - + //public InventoryWorkbenchCrafting inventoryCrafting; + public TileEntityWorkbench(){ - this.inventoryCrafting = new InventoryWorkbenchCrafting();//number of slots - without product slot this.inventoryTool = new InventoryWorkbenchTools();//number of slots - without product slot this.inventoryChest = new InventoryWorkbenchChest();//number of slots - without product slot this.canUpdate(); @@ -36,7 +33,7 @@ public class TileEntityWorkbench extends TileEntity { super.writeToNBT(nbt); inventoryChest.writeToNBT(getTag(nbt, "ContentsChest")); inventoryTool.writeToNBT(getTag(nbt, "ContentsTools")); - inventoryCrafting.writeToNBT(getTag(nbt, "ContentsCrafting")); + //inventoryCrafting.writeToNBT(getTag(nbt, "ContentsCrafting")); } @@ -46,7 +43,7 @@ public class TileEntityWorkbench extends TileEntity { super.readFromNBT(nbt); inventoryChest.readFromNBT(nbt.getCompoundTag("ContentsChest")); inventoryTool.readFromNBT(nbt.getCompoundTag("ContentsTools")); - inventoryCrafting.readFromNBT(nbt.getCompoundTag("ContentsCrafting")); + //inventoryCrafting.readFromNBT(nbt.getCompoundTag("ContentsCrafting")); } }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java index 7a70b41f96..197482f1ae 100644 --- a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java +++ b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java @@ -27,6 +27,7 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.fluid.FluidUtils; import gtPlusPlus.core.util.materials.MaterialUtils; import gtPlusPlus.core.util.wrapper.var; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Plates; import java.util.ArrayList; import java.util.List; @@ -267,7 +268,7 @@ public class UtilsItems { short[] C = matInfo.getRGBA(); int Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]); boolean hotIngot = matInfo.requiresBlastFurnace(); - int materialTier = 0; //TODO + int materialTier = matInfo.vTier; //TODO if (materialTier > 10 || materialTier <= 0){ materialTier = 2; @@ -286,13 +287,13 @@ public class UtilsItems { tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour); temp = new BaseItemIngot("itemIngot"+unlocalizedName, materialName, Colour, sRadiation); - temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", hotIngot, materialTier, sRadiation); - temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", hotIngot, materialTier, sRadiation); - temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", hotIngot, materialTier, sRadiation); + temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation); + temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation); + temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation); temp = new BaseItemPlate("itemPlate"+unlocalizedName, materialName, Colour, materialTier, sRadiation); - temp = new BaseItemRod("itemRod"+unlocalizedName, materialName, Colour, materialTier, sRadiation); - temp = new BaseItemRodLong("itemRodLong"+unlocalizedName, materialName, Colour, materialTier, sRadiation); + temp = new BaseItemRod(matInfo, sRadiation); + temp = new BaseItemRodLong(matInfo, sRadiation); } else { @@ -305,31 +306,33 @@ public class UtilsItems { Item tempIngot = temp; temp = new BaseItemIngotHot("itemHotIngot"+unlocalizedName, materialName, UtilsItems.getSimpleStack(tempIngot, 1), materialTier); } - temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", hotIngot, materialTier, sRadiation); - temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", hotIngot, materialTier, sRadiation); - temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", hotIngot, materialTier, sRadiation); + temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation); + temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation); + temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation); temp = new BaseItemPlate("itemPlate"+unlocalizedName, materialName, Colour, materialTier, sRadiation); temp = new BaseItemPlateDouble("itemPlateDouble"+unlocalizedName, materialName, Colour, materialTier, sRadiation); - temp = new BaseItemRod("itemRod"+unlocalizedName, materialName, Colour, materialTier, sRadiation); - temp = new BaseItemRodLong("itemRodLong"+unlocalizedName, materialName, Colour, materialTier, sRadiation); - temp = new BaseItemRing("itemRing"+unlocalizedName, materialName, Colour, materialTier); - temp = new BaseItemBolt("itemBolt"+unlocalizedName, materialName, Colour, materialTier); - temp = new BaseItemScrew("itemScrew"+unlocalizedName, materialName, Colour, materialTier); + temp = new BaseItemBolt(matInfo); + temp = new BaseItemRod(matInfo, sRadiation); + temp = new BaseItemRodLong(matInfo, sRadiation); + temp = new BaseItemRing(matInfo); + temp = new BaseItemScrew(matInfo); temp = new BaseItemRotor("itemRotor"+unlocalizedName, materialName, Colour); - temp = new BaseItemGear("itemGear"+unlocalizedName, materialName, Colour, materialTier); + temp = new BaseItemGear(matInfo); } - + + RecipeGen_Plates.generateRecipes(matInfo); + FluidUtils.generateFluid(matInfo, 1); } - public static Item[] generateDusts(String unlocalizedName, String materialName, int materialTier, Material matInfo, int Colour, boolean hotIngot){ + public static Item[] generateDusts(String unlocalizedName, String materialName, int materialTier, Material matInfo, int Colour){ int radioactive = getRadioactivityLevel(materialName); Item[] output = { - new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", hotIngot, materialTier, radioactive), - new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", hotIngot, materialTier, radioactive), - new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", hotIngot, materialTier, radioactive)}; + new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, radioactive), + new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, radioactive), + new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, radioactive)}; return output; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index 0808eab6b3..8140839cac 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -1,10 +1,12 @@ package gtPlusPlus.xmod.gregtech; import gregtech.api.util.GT_Config; +import gtPlusPlus.core.handler.COMPAT_HANDLER; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.common.blocks.fluid.GregtechFluidHandler; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; +import gtPlusPlus.xmod.gregtech.loaders.Gregtech_Blocks; import gtPlusPlus.xmod.gregtech.loaders.ProcessingToolHeadChoocher; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits; @@ -12,40 +14,33 @@ public class HANDLER_GT { public static GT_Config mMaterialProperties = null; + @SuppressWarnings("unused") public static void preInit(){ new MetaGeneratedGregtechItems(); if (mMaterialProperties != null){ GT_Materials.init(mMaterialProperties); } GregtechFluidHandler.run(); - //new Processing_Ingot1(); - //new Processing_Plate1(); - //new Processing_Block(); - //new Processing_HotIngots(); } + @SuppressWarnings("unused") public static void init(){ + //Load General Blocks and set up some Basic Meta Tile Entitie states + Gregtech_Blocks.run(); + + //Register Tile Entities + COMPAT_HANDLER.registerGregtechMachines(); + //Add Custom Pipes, Wires and Cables. GregtechConduits.run(); new MetaGeneratedGregtechTools(); new ProcessingToolHeadChoocher().run(); - /*if (Meta_GT_Proxy.mSortToTheEnd) { - new GT_ItemIterator().run(); - Meta_GT_Proxy.registerUnificationEntries(); - new GT_FuelLoader().run(); - }*/ + } public static void postInit(){ - /*Meta_GT_Proxy.activateOreDictHandler(); - if (Meta_GT_Proxy.mSortToTheEnd) { - Meta_GT_Proxy.registerUnificationEntries(); - } else { - new GT_ItemIterator().run(); - Meta_GT_Proxy.registerUnificationEntries(); - new GT_FuelLoader().run(); - }*/ + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaBasicTank.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaBasicTank.java index a0bf55a39a..c199114daa 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaBasicTank.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaBasicTank.java @@ -5,7 +5,6 @@ import gregtech.api.gui.GT_Container_BasicTank; import gregtech.api.gui.GT_GUIContainer_BasicTank; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -17,7 +16,7 @@ import net.minecraftforge.fluids.FluidStack; * <p/> * This is the main construct for my generic Tanks. Filling and emptying behavior have to be implemented manually */ -public abstract class GregtechMetaBasicTank extends GT_MetaTileEntity_TieredMachineBlock { +public abstract class GregtechMetaBasicTank extends GregtechMetaTieredMachineBlock { public FluidStack mFluid; public FluidStack mInternal; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java index 15bd666b53..05abaa00da 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java @@ -10,6 +10,7 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; import gregtech.api.enums.TC_Aspects; import gregtech.api.enums.ToolDictNames; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.objects.ItemData; import gregtech.api.objects.MaterialStack; import gregtech.api.util.GT_Log; @@ -42,6 +43,9 @@ import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class Meta_GT_Proxy { + + //Store Some MetaTileEntity Data here, why not? + public static final IMetaTileEntity[] METATILEENTITIES = new IMetaTileEntity[GregTech_API.MAXIMUM_METATILE_IDS]; //Silly Vars private static final Collection<String> mIgnoredItems = new HashSet<String>(Arrays.asList(new String[]{"itemGhastTear", "itemFlint", "itemClay", "itemBucketSaltWater", diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMultiTank.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMultiTank.java index b78980f3e3..7d6c3caec7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMultiTank.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMultiTank.java @@ -77,9 +77,9 @@ public class GregtechMetaTileEntityMultiTank private long getMaximumTankStorage(){ int multiplier = getStorageMultiplier(); - Utils.LOG_INFO("x = "+multiplier+" * 96000"); + Utils.LOG_WARNING("x = "+multiplier+" * 96000"); long tempTankStorageMax = (96000*multiplier); - Utils.LOG_INFO("x = "+tempTankStorageMax); + Utils.LOG_WARNING("x = "+tempTankStorageMax); if (tempTankStorageMax <= 0){ return 96000; } @@ -207,7 +207,7 @@ public class GregtechMetaTileEntityMultiTank int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) { - Utils.LOG_INFO("Must be hollow."); + Utils.LOG_WARNING("Must be hollow."); return false; } int tAmount = 0; @@ -219,20 +219,20 @@ public class GregtechMetaTileEntityMultiTank if ((!addMaintenanceToMachineList(tTileEntity, 17)) && (!addInputToMachineList(tTileEntity, 17)) && (!addOutputToMachineList(tTileEntity, 17)) && (!addEnergyInputToMachineList(tTileEntity, 17))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { if (h < 3){ - Utils.LOG_INFO("Casing Expected."); + Utils.LOG_WARNING("Casing Expected."); return false; } else if (h >= 3){ - //Utils.LOG_INFO("Your Multitank can be 20 blocks tall."); + //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); } } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 11) { if (h < 3){ - Utils.LOG_INFO("Wrong Meta."); + Utils.LOG_WARNING("Wrong Meta."); return false; } else if (h >= 3){ - //Utils.LOG_INFO("Your Multitank can be 20 blocks tall."); + //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); } } if (h < 3){ @@ -240,10 +240,10 @@ public class GregtechMetaTileEntityMultiTank } else if (h >= 3){ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == Blocks.air || aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName().contains("residual")){ - Utils.LOG_INFO("Found air"); + Utils.LOG_WARNING("Found air"); } else { - Utils.LOG_INFO("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank."); + Utils.LOG_WARNING("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank."); tAmount++; } } @@ -253,7 +253,7 @@ public class GregtechMetaTileEntityMultiTank } } multiblockCasingCount = (short) tAmount; - Utils.LOG_INFO("Your Multitank can be 20 blocks tall."); + Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); Utils.LOG_INFO("Casings Count: "+tAmount+" Valid Multiblock: "+(tAmount >= 16)+" Tank Storage Capacity:"+getMaximumTankStorage()+"L"); return tAmount >= 16; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java index 7a2e49492d..6bce3b9f67 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java @@ -16,10 +16,10 @@ public class GT_MetaTileEntity_TieredTank extends GregtechMetaBasicTank { protected FluidStack internalTank = getInternalStack(); - protected String fluidName = getFluidName(); - protected int fluidAmount = getInternalFluidAmount(); + /*protected String fluidName = getFluidName(); + protected int fluidAmount = getInternalFluidAmount();*/ - private String getFluidName(){ + /*private String getFluidName(){ String x; if (internalTank != null){ x = internalTank.getFluid().getName(); @@ -39,7 +39,7 @@ public class GT_MetaTileEntity_TieredTank x = 0; } return x; - } + }*/ public GT_MetaTileEntity_TieredTank(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 3, "Stores " + ((int) (Math.pow(2, aTier) * 32000)) + "L of fluid"); @@ -89,8 +89,14 @@ public class GT_MetaTileEntity_TieredTank @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) return true; + Utils.LOG_INFO("Right Click on Block"); + if (aBaseMetaTileEntity.isClientSide()){ + Utils.LOG_INFO("MTE is ClientSide"); + return true; + } + Utils.LOG_INFO("MTE is not ClientSide"); aBaseMetaTileEntity.openGUI(aPlayer); + Utils.LOG_INFO("MTE is now has an open GUI"); return true; } |