From 26e10439a576e08bc3261a6d7c6c00c6cad7b761 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Mon, 10 Oct 2016 16:35:28 +1000 Subject: + Added some Geothermal Generators. + Added recipes and fuels for all Geothermals. (Normal Lava and Pahoehoe Lava) $ Fixed workbench not saving crafting table contents when closed. % Changed internal loading of Workbenches, Tanks and Geothermals. % Disabled old workbench buttons, now using Gregtech Holo slots. --- src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index bb482d96d5..6a1e496305 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -13,6 +13,7 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.fluid.FluidUtils; import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; public class RECIPES_GREGTECH { @@ -175,6 +176,13 @@ public class RECIPES_GREGTECH { GT_Values.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketFire_water", 0, 1), null, 120, 0); GT_Values.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketRocket_fuel", 0, 1), null, 112, 0); GT_Values.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketHootch", 0, 1), null, 36, 0); + + + + //CORE.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketRocket_fuel", 0, 1), null, 112, 0); + GT_Values.RA.addFuel(UtilsItems.getSimpleStack(Items.lava_bucket), null, 32, 2); + GT_Values.RA.addFuel(UtilsItems.getIC2Cell(2), null, 32, 2); + GT_Values.RA.addFuel(UtilsItems.getIC2Cell(11), null, 24, 2); //System.exit(1); } @@ -196,9 +204,5 @@ public class RECIPES_GREGTECH { 240); } - private static void registerSkookumChoocher(){ - //GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.toolHeadUniversalSpade, aMaterial, 1L), tBits, new Object[]{"fX", Character.valueOf('X'), OrePrefixes.toolHeadShovel.get(aMaterial)}); - } - } \ No newline at end of file -- cgit From d6bf108b40f0b281ff7c3c2bc91e43ed2b9883f7 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Mon, 17 Oct 2016 01:39:50 +1000 Subject: + Added Tesseract Generators and Terminals. + Added a handful of new, old textures from GT4. % Rewrote portions of the Blueprint item again, to try make it work better with NBT. + Added an Example NBT item for myself~ because I am a derp. + Added some custom textures for the Industrial Centrifuge. % Moved all the GT4 Tile Entities to their own loading class. --- src/Java/gtPlusPlus/GTplusplus.java | 5 + .../core/container/Container_Workbench.java | 23 +- .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 4 +- .../core/handler/Recipes/RegistrationHandler.java | 2 + .../gtPlusPlus/core/interfaces/IItemBlueprint.java | 4 +- .../gtPlusPlus/core/item/base/BaseItemBrain.java | 108 ++++ .../core/item/general/ItemBlueprint.java | 225 ++++++-- src/Java/gtPlusPlus/core/lib/CORE.java | 5 + .../gtPlusPlus/core/recipe/RECIPES_General.java | 49 ++ src/Java/gtPlusPlus/core/util/item/UtilsItems.java | 11 +- .../gtPlusPlus/core/util/recipe/UtilsRecipe.java | 11 +- .../xmod/gregtech/api/enums/GregtechItemList.java | 5 +- .../api/gui/CONTAINER_AdvancedWorkbench.java | 4 +- .../gregtech/api/gui/GUI_AdvancedWorkbench.java | 4 +- .../blocks/textures/CasingTextureHandler.java | 11 +- .../textures/TexturesCentrifugeMultiblock.java | 441 +++++++++++++++ .../common/blocks/textures/TexturesGtBlocks.java | 75 +++ .../GT_MetaTileEntity_TesseractGenerator.java | 602 +++++++++++++++++++++ .../GT_MetaTileEntity_TesseractTerminal.java | 504 +++++++++++++++++ ...GregtechMetaTileEntityIndustrialCentrifuge.java | 13 +- .../registration/gregtech/Gregtech4Content.java | 37 ++ .../registration/gregtech/GregtechWorkbenches.java | 29 - .../TileEntities/adv_machine_dimensional.png | Bin 0 -> 1660 bytes .../adv_machine_dimensional.png.mcmeta | 5 + .../TileEntities/adv_machine_screen_frequency.png | Bin 0 -> 822 bytes .../TileEntities/adv_machine_screen_random1.png | Bin 0 -> 12342 bytes .../adv_machine_screen_random1.png.mcmeta | 5 + .../TileEntities/adv_machine_screen_random2.png | Bin 0 -> 12342 bytes .../adv_machine_screen_random2.png.mcmeta | 5 + .../TileEntities/adv_machine_screen_random3.png | Bin 0 -> 12342 bytes .../adv_machine_screen_random3.png.mcmeta | 5 + .../TileEntities/high_adv_machine_dimensional.png | Bin 0 -> 1713 bytes .../high_adv_machine_dimensional.png.mcmeta | 5 + 33 files changed, 2085 insertions(+), 112 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/item/base/BaseItemBrain.java create mode 100644 src/Java/gtPlusPlus/core/recipe/RECIPES_General.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java delete mode 100644 src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWorkbenches.java create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_dimensional.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_dimensional.png.mcmeta create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_frequency.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random1.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random1.png.mcmeta create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random2.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random2.png.mcmeta create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random3.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random3.png.mcmeta create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/high_adv_machine_dimensional.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/high_adv_machine_dimensional.png.mcmeta (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java index 89988a1248..3fb57d064c 100644 --- a/src/Java/gtPlusPlus/GTplusplus.java +++ b/src/Java/gtPlusPlus/GTplusplus.java @@ -24,6 +24,7 @@ import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.HANDLER_GT; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlocks; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools; import java.awt.event.ActionEvent; @@ -120,7 +121,11 @@ implements ActionListener @SideOnly(value=Side.CLIENT) public static void loadTextures(){ Utils.LOG_INFO("Loading some textures on the client."); + //Tools Utils.LOG_WARNING("Processing texture: "+TexturesGtTools.SKOOKUM_CHOOCHER.getTextureFile().getResourcePath()); + + //Blocks + Utils.LOG_WARNING("Processing texture: "+TexturesGtBlocks.Casing_Machine_Dimensional.getTextureFile().getResourcePath()); } diff --git a/src/Java/gtPlusPlus/core/container/Container_Workbench.java b/src/Java/gtPlusPlus/core/container/Container_Workbench.java index 5ce6d0e1a2..b3b024f52c 100644 --- a/src/Java/gtPlusPlus/core/container/Container_Workbench.java +++ b/src/Java/gtPlusPlus/core/container/Container_Workbench.java @@ -188,8 +188,9 @@ public class Container_Workbench extends Container { @Override public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer){ + if (!aPlayer.worldObj.isRemote){ if (aSlotIndex == 999 || aSlotIndex == -999){ - Utils.LOG_INFO("??? - "+aSlotIndex); + //Utils.LOG_INFO("??? - "+aSlotIndex); } if (aSlotIndex == slotOutput){ @@ -210,7 +211,7 @@ public class Container_Workbench extends Container { Utils.LOG_INFO("Found a blueprint."); ItemStack tempBlueprint = inventoryHolo.getStackInSlot(1); ItemBlueprint tempItemBlueprint = (ItemBlueprint) tempBlueprint.getItem(); - if (inventoryHolo.getStackInSlot(0) != null){ + if (inventoryHolo.getStackInSlot(0) != null && !tempItemBlueprint.hasBlueprint(tempBlueprint)){ Utils.LOG_INFO("Output slot was not empty."); Utils.LOG_INFO("Trying to manipulate NBT data on the blueprint stack, then replace it with the new one."); tempItemBlueprint.setBlueprint(inventoryHolo.getStackInSlot(1), craftMatrix, inventoryHolo.getStackInSlot(0)); @@ -219,7 +220,12 @@ public class Container_Workbench extends Container { Utils.LOG_INFO(UtilsItems.getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint))); } else { - Utils.LOG_INFO("Output slot was empty."); + if (tempItemBlueprint.hasBlueprint(tempBlueprint)){ + Utils.LOG_INFO("Blueprint already holds a recipe."); + } + else { + Utils.LOG_INFO("Output slot was empty."); + } } } else { @@ -257,6 +263,7 @@ public class Container_Workbench extends Container { Utils.LOG_INFO("Player Clicked slot "+aSlotIndex+" in the tool Grid"); } } + } //Utils.LOG_INFO("Player Clicked slot "+aSlotIndex+" in the Grid"); return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } @@ -267,7 +274,15 @@ public class Container_Workbench extends Container { //craftResult.setInventorySlotContents(0, Workbench_CraftingHandler.getInstance().findMatchingRecipe(craftMatrix, worldObj)); //Vanilla CraftingManager - craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj)); + Utils.LOG_INFO("checking crafting grid for a valid output."); + ItemStack temp = CraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj); + if (temp != null){ + Utils.LOG_INFO("Output found. "+temp.getDisplayName()+" x"+temp.stackSize); + inventoryHolo.setInventorySlotContents(slotOutput, temp); + } + else { + Utils.LOG_INFO("No Valid output found."); + } } diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index fd7fbf9645..e51dc157c6 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -42,7 +42,7 @@ import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSolarGenerators; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSteamCondenser; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSuperConductionPoint; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechTieredFluidTanks; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechWorkbenches; +import gtPlusPlus.xmod.gregtech.registration.gregtech.Gregtech4Content; import java.util.LinkedList; import java.util.Queue; @@ -91,7 +91,7 @@ public class COMPAT_HANDLER { GregtechDehydrator.run(); GregtechTieredFluidTanks.run(); GregtechIndustrialMultiTank.run(); - GregtechWorkbenches.run(); + Gregtech4Content.run(); GregtechGeothermalThermalGenerator.run(); } diff --git a/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java b/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java index affb56566d..275a67f571 100644 --- a/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java +++ b/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java @@ -1,6 +1,7 @@ package gtPlusPlus.core.handler.Recipes; import gtPlusPlus.core.handler.COMPAT_HANDLER; +import gtPlusPlus.core.recipe.RECIPES_General; import gtPlusPlus.core.recipe.RECIPES_MachineComponents; import gtPlusPlus.core.recipe.RECIPES_Machines; import gtPlusPlus.core.recipe.RECIPES_Shapeless; @@ -23,6 +24,7 @@ public class RegistrationHandler { RECIPES_Shapeless.RECIPES_LOAD(); RECIPES_MachineComponents.RECIPES_LOAD(); RECIPE_Batteries.RECIPES_LOAD(); + RECIPES_General.RECIPES_LOAD(); //RECIPES_MTWRAPPER.run(); Utils.LOG_INFO("Loaded: "+recipesSuccess+" Failed: "+recipesFailed); COMPAT_HANDLER.areInitItemsLoaded = true; diff --git a/src/Java/gtPlusPlus/core/interfaces/IItemBlueprint.java b/src/Java/gtPlusPlus/core/interfaces/IItemBlueprint.java index f3f4e40b66..90126b1e82 100644 --- a/src/Java/gtPlusPlus/core/interfaces/IItemBlueprint.java +++ b/src/Java/gtPlusPlus/core/interfaces/IItemBlueprint.java @@ -29,7 +29,7 @@ public interface IItemBlueprint { * @param String Blueprint Name * @return N/A */ - public void setBlueprintName(String name); + public void setBlueprintName(ItemStack stack, String name); /** * Does this itemstack hold a blueprint? @@ -43,6 +43,6 @@ public interface IItemBlueprint { * @param stack yourMetaItem * @return the blueprints contents */ - public ItemStack[] getBlueprint(ItemStack stack); + public ItemStack[] getBlueprint(ItemStack stack); } diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemBrain.java b/src/Java/gtPlusPlus/core/item/base/BaseItemBrain.java new file mode 100644 index 0000000000..86cd1c8046 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemBrain.java @@ -0,0 +1,108 @@ +package gtPlusPlus.core.item.base; + +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/* + * + * + Key Point: You can access the NBT compound data from the Item class (in those methods that pass an ItemStack), but the NBT compound can only be set on an ItemStack. + + The steps to add NBT data to an ItemStack: + Create or otherwise get an ItemStack of the desired item + Create an NBTTagCompound and fill it with the appropriate data + Call ItemStack#setTagCompound() method to set it. + + * + */ + +public class BaseItemBrain extends Item{ + // This is an array of all the types I am going to be adding. + String[] brainTypes = { "dead", "preserved", "fresh", "tasty" }; + + // This method allows us to have different language translation keys for + // each item we add. + @Override + public String getUnlocalizedName(ItemStack stack) + { + // This makes sure that the stack has a tag compound. This is how data + // is stored on items. + if (stack.hasTagCompound()) + { + // This is the object holding all of the item data. + NBTTagCompound itemData = stack.getTagCompound(); + // This checks to see if the item has data stored under the + // brainType key. + if (itemData.hasKey("brainType")) + { + // This retrieves data from the brainType key and uses it in + // the return value + return "item." + itemData.getString("brainType"); + } + } + // This will be used if the item is obtained without nbt data on it. + return "item.nullBrain"; + } + + + // This is a fun method which allows us to run some code when our item is + // shown in a creative tab. I am going to use it to add all the brain + // types. + @SuppressWarnings("unchecked") + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs tab, List itemList) + { + // This creates a loop with a counter. It will go through once for + // every listing in brainTypes, and gives us a number associated + // with each listing. + for (int pos = 0; pos < brainTypes.length; pos++) + { + // This creates a new ItemStack instance. The item parameter + // supplied is this item. + ItemStack brainStack = new ItemStack(item); + // By default, a new ItemStack does not have any nbt compound data. + // We need to give it some. + brainStack.setTagCompound(new NBTTagCompound()); + // Now we set the type of the item, brainType is the key, and + // brainTypes[pos] is grabbing a + // entry from the brainTypes array. + brainStack.getTagCompound().setString("brainType", + brainTypes[pos]); + // And this adds it to the itemList, which is a list of all items + // in the creative tab. + itemList.add(brainStack); + } + } + + // This code will allow us to tell the items apart in game. You can change + @SuppressWarnings("unchecked") + // texture based on nbt data, but I won't be covering that. + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean isAdvanced){ + if ( stack.hasTagCompound() + && stack.getTagCompound().hasKey("brainType")) + { + // StatCollector is a class which allows us to handle string + // language translation. This requires that you fill out the + // translation in you language class. + tooltip.add(StatCollector.translateToLocal("tooltip.yourmod." + + stack.getTagCompound().getString("brainType") + ".desc")); + } + else // If the brain does not have valid tag data, a default message + { + tooltip.add(StatCollector.translateToLocal( + "tooltip.yourmod.nullbrain.desc")); + } + } +} + diff --git a/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java b/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java index a15616711d..b721672aa4 100644 --- a/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java +++ b/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java @@ -4,6 +4,7 @@ import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.interfaces.IItemBlueprint; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.core.util.math.MathUtils; import java.util.List; @@ -21,49 +22,59 @@ import cpw.mods.fml.common.registry.GameRegistry; public class ItemBlueprint extends Item implements IItemBlueprint{ - protected String mName = ""; - protected boolean mHasBlueprint = false; - private final int bpID; - - /** - * The inventory of items the blueprint holds~ - */ - protected ItemStack[] blueprint = new ItemStack[9]; - public ItemBlueprint(String unlocalizedName) { this.setUnlocalizedName(unlocalizedName); this.setTextureName(CORE.MODID + ":" + unlocalizedName); this.setMaxStackSize(1); this.setCreativeTab(AddToCreativeTab.tabMachines); - this.bpID = MathUtils.randInt(0, 1000); + //this.bpID = MathUtils.randInt(0, 1000); GameRegistry.registerItem(this, unlocalizedName); } @SuppressWarnings({ "unchecked", "rawtypes" }) @Override - public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { - if (bpID >= 0){ - list.add(EnumChatFormatting.GRAY+"Technical Document No. "+bpID); + public void addInformation(ItemStack itemStack, EntityPlayer aPlayer, List list, boolean bool) { + //Create some NBT if it's not there, otherwise this does nothing. + if (!itemStack.hasTagCompound()){ + createNBT(itemStack); } - if(mHasBlueprint){ - list.add(EnumChatFormatting.BLUE+"Currently holding a blueprint for "+mName); + //Set up some default variables. + int id = -1; + String name = ""; + boolean blueprint = false; + //Get proper display vars from NBT if it's there + if (itemStack.hasTagCompound()){ + //Utils.LOG_INFO("Found TagCompound"); + id = (int) getNBT(itemStack, "mID"); + name = (String) getNBT(itemStack, "mName"); + blueprint = (boolean) getNBT(itemStack, "mBlueprint"); } + //Write to tooltip list for each viable setting. + if (itemStack.hasTagCompound()) { + if (id != -1){ + list.add(EnumChatFormatting.GRAY+"Technical Document No. "+id); + } + if(blueprint){ + list.add(EnumChatFormatting.BLUE+"Currently holding a blueprint for "+name); + } + else { + list.add(EnumChatFormatting.RED+"Currently not holding a blueprint for anything."); + } + } else { list.add(EnumChatFormatting.RED+"Currently not holding a blueprint for anything."); } - super.addInformation(stack, aPlayer, list, bool); + super.addInformation(itemStack, aPlayer, list, bool); } - + @Override public String getItemStackDisplayName(ItemStack p_77653_1_) { - return "Blueprint"; + return "Blueprint"; } @Override - public void onCreated(ItemStack itemStack, World world, EntityPlayer player) { - itemStack.stackTagCompound = new NBTTagCompound(); - //this.inventory = null; - //itemStack.stackTagCompound.set("pos_x", bed_X); TODO + public void onCreated(ItemStack itemStack, World world, EntityPlayer player) { + createNBT(itemStack); } @Override @@ -74,38 +85,59 @@ public class ItemBlueprint extends Item implements IItemBlueprint{ @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer par3Entity) { //Let the player know what blueprint is held - Utils.messagePlayer(par3Entity, "This is a placeholder."); + if (itemStack.hasTagCompound()) { + Utils.messagePlayer(par3Entity, "This Blueprint holds NBT data. "+"|"+getNBT(itemStack, "mID")+"|"+getNBT(itemStack, "mBlueprint")+"|"+getNBT(itemStack, "mName")+"|"+UtilsItems.getArrayStackNames(readItemsFromNBT(itemStack))); + } + else { + createNBT(itemStack); + Utils.messagePlayer(par3Entity, "This is a placeholder. "+getNBT(itemStack, "mID")); + } + + return super.onItemRightClick(itemStack, world, par3Entity); } - public void readFromNBT(NBTTagCompound nbt){ - NBTTagList list = nbt.getTagList("Items", 10); - blueprint = new ItemStack[INV_SIZE]; - for(int i = 0;i= 0 && slot < INV_SIZE) + public ItemStack[] readItemsFromNBT(ItemStack itemStack){ + ItemStack[] blueprint = new ItemStack[9]; + if (itemStack.hasTagCompound()){ + NBTTagCompound nbt = itemStack.getTagCompound(); + NBTTagList list = nbt.getTagList("Items", 10); + blueprint = new ItemStack[INV_SIZE]; + for(int i = 0;i= 0 && slot < INV_SIZE) + { + blueprint[slot] = ItemStack.loadItemStackFromNBT(data); + } } + return blueprint; } + return null; } - public void writeToNBT(NBTTagCompound nbt){ - NBTTagList list = new NBTTagList(); - for(int i = 0;i sTesseractGenerators = new HashMap(); //GUIS public enum GUI_ENUM diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java new file mode 100644 index 0000000000..9a396334d4 --- /dev/null +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java @@ -0,0 +1,49 @@ +package gtPlusPlus.core.recipe; + +import gregtech.api.enums.ItemList; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.item.ModItems; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.recipe.UtilsRecipe; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class RECIPES_General { + + static ItemStack RECIPE_Paper = UtilsItems.getSimpleStack(Items.paper); + static ItemStack RECIPE_LapisDust = UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustLazurite", 2); + static ItemStack OUTPUT_Blueprint = UtilsItems.getSimpleStack(ModItems.itemBlueprintBase); + static ItemStack RECIPE_CraftingTable = UtilsItems.getSimpleStack(Item.getItemFromBlock(Blocks.crafting_table)); + static ItemStack RECIPE_BronzePlate = UtilsItems.getItemStackOfAmountFromOreDictNoBroken("plateBronze", 1); + static ItemStack RECIPE_BasicCasingIC2; + static ItemStack OUTPUT_Workbench_Bronze = UtilsItems.getSimpleStack(Item.getItemFromBlock(ModBlocks.blockWorkbench)); + static ItemStack NULL = null; + + public static void RECIPES_LOAD(){ + + if (LoadedMods.Gregtech){ + RECIPE_BasicCasingIC2 = ItemList.Casing_Gearbox_Bronze.get(1); + run(); + } + } + + private static void run(){ + + + UtilsRecipe.recipeBuilder( + RECIPE_Paper, RECIPE_LapisDust, NULL, + RECIPE_Paper, RECIPE_LapisDust, NULL, + RECIPE_LapisDust, RECIPE_LapisDust, NULL, + OUTPUT_Blueprint); + + UtilsRecipe.recipeBuilder( + RECIPE_BronzePlate, RECIPE_CraftingTable, RECIPE_BronzePlate, + RECIPE_BronzePlate, RECIPE_BasicCasingIC2, RECIPE_BronzePlate, + RECIPE_BronzePlate, RECIPE_BronzePlate, RECIPE_BronzePlate, + OUTPUT_Workbench_Bronze); + } + +} diff --git a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java index ec4e457489..64f06a078c 100644 --- a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java +++ b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java @@ -467,8 +467,15 @@ public class UtilsItems { public static String getArrayStackNames(ItemStack[] aStack){ String itemNames = "Item Array: "; for (ItemStack alph : aStack){ - String temp = itemNames; - itemNames = temp + ", " + alph.getDisplayName() + " x" + alph.stackSize; + + if (alph != null){ + String temp = itemNames; + itemNames = temp + ", " + alph.getDisplayName() + " x" + alph.stackSize; + } + else { + String temp = itemNames; + itemNames = temp + ", " + "null" + " x" + "0"; + } } return itemNames; diff --git a/src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java b/src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java index 997aaa95c9..727e40f570 100644 --- a/src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java +++ b/src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java @@ -101,7 +101,7 @@ public class UtilsRecipe { try { GameRegistry.addRecipe(new ShapedOreRecipe(resultItem.copy(), (Object[]) validSlots.toArray())); - Utils.LOG_INFO("Success! Added a recipe for "+resultItem.toString()); + Utils.LOG_INFO("Success! Added a recipe for "+resultItem.getDisplayName()); if (!COMPAT_HANDLER.areInitItemsLoaded){ RegistrationHandler.recipesSuccess++; } @@ -173,7 +173,7 @@ public class UtilsRecipe { //GameRegistry.addRecipe(new ShapelessOreRecipe(Output, outputAmount), (Object[]) validSlots.toArray()); GameRegistry.addRecipe(new ShapelessOreRecipe(Output, (Object[]) validSlots.toArray())); //GameRegistry.addShapelessRecipe(new ItemStack(output_ITEM, 1), new Object[] {slot_1, slot_2}); - Utils.LOG_INFO("Success! Added a recipe for "+Output.toString()); + Utils.LOG_INFO("Success! Added a recipe for "+Output.getDisplayName()); RegistrationHandler.recipesSuccess++; } catch(RuntimeException k){ @@ -333,7 +333,7 @@ public class UtilsRecipe { return; } - GT_ModHandler.addCraftingRecipe(OutputItem, + if (GT_ModHandler.addCraftingRecipe(OutputItem, GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"ABC", "DEF", "GHI", @@ -345,7 +345,10 @@ public class UtilsRecipe { 'F', InputItem6, 'G', InputItem7, 'H', InputItem8, - 'I', InputItem9}); + 'I', InputItem9})){ + Utils.LOG_INFO("Success! Added a recipe for "+OutputItem.getDisplayName()); + RegistrationHandler.recipesSuccess++; + } } public static void addShapelessGregtechRecipe(ItemStack OutputItem, Object... inputItems){ diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 346b239932..6576e1c0d9 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -128,7 +128,10 @@ public enum GregtechItemList implements GregtechItemContainer { GT4_Workbench_Bronze, GT4_Workbench_Advanced, //Geothermal Engines - Geothermal_Engine_EV, Geothermal_Engine_IV, Geothermal_Engine_LuV; + Geothermal_Engine_EV, Geothermal_Engine_IV, Geothermal_Engine_LuV, + + //Tesseracts + GT4_Tesseract_Generator, GT4_Tesseract_Terminal; public static final GregtechItemList[] DYE_ONLY_ITEMS = { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedWorkbench.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedWorkbench.java index c5bfc4ac7b..47c8aedb98 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedWorkbench.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedWorkbench.java @@ -1,19 +1,19 @@ package gtPlusPlus.xmod.gregtech.api.gui; +import gregtech.api.gui.GT_ContainerMetaTile_Machine; import gregtech.api.gui.GT_Slot_Holo; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.slots.SlotGtTool; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.xmod.gregtech.api.gui.dev.GT_ContainerMetaTile_MachineEx; import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_AdvancedCraftingTable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -public class CONTAINER_AdvancedWorkbench extends GT_ContainerMetaTile_MachineEx { +public class CONTAINER_AdvancedWorkbench extends GT_ContainerMetaTile_Machine { public CONTAINER_AdvancedWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_AdvancedWorkbench.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_AdvancedWorkbench.java index c52d50d674..7da9238bd5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_AdvancedWorkbench.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_AdvancedWorkbench.java @@ -1,12 +1,12 @@ package gtPlusPlus.xmod.gregtech.api.gui; +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.xmod.gregtech.api.gui.dev.GT_GUIContainerMetaTile_MachineEx; import net.minecraft.entity.player.InventoryPlayer; public class GUI_AdvancedWorkbench -extends GT_GUIContainerMetaTile_MachineEx +extends GT_GUIContainerMetaTile_Machine { public GUI_AdvancedWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java index 19210eea8a..a638baf5a2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java @@ -1,15 +1,15 @@ package gtPlusPlus.xmod.gregtech.common.blocks.textures; import gregtech.api.enums.Textures; -import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; public class CasingTextureHandler { - private static final TexturesGregtech59 gregtech59 = new TexturesGregtech59(); - private static final TexturesGregtech58 gregtech58 = new TexturesGregtech58(); + //private static final TexturesGregtech59 gregtech59 = new TexturesGregtech59(); + //private static final TexturesGregtech58 gregtech58 = new TexturesGregtech58(); + private static final TexturesCentrifugeMultiblock gregtechX = new TexturesCentrifugeMultiblock(); public static IIcon getIcon(int aSide, int aMeta) { //Texture ID's. case 0 == ID[57] if ((aMeta >= 0) && (aMeta < 16)) { @@ -67,9 +67,10 @@ public class CasingTextureHandler { public static IIcon handleCasingsGT(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide, GregtechMetaCasingBlocks thisBlock) { - if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ + /*if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ return gregtech59.handleCasingsGT59(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock); } - return gregtech58.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock); + return gregtech58.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);*/ + return gregtechX.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock); } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java new file mode 100644 index 0000000000..bc7827916e --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java @@ -0,0 +1,441 @@ +package gtPlusPlus.xmod.gregtech.common.blocks.textures; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlocks.CustomIcon; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityIndustrialCentrifuge; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +public class TexturesCentrifugeMultiblock { + + private static CustomIcon GT8_1_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE1"); + private static CustomIcon GT8_1 = new CustomIcon("iconsets/LARGECENTRIFUGE1"); + private static CustomIcon GT8_2_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE2"); + private static CustomIcon GT8_2 = new CustomIcon("iconsets/LARGECENTRIFUGE2"); + private static CustomIcon GT8_3_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE3"); + private static CustomIcon GT8_3 = new CustomIcon("iconsets/LARGECENTRIFUGE3"); + private static CustomIcon GT8_4_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE4"); + private static CustomIcon GT8_4 = new CustomIcon("iconsets/LARGECENTRIFUGE4"); + private static CustomIcon GT8_5_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE5"); + private static CustomIcon GT8_5 = new CustomIcon("iconsets/LARGECENTRIFUGE5"); + private static CustomIcon GT8_6_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE6"); + private static CustomIcon GT8_6 = new CustomIcon("iconsets/LARGECENTRIFUGE6"); + private static CustomIcon GT8_7_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE7"); + private static CustomIcon GT8_7 = new CustomIcon("iconsets/LARGECENTRIFUGE7"); + private static CustomIcon GT8_8_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE8"); + private static CustomIcon GT8_8 = new CustomIcon("iconsets/LARGECENTRIFUGE8"); + private static CustomIcon GT8_9_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE9"); + private static CustomIcon GT8_9 = new CustomIcon("iconsets/LARGECENTRIFUGE9"); + + private static CustomIcon frontFace_0 = (GT8_1); + private static CustomIcon frontFaceActive_0 = (GT8_1_Active); + private static CustomIcon frontFace_1 = (GT8_2); + private static CustomIcon frontFaceActive_1 = (GT8_2_Active); + private static CustomIcon frontFace_2 = (GT8_3); + private static CustomIcon frontFaceActive_2 = (GT8_3_Active); + private static CustomIcon frontFace_3 = (GT8_4); + private static CustomIcon frontFaceActive_3 = (GT8_4_Active); + private static CustomIcon frontFace_4 = (GT8_5); + private static CustomIcon frontFaceActive_4 = (GT8_5_Active); + private static CustomIcon frontFace_5 = (GT8_6); + private static CustomIcon frontFaceActive_5 = (GT8_6_Active); + private static CustomIcon frontFace_6 = (GT8_7); + private static CustomIcon frontFaceActive_6 = (GT8_7_Active); + private static CustomIcon frontFace_7 = (GT8_8); + private static CustomIcon frontFaceActive_7 = (GT8_8_Active); + private static CustomIcon frontFace_8 = (GT8_9); + private static CustomIcon frontFaceActive_8 = (GT8_9_Active); + + CustomIcon[] CENTRIFUGE = new CustomIcon[]{ + frontFace_0, + frontFace_1, + frontFace_2, + frontFace_3, + frontFace_4, + frontFace_5, + frontFace_6, + frontFace_7, + frontFace_8 + }; + + CustomIcon[] CENTRIFUGE_ACTIVE = new CustomIcon[]{ + frontFaceActive_0, + frontFaceActive_1, + frontFaceActive_2, + frontFaceActive_3, + frontFaceActive_4, + frontFaceActive_5, + frontFaceActive_6, + frontFaceActive_7, + frontFaceActive_8 + }; + + public IIcon handleCasingsGT(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide, GregtechMetaCasingBlocks thisBlock) { + return handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock); + } + + + public IIcon handleCasingsGT58(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide, GregtechMetaCasingBlocks thisBlock) { + int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); + if (((tMeta != 6) && (tMeta != 8) && (tMeta != 0))) { + return CasingTextureHandler.getIcon(aSide, tMeta); + } + int tStartIndex = tMeta == 6 ? 1 : 13; + if (tMeta == 0) { + if ((aSide == 2) || (aSide == 3)) { + TileEntity tTileEntity; + IMetaTileEntity tMetaTileEntity; + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return CENTRIFUGE_ACTIVE[0].getIcon(); + } + return CENTRIFUGE[0].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return CENTRIFUGE_ACTIVE[3].getIcon(); + } + return CENTRIFUGE[3].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return CENTRIFUGE_ACTIVE[6].getIcon(); + } + return CENTRIFUGE[6].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return CENTRIFUGE_ACTIVE[1].getIcon(); + } + return CENTRIFUGE[1].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return CENTRIFUGE_ACTIVE[7].getIcon(); + } + return CENTRIFUGE[7].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return CENTRIFUGE_ACTIVE[8].getIcon(); + } + return CENTRIFUGE[8].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return CENTRIFUGE_ACTIVE[5].getIcon(); + } + return CENTRIFUGE[5].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return CENTRIFUGE_ACTIVE[2].getIcon(); + } + return CENTRIFUGE[2].getIcon(); + } + } else if ((aSide == 4) || (aSide == 5)) { + TileEntity tTileEntity; + Object tMetaTileEntity; + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return CENTRIFUGE_ACTIVE[0].getIcon(); + } + return CENTRIFUGE[0].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return CENTRIFUGE_ACTIVE[3].getIcon(); + } + return CENTRIFUGE[3].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return CENTRIFUGE_ACTIVE[6].getIcon(); + } + return CENTRIFUGE[6].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return CENTRIFUGE_ACTIVE[1].getIcon(); + } + return CENTRIFUGE[1].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return CENTRIFUGE_ACTIVE[7].getIcon(); + } + return CENTRIFUGE[7].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return CENTRIFUGE_ACTIVE[8].getIcon(); + } + return CENTRIFUGE[8].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return CENTRIFUGE_ACTIVE[5].getIcon(); + } + return CENTRIFUGE[5].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) { + if (((IGregTechTileEntity) tTileEntity).isActive()) { + return CENTRIFUGE_ACTIVE[2].getIcon(); + } + return CENTRIFUGE[2].getIcon(); + } + } + return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + } + boolean[] tConnectedSides = {(aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta), (aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta), (aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta)}; + switch (aSide) { + case 0: + if (tConnectedSides[0]) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); + } + if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); + } + if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); + } + if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); + } + if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); + } + if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon(); + } + if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon(); + } + if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon(); + } + if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon(); + } + if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon(); + } + if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); + } + if ((!tConnectedSides[4]) && (!tConnectedSides[2])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon(); + } + if ((!tConnectedSides[5]) && (!tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon(); + } + case 1: + if (tConnectedSides[1]) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); + } + if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); + } + if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); + } + if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); + } + if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); + } + if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon(); + } + if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon(); + } + if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon(); + } + if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon(); + } + if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon(); + } + if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); + } + if ((!tConnectedSides[2]) && (!tConnectedSides[4])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon(); + } + if ((!tConnectedSides[3]) && (!tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon(); + } + case 2: + if (tConnectedSides[5]) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); + } + if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); + } + if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); + } + if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon(); + } + if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); + } + if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); + } + if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon(); + } + if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon(); + } + if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon(); + } + if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon(); + } + if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); + } + if ((!tConnectedSides[2]) && (!tConnectedSides[4])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon(); + } + if ((!tConnectedSides[0]) && (!tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon(); + } + case 3: + if (tConnectedSides[3]) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); + } + if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); + } + if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); + } + if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon(); + } + if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); + } + if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); + } + if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon(); + } + if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon(); + } + if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon(); + } + if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon(); + } + if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); + } + if ((!tConnectedSides[2]) && (!tConnectedSides[4])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon(); + } + if ((!tConnectedSides[0]) && (!tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon(); + } + case 4: + if (tConnectedSides[4]) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); + } + if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); + } + if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon(); + } + if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); + } + if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); + } + if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); + } + if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon(); + } + if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon(); + } + if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon(); + } + if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon(); + } + if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); + } + if ((!tConnectedSides[0]) && (!tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon(); + } + if ((!tConnectedSides[3]) && (!tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon(); + } + case 5: + if (tConnectedSides[2]) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); + } + if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); + } + if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon(); + } + if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); + } + if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); + } + if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); + } + if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon(); + } + if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon(); + } + if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon(); + } + if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon(); + } + if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); + } + if ((!tConnectedSides[0]) && (!tConnectedSides[1])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon(); + } + if ((!tConnectedSides[3]) && (!tConnectedSides[5])) { + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon(); + } + break; + } + return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java new file mode 100644 index 0000000000..5044f958c8 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java @@ -0,0 +1,75 @@ +package gtPlusPlus.xmod.gregtech.common.blocks.textures; + +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.IIconContainer; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + +public class TexturesGtBlocks { + + /* + * Handles Custom Textures. + */ + + public static class CustomIcon implements IIconContainer, Runnable { + protected IIcon mIcon; + protected String mIconName; + + public CustomIcon(String aIconName) { + mIconName = aIconName; + Utils.LOG_INFO("Constructing a Custom Texture. " + mIconName); + GregTech_API.sGTBlockIconload.add(this); + } + + @Override + public IIcon getIcon() { + return mIcon; + } + + @Override + public IIcon getOverlayIcon() { + return null; + } + + @Override + public void run() { + mIcon = GregTech_API.sBlockIcons.registerIcon(CORE.MODID + ":" + mIconName); + Utils.LOG_INFO("FIND ME _ Processing texture: "+this.getTextureFile().getResourcePath()); + } + + @Override + public ResourceLocation getTextureFile() { + return TextureMap.locationBlocksTexture; + } + } + + + /* + * Add Some Custom Textures below. + * I am not sure whether or not I need to declare them as such, but better to be safe than sorry. + * Right? + */ + + + + //Machine Casings + private static final CustomIcon Internal_Casing_Machine_Dimensional = new CustomIcon("TileEntities/adv_machine_dimensional"); + public static final CustomIcon Casing_Machine_Dimensional = Internal_Casing_Machine_Dimensional; + private static final CustomIcon Internal_Casing_Machine_Dimensional_Adv = new CustomIcon("TileEntities/high_adv_machine_dimensional"); + public static final CustomIcon Casing_Machine_Dimensional_Adv = Internal_Casing_Machine_Dimensional_Adv; + + //Computer Screens + private static final CustomIcon Internal_Casing_Machine_Screen_1 = new CustomIcon("TileEntities/adv_machine_screen_random1"); + public static final CustomIcon Casing_Machine_Screen_1 = Internal_Casing_Machine_Screen_1; + private static final CustomIcon Internal_Casing_Machine_Screen_2 = new CustomIcon("TileEntities/adv_machine_screen_random2"); + public static final CustomIcon Casing_Machine_Screen_2 = Internal_Casing_Machine_Screen_2; + private static final CustomIcon Internal_Casing_Machine_Screen_3 = new CustomIcon("TileEntities/adv_machine_screen_random3"); + public static final CustomIcon Casing_Machine_Screen_3 = Internal_Casing_Machine_Screen_3; + private static final CustomIcon Internal_Casing_Machine_Screen_Frequency = new CustomIcon("TileEntities/adv_machine_screen_frequency"); + public static final CustomIcon Casing_Machine_Screen_Frequency = Internal_Casing_Machine_Screen_Frequency; + + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java new file mode 100644 index 0000000000..dde2c6927c --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java @@ -0,0 +1,602 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.automation; + +import static gtPlusPlus.core.lib.CORE.sTesseractGenerators; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IDigitalChest; +import gregtech.api.interfaces.tileentity.IGregTechDeviceInformation; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlocks; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class GT_MetaTileEntity_TesseractGenerator +extends GT_MetaTileEntity_BasicTank +{ + public static int TESSERACT_ENERGY_COST_DIMENSIONAL = 2048; + public static int TESSERACT_ENERGY_COST = 1024; + public byte isWorking = 0; + public int oFrequency = 0; + public int mNeededEnergy = 0; + public int mFrequency = 0; + + public GT_MetaTileEntity_TesseractGenerator(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 3, ""); + } + + public GT_MetaTileEntity_TesseractGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 3, aDescription, aTextures); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_TesseractGenerator(mName, mTier, mDescription, mTextures); + } + + @Override + public boolean isTransformerUpgradable() + { + return true; + } + + @Override + public boolean isOverclockerUpgradable() + { + return false; + } + + @Override + public boolean isSimpleMachine() + { + return false; + } + + @Override + public boolean isFacingValid(byte aFacing) + { + return true; + } + + @Override + public boolean isEnetInput() + { + return true; + } + + @Override + public boolean isEnetOutput() + { + return false; + } + + @Override + public boolean isInputFacing(byte aSide) + { + return true; + } + + @Override + public boolean isOutputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getBackFacing(); + } + + @Override + public boolean isValidSlot(int aIndex) + { + return false; + } + + @Override + public long getMinimumStoredEU() + { + return getBaseMetaTileEntity().getEUCapacity() / 2; + } + + @Override + public long maxEUInput() + { + return 2048; + } + + @Override + public long maxEUOutput() + { + return 0; + } + + @Override + public long maxEUStore() + { + return 100000; + } + + @Override + public long maxSteamStore() + { + return maxEUStore(); + } + + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) + { + return true; + } + + @Override + public boolean ownerControl() + { + return true; + } + + @Override + public int getProgresstime() + { + return (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this) && (this.isWorking >= 20) ? 999 : 0; + } + + @Override + public int maxProgresstime() + { + return 1000; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) + { + aNBT.setInteger("mFrequency", this.mFrequency); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) + { + this.mFrequency = aNBT.getInteger("mFrequency"); + } + + @Override + public void onConfigLoad(GT_Config aConfig) + { + TESSERACT_ENERGY_COST = 1024; + TESSERACT_ENERGY_COST_DIMENSIONAL = 2048; + } + + @Override + public void onServerStart() + { + sTesseractGenerators.clear(); + } + + public void onServerStop() + { + sTesseractGenerators.clear(); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ){ + if (aSide == getBaseMetaTileEntity().getFrontFacing()){ + float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ); + switch ((byte)((byte)(int)(tCoords[0] * 2.0F) + 2 * (byte)(int)(tCoords[1] * 2.0F))){ + case 0: + Utils.LOG_INFO("Freq. -1 | " + this.mFrequency); + this.mFrequency -= 1; + break; + case 1: + Utils.LOG_INFO("Freq. +1 | " + this.mFrequency); + this.mFrequency += 1; + default: + //Utils.LOG_INFO("Did not click the correct place."); + break; + } + Utils.messagePlayer(aPlayer, "Frequency: " + this.mFrequency); + Utils.messagePlayer(aPlayer, ((sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != null) && (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != this) ? EnumChatFormatting.RED + " (Occupied)" : "")); + } + return true; + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) + { + if (aSide == getBaseMetaTileEntity().getFrontFacing()) + { + float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ); + switch ((byte)((byte)(int)(tCoords[0] * 2.0F) + 2 * (byte)(int)(tCoords[1] * 2.0F))) + { + case 0: + this.mFrequency -= 64; + break; + case 1: + this.mFrequency += 64; + break; + case 2: + this.mFrequency -= 512; + break; + case 3: + this.mFrequency += 512; + } + GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency + ((sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != null) && (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != this) ? EnumChatFormatting.RED + " (Occupied)" : "")); + } + } + + public boolean allowCoverOnSide(byte aSide, int aCoverID) + { + return aSide != getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public String[] getInfoData() + { + TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IGregTechDeviceInformation)) && (((IGregTechDeviceInformation)tTileEntity).isGivingInformation())) { + return ((IGregTechDeviceInformation)tTileEntity).getInfoData(); + } + return new String[] { "Tesseract Generator", "Freqency:", "" + this.mFrequency, (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this) && (this.isWorking >= 20) ? "Active" : "Inactive" }; + } + + @Override + public boolean isGivingInformation() + { + return true; + } + + public boolean isSendingInformation() + { + TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IGregTechDeviceInformation))) { + return ((IGregTechDeviceInformation)tTileEntity).isGivingInformation(); + } + return false; + } + + @Override + public boolean isDigitalChest() + { + TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) { + return ((IDigitalChest)tTileEntity).isDigitalChest(); + } + return false; + } + + @Override + public ItemStack[] getStoredItemData() + { + TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) { + return ((IDigitalChest)tTileEntity).getStoredItemData(); + } + return null; + } + + @Override + public void setItemCount(int aCount) + { + TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) { + ((IDigitalChest)tTileEntity).setItemCount(aCount); + } + } + + @Override + public int getMaxItemCount() + { + TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) { + return ((IDigitalChest)tTileEntity).getMaxItemCount(); + } + return 0; + } + + @Override + public boolean isItemValidForSlot(int aIndex, ItemStack aStack) + { + IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return false; + } + return tTileEntity.isItemValidForSlot(aIndex, aStack); + } + + @Override + public int[] getAccessibleSlotsFromSide(int aSide) + { + IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return new int[0]; + } + if ((tTileEntity instanceof ISidedInventory)) { + return ((ISidedInventory)tTileEntity).getAccessibleSlotsFromSide(aSide); + } + int[] rArray = new int[getSizeInventory()]; + for (int i = 0; i < getSizeInventory(); i++) { + rArray[i] = i; + } + return rArray; + } + + @Override + public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) + { + IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return false; + } + if ((tTileEntity instanceof ISidedInventory)) { + return ((ISidedInventory)tTileEntity).canInsertItem(aIndex, aStack, aSide); + } + return true; + } + + @Override + public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) + { + IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return false; + } + if ((tTileEntity instanceof ISidedInventory)) { + return ((ISidedInventory)tTileEntity).canExtractItem(aIndex, aStack, aSide); + } + return true; + } + + @Override + public int getSizeInventory() + { + IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return 0; + } + return tTileEntity.getSizeInventory(); + } + + @Override + public ItemStack getStackInSlot(int aIndex) + { + IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return null; + } + return tTileEntity.getStackInSlot(aIndex); + } + + @Override + public void setInventorySlotContents(int aIndex, ItemStack aStack) + { + IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return; + } + tTileEntity.setInventorySlotContents(aIndex, aStack); + } + + @Override + public ItemStack decrStackSize(int aIndex, int aAmount) + { + IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return null; + } + return tTileEntity.decrStackSize(aIndex, aAmount); + } + + @Override + public String getInventoryName() + { + IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return ""; + } + return tTileEntity.getInventoryName(); + } + + @Override + public int getInventoryStackLimit() + { + IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return 0; + } + return tTileEntity.getInventoryStackLimit(); + } + + @Override + public boolean canFill(ForgeDirection aSide, Fluid aFluid) + { + IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return false; + } + return tTileEntity.canFill(aSide, aFluid); + } + + @Override + public boolean canDrain(ForgeDirection aSide, Fluid aFluid) + { + IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return false; + } + return tTileEntity.canDrain(aSide, aFluid); + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection aSide) + { + IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return new FluidTankInfo[0]; + } + return tTileEntity.getTankInfo(aSide); + } + + @Override + public int fill_default(ForgeDirection aDirection, FluidStack aFluid, boolean doFill) + { + IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return 0; + } + return tTileEntity.fill(aDirection, aFluid, doFill); + } + + @Override + public FluidStack drain(ForgeDirection aDirection, int maxDrain, boolean doDrain) + { + IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return null; + } + return tTileEntity.drain(aDirection, maxDrain, doDrain); + } + + @Override + public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) + { + IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing()); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return null; + } + return tTileEntity.drain(aSide, aFluid, doDrain); + } + + public boolean addEnergyConsumption(GT_MetaTileEntity_TesseractTerminal aTerminal) + { + if (!getBaseMetaTileEntity().isAllowedToWork()) { + return false; + } + this.mNeededEnergy += (aTerminal.getBaseMetaTileEntity().getWorld() == getBaseMetaTileEntity().getWorld() ? TESSERACT_ENERGY_COST : TESSERACT_ENERGY_COST_DIMENSIONAL); + return true; + } + + public boolean isValidTesseractGenerator(String aOwnerName, boolean aWorkIrrelevant) + { + return (getBaseMetaTileEntity() != null) && (!getBaseMetaTileEntity().isInvalidTileEntity()) && (getBaseMetaTileEntity().isAllowedToWork()) && ((aOwnerName == null) || (getBaseMetaTileEntity().getOwnerName().equals(aOwnerName))) && ((aWorkIrrelevant) || (this.isWorking >= 20)); + } + + public void onPostTick() + { + if (getBaseMetaTileEntity().isServerSide()){ + if (this.mFrequency != this.oFrequency){ + + Utils.LOG_INFO("mFreq != oFreq"); + + if (sTesseractGenerators.get(Integer.valueOf(this.oFrequency)) == this) + { + sTesseractGenerators.remove(Integer.valueOf(this.oFrequency)); + getBaseMetaTileEntity().issueBlockUpdate(); + Utils.LOG_INFO("this Gen == oFreq on map - do block update"); + } + Utils.LOG_INFO("mFreq will be set to oFreq"); + this.oFrequency = this.mFrequency; + } + if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().decreaseStoredEnergyUnits(this.mNeededEnergy, false))) + { + Utils.LOG_INFO("Can Work & Has Energy"); + if ((sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == null) || (!((GT_MetaTileEntity_TesseractGenerator)sTesseractGenerators.get(Integer.valueOf(this.mFrequency))).isValidTesseractGenerator(null, true))) { + Utils.LOG_INFO("storing TE I think to mFreq map?"); + sTesseractGenerators.put(Integer.valueOf(this.mFrequency), this); + } + } + else + { + if (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this) + { + Utils.LOG_INFO("this gen == mFreq on map - do block update"); + sTesseractGenerators.remove(Integer.valueOf(this.mFrequency)); + getBaseMetaTileEntity().issueBlockUpdate(); + } + this.isWorking = 0; + } + if (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this) + { + Utils.LOG_INFO("mFreq == this - do work related things"); + if (this.isWorking < 20) { + this.isWorking = ((byte)(this.isWorking + 1)); + } + if (this.isWorking == 20) + { + getBaseMetaTileEntity().issueBlockUpdate(); + this.isWorking = ((byte)(this.isWorking + 1)); + } + } + else + { + this.isWorking = 0; + } + this.mNeededEnergy = 0; + } + } + + @Override + public String[] getDescription() + { + return new String[] {"Generates a Tesseract for the attached Inventory"}; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + return new ITexture[0][0][0]; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return aSide == aFacing ? new ITexture[]{ new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Dimensional), new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Screen_Frequency)} : new ITexture[]{new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Dimensional), new GT_RenderedTexture(Textures.BlockIcons.VOID)}; + } + + + //To-Do? + @Override + public boolean doesFillContainers() { + return false; + } + + @Override + public boolean doesEmptyContainers() { + return false; + } + + @Override + public boolean canTankBeFilled() { + return false; + } + + @Override + public boolean canTankBeEmptied() { + return false; + } + + @Override + public boolean displaysItemStack() { + return false; + } + + @Override + public boolean displaysStackSize() { + return false; + } +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java new file mode 100644 index 0000000000..8c22b49260 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java @@ -0,0 +1,504 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.automation; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlocks; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; + +public class GT_MetaTileEntity_TesseractTerminal +extends GT_MetaTileEntity_BasicTank +{ + public int mFrequency = 0; + public boolean mDidWork = false; + public static boolean sInterDimensionalTesseractAllowed = true; + + public GT_MetaTileEntity_TesseractTerminal(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 3, ""); + } + + public GT_MetaTileEntity_TesseractTerminal(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 3, aDescription, aTextures); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_TesseractTerminal(mName, mTier, mDescription, mTextures); + } + + @Override + public boolean isTransformerUpgradable() + { + return false; + } + + @Override + public boolean isOverclockerUpgradable() + { + return false; + } + + @Override + public boolean isSimpleMachine() + { + return false; + } + + @Override + public boolean isFacingValid(byte aFacing) + { + return true; + } + + @Override + public boolean isOutputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getBackFacing(); + } + + @Override + public boolean isValidSlot(int aIndex) + { + return false; + } + + @Override + public long getMinimumStoredEU() + { + return getBaseMetaTileEntity().getEUCapacity() / 2; + } + + @Override + public long maxEUInput() + { + return 2048; + } + + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) + { + return true; + } + + @Override + public long maxEUStore() + { + return 100000; + } + + @Override + public long maxSteamStore() + { + return maxEUStore(); + } + + @Override + public boolean ownerControl() + { + return true; + } + + @Override + public int getProgresstime() + { + return getTesseract(this.mFrequency, false) != null ? 999 : 0; + } + + @Override + public int maxProgresstime() + { + return 1000; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) + { + aNBT.setInteger("mFrequency", this.mFrequency); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) + { + this.mFrequency = aNBT.getInteger("mFrequency"); + } + + @Override + public void onConfigLoad(GT_Config aConfig) + { + sInterDimensionalTesseractAllowed = true; + } + + public boolean onRightclick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) + { + if (aSide == getBaseMetaTileEntity().getFrontFacing()) + { + float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ); + switch ((byte)((byte)(int)(tCoords[0] * 2.0F) + 2 * (byte)(int)(tCoords[1] * 2.0F))) + { + case 0: + this.mFrequency -= 1; + break; + case 1: + this.mFrequency += 1; + } + GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency + (getTesseract(this.mFrequency, false) == null ? "" : new StringBuilder().append(EnumChatFormatting.GREEN).append(" (Connected)").toString())); + } + return true; + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) + { + if (aSide == getBaseMetaTileEntity().getFrontFacing()) + { + float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ); + switch ((byte)((byte)(int)(tCoords[0] * 2.0F) + 2 * (byte)(int)(tCoords[1] * 2.0F))) + { + case 0: + this.mFrequency -= 64; + break; + case 1: + this.mFrequency += 64; + break; + case 2: + this.mFrequency -= 512; + break; + case 3: + this.mFrequency += 512; + } + GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency + (getTesseract(this.mFrequency, false) == null ? "" : new StringBuilder().append(EnumChatFormatting.GREEN).append(" (Connected)").toString())); + } + } + + public boolean allowCoverOnSide(byte aSide, int aCoverID) + { + return aSide != getBaseMetaTileEntity().getFrontFacing(); + } + + public GT_MetaTileEntity_TesseractGenerator getTesseract(int aFrequency, boolean aWorkIrrelevant) + { + GT_MetaTileEntity_TesseractGenerator rTesseract = (GT_MetaTileEntity_TesseractGenerator)CORE.sTesseractGenerators.get(Integer.valueOf(aFrequency)); + if (rTesseract == null) { + return null; + } + if (rTesseract.mFrequency != aFrequency) + { + CORE.sTesseractGenerators.put(Integer.valueOf(aFrequency), null);return null; + } + if (!rTesseract.isValidTesseractGenerator(getBaseMetaTileEntity().getOwnerName(), aWorkIrrelevant)) { + return null; + } + if ((!sInterDimensionalTesseractAllowed) && (rTesseract.getBaseMetaTileEntity().getWorld() != getBaseMetaTileEntity().getWorld())) { + return null; + } + return rTesseract; + } + + @Override + public String[] getInfoData() + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && (tTileEntity.isSendingInformation())) { + return tTileEntity.getInfoData(); + } + return new String[] { "Tesseract Generator", "Freqency:", "" + this.mFrequency, getTesseract(this.mFrequency, false) != null ? "Active" : "Inactive" }; + } + + @Override + public boolean isGivingInformation() + { + return true; + } + + @Override + public boolean isDigitalChest() + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return false; + } + return tTileEntity.isDigitalChest(); + } + + @Override + public ItemStack[] getStoredItemData() + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return null; + } + return tTileEntity.getStoredItemData(); + } + + @Override + public void setItemCount(int aCount) + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return; + } + tTileEntity.setItemCount(aCount); + } + + @Override + public int getMaxItemCount() + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return 0; + } + return tTileEntity.getMaxItemCount(); + } + + @Override + public boolean isItemValidForSlot(int aIndex, ItemStack aStack) + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return false; + } + return tTileEntity.isItemValidForSlot(aIndex, aStack); + } + + @Override + public int[] getAccessibleSlotsFromSide(int aSide) + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return new int[0]; + } + return tTileEntity.getAccessibleSlotsFromSide(aSide); + } + + @Override + public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return false; + } + return tTileEntity.canInsertItem(aIndex, aStack, aSide); + } + + @Override + public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return false; + } + return tTileEntity.canExtractItem(aIndex, aStack, aSide); + } + + @Override + public int getSizeInventory() + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return 0; + } + return tTileEntity.getSizeInventory(); + } + + @Override + public ItemStack getStackInSlot(int aIndex) + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return null; + } + return tTileEntity.getStackInSlot(aIndex); + } + + @Override + public void setInventorySlotContents(int aIndex, ItemStack aStack) + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return; + } + tTileEntity.setInventorySlotContents(aIndex, aStack); + } + + @Override + public ItemStack decrStackSize(int aIndex, int aAmount) + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return null; + } + return tTileEntity.decrStackSize(aIndex, aAmount); + } + + @Override + public String getInventoryName() + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return ""; + } + return tTileEntity.getInventoryName(); + } + + @Override + public int getInventoryStackLimit() + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return 0; + } + return tTileEntity.getInventoryStackLimit(); + } + + @Override + public boolean canFill(ForgeDirection aSide, Fluid aFluid) + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return false; + } + return tTileEntity.canFill(aSide, aFluid); + } + + @Override + public boolean canDrain(ForgeDirection aSide, Fluid aFluid) + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return false; + } + return tTileEntity.canDrain(aSide, aFluid); + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection aSide) + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return new FluidTankInfo[0]; + } + return tTileEntity.getTankInfo(aSide); + } + + @Override + public int fill_default(ForgeDirection aDirection, FluidStack aFluid, boolean doFill) + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return 0; + } + return tTileEntity.fill(aDirection, aFluid, doFill); + } + + @Override + public FluidStack drain(ForgeDirection aDirection, int maxDrain, boolean doDrain) + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return null; + } + return tTileEntity.drain(aDirection, maxDrain, doDrain); + } + + @Override + public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain) + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false); + if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) { + return null; + } + return tTileEntity.drain(aSide, aFluid, doDrain); + } + + public void onPostTick() + { + if ((getBaseMetaTileEntity().isServerSide()) && (getBaseMetaTileEntity().isAllowedToWork())) + { + GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, true); + if (tTileEntity != null) + { + tTileEntity.addEnergyConsumption(this); + if ((!this.mDidWork) && (getTesseract(this.mFrequency, false) != null)) + { + this.mDidWork = true; + getBaseMetaTileEntity().issueBlockUpdate(); + } + } + else if (this.mDidWork == true) + { + this.mDidWork = false; + getBaseMetaTileEntity().issueBlockUpdate(); + } + } + } + + @Override + public String[] getDescription() + { + return new String[] {"Accesses Tesseracts remotely"}; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + return new ITexture[0][0][0]; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return aSide == aFacing ? new ITexture[]{new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Dimensional), new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Screen_Frequency)} : new ITexture[]{new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Dimensional), new GT_RenderedTexture(Textures.BlockIcons.VOID)}; + } + + //To-Do? + @Override + public boolean doesFillContainers() { + return false; + } + + @Override + public boolean doesEmptyContainers() { + return false; + } + + @Override + public boolean canTankBeFilled() { + return false; + } + + @Override + public boolean canTankBeEmptied() { + return false; + } + + @Override + public boolean displaysItemStack() { + return false; + } + + @Override + public boolean displaysStackSize() { + return false; + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java index 13ae8e424f..c76afc23be 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java @@ -16,6 +16,7 @@ import gtPlusPlus.core.lib.CORE.configSwitches; import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlocks.CustomIcon; import java.util.ArrayList; import java.util.List; @@ -36,22 +37,14 @@ extends GregtechMeta_MultiBlockBase { private static boolean isDisabled = false; private static ITexture frontFace; private static ITexture frontFaceActive; - private static Textures.BlockIcons.CustomIcon GT9_5_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE5"); - private static Textures.BlockIcons.CustomIcon GT9_5 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST5"); - private static Textures.BlockIcons.CustomIcon GT8_5_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE5"); - private static Textures.BlockIcons.CustomIcon GT8_5 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE5"); + private static CustomIcon GT9_5_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE5"); + private static CustomIcon GT9_5 = new CustomIcon("iconsets/LARGECENTRIFUGE5"); //public static double recipesComplete = 0; public GregtechMetaTileEntityIndustrialCentrifuge(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ frontFaceActive = new GT_RenderedTexture(GT9_5_Active); frontFace = new GT_RenderedTexture(GT9_5); - } - else{ - frontFaceActive = new GT_RenderedTexture(GT8_5_Active); - frontFace = new GT_RenderedTexture(GT8_5); - } } public GregtechMetaTileEntityIndustrialCentrifuge(String aName) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java new file mode 100644 index 0000000000..3d8f8ce61c --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java @@ -0,0 +1,37 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractGenerator; +import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractTerminal; +import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_AdvancedCraftingTable; +import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_BronzeCraftingTable; + +public class Gregtech4Content +{ + + //ID Range 828, 829, 833 - 850 + + public static void run() + { + if (LoadedMods.Gregtech){ + workbenches(); + tesseracts(); + } + } + + private static void workbenches(){ + //Gregtech 4 Workbenches + Utils.LOG_INFO("Gregtech 4 Content | Registering Workbenches."); + GregtechItemList.GT4_Workbench_Bronze.set(new GT_MetaTileEntity_BronzeCraftingTable(828, "workbench.bronze", "Bronze Workbench", 0).getStackForm(1L)); + GregtechItemList.GT4_Workbench_Advanced.set(new GT_MetaTileEntity_AdvancedCraftingTable(829, "workbench.advanced", "Advanced Workbench", 1).getStackForm(1L)); + } + + private static void tesseracts(){ + //Gregtech 4 Workbenches + Utils.LOG_INFO("Gregtech 4 Content | Registering Tesseracts."); + GregtechItemList.GT4_Tesseract_Generator.set(new GT_MetaTileEntity_TesseractGenerator(833, "tesseract.generator", "Tesseract Generator", 4).getStackForm(1L)); + GregtechItemList.GT4_Tesseract_Terminal.set(new GT_MetaTileEntity_TesseractTerminal(834, "tesseract.terminal", "Tesseract Terminal", 4).getStackForm(1L)); + } +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWorkbenches.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWorkbenches.java deleted file mode 100644 index 4486bc5cd5..0000000000 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWorkbenches.java +++ /dev/null @@ -1,29 +0,0 @@ -package gtPlusPlus.xmod.gregtech.registration.gregtech; - -import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_AdvancedCraftingTable; -import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_BronzeCraftingTable; - -public class GregtechWorkbenches -{ - public static void run() - { - if (LoadedMods.Gregtech){ - Utils.LOG_INFO("Gregtech5u Content | Registering Workbenches."); - run1(); - //run2(); - } - - } - - private static void run1() - { - //Gregtech 4 Workbenches - GregtechItemList.GT4_Workbench_Bronze.set(new GT_MetaTileEntity_BronzeCraftingTable(828, "workbench.bronze", "Bronze Workbench", 0).getStackForm(1L)); - GregtechItemList.GT4_Workbench_Advanced.set(new GT_MetaTileEntity_AdvancedCraftingTable(829, "workbench.advanced", "Advanced Workbench", 1).getStackForm(1L)); - - - } -} diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_dimensional.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_dimensional.png new file mode 100644 index 0000000000..d391da4eaf Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_dimensional.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_dimensional.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_dimensional.png.mcmeta new file mode 100644 index 0000000000..60af678259 --- /dev/null +++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_dimensional.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":4 + } +} \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_frequency.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_frequency.png new file mode 100644 index 0000000000..0db2d5da9b Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_frequency.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random1.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random1.png new file mode 100644 index 0000000000..7157b7541d Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random1.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random1.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random1.png.mcmeta new file mode 100644 index 0000000000..60af678259 --- /dev/null +++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random1.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":4 + } +} \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random2.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random2.png new file mode 100644 index 0000000000..7157b7541d Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random2.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random2.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random2.png.mcmeta new file mode 100644 index 0000000000..97596ba817 --- /dev/null +++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random2.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":2 + } +} \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random3.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random3.png new file mode 100644 index 0000000000..7157b7541d Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random3.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random3.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random3.png.mcmeta new file mode 100644 index 0000000000..dfae8cae16 --- /dev/null +++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random3.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":1 + } +} \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/high_adv_machine_dimensional.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/high_adv_machine_dimensional.png new file mode 100644 index 0000000000..fe779e8a9e Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/high_adv_machine_dimensional.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/high_adv_machine_dimensional.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/high_adv_machine_dimensional.png.mcmeta new file mode 100644 index 0000000000..60af678259 --- /dev/null +++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/high_adv_machine_dimensional.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation":{ + "frametime":4 + } +} \ No newline at end of file -- cgit From a9d22d7d85ba567cacc83e22cecae06ceb1e4936 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Thu, 20 Oct 2016 02:52:06 +1000 Subject: $ Fixed Workbench recipe not using correct machine casing. $ Fixed the Extruder and the Alloy smelter eating the shaping molds. $ Fixed .09 recipes for cells. % Changed the recipes for the Geothermal Engines and Rocket Engines. --- src/Java/gtPlusPlus/core/material/Material.java | 8 ++++++++ src/Java/gtPlusPlus/core/recipe/RECIPES_General.java | 3 +-- .../xmod/gregtech/common/items/MetaGeneratedGregtechItems.java | 8 ++++---- src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java | 4 ++-- .../gregtech/GregtechGeothermalThermalGenerator.java | 9 +++++---- .../registration/gregtech/GregtechRocketFuelGenerator.java | 7 ++++--- 6 files changed, 24 insertions(+), 15 deletions(-) (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 0902bf62f9..3e5c3a4d67 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -174,6 +174,14 @@ public class Material { public ItemStack getPlateDouble(int stacksize){ return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("plateDouble"+unlocalizedName, stacksize); } + + public ItemStack getGear(int stacksize){ + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("gear"+unlocalizedName, stacksize); + } + + public ItemStack getRod(int stacksize){ + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("stick"+unlocalizedName, stacksize); + } public ItemStack[] getMaterialComposites(){ //Utils.LOG_INFO("Something requested the materials needed for "+localizedName); diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java index 9a396334d4..1d17bee204 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java @@ -1,6 +1,5 @@ package gtPlusPlus.core.recipe; -import gregtech.api.enums.ItemList; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.LoadedMods; @@ -25,7 +24,7 @@ public class RECIPES_General { public static void RECIPES_LOAD(){ if (LoadedMods.Gregtech){ - RECIPE_BasicCasingIC2 = ItemList.Casing_Gearbox_Bronze.get(1); + RECIPE_BasicCasingIC2 = UtilsItems.getItemStack("IC2:blockMachine", 1); run(); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java index 4956327fa8..7dd6ddd2ab 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java @@ -192,10 +192,10 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { setFluidContainerStats(32000 + tLastID, 1L, 64L); if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.WroughtIron, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.WroughtIron, 1L), GregtechItemList.Fluid_Cell_1L.get(1L, new Object[0]), 50, 32); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Bronze, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Bronze, 1L), GregtechItemList.Fluid_Cell_16L.get(1L, new Object[0]), 50, 32); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Brass, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Brass, 1L), GregtechItemList.Fluid_Cell_36L.get(1L, new Object[0]), 75, 32); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Invar, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Invar, 1L), GregtechItemList.Fluid_Cell_144L.get(1L, new Object[0]), 75, 32); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.WroughtIron, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.WroughtIron, 2L), GregtechItemList.Fluid_Cell_1L.get(1L, new Object[0]), 50, 32); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Bronze, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Bronze, 2L), GregtechItemList.Fluid_Cell_16L.get(1L, new Object[0]), 50, 32); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Brass, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Brass, 2L), GregtechItemList.Fluid_Cell_36L.get(1L, new Object[0]), 75, 32); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Invar, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Invar, 2L), GregtechItemList.Fluid_Cell_144L.get(1L, new Object[0]), 75, 32); } else { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java index 6d84abe37b..627cba7064 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java @@ -16,8 +16,8 @@ public class RecipeGen_Plates { int tVoltageMultiplier = material.getMeltingPoint_K() >= 2800 ? 64 : 16; ItemStack ingotStackOne = material.getIngot(1); ItemStack ingotStackTwo = material.getIngot(2); - ItemStack shape_Mold = ItemList.Shape_Mold_Plate.get(1); - ItemStack shape_Extruder = ItemList.Shape_Extruder_Plate.get(1); + ItemStack shape_Mold = ItemList.Shape_Mold_Plate.get(0); + ItemStack shape_Extruder = ItemList.Shape_Extruder_Plate.get(0); ItemStack plate_Single = material.getPlate(1); ItemStack plate_SingleTwo = material.getPlate(2); ItemStack plate_Double = material.getPlateDouble(1); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java index 961abedc8d..844ba03ec9 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java @@ -5,6 +5,7 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.recipe.RECIPE_CONSTANTS; import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; @@ -38,7 +39,7 @@ public class GregtechGeothermalThermalGenerator { Character.valueOf('E'), ItemList.Electric_Motor_EV, Character.valueOf('C'), GregtechOrePrefixes.circuit.get(Materials.Ultimate), Character.valueOf('W'), OrePrefixes.cableGt04.get(Materials.Aluminium), - Character.valueOf('G'), OrePrefixes.gearGt.get(Materials.Titanium)}); + Character.valueOf('G'), ALLOY.TANTALLOY_61.getGear(1)}); GT_ModHandler.addCraftingRecipe(GregtechItemList.Geothermal_Engine_IV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, @@ -48,7 +49,7 @@ public class GregtechGeothermalThermalGenerator { Character.valueOf('E'), ItemList.Electric_Motor_IV, Character.valueOf('C'), GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic), Character.valueOf('W'), OrePrefixes.cableGt04.get(Materials.Platinum), - Character.valueOf('G'), OrePrefixes.gearGt.get(Materials.TungstenSteel)}); + Character.valueOf('G'), ALLOY.STELLITE.getGear(1)}); final ItemStack INGREDIENT_1 = RECIPE_CONSTANTS.electricPiston_LuV; final ItemStack INGREDIENT_2 = RECIPE_CONSTANTS.electricMotor_LuV; @@ -59,8 +60,8 @@ public class GregtechGeothermalThermalGenerator { Character.valueOf('P'), INGREDIENT_1, Character.valueOf('E'), INGREDIENT_2, Character.valueOf('C'), GregtechOrePrefixes.circuit.get(GT_Materials.Neutronic), - Character.valueOf('W'), OrePrefixes.cableGt04.get(Materials.Tungsten), - Character.valueOf('G'), OrePrefixes.gearGt.get(Materials.Chrome)}); + Character.valueOf('W'), OrePrefixes.cableGt04.get(Materials.Tungsten), + Character.valueOf('G'), ALLOY.ZERON_100.getGear(1)}); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java index dc9173a502..f75a44bf8b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java @@ -5,6 +5,7 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.recipe.RECIPE_CONSTANTS; import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; @@ -38,7 +39,7 @@ public class GregtechRocketFuelGenerator { Character.valueOf('E'), ItemList.Electric_Motor_EV, Character.valueOf('C'), GregtechOrePrefixes.circuit.get(Materials.Ultimate), Character.valueOf('W'), OrePrefixes.cableGt02.get(Materials.Aluminium), - Character.valueOf('G'), OrePrefixes.gearGt.get(Materials.Titanium)}); + Character.valueOf('G'), ALLOY.TANTALLOY_61.getGear(1)}); GT_ModHandler.addCraftingRecipe(GregtechItemList.Rocket_Engine_IV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, @@ -48,7 +49,7 @@ public class GregtechRocketFuelGenerator { Character.valueOf('E'), ItemList.Electric_Motor_IV, Character.valueOf('C'), GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic), Character.valueOf('W'), OrePrefixes.cableGt02.get(Materials.Platinum), - Character.valueOf('G'), OrePrefixes.gearGt.get(Materials.TungstenSteel)}); + Character.valueOf('G'), ALLOY.STELLITE.getGear(1)}); final ItemStack INGREDIENT_1 = RECIPE_CONSTANTS.electricPiston_LuV; final ItemStack INGREDIENT_2 = RECIPE_CONSTANTS.electricMotor_LuV; @@ -60,7 +61,7 @@ public class GregtechRocketFuelGenerator { Character.valueOf('E'), INGREDIENT_2, Character.valueOf('C'), GregtechOrePrefixes.circuit.get(GT_Materials.Neutronic), Character.valueOf('W'), OrePrefixes.cableGt02.get(Materials.Tungsten), - Character.valueOf('G'), OrePrefixes.gearGt.get(Materials.Chrome)}); + Character.valueOf('G'), ALLOY.ZERON_100.getGear(1)}); } } -- cgit From d6c2e9fd582594f9e19f732398d1c16d20d3b38e Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Thu, 20 Oct 2016 20:04:45 +1000 Subject: + Added the Advanced workbench. + Added custom slots for the Adv. Workbench, that take either tools or IElectricItems. % Swapped the textures on most multiblocks/casings. --- src/Java/gtPlusPlus/core/block/ModBlocks.java | 3 + .../core/block/machine/Machine_Workbench.java | 67 +++- .../block/machine/Machine_WorkbenchAdvanced.java | 115 ++++++ .../core/container/Container_Workbench.java | 56 +-- .../container/Container_WorkbenchAdvanced.java | 384 +++++++++++++++++++++ .../core/gui/machine/GUI_WorkbenchAdvanced.java | 41 +++ src/Java/gtPlusPlus/core/handler/GuiHandler.java | 14 +- .../InventoryWorkbenchToolsElectric.java | 191 ++++++++++ .../item/base/itemblock/ItemBlockTileEntity.java | 43 +++ .../gtPlusPlus/core/recipe/RECIPES_General.java | 2 +- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 18 +- .../gtPlusPlus/core/slots/SlotGtToolElectric.java | 98 ++++++ .../core/tileentities/ModTileEntities.java | 2 + .../tileentities/machines/TileEntityWorkbench.java | 121 +++++-- .../machines/TileEntityWorkbenchAdvanced.java | 249 +++++++++++++ src/Java/gtPlusPlus/core/util/item/UtilsItems.java | 37 ++ .../blocks/textures/CasingTextureHandler.java | 12 +- .../common/blocks/textures/TexturesGtBlocks.java | 18 +- 18 files changed, 1386 insertions(+), 85 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java create mode 100644 src/Java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java create mode 100644 src/Java/gtPlusPlus/core/gui/machine/GUI_WorkbenchAdvanced.java create mode 100644 src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchToolsElectric.java create mode 100644 src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockTileEntity.java create mode 100644 src/Java/gtPlusPlus/core/slots/SlotGtToolElectric.java create mode 100644 src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbenchAdvanced.java (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gtPlusPlus/core/block/ModBlocks.java b/src/Java/gtPlusPlus/core/block/ModBlocks.java index b7a2526e30..af7e5d833e 100644 --- a/src/Java/gtPlusPlus/core/block/ModBlocks.java +++ b/src/Java/gtPlusPlus/core/block/ModBlocks.java @@ -2,6 +2,7 @@ package gtPlusPlus.core.block; import gtPlusPlus.core.block.general.LightGlass; import gtPlusPlus.core.block.machine.Machine_Workbench; +import gtPlusPlus.core.block.machine.Machine_WorkbenchAdvanced; import gtPlusPlus.core.fluids.FluidRegistryHandler; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; @@ -13,6 +14,7 @@ import cpw.mods.fml.common.registry.GameRegistry; public final class ModBlocks { public static Block blockWorkbench; + public static Block blockWorkbenchAdvanced; //Blocks //public static Block blockBloodSteel; //public static Block blockStaballoy; @@ -48,6 +50,7 @@ public final class ModBlocks { //Workbench blockWorkbench = new Machine_Workbench().setHardness(1.5F); + blockWorkbenchAdvanced = new Machine_WorkbenchAdvanced().setHardness(2.5F); } diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java b/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java index 270d0d1820..212e9154be 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java @@ -1,20 +1,27 @@ package gtPlusPlus.core.block.machine; +import gregtech.api.items.GT_MetaGenerated_Tool; import gtPlusPlus.GTplusplus; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.item.UtilsItems; +import ic2.core.item.tool.ItemToolWrench; 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.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; +import buildcraft.api.tools.IToolWrench; 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 crazypants.enderio.api.tool.ITool; public class Machine_Workbench extends BlockContainer { @@ -32,7 +39,7 @@ public class Machine_Workbench extends BlockContainer this.setBlockName("blockWorkbenchGT"); this.setCreativeTab(AddToCreativeTab.tabMachines); GameRegistry.registerBlock(this, "blockWorkbenchGT"); - LanguageRegistry.addName(this, "Gregtech Workbench"); + LanguageRegistry.addName(this, "Bronze Workbench"); } @@ -50,10 +57,10 @@ public class Machine_Workbench extends BlockContainer @SideOnly(Side.CLIENT) public void registerBlockIcons(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"); + 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"); } /** @@ -61,17 +68,45 @@ public class Machine_Workbench extends BlockContainer */ @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, float lz) - { - if (world.isRemote) return true; - - TileEntity te = world.getTileEntity(x, y, z); - if (te != null && te instanceof TileEntityWorkbench) - { - player.openGui(GTplusplus.instance, 3, world, x, y, z); - return true; - } - return false; - } + { + if (world.isRemote) return true; + + ItemStack heldItem = UtilsItems.getItemStackInPlayersHand(); + 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; + } + } + + + 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; + } + Utils.LOG_INFO("Holding a Wrench, doing wrench things instead."); + } + return false; + } @Override public TileEntity createNewTileEntity(World world, int p_149915_2_) { diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java b/src/Java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java new file mode 100644 index 0000000000..46c08c0d4d --- /dev/null +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java @@ -0,0 +1,115 @@ +package gtPlusPlus.core.block.machine; + +import gregtech.api.items.GT_MetaGenerated_Tool; +import gtPlusPlus.GTplusplus; +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.item.UtilsItems; +import ic2.core.item.tool.ItemToolWrench; +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.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import buildcraft.api.tools.IToolWrench; +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 crazypants.enderio.api.tool.ITool; + +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(int p_149691_1_, 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(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(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, float lz) + { + if (world.isRemote) return true; + + ItemStack heldItem = UtilsItems.getItemStackInPlayersHand(); + 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; + } + } + + + 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(World world, int p_149915_2_) { + return new TileEntityWorkbenchAdvanced(128000, 2); + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/container/Container_Workbench.java b/src/Java/gtPlusPlus/core/container/Container_Workbench.java index aa1fd1b509..6e68eb7338 100644 --- a/src/Java/gtPlusPlus/core/container/Container_Workbench.java +++ b/src/Java/gtPlusPlus/core/container/Container_Workbench.java @@ -9,8 +9,8 @@ import gtPlusPlus.core.inventories.InventoryWorkbenchHoloSlots; import gtPlusPlus.core.inventories.InventoryWorkbenchTools; import gtPlusPlus.core.item.general.ItemBlueprint; import gtPlusPlus.core.slots.SlotBlueprint; -import gtPlusPlus.core.slots.SlotGeneric; import gtPlusPlus.core.slots.SlotGtTool; +import gtPlusPlus.core.slots.SlotNoInput; import gtPlusPlus.core.slots.SlotOutput; import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench; import gtPlusPlus.core.util.Utils; @@ -108,8 +108,8 @@ public class Container_Workbench extends Container { addSlotToContainer(new SlotOutput(inventory.player, this.craftMatrix, tile.inventoryCraftResult, 0, 136, 64)); //Util Slots addSlotToContainer(new SlotBlueprint(inventoryHolo, 1, 136, 28)); //Blueprint - addSlotToContainer(new GT_Slot_Holo(inventoryHolo, 2, 154, 28, false, false, 1)); //Hopper - addSlotToContainer(new SlotGeneric(inventoryHolo, 3, 154, 64)); //Parking + addSlotToContainer(new SlotNoInput(inventoryHolo, 2, 154, 28)); //Hopper + addSlotToContainer(new GT_Slot_Holo(inventoryHolo, 3, 154, 64, false, false, 64)); //Parking //Holo Slots addSlotToContainer(new GT_Slot_Holo(inventoryHolo, 4, 154, 46, false, false, 1)); addSlotToContainer(new GT_Slot_Holo(inventoryHolo, 5, 136, 46, false, false, 1)); @@ -146,7 +146,7 @@ public class Container_Workbench extends Container { { for (var7 = 0; var7 < 4; ++var7) { - //Utils.LOG_INFO("Adding slots at var:"+(var7 + var6 * 4)+" x:"+(8 + var7 * 18)+" y:"+(7 + var6 * 18)); + //Utils.LOG_WARNING("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)); slotStorage[o] = o+15; o++; @@ -190,82 +190,82 @@ public class Container_Workbench extends Container { if (!aPlayer.worldObj.isRemote){ if (aSlotIndex == 999 || aSlotIndex == -999){ - //Utils.LOG_INFO("??? - "+aSlotIndex); + //Utils.LOG_WARNING("??? - "+aSlotIndex); } if (aSlotIndex == slotOutput){ - Utils.LOG_INFO("Player Clicked on the output slot"); + Utils.LOG_WARNING("Player Clicked on the output slot"); //TODO } for (int x : slotHolo){ if (aSlotIndex == x){ - Utils.LOG_INFO("Player Clicked slot "+aSlotIndex+" in the Holo Grid"); + Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Holo Grid"); if (x == 1){ - Utils.LOG_INFO("Player Clicked Blueprint slot in the Holo Grid"); + Utils.LOG_WARNING("Player Clicked Blueprint slot in the Holo Grid"); } else if (x == 2){ - Utils.LOG_INFO("Player Clicked Right Arrow slot in the Holo Grid"); + Utils.LOG_WARNING("Player Clicked Right Arrow slot in the Holo Grid"); if (inventoryHolo.getStackInSlot(1) != null){ - Utils.LOG_INFO("Found an ItemStack."); + Utils.LOG_WARNING("Found an ItemStack."); if (inventoryHolo.getStackInSlot(1).getItem() instanceof IItemBlueprint){ - Utils.LOG_INFO("Found a blueprint."); + Utils.LOG_WARNING("Found a blueprint."); ItemStack tempBlueprint = inventoryHolo.getStackInSlot(1); ItemBlueprint tempItemBlueprint = (ItemBlueprint) tempBlueprint.getItem(); if (inventoryHolo.getStackInSlot(0) != null && !tempItemBlueprint.hasBlueprint(tempBlueprint)){ - Utils.LOG_INFO("Output slot was not empty."); - Utils.LOG_INFO("Trying to manipulate NBT data on the blueprint stack, then replace it with the new one."); + Utils.LOG_WARNING("Output slot was not empty."); + Utils.LOG_WARNING("Trying to manipulate NBT data on the blueprint stack, then replace it with the new one."); tempItemBlueprint.setBlueprint(inventoryHolo.getStackInSlot(1), craftMatrix, inventoryHolo.getStackInSlot(0)); ItemStack newTempBlueprint = UtilsItems.getSimpleStack(tempItemBlueprint); inventoryHolo.setInventorySlotContents(1, newTempBlueprint); - Utils.LOG_INFO(UtilsItems.getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint))); + Utils.LOG_WARNING(UtilsItems.getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint))); } else { if (tempItemBlueprint.hasBlueprint(tempBlueprint)){ - Utils.LOG_INFO("Blueprint already holds a recipe."); + Utils.LOG_WARNING("Blueprint already holds a recipe."); } else { - Utils.LOG_INFO("Output slot was empty."); + Utils.LOG_WARNING("Output slot was empty."); } } } else { - Utils.LOG_INFO("ItemStack found was not a blueprint."); + Utils.LOG_WARNING("ItemStack found was not a blueprint."); } } else { - Utils.LOG_INFO("No ItemStack found in Blueprint slot."); + Utils.LOG_WARNING("No ItemStack found in Blueprint slot."); } } else if (x == 3){ - Utils.LOG_INFO("Player Clicked Big [P] slot in the Holo Grid"); + Utils.LOG_WARNING("Player Clicked Big [P] slot in the Holo Grid"); } else if (x == 4){ - Utils.LOG_INFO("Player Clicked Transfer to Crafting Grid slot in the Holo Grid"); + Utils.LOG_WARNING("Player Clicked Transfer to Crafting Grid slot in the Holo Grid"); } else if (x == 5){ - Utils.LOG_INFO("Player Clicked Transfer to Storage Grid slot in the Holo Grid"); + Utils.LOG_WARNING("Player Clicked Transfer to Storage Grid slot in the Holo Grid"); } } } for (int x : slotCrafting){ if (aSlotIndex == x){ - Utils.LOG_INFO("Player Clicked slot "+aSlotIndex+" in the crafting Grid"); + Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the crafting Grid"); } } for (int x : slotStorage){ if (aSlotIndex == x){ - Utils.LOG_INFO("Player Clicked slot "+aSlotIndex+" in the storage Grid"); + Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the storage Grid"); } } for (int x : slotTools){ if (aSlotIndex == x){ - Utils.LOG_INFO("Player Clicked slot "+aSlotIndex+" in the tool Grid"); + Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the tool Grid"); } } } - //Utils.LOG_INFO("Player Clicked slot "+aSlotIndex+" in the Grid"); + //Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid"); return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } @@ -302,14 +302,14 @@ public class Container_Workbench extends Container { //craftResult.setInventorySlotContents(0, Workbench_CraftingHandler.getInstance().findMatchingRecipe(craftMatrix, worldObj)); //Vanilla CraftingManager - Utils.LOG_INFO("checking crafting grid for a valid output."); + Utils.LOG_WARNING("checking crafting grid for a valid output."); ItemStack temp = CraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj); if (temp != null){ - Utils.LOG_INFO("Output found. "+temp.getDisplayName()+" x"+temp.stackSize); + Utils.LOG_WARNING("Output found. "+temp.getDisplayName()+" x"+temp.stackSize); craftResult.setInventorySlotContents(slotOutput, temp); } else { - Utils.LOG_INFO("No Valid output found."); + Utils.LOG_WARNING("No Valid output found."); craftResult.setInventorySlotContents(slotOutput, null); } }*/ diff --git a/src/Java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java b/src/Java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java new file mode 100644 index 0000000000..17ec451056 --- /dev/null +++ b/src/Java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java @@ -0,0 +1,384 @@ +package gtPlusPlus.core.container; + +import gregtech.api.gui.GT_Slot_Holo; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.interfaces.IItemBlueprint; +import gtPlusPlus.core.inventories.InventoryWorkbenchChest; +import gtPlusPlus.core.inventories.InventoryWorkbenchHoloCrafting; +import gtPlusPlus.core.inventories.InventoryWorkbenchHoloSlots; +import gtPlusPlus.core.inventories.InventoryWorkbenchToolsElectric; +import gtPlusPlus.core.item.general.ItemBlueprint; +import gtPlusPlus.core.slots.SlotBlueprint; +import gtPlusPlus.core.slots.SlotGtToolElectric; +import gtPlusPlus.core.slots.SlotNoInput; +import gtPlusPlus.core.slots.SlotOutput; +import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.item.UtilsItems; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.world.World; + +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 World worldObj; + private int posX; + private int posY; + private 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 int slotOutput = 0; + private int[] slotHolo = new int[5]; + private int[] slotCrafting = new int[9]; + private int[] slotStorage = new int[16]; + private int[] slotTools = new int[5]; + + public Container_WorkbenchAdvanced(InventoryPlayer inventory, 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; + worldObj = tile.getWorldObj(); + posX = tile.xCoord; + posY = tile.yCoord; + posZ = tile.zCoord; + + int o=0; + + //Output slot + addSlotToContainer(new SlotOutput(inventory.player, this.craftMatrix, tile.inventoryCraftResult, 0, 136, 64)); + //Util Slots + addSlotToContainer(new SlotBlueprint(inventoryHolo, 1, 136, 28)); //Blueprint + addSlotToContainer(new SlotNoInput(inventoryHolo, 2, 154, 28)); //Hopper + addSlotToContainer(new GT_Slot_Holo(inventoryHolo, 3, 154, 64, false, false, 64)); //Parking + //Holo Slots + addSlotToContainer(new GT_Slot_Holo(inventoryHolo, 4, 154, 46, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(inventoryHolo, 5, 136, 46, false, false, 1)); + + for (int i=1; i<6; i++){ + slotHolo[o] = o+1; + o++; + } + + o=0; + + 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); + } */ + 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(inventoryChest, var7 + var6 * 4, 8 + var7 * 18, 7 + var6 * 18)); + slotStorage[o] = o+15; + o++; + } + } + + o=0; + + //Tool Slots + for (var6 = 0; var6 < 1; ++var6) + { + for (var7 = 0; var7 < 5; ++var7) + { + this.addSlotToContainer(new SlotGtToolElectric(inventoryTool, var7 + var6 * 3, 82 + var7 * 18, 8 + var6 * 18, 3, false)); + 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(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer){ + + if (!aPlayer.worldObj.isRemote){ + if (aSlotIndex == 999 || aSlotIndex == -999){ + //Utils.LOG_WARNING("??? - "+aSlotIndex); + } + + if (aSlotIndex == slotOutput){ + Utils.LOG_WARNING("Player Clicked on the output slot"); + //TODO + } + + for (int x : slotHolo){ + if (aSlotIndex == x){ + Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Holo Grid"); + if (x == 1){ + Utils.LOG_WARNING("Player Clicked Blueprint slot in the Holo Grid"); + } + else if (x == 2){ + Utils.LOG_WARNING("Player Clicked Right Arrow slot in the Holo Grid"); + if (inventoryHolo.getStackInSlot(1) != null){ + Utils.LOG_WARNING("Found an ItemStack."); + if (inventoryHolo.getStackInSlot(1).getItem() instanceof IItemBlueprint){ + Utils.LOG_WARNING("Found a blueprint."); + ItemStack tempBlueprint = inventoryHolo.getStackInSlot(1); + ItemBlueprint tempItemBlueprint = (ItemBlueprint) tempBlueprint.getItem(); + if (inventoryHolo.getStackInSlot(0) != null && !tempItemBlueprint.hasBlueprint(tempBlueprint)){ + Utils.LOG_WARNING("Output slot was not empty."); + Utils.LOG_WARNING("Trying to manipulate NBT data on the blueprint stack, then replace it with the new one."); + tempItemBlueprint.setBlueprint(inventoryHolo.getStackInSlot(1), craftMatrix, inventoryHolo.getStackInSlot(0)); + ItemStack newTempBlueprint = UtilsItems.getSimpleStack(tempItemBlueprint); + inventoryHolo.setInventorySlotContents(1, newTempBlueprint); + Utils.LOG_WARNING(UtilsItems.getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint))); + } + else { + if (tempItemBlueprint.hasBlueprint(tempBlueprint)){ + Utils.LOG_WARNING("Blueprint already holds a recipe."); + } + else { + Utils.LOG_WARNING("Output slot was empty."); + } + } + } + else { + Utils.LOG_WARNING("ItemStack found was not a blueprint."); + } + } + else { + Utils.LOG_WARNING("No ItemStack found in Blueprint slot."); + } + } + else if (x == 3){ + Utils.LOG_WARNING("Player Clicked Big [P] slot in the Holo Grid"); + } + else if (x == 4){ + Utils.LOG_WARNING("Player Clicked Transfer to Crafting Grid slot in the Holo Grid"); + } + else if (x == 5){ + Utils.LOG_WARNING("Player Clicked Transfer to Storage Grid slot in the Holo Grid"); + } + } + } + + for (int x : slotCrafting){ + if (aSlotIndex == x){ + Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the crafting Grid"); + } + } + for (int x : slotStorage){ + if (aSlotIndex == x){ + Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the storage Grid"); + } + } + for (int x : slotTools){ + if (aSlotIndex == x){ + Utils.LOG_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 < craftMatrix.getSizeInventory(); i++) { + craftMatrix.setInventorySlotContents(i, tile_entity.inventoryCrafting.getStackInSlot(i)); + } + } + + @Override + public void onCraftMatrixChanged(IInventory iiventory) { + tile_entity.inventoryCraftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj)); + } + + @Override + public void onContainerClosed(EntityPlayer par1EntityPlayer) + { + super.onContainerClosed(par1EntityPlayer); + saveCraftingMatrix(); + } + + private void saveCraftingMatrix() { + for (int i = 0; i < craftMatrix.getSizeInventory(); i++) { + tile_entity.inventoryCrafting.setInventorySlotContents(i, 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= 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(ItemStack p_94530_1_, Slot p_94530_2_) { + return p_94530_2_.inventory != tile_entity.inventoryCraftResult && super.func_94530_a(p_94530_1_, p_94530_2_); + } + + +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_WorkbenchAdvanced.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_WorkbenchAdvanced.java new file mode 100644 index 0000000000..5c04acf13b --- /dev/null +++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_WorkbenchAdvanced.java @@ -0,0 +1,41 @@ +package gtPlusPlus.core.gui.machine; + +import gtPlusPlus.core.container.Container_WorkbenchAdvanced; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class GUI_WorkbenchAdvanced extends GuiContainer { + + private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/AdvancedCraftingTable.png"); + + public GUI_WorkbenchAdvanced(InventoryPlayer player_inventory, TileEntityWorkbenchAdvanced tile){ + super(new Container_WorkbenchAdvanced(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); + } + + + @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); + } + +} \ 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 dc1903e83d..c2b120d428 100644 --- a/src/Java/gtPlusPlus/core/handler/GuiHandler.java +++ b/src/Java/gtPlusPlus/core/handler/GuiHandler.java @@ -3,14 +3,17 @@ package gtPlusPlus.core.handler; import gtPlusPlus.GTplusplus; import gtPlusPlus.core.container.Container_BackpackBase; import gtPlusPlus.core.container.Container_Workbench; +import gtPlusPlus.core.container.Container_WorkbenchAdvanced; import gtPlusPlus.core.gui.beta.Gui_ID_Registry; import gtPlusPlus.core.gui.beta.MU_GuiId; import gtPlusPlus.core.gui.item.GuiBaseBackpack; import gtPlusPlus.core.gui.machine.GUI_Workbench; +import gtPlusPlus.core.gui.machine.GUI_WorkbenchAdvanced; import gtPlusPlus.core.interfaces.IGuiManager; import gtPlusPlus.core.inventories.BaseInventoryBackpack; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench; +import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced; import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.forestry.bees.alveary.TileAlvearyFrameHousing; import gtPlusPlus.xmod.forestry.bees.alveary.gui.CONTAINER_FrameHousing; @@ -28,7 +31,7 @@ public class GuiHandler implements IGuiHandler { public static final int GUI2 = 1; //RTG public static final int GUI3 = 2; //BackpackHandler public static final int GUI4 = 3; //Workbench - public static final int GUI5 = 4; // + public static final int GUI5 = 4; //Workbench Adv public static final int GUI6 = 5; // public static final int GUI7 = 6; // public static final int GUI8 = 7; // @@ -73,6 +76,11 @@ public class GuiHandler implements IGuiHandler { return new Container_Workbench(player.inventory, (TileEntityWorkbench)te); } + if (ID == GUI5){ + Utils.LOG_INFO("sad"); + return new Container_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced)te); + + } } @@ -112,6 +120,10 @@ public class GuiHandler implements IGuiHandler { if (ID == GUI4){ return new GUI_Workbench(player.inventory, (TileEntityWorkbench)te); } + if (ID == GUI5){ + Utils.LOG_INFO("sad"); + return new GUI_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced)te); + } } return null; diff --git a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchToolsElectric.java b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchToolsElectric.java new file mode 100644 index 0000000000..77f3351e59 --- /dev/null +++ b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchToolsElectric.java @@ -0,0 +1,191 @@ +package gtPlusPlus.core.inventories; + +import gregtech.api.items.GT_MetaGenerated_Tool; +import gtPlusPlus.core.slots.SlotGtToolElectric; +import ic2.api.item.IElectricItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + +public class InventoryWorkbenchToolsElectric implements IInventory{ + + private String name = "Inventory Tools"; + + /** Defining your inventory size this way is handy */ + public static final int INV_SIZE = 5; + + /** Inventory's size must be same as number of slots you add to the Container class */ + private ItemStack[] inventory = new ItemStack[INV_SIZE]; + private Slot[] toolSlots = new SlotGtToolElectric[INV_SIZE]; //TODO + + /** + * @param itemstack - the ItemStack to which this inventory belongs + */ + public InventoryWorkbenchToolsElectric() + { + + } + + public void readFromNBT(NBTTagCompound nbt) + { + NBTTagList list = nbt.getTagList("Items", 10); + inventory = new ItemStack[INV_SIZE]; + for(int i = 0;i= 0 && slot < INV_SIZE) + { + inventory[slot] = ItemStack.loadItemStackFromNBT(data); + } + } + } + + public void writeToNBT(NBTTagCompound nbt) + { + NBTTagList list = new NBTTagList(); + for(int i = 0;i amount) + { + stack = stack.splitStack(amount); + // Don't forget this line or your inventory will not be saved! + markDirty(); + } + else + { + // this method also calls markDirty, so we don't need to call it again + setInventorySlotContents(slot, null); + } + } + return stack; + } + + @Override + public ItemStack getStackInSlotOnClosing(int slot) + { + ItemStack stack = getStackInSlot(slot); + setInventorySlotContents(slot, null); + return stack; + } + + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory[slot] = stack; + + if (stack != null && stack.stackSize > getInventoryStackLimit()) + { + stack.stackSize = getInventoryStackLimit(); + } + + // Don't forget this line or your inventory will not be saved! + markDirty(); + } + + // 1.7.2+ renamed to getInventoryName + @Override + public String getInventoryName() + { + return name; + } + + // 1.7.2+ renamed to hasCustomInventoryName + @Override + public boolean hasCustomInventoryName() + { + return name.length() > 0; + } + + @Override + public int getInventoryStackLimit() + { + return 1; + } + + /** + * This is the method that will handle saving the inventory contents, as it is called (or should be called!) + * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also + * let you change things in your inventory without ever opening a Gui, if you want. + */ + // 1.7.2+ renamed to markDirty + @Override + public void markDirty() + { + for (int i = 0; i < getSizeInventory(); ++i) + { + if (getStackInSlot(i) != null && getStackInSlot(i).stackSize == 0) { + inventory[i] = null; + } + } + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) + { + return true; + } + + // 1.7.2+ renamed to openInventory(EntityPlayer player) + @Override + public void openInventory() {} + + // 1.7.2+ renamed to closeInventory(EntityPlayer player) + @Override + public void closeInventory() {} + + /** + * This method doesn't seem to do what it claims to do, as + * items can still be left-clicked and placed in the inventory + * even when this returns false + */ + @Override + public boolean isItemValidForSlot(int slot, ItemStack itemstack) + { + // 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 + if (itemstack.getItem() instanceof GT_MetaGenerated_Tool || itemstack.getItem() instanceof IElectricItem){ + return true; + } + return false; + } + +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockTileEntity.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockTileEntity.java new file mode 100644 index 0000000000..73fcbc2ab6 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockTileEntity.java @@ -0,0 +1,43 @@ +package gtPlusPlus.core.item.base.itemblock; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class ItemBlockTileEntity extends ItemBlock{ + + String[] description; + + public ItemBlockTileEntity(Block block) { + super(block); + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { + for (int i =0; i< this.description.length; i++){ + if (!this.description[i].equals("")){ + list.add(this.description[i]); + } + } + + + super.addInformation(stack, aPlayer, list, bool); + } + + @Override + public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) { + + } + + public void setDecription(String[] description){ + for (int i =0; i< description.length; i++){ + this.description[i] = description[i]; + } + } + +} diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java index 1d17bee204..2f57dc4c81 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java @@ -16,7 +16,7 @@ public class RECIPES_General { static ItemStack RECIPE_LapisDust = UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustLazurite", 2); static ItemStack OUTPUT_Blueprint = UtilsItems.getSimpleStack(ModItems.itemBlueprintBase); static ItemStack RECIPE_CraftingTable = UtilsItems.getSimpleStack(Item.getItemFromBlock(Blocks.crafting_table)); - static ItemStack RECIPE_BronzePlate = UtilsItems.getItemStackOfAmountFromOreDictNoBroken("plateBronze", 1); + static ItemStack RECIPE_BronzePlate = UtilsItems.getItemStackOfAmountFromOreDictNoBrokenExcluding("ic2", "plateAnyBronze", 1); static ItemStack RECIPE_BasicCasingIC2; static ItemStack OUTPUT_Workbench_Bronze = UtilsItems.getSimpleStack(Item.getItemFromBlock(ModBlocks.blockWorkbench)); static ItemStack NULL = null; diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 09a7acbfd6..eac35d586f 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -95,8 +95,8 @@ public class RECIPES_Machines { static String plateTier4 = "plateGold"; static String plateTier5 = "plateAluminium"; static String plateTier6 = "plateMaragingSteel250"; - static String plateTier7 = "plateTungsten"; - static String plateTier8 = "plateTungstenSteel"; + static String plateTier7 = "plateTantalloy61"; + static String plateTier8 = "plateInconel792"; static String plateTier9 = "plateZeron100"; static String plateTier10 = "plateNaquadahEnriched"; static String plateTier11 = "plateNeutronium"; @@ -108,8 +108,8 @@ public class RECIPES_Machines { static String rodTier4 = "stickGold"; static String rodTier5 = "stickAluminium"; static String rodTier6 = "stickMaragingSteel250"; - static String rodTier7 = "stickTungsten"; - static String rodTier8 = "stickTungstenSteel"; + static String rodTier7 = "stickTantalloy61"; + static String rodTier8 = "stickInconel792"; static String rodTier9 = "stickZeron100"; static String rodTier10 = "stickNaquadahEnriched"; static String rodTier11 = "stickNeutronium"; @@ -528,16 +528,16 @@ public class RECIPES_Machines { if (LoadedMods.ImmersiveEngineering){ //Industrial Coke Oven UtilsRecipe.addShapedGregtechRecipe( - plateCobalt, circuitTier4, plateCobalt, + plateTier8, circuitTier4, plateTier8, machineCasing_HV, INPUT_IECokeOvenBlock, machineCasing_HV, - plateCobalt, circuitTier5, plateCobalt, + plateTier8, circuitTier3, plateTier8, RECIPE_IndustrialCokeOvenController); } //Coke Oven Frame Casing UtilsRecipe.addShapedGregtechRecipe( - plateTier8, rodTier8, plateTier8, - rodTier8, "frameGtTantalloy61", rodTier8, - plateTier8, rodTier8, plateTier8, + plateTier7, rodTier7, plateTier7, + rodTier7, "frameGtTantalloy61", rodTier7, + plateTier7, rodTier7, plateTier7, RECIPE_IndustrialCokeOvenFrame); //Coke Oven Coil 1 UtilsRecipe.addShapedGregtechRecipe( diff --git a/src/Java/gtPlusPlus/core/slots/SlotGtToolElectric.java b/src/Java/gtPlusPlus/core/slots/SlotGtToolElectric.java new file mode 100644 index 0000000000..461fa6ff04 --- /dev/null +++ b/src/Java/gtPlusPlus/core/slots/SlotGtToolElectric.java @@ -0,0 +1,98 @@ +package gtPlusPlus.core.slots; + +import gregtech.api.items.GT_MetaGenerated_Tool; +import gtPlusPlus.core.util.Utils; +import ic2.api.info.Info; +import ic2.api.item.ElectricItem; +import ic2.api.item.IElectricItem; +import net.minecraft.init.Items; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + +public class SlotGtToolElectric extends SlotGtTool { + public int tier; + private ItemStack content; + + public SlotGtToolElectric(IInventory base, int x, int y, int z, int tier, boolean allowRedstoneDust) + { + super(base, x, y, z); + this.tier = tier; + this.allowRedstoneDust = allowRedstoneDust; + } + + public boolean accepts(ItemStack stack) + { + if (stack == null) { + return false; + } + if ((stack.getItem() == Items.redstone) && (!this.allowRedstoneDust)) { + return false; + } + return (Info.itemEnergy.getEnergyValue(stack) > 0.0D) || (ElectricItem.manager.discharge(stack, (1.0D / 0.0D), this.tier, true, true, true) > 0.0D); + } + + public double discharge(double amount, boolean ignoreLimit) + { + if (amount <= 0.0D) { + throw new IllegalArgumentException("Amount must be > 0."); + } + ItemStack stack = get(0); + if (stack == null) { + return 0.0D; + } + double realAmount = ElectricItem.manager.discharge(stack, amount, this.tier, ignoreLimit, true, false); + if (realAmount <= 0.0D) + { + realAmount = Info.itemEnergy.getEnergyValue(stack); + if (realAmount <= 0.0D) { + return 0.0D; + } + stack.stackSize -= 1; + if (stack.stackSize <= 0) { + put(0, null); + } + } + return realAmount; + } + + public void setTier(int tier1) + { + this.tier = tier1; + } + + public boolean allowRedstoneDust = true; + + public ItemStack get() + { + return get(0); + } + + public ItemStack get(int index) + { + return this.content; + } + + public void put(ItemStack content) + { + put(0, content); + } + + public void put(int index, ItemStack content) + { + this.content = content; + onChanged(); + } + + public void onChanged() {} + + @Override + public boolean isItemValid(ItemStack itemstack) { + if (itemstack.getItem() instanceof GT_MetaGenerated_Tool || itemstack.getItem() instanceof IElectricItem){ + Utils.LOG_WARNING(itemstack.getDisplayName()+" is a valid Tool."); + return true; + } + Utils.LOG_WARNING(itemstack.getDisplayName()+" is not a valid Tool."); + return false; + } + +} diff --git a/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java b/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java index 2028e19787..a228021c82 100644 --- a/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java +++ b/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java @@ -1,6 +1,7 @@ package gtPlusPlus.core.tileentities; import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench; +import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced; import gtPlusPlus.core.util.Utils; import cpw.mods.fml.common.registry.GameRegistry; @@ -15,6 +16,7 @@ public class ModTileEntities { //GameRegistry.registerTileEntity(TileEntityCharger.class, "TE_Charger"); // GameRegistry.registerTileEntity(TileEntityHeliumGenerator.class, "Helium"); GameRegistry.registerTileEntity(TileEntityWorkbench.class, "TileWorkbench"); + GameRegistry.registerTileEntity(TileEntityWorkbenchAdvanced.class, "TileWorkbenchAdvanced"); } } diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbench.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbench.java index 725967c31e..9cbd963572 100644 --- a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbench.java +++ b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbench.java @@ -4,6 +4,16 @@ import gtPlusPlus.core.inventories.InventoryWorkbenchChest; import gtPlusPlus.core.inventories.InventoryWorkbenchHoloCrafting; import gtPlusPlus.core.inventories.InventoryWorkbenchHoloSlots; import gtPlusPlus.core.inventories.InventoryWorkbenchTools; +import ic2.api.network.INetworkDataProvider; +import ic2.api.network.INetworkUpdateListener; +import ic2.api.tile.IWrenchable; +import ic2.core.IC2; +import ic2.core.network.NetworkManager; + +import java.util.List; +import java.util.Vector; + +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryCraftResult; import net.minecraft.item.ItemStack; @@ -11,8 +21,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; -public class TileEntityWorkbench extends TileEntity { - +public class TileEntityWorkbench extends TileEntity implements INetworkDataProvider, INetworkUpdateListener, IWrenchable{ + //Credit to NovaViper in http://www.minecraftforge.net/forum/index.php?topic=26439.0 - Helped me restructure my Inventory system and now the crafting matrix works better. public InventoryWorkbenchChest inventoryChest; @@ -44,22 +54,25 @@ public class TileEntityWorkbench extends TileEntity { public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); + + nbt.setShort("facing", this.facing); + inventoryChest.writeToNBT(getTag(nbt, "ContentsChest")); inventoryTool.writeToNBT(getTag(nbt, "ContentsTools")); //inventoryCrafting.writeToNBT(getTag(nbt, "ContentsCrafting")); inventoryHolo.writeToNBT(getTag(nbt, "ContentsHolo")); - // Write Crafting Matrix to NBT - NBTTagList craftingTag = new NBTTagList(); - for (int currentIndex = 0; currentIndex < inventoryCrafting.getSizeInventory(); ++currentIndex) { - if (inventoryCrafting.getStackInSlot(currentIndex) != null) { - NBTTagCompound tagCompound = new NBTTagCompound(); - tagCompound.setByte("Slot", (byte) currentIndex); - inventoryCrafting.getStackInSlot(currentIndex).writeToNBT(tagCompound); - craftingTag.appendTag(tagCompound); - } - } - + // Write Crafting Matrix to NBT + NBTTagList craftingTag = new NBTTagList(); + for (int currentIndex = 0; currentIndex < inventoryCrafting.getSizeInventory(); ++currentIndex) { + if (inventoryCrafting.getStackInSlot(currentIndex) != null) { + NBTTagCompound tagCompound = new NBTTagCompound(); + tagCompound.setByte("Slot", (byte) currentIndex); + inventoryCrafting.getStackInSlot(currentIndex).writeToNBT(tagCompound); + craftingTag.appendTag(tagCompound); + } + } + nbt.setTag("CraftingMatrix", craftingTag); // Write craftingResult to NBT if (inventoryCraftResult.getStackInSlot(0) != null) @@ -71,29 +84,91 @@ public class TileEntityWorkbench extends TileEntity { public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); + + this.prevFacing = (this.facing = nbt.getShort("facing")); + inventoryChest.readFromNBT(nbt.getCompoundTag("ContentsChest")); inventoryTool.readFromNBT(nbt.getCompoundTag("ContentsTools")); //inventoryCrafting.readFromNBT(nbt.getCompoundTag("ContentsCrafting")); inventoryHolo.readFromNBT(nbt.getCompoundTag("ContentsHolo")); // Read in the Crafting Matrix from NBT - NBTTagList craftingTag = nbt.getTagList("CraftingMatrix", 10); - inventoryCrafting = new InventoryWorkbenchHoloCrafting(); //TODO: magic number - for (int i = 0; i < craftingTag.tagCount(); ++i) { - NBTTagCompound tagCompound = (NBTTagCompound) craftingTag.getCompoundTagAt(i); - byte slot = tagCompound.getByte("Slot"); - if (slot >= 0 && slot < inventoryCrafting.getSizeInventory()) { - inventoryCrafting.setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(tagCompound)); - } - } + NBTTagList craftingTag = nbt.getTagList("CraftingMatrix", 10); + inventoryCrafting = new InventoryWorkbenchHoloCrafting(); //TODO: magic number + for (int i = 0; i < craftingTag.tagCount(); ++i) { + NBTTagCompound tagCompound = (NBTTagCompound) craftingTag.getCompoundTagAt(i); + byte slot = tagCompound.getByte("Slot"); + if (slot >= 0 && slot < inventoryCrafting.getSizeInventory()) { + inventoryCrafting.setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(tagCompound)); + } + } + - // Read craftingResult from NBT NBTTagCompound tagCraftResult = nbt.getCompoundTag("CraftingResult"); inventoryCraftResult.setInventorySlotContents(0, ItemStack.loadItemStackFromNBT(tagCraftResult)); } + @Override + public List getNetworkedFields(){ + List ret = new Vector(2); + ret.add("facing"); + return ret; + } + + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) + { + return false; + } + + private short facing = 0; + public short prevFacing = 0; + + @Override + public void setFacing(short facing1) + { + this.facing = facing1; + if (this.prevFacing != facing1) { + ((NetworkManager)IC2.network.get()).updateTileEntityField(this, "facing"); + } + this.prevFacing = facing1; + } + + @Override + public short getFacing() + { + return this.facing; + } + + + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + return true; + } + + @Override + public float getWrenchDropRate() + { + return 1.0F; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord), 1, this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord)); + } + + @Override + public void onNetworkUpdate(String field) { + + this.prevFacing = this.facing; + + } + } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbenchAdvanced.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbenchAdvanced.java new file mode 100644 index 0000000000..63770a6efd --- /dev/null +++ b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbenchAdvanced.java @@ -0,0 +1,249 @@ +package gtPlusPlus.core.tileentities.machines; + +import gtPlusPlus.core.inventories.InventoryWorkbenchChest; +import gtPlusPlus.core.inventories.InventoryWorkbenchHoloCrafting; +import gtPlusPlus.core.inventories.InventoryWorkbenchHoloSlots; +import gtPlusPlus.core.inventories.InventoryWorkbenchToolsElectric; +import ic2.api.energy.event.EnergyTileLoadEvent; +import ic2.api.energy.event.EnergyTileUnloadEvent; +import ic2.api.energy.tile.IEnergySink; +import ic2.api.network.INetworkDataProvider; +import ic2.api.network.INetworkUpdateListener; +import ic2.api.tile.IWrenchable; +import ic2.core.IC2; +import ic2.core.network.NetworkManager; + +import java.util.List; +import java.util.Vector; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryCraftResult; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; + +public class TileEntityWorkbenchAdvanced extends TileEntity implements IEnergySink, INetworkDataProvider, INetworkUpdateListener, IWrenchable{ + + //Credit to NovaViper in http://www.minecraftforge.net/forum/index.php?topic=26439.0 - Helped me restructure my Inventory system and now the crafting matrix works better. + + public InventoryWorkbenchChest inventoryChest; + public InventoryWorkbenchToolsElectric inventoryTool; + public InventoryWorkbenchHoloSlots inventoryHolo; + public InventoryWorkbenchHoloCrafting inventoryCrafting; + + public IInventory inventoryCraftResult = new InventoryCraftResult(); + + //Wrench Code + private short facing = 0; + public short prevFacing = 0; + + //E-Net Code + public double energy = 0.0D; + public int maxEnergy; + private boolean addedToEnergyNet = false; + private int tier; + private float guiChargeLevel; + + + public TileEntityWorkbenchAdvanced(int maxenergy, int tier1){ + this.inventoryTool = new InventoryWorkbenchToolsElectric();//number of slots - without product slot + this.inventoryChest = new InventoryWorkbenchChest();//number of slots - without product slot + this.inventoryHolo = new InventoryWorkbenchHoloSlots(); + this.inventoryCrafting = new InventoryWorkbenchHoloCrafting(); + this.canUpdate(); + + //Electric Stats + this.maxEnergy = maxenergy; + this.tier = tier1; + + } + + @SuppressWarnings("static-method") + public NBTTagCompound getTag(NBTTagCompound nbt, String tag) + { + if(!nbt.hasKey(tag)) + { + nbt.setTag(tag, new NBTTagCompound()); + } + return nbt.getCompoundTag(tag); + } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + nbt.setDouble("energy", this.energy); + nbt.setShort("facing", this.facing); + + inventoryChest.writeToNBT(getTag(nbt, "ContentsChest")); + inventoryTool.writeToNBT(getTag(nbt, "ContentsTools")); + //inventoryCrafting.writeToNBT(getTag(nbt, "ContentsCrafting")); + inventoryHolo.writeToNBT(getTag(nbt, "ContentsHolo")); + + // Write Crafting Matrix to NBT + NBTTagList craftingTag = new NBTTagList(); + for (int currentIndex = 0; currentIndex < inventoryCrafting.getSizeInventory(); ++currentIndex) { + if (inventoryCrafting.getStackInSlot(currentIndex) != null) { + NBTTagCompound tagCompound = new NBTTagCompound(); + tagCompound.setByte("Slot", (byte) currentIndex); + inventoryCrafting.getStackInSlot(currentIndex).writeToNBT(tagCompound); + craftingTag.appendTag(tagCompound); + } + } + + nbt.setTag("CraftingMatrix", craftingTag); + // Write craftingResult to NBT + if (inventoryCraftResult.getStackInSlot(0) != null) + nbt.setTag("CraftingResult", inventoryCraftResult.getStackInSlot(0).writeToNBT(new NBTTagCompound())); + + } + + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + this.energy = nbt.getDouble("energy"); + + this.prevFacing = (this.facing = nbt.getShort("facing")); + + inventoryChest.readFromNBT(nbt.getCompoundTag("ContentsChest")); + inventoryTool.readFromNBT(nbt.getCompoundTag("ContentsTools")); + //inventoryCrafting.readFromNBT(nbt.getCompoundTag("ContentsCrafting")); + inventoryHolo.readFromNBT(nbt.getCompoundTag("ContentsHolo")); + + // Read in the Crafting Matrix from NBT + NBTTagList craftingTag = nbt.getTagList("CraftingMatrix", 10); + inventoryCrafting = new InventoryWorkbenchHoloCrafting(); //TODO: magic number + for (int i = 0; i < craftingTag.tagCount(); ++i) { + NBTTagCompound tagCompound = (NBTTagCompound) craftingTag.getCompoundTagAt(i); + byte slot = tagCompound.getByte("Slot"); + if (slot >= 0 && slot < inventoryCrafting.getSizeInventory()) { + inventoryCrafting.setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(tagCompound)); + } + } + + + // Read craftingResult from NBT + NBTTagCompound tagCraftResult = nbt.getCompoundTag("CraftingResult"); + inventoryCraftResult.setInventorySlotContents(0, ItemStack.loadItemStackFromNBT(tagCraftResult)); + + } + + @Override + public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) + { + return true; + } + + @Override + public double getDemandedEnergy() + { + return this.maxEnergy - this.energy; + } + + @Override + public int getSinkTier() + { + return this.tier; + } + + @Override + public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) + { + if (this.energy >= this.maxEnergy) { + return amount; + } + this.energy += amount; + return 0.0D; + } + + public final float getChargeLevel() + { + return this.guiChargeLevel; + } + + public void setTier(int tier1) + { + if (this.tier == tier1) { + return; + } + boolean addedToENet = this.addedToEnergyNet; + if (addedToENet) + { + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); + this.addedToEnergyNet = false; + } + this.tier = tier1; + + for (int i=0; i getNetworkedFields(){ + List ret = new Vector(2); + ret.add("facing"); + return ret; + } + + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) + { + return false; + } + + @Override + public void setFacing(short facing1) + { + this.facing = facing1; + if (this.prevFacing != facing1) { + ((NetworkManager)IC2.network.get()).updateTileEntityField(this, "facing"); + } + this.prevFacing = facing1; + } + + @Override + public short getFacing() + { + return this.facing; + } + + + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + return true; + } + + @Override + public float getWrenchDropRate() + { + return 1.0F; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord), 1, this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord)); + } + + @Override + public void onNetworkUpdate(String field) { + + this.prevFacing = this.facing; + + } + +} \ 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 64f06a078c..62162e596d 100644 --- a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java +++ b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java @@ -244,6 +244,17 @@ public class UtilsItems { return null; } + + public static ItemStack getItemStackInPlayersHand(){ + Minecraft mc = Minecraft.getMinecraft(); + ItemStack heldItem = null; + try{heldItem = mc.thePlayer.getHeldItem(); + }catch(NullPointerException e){return null;} + if (heldItem != null){ + return heldItem; + } + return null; + } public static void generateSpawnEgg(String entityModID, String parSpawnName, int colourEgg, int colourOverlay){ Item itemSpawnEgg = new BasicSpawnEgg(entityModID, parSpawnName, colourEgg, colourOverlay).setUnlocalizedName("spawn_egg_"+parSpawnName.toLowerCase()).setTextureName(CORE.MODID+":spawn_egg"); @@ -279,6 +290,32 @@ public class UtilsItems { Utils.LOG_INFO(oredictName+" was not valid."); return null; } + + public static ItemStack getItemStackOfAmountFromOreDictNoBrokenExcluding(String excludeModName, String oredictName, int amount){ + ItemStack returnValue = getItemStackOfAmountFromOreDict(oredictName, amount); + + if (returnValue.getItem().getClass() != ModItems.AAA_Broken.getClass() || returnValue.getItem() != ModItems.AAA_Broken){ + if (returnValue.getClass().toString().toLowerCase().contains(excludeModName.toLowerCase())){ + ArrayList oreDictList = OreDictionary.getOres(oredictName); + if (!oreDictList.isEmpty()){ + returnValue = oreDictList.get(1).copy(); + returnValue.stackSize = amount; + return returnValue; + } + } + else { + ArrayList oreDictList = OreDictionary.getOres(oredictName); + if (!oreDictList.isEmpty()){ + returnValue = oreDictList.get(1).copy(); + returnValue.stackSize = amount; + return returnValue; + } + } + return returnValue; + } + Utils.LOG_INFO(oredictName+" was not valid."); + return null; + } public static void generateItemsFromMaterial(Material matInfo){ diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java index 8327d30155..0f4a9f522c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java @@ -16,10 +16,10 @@ public class CasingTextureHandler { switch (aMeta) { //Centrifuge case 0: - return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + return TexturesGtBlocks.Casing_Material_MaragingSteel.getIcon(); //Coke Oven Frame case 1: - return Textures.BlockIcons.MACHINE_CASING_RADIATIONPROOF.getIcon(); + return TexturesGtBlocks.Casing_Material_Staballoy61.getIcon(); //Coke Oven Casing Tier 1 case 2: return Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon(); @@ -31,13 +31,13 @@ public class CasingTextureHandler { return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); //Electrolyzer Casings case 5: - return Textures.BlockIcons.MACHINE_CASING_FUSION_2.getIcon(); + return TexturesGtBlocks.Casing_Material_Potin.getIcon(); //Broken Blue Fusion Casings case 6: return Textures.BlockIcons.MACHINE_CASING_FUSION.getIcon(); //Maceration Stack Casings case 7: - return Textures.BlockIcons.MACHINE_LuV_BOTTOM.getIcon(); + return TexturesGtBlocks.Casing_Material_Tumbaga.getIcon(); //Broken Pink Fusion Casings case 8: return Textures.BlockIcons.MACHINE_CASING_FUSION_2.getIcon(); @@ -52,10 +52,10 @@ public class CasingTextureHandler { return Textures.BlockIcons.MACHINE_CASING_GRATE.getIcon(); //Reactor Casing I case 12: - return Textures.BlockIcons.MACHINE_CASING_CLEAN_STAINLESSSTEEL.getIcon(); + return TexturesGtBlocks.Casing_Material_Stellite.getIcon(); //Reactor Casing II case 13: - return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); + return TexturesGtBlocks.Casing_Material_Zeron100.getIcon(); default: return Textures.BlockIcons.MACHINE_CASING_RADIOACTIVEHAZARD.getIcon(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java index 3f90e2a467..672fc58ff7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java @@ -58,12 +58,28 @@ public class TexturesGtBlocks { //Machine Casings private static final CustomIcon Internal_Casing_Machine_Simple = new CustomIcon("TileEntities/machine_top"); public static final CustomIcon Casing_Machine_Simple = Internal_Casing_Machine_Simple; - private static final CustomIcon Internal_Casing_Machine_Dimensional = new CustomIcon("TileEntities/adv_machine_dimensional"); public static final CustomIcon Casing_Machine_Dimensional = Internal_Casing_Machine_Dimensional; private static final CustomIcon Internal_Casing_Machine_Dimensional_Adv = new CustomIcon("TileEntities/high_adv_machine_dimensional"); public static final CustomIcon Casing_Machine_Dimensional_Adv = Internal_Casing_Machine_Dimensional_Adv; + //Material Casings + private static final CustomIcon Internal_Casing_Staballoy61 = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TANTALLOY61"); + public static final CustomIcon Casing_Material_Staballoy61 = Internal_Casing_Staballoy61; + private static final CustomIcon Internal_Casing_MaragingSteel = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_MARAGINGSTEEL"); + public static final CustomIcon Casing_Material_MaragingSteel = Internal_Casing_MaragingSteel; + private static final CustomIcon Internal_Casing_Stellite = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_STELLITE"); + public static final CustomIcon Casing_Material_Stellite = Internal_Casing_Stellite; + private static final CustomIcon Internal_Casing_Talonite = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TALONITE"); + public static final CustomIcon Casing_Material_Talonite = Internal_Casing_Talonite; + private static final CustomIcon Internal_Casing_Tumbaga = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TUMBAGA"); + public static final CustomIcon Casing_Material_Tumbaga = Internal_Casing_Tumbaga; + private static final CustomIcon Internal_Casing_Zeron100 = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_ZERON100"); + public static final CustomIcon Casing_Material_Zeron100 = Internal_Casing_Zeron100; + private static final CustomIcon Internal_Casing_Potin = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_POTIN"); + public static final CustomIcon Casing_Material_Potin = Internal_Casing_Potin; + + //Misc Casings private static final CustomIcon Internal_Casing_Machine_Sound = new CustomIcon("TileEntities/audio_out"); public static final CustomIcon Casing_Machine_Sound = Internal_Casing_Machine_Sound; private static final CustomIcon Internal_Casing_Machine_Sound_Active = new CustomIcon("TileEntities/audio_out_active"); -- cgit From ff409ce305de28b2b90c17bb357bbf44715a5f9e Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Sat, 22 Oct 2016 06:09:00 +1000 Subject: + Added more Dehydrator Recipes. + Added new dusts for nuclear fuel production. $ Fixed OreDictionary not working for some recipes. $ Changed the Textures on some machines, to now use GT4 overlay textures. --- src/Java/gtPlusPlus/core/item/ModItems.java | 10 +- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 80 ++++++++-- .../gtPlusPlus/core/recipe/RECIPES_General.java | 4 +- .../interfaces/internal/IGregtech_RecipeAdder.java | 24 ++- .../blocks/textures/CasingTextureHandler.java | 2 +- .../common/blocks/textures/TexturesGtBlocks.java | 70 ++++++--- .../GregtechMetaTileEntityGeothermalGenerator.java | 9 +- .../GregtechMetaTileEntityRocketFuelGenerator.java | 34 ++-- .../GregtechMetaTileEntityIronBlastFurnace.java | 2 +- .../xmod/gregtech/recipes/GregtechRecipeAdder.java | 172 +++++++++++---------- .../registration/gregtech/GregtechDehydrator.java | 8 +- 11 files changed, 278 insertions(+), 137 deletions(-) (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index b33a8b747f..a0304727f0 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -132,6 +132,10 @@ public final class ModItems { public static BaseItemBackpack backpack_White; public static Item dustLithiumCarbonate; + + public static Item dustUraniumTetraFluoride; + public static Item dustUraniumHexaFluoride; + public static Item dustLithiumFluoride; public static ItemBlueprint itemBlueprintBase; @@ -233,7 +237,11 @@ public final class ModItems { dustLithiumCarbonate = UtilsItems.generateSpecialUseDusts("LithiumCarbonate", "Lithium Carbonate", Utils.rgbtoHexValue(137, 139, 142))[0]; - + + //Nuclear Fuel Dusts + dustUraniumTetraFluoride = UtilsItems.generateSpecialUseDusts("UraniumTetrafluoride", "Uranium Tetrafluoride", Utils.rgbtoHexValue(17, 179, 42))[0]; + dustUraniumHexaFluoride = UtilsItems.generateSpecialUseDusts("UraniumHexafluoride", "Uranium Hexafluoride", Utils.rgbtoHexValue(9, 199, 32))[0]; + dustLithiumFluoride = UtilsItems.generateSpecialUseDusts("LithiumFluoride", "Lithium Fluoride", Utils.rgbtoHexValue(245, 245, 245))[0]; boolean gtStyleTools = LoadedMods.Gregtech; diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index 6a1e496305..e583e05473 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -131,19 +131,19 @@ public class RECIPES_GREGTECH { 30); //EU }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}*/ try { - + ItemStack cells = UtilsItems.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:itemCellEmpty", "Empty Fluid Cells", 0, 12); - + if (cells == null){ cells = UtilsItems.getItemStackOfAmountFromOreDictNoBroken("cellEmpty", 12); } - + ItemStack[] input = {cells, UtilsItems.getItemStackOfAmountFromOreDict("dustLepidolite", 20)}; - + CORE.RA.addDehydratorRecipe( input, //Item input (Array, up to 2) FluidUtils.getFluidStack("sulfuricacid", 10000), //Fluid input (slot 1) - FluidUtils.getFluidStack("sulfuriclithium", 10000), //Fluid output (slot 1) + FluidUtils.getFluidStack("sulfuriclithium", 10000), //Fluid output (slot 2) new ItemStack[]{ UtilsItems.getItemStackOfAmountFromOreDict("dustPotassium", 1), UtilsItems.getItemStackOfAmountFromOreDict("dustAluminium", 4), @@ -152,11 +152,61 @@ public class RECIPES_GREGTECH { UtilsItems.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 3), //LithiumCarbonate }, //Output Array of Items - Upto 9, new int[]{0}, - 90*20, //Time in ticks + 75*20, //Time in ticks + 1000); //EU + + }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");} + try { + + CORE.RA.addDehydratorRecipe( + new ItemStack[]{ + UtilsItems.getItemStackOfAmountFromOreDict("cellWater", 10) + }, //Item input (Array, up to 2) + FluidUtils.getFluidStack("uraniumtetrafluoride", 1440), //Fluid input (slot 1) + null, //Fluid output (slot 2) + new ItemStack[]{ + UtilsItems.getItemStackOfAmountFromOreDict("dustUraniumTetrafluoride", 10), + UtilsItems.getItemStackOfAmountFromOreDictNoBroken("cellEmpty", 10) + }, //Output Array of Items - Upto 9, + new int[]{0}, + 150*20, //Time in ticks 2000); //EU }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");} - + try { + + CORE.RA.addDehydratorRecipe( + new ItemStack[]{ + UtilsItems.getItemStackOfAmountFromOreDict("cellWater", 10) + }, //Item input (Array, up to 2) + FluidUtils.getFluidStack("uraniumhexafluoride", 1440), //Fluid input (slot 1) + null, //Fluid output (slot 2) + new ItemStack[]{ + UtilsItems.getItemStackOfAmountFromOreDict("dustUraniumHexafluoride", 10), + UtilsItems.getItemStackOfAmountFromOreDictNoBroken("cellEmpty", 10) + }, //Output Array of Items - Upto 9, + new int[]{0}, + 300*20, //Time in ticks + 4000); //EU + + }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");} + try { + + CORE.RA.addDehydratorRecipe( + new ItemStack[]{ + UtilsItems.getItemStackOfAmountFromOreDict("cropGrape", 1) + }, //Item input (Array, up to 2) + null, //Fluid input (slot 1) + null, //Fluid output (slot 2) + new ItemStack[]{ + UtilsItems.getItemStackOfAmountFromOreDict("foodRaisins", 1) + }, //Output Array of Items - Upto 9, + new int[]{0}, + 10*20, //Time in ticks + 8); //EU + + }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");} + } private static void assemblerRecipes(){ @@ -176,9 +226,9 @@ public class RECIPES_GREGTECH { GT_Values.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketFire_water", 0, 1), null, 120, 0); GT_Values.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketRocket_fuel", 0, 1), null, 112, 0); GT_Values.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketHootch", 0, 1), null, 36, 0); - - - + + + //CORE.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketRocket_fuel", 0, 1), null, 112, 0); GT_Values.RA.addFuel(UtilsItems.getSimpleStack(Items.lava_bucket), null, 32, 2); GT_Values.RA.addFuel(UtilsItems.getIC2Cell(2), null, 32, 2); @@ -202,6 +252,16 @@ public class RECIPES_GREGTECH { chances, 30*20, 240); + + GT_Values.RA.addChemicalBathRecipe( + UtilsItems.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 10), + FluidUtils.getFluidStack("hydrofluoricacid", 20000), + UtilsItems.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 5), + null, + null, + new int[]{}, + 90*20, + 500); } diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java index 2f57dc4c81..5d1a4cc353 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java @@ -13,10 +13,10 @@ import net.minecraft.item.ItemStack; public class RECIPES_General { static ItemStack RECIPE_Paper = UtilsItems.getSimpleStack(Items.paper); - static ItemStack RECIPE_LapisDust = UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustLazurite", 2); + static String RECIPE_LapisDust = "dustLazurite"; static ItemStack OUTPUT_Blueprint = UtilsItems.getSimpleStack(ModItems.itemBlueprintBase); static ItemStack RECIPE_CraftingTable = UtilsItems.getSimpleStack(Item.getItemFromBlock(Blocks.crafting_table)); - static ItemStack RECIPE_BronzePlate = UtilsItems.getItemStackOfAmountFromOreDictNoBrokenExcluding("ic2", "plateAnyBronze", 1); + static String RECIPE_BronzePlate = "plateAnyBronze"; static ItemStack RECIPE_BasicCasingIC2; static ItemStack OUTPUT_Workbench_Bronze = UtilsItems.getSimpleStack(Item.getItemFromBlock(ModBlocks.blockWorkbench)); static ItemStack NULL = null; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java index 96f2cbcfcf..3b876e6d93 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java @@ -37,19 +37,33 @@ public interface IGregtech_RecipeAdder { /** - * Adds a Recipe for the Sifter. (up to 9 Outputs) + * Adds a Recipe for the Dehydrator. (up to 9 Outputs) * - * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize) + * @param aInput = Input itemstack (not null, and respects StackSize) * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize) + * @param aOutputItems = Itemstack[] (not null, and respects StackSize) * @param aDuration = Duration (must be >= 0) * @param aEUt = EU needed for heating up (must be >= 0) * @return true if the Recipe got added, otherwise false. */ - - /*public boolean addDehydratorRecipe(FluidStack aFluid, FluidStack aOutputFluid, ItemStack[] aOutputItems, int aDuration, int aEUt); + public boolean addDehydratorRecipe(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutputItems, int aDuration, int aEUt); - public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, ItemStack[] aOutputItems, int aDuration, int aEUt); + /*public boolean addDehydratorRecipe(FluidStack aFluid, FluidStack aOutputFluid, ItemStack[] aOutputItems, int aDuration, int aEUt);*/ + /*public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, ItemStack[] aOutputItems, int aDuration, int aEUt); public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, FluidStack aFluid, ItemStack[] aOutputItems, FluidStack aOutputFluid, int aDuration, int aEUt);*/ + + /** + * Adds a Recipe for the Dehydrator. (up to 9 Outputs) + * + * @param aInput = ItemStack[] (not null, and respects StackSize) + * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize) + * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize) + * @param aOutputItems = ItemStack[] (not null, and respects StackSize) + * @param aChances = Output Change (can be == 0) + * @param aDuration = Duration (must be >= 0) + * @param aEUt = EU needed for heating up (must be >= 0) + * @return true if the Recipe got added, otherwise false. + */ public boolean addDehydratorRecipe(ItemStack[] aInput, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack[] aOutputItems, int[] aChances, int aDuration, int aEUt); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java index 0f4a9f522c..c5b8985396 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java @@ -46,7 +46,7 @@ public class CasingTextureHandler { return TexturesGtBlocks.Casing_Machine_Dimensional_Adv.getIcon(); //Iron Blast Fuance Textures case 10: - return TexturesGtBlocks.Casing_Machine_Simple.getIcon(); + return TexturesGtBlocks.Casing_Machine_Simple_Top.getIcon(); //Multitank Exterior Casing case 11: return Textures.BlockIcons.MACHINE_CASING_GRATE.getIcon(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java index 672fc58ff7..e82355ae8c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java @@ -56,8 +56,17 @@ public class TexturesGtBlocks { //Machine Casings - private static final CustomIcon Internal_Casing_Machine_Simple = new CustomIcon("TileEntities/machine_top"); - public static final CustomIcon Casing_Machine_Simple = Internal_Casing_Machine_Simple; + //Simple + private static final CustomIcon Internal_Casing_Machine_Simple_Top = new CustomIcon("TileEntities/machine_top"); + public static final CustomIcon Casing_Machine_Simple_Top = Internal_Casing_Machine_Simple_Top; + private static final CustomIcon Internal_Casing_Machine_Simple_Bottom = new CustomIcon("TileEntities/machine_bottom"); + public static final CustomIcon Casing_Machine_Simple_Bottom = Internal_Casing_Machine_Simple_Bottom; + //Advanced and Ultra + private static final CustomIcon Internal_Casing_Machine_Advanced = new CustomIcon("TileEntities/high_adv_machine"); + public static final CustomIcon Casing_Machine_Advanced = Internal_Casing_Machine_Advanced; + private static final CustomIcon Internal_Casing_Machine_Ultra = new CustomIcon("TileEntities/adv_machine_lesu"); + public static final CustomIcon Casing_Machine_Ultra = Internal_Casing_Machine_Ultra; + //Dimensional - Non Overlay private static final CustomIcon Internal_Casing_Machine_Dimensional = new CustomIcon("TileEntities/adv_machine_dimensional"); public static final CustomIcon Casing_Machine_Dimensional = Internal_Casing_Machine_Dimensional; private static final CustomIcon Internal_Casing_Machine_Dimensional_Adv = new CustomIcon("TileEntities/high_adv_machine_dimensional"); @@ -78,25 +87,34 @@ public class TexturesGtBlocks { public static final CustomIcon Casing_Material_Zeron100 = Internal_Casing_Zeron100; private static final CustomIcon Internal_Casing_Potin = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_POTIN"); public static final CustomIcon Casing_Material_Potin = Internal_Casing_Potin; - - //Misc Casings - private static final CustomIcon Internal_Casing_Machine_Sound = new CustomIcon("TileEntities/audio_out"); - public static final CustomIcon Casing_Machine_Sound = Internal_Casing_Machine_Sound; - private static final CustomIcon Internal_Casing_Machine_Sound_Active = new CustomIcon("TileEntities/audio_out_active"); - public static final CustomIcon Casing_Machine_Sound_Active = Internal_Casing_Machine_Sound_Active; - + //Misc Casings private static final CustomIcon Internal_Casing_Machine_Redstone_Off = new CustomIcon("TileEntities/cover_redstone_conductor"); public static final CustomIcon Casing_Machine_Redstone_Off = Internal_Casing_Machine_Redstone_Off; private static final CustomIcon Internal_Casing_Machine_Redstone_On = new CustomIcon("TileEntities/cover_redstone_emitter"); public static final CustomIcon Casing_Machine_Redstone_On = Internal_Casing_Machine_Redstone_On; - private static final CustomIcon Internal_Casing_Machine_Vent = new CustomIcon("TileEntities/machine_top_vent_rotating"); - public static final CustomIcon Casing_Machine_Vent = Internal_Casing_Machine_Vent; - private static final CustomIcon Internal_Casing_Machine_Vent_Fast = new CustomIcon("TileEntities/machine_top_vent_rotating_fast"); - public static final CustomIcon Casing_Machine_Vent_Fast = Internal_Casing_Machine_Vent_Fast; - private static final CustomIcon Internal_Casing_Machine_Vent_Adv = new CustomIcon("TileEntities/adv_machine_vent_rotating"); - public static final CustomIcon Casing_Machine_Vent_Adv = Internal_Casing_Machine_Vent_Adv; - + //Overlays + //Fan Textures + private static final CustomIcon Internal_Overlay_Machine_Vent = new CustomIcon("TileEntities/machine_top_vent_rotating"); + public static final CustomIcon Overlay_Machine_Vent = Internal_Overlay_Machine_Vent; + private static final CustomIcon Internal_Overlay_Machine_Vent_Fast = new CustomIcon("TileEntities/machine_top_vent_rotating_fast"); + public static final CustomIcon Overlay_Machine_Vent_Fast = Internal_Overlay_Machine_Vent_Fast; + private static final CustomIcon Internal_Overlay_Machine_Vent_Adv = new CustomIcon("TileEntities/adv_machine_vent_rotating"); + public static final CustomIcon Overlay_Machine_Vent_Adv = Internal_Overlay_Machine_Vent_Adv; + //Speaker Texture + private static final CustomIcon Internal_Overlay_Machine_Sound = new CustomIcon("TileEntities/audio_out"); + public static final CustomIcon Overlay_Machine_Sound = Internal_Overlay_Machine_Sound; + private static final CustomIcon Internal_Overlay_Machine_Sound_Active = new CustomIcon("TileEntities/audio_out_active"); + public static final CustomIcon Overlay_Machine_Sound_Active = Internal_Overlay_Machine_Sound_Active; + //Diesel Engines + private static final CustomIcon Internal_Overlay_Machine_Diesel_Vertical = new CustomIcon("TileEntities/machine_top_dieselmotor"); + public static final CustomIcon Overlay_Machine_Diesel_Vertical = Internal_Overlay_Machine_Diesel_Vertical; + private static final CustomIcon Internal_Overlay_Machine_Diesel_Horizontal = new CustomIcon("TileEntities/machine_top_dieselmotor2"); + public static final CustomIcon Overlay_Machine_Diesel_Horizontal = Internal_Overlay_Machine_Diesel_Horizontal; + private static final CustomIcon Internal_Overlay_Machine_Diesel_Vertical_Active = new CustomIcon("TileEntities/machine_top_dieselmotor_active"); + public static final CustomIcon Overlay_Machine_Diesel_Vertical_Active = Internal_Overlay_Machine_Diesel_Vertical_Active; + private static final CustomIcon Internal_Overlay_Machine_Diesel_Horizontal_Active = new CustomIcon("TileEntities/machine_top_dieselmotor2_active"); + public static final CustomIcon Overlay_Machine_Diesel_Horizontal_Active = Internal_Overlay_Machine_Diesel_Horizontal_Active; //Computer Screens private static final CustomIcon Internal_Casing_Machine_Screen_1 = new CustomIcon("TileEntities/adv_machine_screen_random1"); public static final CustomIcon Casing_Machine_Screen_1 = Internal_Casing_Machine_Screen_1; @@ -106,12 +124,26 @@ public class TexturesGtBlocks { public static final CustomIcon Casing_Machine_Screen_3 = Internal_Casing_Machine_Screen_3; private static final CustomIcon Internal_Casing_Machine_Screen_Frequency = new CustomIcon("TileEntities/adv_machine_screen_frequency"); public static final CustomIcon Casing_Machine_Screen_Frequency = Internal_Casing_Machine_Screen_Frequency; - - //Overlays + private static final CustomIcon Internal_Overlay_Machine_Screen_Logo = new CustomIcon("TileEntities/adv_machine_screen_logo"); + public static final CustomIcon Overlay_Machine_Screen_Logo = Internal_Overlay_Machine_Screen_Logo; + //Crafting Overlays private static final CustomIcon Internal_Overlay_Crafting_Bronze = new CustomIcon("TileEntities/bronze_top_crafting"); public static final CustomIcon Overlay_Crafting_Bronze = Internal_Overlay_Crafting_Bronze; private static final CustomIcon Internal_Overlay_Crafting_Steel = new CustomIcon("TileEntities/cover_crafting"); public static final CustomIcon Overlay_Crafting_Steel = Internal_Overlay_Crafting_Steel; - + //Dimensional + private static final CustomIcon Internal_Overlay_Machine_Dimensional_Blue = new CustomIcon("TileEntities/adv_machine_dimensional_cover_blue"); + public static final CustomIcon Overlay_Machine_Dimensional_Blue = Internal_Overlay_Machine_Dimensional_Blue; + private static final CustomIcon Internal_Overlay_Machine_Dimensional_Orange = new CustomIcon("TileEntities/adv_machine_dimensional_cover_orange"); + public static final CustomIcon Overlay_Machine_Dimensional_Orange = Internal_Overlay_Machine_Dimensional_Orange; + //Icons + private static final CustomIcon Internal_Overlay_MatterFab = new CustomIcon("TileEntities/adv_machine_matterfab"); + public static final CustomIcon Overlay_MatterFab = Internal_Overlay_MatterFab; + private static final CustomIcon Internal_Overlay_MatterFab_Active = new CustomIcon("TileEntities/adv_machine_matterfab_active"); + public static final CustomIcon Overlay_MatterFab_Active = Internal_Overlay_MatterFab_Active; + private static final CustomIcon Internal_Overlay_Oil = new CustomIcon("TileEntities/adv_machine_oil"); + public static final CustomIcon Overlay_Oil = Internal_Overlay_Oil; + private static final CustomIcon Internal_Overlay_UU_Matter = new CustomIcon("TileEntities/adv_machine_uum"); + public static final CustomIcon Overlay_UU_Matter = Internal_Overlay_UU_Matter; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java index a84ba6d249..b68fb7155c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java @@ -11,6 +11,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenera import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlocks; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import cpw.mods.fml.common.registry.GameRegistry; @@ -76,12 +77,12 @@ extends GT_MetaTileEntity_BasicGenerator @Override public ITexture[] getFront(byte aColor) { - return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; } @Override public ITexture[] getBack(byte aColor) { - return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK), new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP)}; + return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK), new GT_RenderedTexture(TexturesGtBlocks.Overlay_Machine_Diesel_Vertical)}; } @Override @@ -101,12 +102,12 @@ extends GT_MetaTileEntity_BasicGenerator @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; } @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE)}; + return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE), new GT_RenderedTexture(TexturesGtBlocks.Overlay_Machine_Diesel_Vertical_Active)}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java index 892f573add..f3bff0c2f4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java @@ -21,7 +21,7 @@ public class GregtechMetaTileEntityRocketFuelGenerator public int mEfficiency; public GregtechMetaTileEntityRocketFuelGenerator(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, "Requires liquid Fuel", new ITexture[0]); + super(aID, aName, aNameRegional, aTier, "Requires two liquid Fuels. Fuel A is Fastburn, Fuel B is slowburn.", new ITexture[0]); onConfigLoad(); } @@ -67,20 +67,36 @@ public class GregtechMetaTileEntityRocketFuelGenerator } return rValue; } + + private GT_RenderedTexture getCasingTexture(){ + if (this.mTier <= 4){ + return new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Simple_Top); + } + else if (this.mTier == 5){ + + return new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Advanced); + } + else if (this.mTier >= 6){ + + return new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Ultra); + } + return new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Simple_Top); + } + @Override public ITexture[] getFront(byte aColor) { - return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Simple), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[]{super.getFront(aColor)[0], getCasingTexture(), Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; } @Override public ITexture[] getBack(byte aColor) { - return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Vent)}; + return new ITexture[]{super.getBack(aColor)[0], getCasingTexture(), new GT_RenderedTexture(TexturesGtBlocks.Overlay_Machine_Vent)}; } @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Simple)}; + return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Simple_Bottom)}; } @Override @@ -90,22 +106,22 @@ public class GregtechMetaTileEntityRocketFuelGenerator @Override public ITexture[] getSides(byte aColor) { - return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Sound)}; + return new ITexture[]{super.getSides(aColor)[0], getCasingTexture(), new GT_RenderedTexture(TexturesGtBlocks.Overlay_Machine_Diesel_Horizontal)}; } @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Simple), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[]{super.getFrontActive(aColor)[0], getCasingTexture(), Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; } @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Vent_Fast)}; + return new ITexture[]{super.getBackActive(aColor)[0], getCasingTexture(), new GT_RenderedTexture(TexturesGtBlocks.Overlay_Machine_Vent_Fast)}; } @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Simple)}; + return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Simple_Bottom)}; } @Override @@ -115,6 +131,6 @@ public class GregtechMetaTileEntityRocketFuelGenerator @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Sound_Active)}; + return new ITexture[]{super.getSidesActive(aColor)[0], getCasingTexture(), new GT_RenderedTexture(TexturesGtBlocks.Overlay_Machine_Diesel_Horizontal_Active)}; } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIronBlastFurnace.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIronBlastFurnace.java index 5ac474e844..f15757491c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIronBlastFurnace.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIronBlastFurnace.java @@ -25,7 +25,7 @@ import net.minecraftforge.common.util.ForgeDirection; public class GregtechMetaTileEntityIronBlastFurnace extends MetaTileEntity { - private static final ITexture[] FACING_SIDE = {new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Simple)}; + private static final ITexture[] FACING_SIDE = {new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Simple_Top)}; private static final ITexture[] FACING_FRONT = {new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Redstone_Off)}; private static final ITexture[] FACING_ACTIVE = {new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Redstone_On)}; public int mMaxProgresstime = 0; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index 6374a5f36a..4b0cf94032 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -12,7 +12,7 @@ import net.minecraftforge.fluids.FluidStack; public class GregtechRecipeAdder implements IGregtech_RecipeAdder { - + @Override public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) { @@ -66,7 +66,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { return false; } } - + @Override public boolean addMatterFabricatorRecipe(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt) { try { @@ -80,7 +80,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } catch (NullPointerException e){e.getStackTrace();} try{ - + //RECIPEHANDLER_MatterFabricator.debug4(aFluidInput, aFluidOutput, aDuration, aEUt); if (aFluidInput == null){ //Recipe_GT.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true, null, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); @@ -107,13 +107,13 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { @Override public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType) { - if (aInput1 == null) { - Utils.LOG_INFO("Fuel Input is Invalid."); - return false; - } - //new GregtechRecipe(aInput1, aOutput1, GregTech_API.sRecipeFile.get("fuel_" + aType, aInput1, aEU), aType); - return true; - } + if (aInput1 == null) { + Utils.LOG_INFO("Fuel Input is Invalid."); + return false; + } + //new GregtechRecipe(aInput1, aOutput1, GregTech_API.sRecipeFile.get("fuel_" + aType, aInput1, aEU), aType); + return true; + } /*@Override public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, FluidStack aFluid, ItemStack[] aOutputItems, FluidStack aOutputFluid, int aDuration, int aEUt) { @@ -132,7 +132,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } return false; } - + @Override public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, ItemStack[] aOutputItems, int aDuration, int aEUt) { if ((aItemA == null) || (aItemB == null) || (aOutputItems == null)) { @@ -145,20 +145,9 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { RECIPEHANDLER_Dehydrator.debug5(aItemA, aItemB, null, null, aOutputItems, aDuration, aEUt); return true; } - - @Override - public boolean addDehydratorRecipe(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutput, int aDuration, int aEUt) { - if ((aInput == null) || (aFluid == null) || (aOutput == null)) { - return false; - } - if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aInput, aDuration)) <= 0) { - return false; - } - Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutput, null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0); - RECIPEHANDLER_Dehydrator.debug5(aInput, null, aFluid, null, aOutput, aDuration, aEUt); - return true; - } - + + + @Override public boolean addDehydratorRecipe(FluidStack aFluid, FluidStack aOutputFluid, ItemStack[] aOutputItems, int aDuration, int aEUt){ if ((aFluid == null) || (aOutputFluid == null || aOutputItems == null)) { @@ -171,64 +160,85 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { RECIPEHANDLER_Dehydrator.debug5(null, null, aFluid, aOutputFluid, aOutputItems, aDuration, aEUt); return true; }*/ - - - - + + + @Override + public boolean addDehydratorRecipe(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutput, int aDuration, int aEUt) { + Utils.LOG_INFO("Trying to add a Dehydrator recipe."); + try{ + if ((aInput == null) || (aFluid == null) || (aOutput == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aInput, aDuration)) <= 0) { + return false; + } + Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutput, null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0); + //RECIPEHANDLER_Dehydrator.debug5(aInput, null, aFluid, null, aOutput, aDuration, aEUt); + return true; + }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");return false;} + } + + + + @Override - public boolean addDehydratorRecipe(ItemStack[] aInput, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack[] aOutputItems, int[] aChances, int aDuration, int aEUt) { + public boolean addDehydratorRecipe(ItemStack[] aInput, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack[] aOutputItems, int[] aChances, int aDuration, int aEUt) throws IndexOutOfBoundsException{ Utils.LOG_INFO("Trying to add a Dehydrator recipe."); - if (aInput[0] != null){ - Utils.LOG_INFO("Recipe requires input: "+aInput[0].getDisplayName()+" x"+aInput[0].stackSize); - } - if (aInput[1] != null){ - Utils.LOG_INFO("Recipe requires input: "+aInput[1].getDisplayName()+" x"+aInput[1].stackSize); - } - if (aFluidInput != null){ - Utils.LOG_INFO("Recipe requires input: "+aFluidInput.getFluid().getName()+" "+aFluidInput.amount+"mbst"); - } + try{ + if (aInput[0] != null){ + Utils.LOG_INFO("Recipe requires input: "+aInput[0].getDisplayName()+" x"+aInput[0].stackSize); + } + if (aInput.length > 1){ + if (aInput[1] != null){ + Utils.LOG_INFO("Recipe requires input: "+aInput[1].getDisplayName()+" x"+aInput[1].stackSize); + } + } + if (aFluidInput != null){ + Utils.LOG_INFO("Recipe requires input: "+aFluidInput.getFluid().getName()+" "+aFluidInput.amount+"mbst"); + } if (((aInput[0] == null) && (aFluidInput == null)) || ((aOutputItems == null) && (aFluidOutput == null))) { - return false; - } - if ((aOutputItems != null) && ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aOutputItems[0], aDuration)) <= 0)) { - return false; - } - if (aOutputItems != null){ - Utils.LOG_INFO("Recipe will output: "+UtilsItems.getArrayStackNames(aOutputItems)); - } - if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { - return false; - } - if (aFluidOutput != null){ - Utils.LOG_INFO("Recipe will output: "+aFluidOutput.getFluid().getName()); - } - - - - if (aInput[1] == null){ - Utils.LOG_INFO("Dehydrator recipe only has a single input item."); - Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); - - } - else { - Utils.LOG_INFO("Dehydrator recipe has two input items."); - Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); - - } - - return true; - } - - - - - - - - - - - - + return false; + } + if ((aOutputItems != null) && ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aOutputItems[0], aDuration)) <= 0)) { + return false; + } + if (aOutputItems != null){ + Utils.LOG_INFO("Recipe will output: "+UtilsItems.getArrayStackNames(aOutputItems)); + } + if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { + return false; + } + if (aFluidOutput != null){ + Utils.LOG_INFO("Recipe will output: "+aFluidOutput.getFluid().getName()); + } + + + + if (aInput.length == 1){ + Utils.LOG_INFO("Dehydrator recipe only has a single input item."); + Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + + } + else { + Utils.LOG_INFO("Dehydrator recipe has two input items."); + Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + + } + + return true; + }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");return false;} + } + + + + + + + + + + + + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java index cd9cb88f44..33dfb60e3f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java @@ -40,7 +40,7 @@ public class GregtechDehydrator GregtechItemList.GT_Dehydrator_EV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe( 813, "advancedmachine.dehydrator.tier.01", "Chemical Dehydrator I", 4, - "Remind Alkalus to add something here."+CORE.GT_Tooltip, + "This dehydrates your Grapes into Raisins. "+CORE.GT_Tooltip, Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, @@ -52,7 +52,7 @@ public class GregtechDehydrator null).getStackForm(1L)); GregtechItemList.GT_Dehydrator_IV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe( 814, "advancedmachine.dehydrator.tier.02", "Chemical Dehydrator II", 5, - "Remind Alkalus to add something here."+CORE.GT_Tooltip, + "A hangover is the way your body reacts to dehydration. "+CORE.GT_Tooltip, Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, @@ -64,7 +64,7 @@ public class GregtechDehydrator null).getStackForm(1L)); GregtechItemList.GT_Dehydrator_LuV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe( 815, "advancedmachine.dehydrator.tier.03", "Chemical Dehydrator III", 6, - "Remind Alkalus to add something here."+CORE.GT_Tooltip, + "You could probably make space icecream with this.. "+CORE.GT_Tooltip, Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, @@ -76,7 +76,7 @@ public class GregtechDehydrator null).getStackForm(1L)); GregtechItemList.GT_Dehydrator_ZPM.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe( 816, "advancedmachine.dehydrator.tier.04", "Chemical Dehydrator IV", 7, - "Remind Alkalus to add something here."+CORE.GT_Tooltip, + "You can definitely make space icecream with this.. "+CORE.GT_Tooltip, Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, -- cgit From 3db8acc3d1de3c040deb8ffc1d94808fc7a57e21 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Sat, 22 Oct 2016 17:32:02 +1000 Subject: + Added 2LiOHCaCO3. + Added Calcium Carbonate and Hydroxide. + Added Quicklime. + Added Lithium Carbonate, Fluoride, Peroxide and Hydroxide. + Added Beryllium Fluoride + Added recipes for the creation of all above chemical compounds. > FLiBe Fuel production chain is basically done. --- src/Java/gtPlusPlus/core/item/ModItems.java | 179 ++++++++++++--------- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 62 +++++++ 2 files changed, 162 insertions(+), 79 deletions(-) (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index a0304727f0..7304d15ee0 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -47,8 +47,8 @@ public final class ModItems { public static Item itemDebugShapeSpawner; public static Item itemBaseSpawnEgg; - - + + //Tantaloy60(789, TextureSet.SET_DULL, 8.0F, 5120, 3, 1 | 2 | 16 | 32 | 64 | 128, 213, 231, 237, 0, "Tantaloy 60", 0, 0, 3035, 2200, true, false, 1, 2, 1, Dyes.dyeLightGray, 2, Arrays.asList(new MaterialStack(Tungsten, 1), new MaterialStack(Tantalum, 9)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 8), new TC_AspectStack(TC_Aspects.STRONTIO, 3))), //Tantaloy61(790, TextureSet.SET_DULL, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 193, 211, 217, 0, "Tantaloy 61", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightGray, 2, Arrays.asList(new MaterialStack(Tungsten, 1), new MaterialStack(Tantalum, 9), new MaterialStack(Titanium, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 8), new TC_AspectStack(TC_Aspects.STRONTIO, 3))), @@ -103,7 +103,7 @@ public final class ModItems { public static BaseItemHotFood itemHotFoodRaisinToast; public static BaseItemFood itemFoodCurriedSausages; public static BaseItemHotFood itemHotFoodCurriedSausages; - + public static Item RfEuBattery; public static Item itemPersonalCloakingDevice; public static Item itemPersonalCloakingDeviceCharged; @@ -111,9 +111,9 @@ public final class ModItems { public static MultiPickaxeBase MP_GTMATERIAL; public static MultiSpadeBase MS_GTMATERIAL; - + public static ItemStack FluidCell; - + public static BaseItemBackpack backpack_Red; public static BaseItemBackpack backpack_Green; public static BaseItemBackpack backpack_Blue; @@ -130,14 +130,23 @@ public final class ModItems { public static BaseItemBackpack backpack_Gray; public static BaseItemBackpack backpack_Black; public static BaseItemBackpack backpack_White; - + + public static ItemBlueprint itemBlueprintBase; + public static Item dustLithiumCarbonate; + public static Item dustLithiumHydroxide; + public static Item dustLithiumPeroxide; + public static Item dustLithiumFluoride; public static Item dustUraniumTetraFluoride; public static Item dustUraniumHexaFluoride; - public static Item dustLithiumFluoride; - - public static ItemBlueprint itemBlueprintBase; + + public static Item dustBerylliumFluoride; + + public static Item dustQuicklime; + public static Item dustCalciumHydroxide; + public static Item dustCalciumCarbonate; + public static Item dust2LiOH_CaCO3; //@SuppressWarnings("unused") @@ -149,7 +158,7 @@ public final class ModItems { if (CORE.DEBUG){ DEBUG_INIT.registerItems(); } - + //Make some backpacks //Primary colours backpack_Red = new BaseItemBackpack("backpackRed", Utils.rgbtoHexValue(200, 0, 0)); @@ -171,61 +180,61 @@ public final class ModItems { backpack_Gray = new BaseItemBackpack("backpackGray", Utils.rgbtoHexValue(128, 128, 128)); backpack_Black = new BaseItemBackpack("backpackBlack", Utils.rgbtoHexValue(20, 20, 20)); backpack_White = new BaseItemBackpack("backpackWhite", Utils.rgbtoHexValue(240, 240, 240)); - + itemBlueprintBase = new ItemBlueprint("itemBlueprint"); - + //Start meta Item Generation ItemsFoods.load(); try{ - generateItemsFromMaterial(ALLOY.ENERGYCRYSTAL); - generateItemsFromMaterial(ALLOY.BLOODSTEEL); - generateItemsFromMaterial(ALLOY.STABALLOY); - generateItemsFromMaterial(ALLOY.TANTALLOY_60); - generateItemsFromMaterial(ALLOY.TANTALLOY_61); - generateItemsFromMaterial(ALLOY.BEDROCKIUM); - generateItemsFromMaterial(ALLOY.QUANTUM); - + generateItemsFromMaterial(ALLOY.ENERGYCRYSTAL); + generateItemsFromMaterial(ALLOY.BLOODSTEEL); + generateItemsFromMaterial(ALLOY.STABALLOY); + generateItemsFromMaterial(ALLOY.TANTALLOY_60); + generateItemsFromMaterial(ALLOY.TANTALLOY_61); + generateItemsFromMaterial(ALLOY.BEDROCKIUM); + generateItemsFromMaterial(ALLOY.QUANTUM); - generateItemsFromMaterial(ALLOY.INCONEL_625); - generateItemsFromMaterial(ALLOY.INCONEL_690); - generateItemsFromMaterial(ALLOY.INCONEL_792); - if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ - generateItemsFromMaterial(ALLOY.TUNGSTEN_CARBIDE); - } - generateItemsFromMaterial(ALLOY.SILICON_CARBIDE); - generateItemsFromMaterial(ALLOY.ZERON_100); - generateItemsFromMaterial(ALLOY.MARAGING250); - generateItemsFromMaterial(ALLOY.MARAGING300); - generateItemsFromMaterial(ALLOY.MARAGING350); - generateItemsFromMaterial(ALLOY.STELLITE); - generateItemsFromMaterial(ALLOY.TALONITE); - - //Tumbaga was the name given by Spaniards to a non-specific alloy of gold and copper - generateItemsFromMaterial(ALLOY.TUMBAGA); - //Potin is traditionally an alloy of bronze, tin and lead, with varying quantities of each possible - generateItemsFromMaterial(ALLOY.POTIN); - + generateItemsFromMaterial(ALLOY.INCONEL_625); + generateItemsFromMaterial(ALLOY.INCONEL_690); + generateItemsFromMaterial(ALLOY.INCONEL_792); + + if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ + generateItemsFromMaterial(ALLOY.TUNGSTEN_CARBIDE); + } + generateItemsFromMaterial(ALLOY.SILICON_CARBIDE); + generateItemsFromMaterial(ALLOY.ZERON_100); + generateItemsFromMaterial(ALLOY.MARAGING250); + generateItemsFromMaterial(ALLOY.MARAGING300); + generateItemsFromMaterial(ALLOY.MARAGING350); + generateItemsFromMaterial(ALLOY.STELLITE); + generateItemsFromMaterial(ALLOY.TALONITE); + + //Tumbaga was the name given by Spaniards to a non-specific alloy of gold and copper + generateItemsFromMaterial(ALLOY.TUMBAGA); + //Potin is traditionally an alloy of bronze, tin and lead, with varying quantities of each possible + generateItemsFromMaterial(ALLOY.POTIN); + + + generateItemsFromMaterial(ALLOY.HASTELLOY_W); + generateItemsFromMaterial(ALLOY.HASTELLOY_X); + generateItemsFromMaterial(ALLOY.HASTELLOY_C276); + generateItemsFromMaterial(ALLOY.HASTELLOY_N); + + generateItemsFromMaterial(ALLOY.INCOLOY_020); + generateItemsFromMaterial(ALLOY.INCOLOY_DS); + generateItemsFromMaterial(ALLOY.INCOLOY_MA956); + + + generateItemsFromMaterial(ELEMENT.ZIRCONIUM); + generateItemsFromMaterial(ALLOY.ZIRCONIUM_CARBIDE); + generateItemsFromMaterial(ALLOY.TANTALUM_CARBIDE); + generateItemsFromMaterial(ALLOY.NIOBIUM_CARBIDE); + + //Uranium-233 is a fissile isotope of uranium that is bred from thorium-232 as part of the thorium fuel cycle. + UtilsItems.generateItemsFromMaterial(ELEMENT.URANIUM233); - generateItemsFromMaterial(ALLOY.HASTELLOY_W); - generateItemsFromMaterial(ALLOY.HASTELLOY_X); - generateItemsFromMaterial(ALLOY.HASTELLOY_C276); - generateItemsFromMaterial(ALLOY.HASTELLOY_N); - - generateItemsFromMaterial(ALLOY.INCOLOY_020); - generateItemsFromMaterial(ALLOY.INCOLOY_DS); - generateItemsFromMaterial(ALLOY.INCOLOY_MA956); - - - generateItemsFromMaterial(ELEMENT.ZIRCONIUM); - generateItemsFromMaterial(ALLOY.ZIRCONIUM_CARBIDE); - generateItemsFromMaterial(ALLOY.TANTALUM_CARBIDE); - generateItemsFromMaterial(ALLOY.NIOBIUM_CARBIDE); - - //Uranium-233 is a fissile isotope of uranium that is bred from thorium-232 as part of the thorium fuel cycle. - UtilsItems.generateItemsFromMaterial(ELEMENT.URANIUM233); - } catch (Throwable r){ Utils.LOG_INFO("Failed to Generated a Material. "+r.getMessage()); //Utils.LOG_INFO("Failed to Generated a Material. "+r.getCause().getMessage()); @@ -234,24 +243,36 @@ public final class ModItems { r.printStackTrace(); System.exit(1); } - - - dustLithiumCarbonate = UtilsItems.generateSpecialUseDusts("LithiumCarbonate", "Lithium Carbonate", Utils.rgbtoHexValue(137, 139, 142))[0]; - + + + //Nuclear Fuel Dusts dustUraniumTetraFluoride = UtilsItems.generateSpecialUseDusts("UraniumTetrafluoride", "Uranium Tetrafluoride", Utils.rgbtoHexValue(17, 179, 42))[0]; dustUraniumHexaFluoride = UtilsItems.generateSpecialUseDusts("UraniumHexafluoride", "Uranium Hexafluoride", Utils.rgbtoHexValue(9, 199, 32))[0]; - dustLithiumFluoride = UtilsItems.generateSpecialUseDusts("LithiumFluoride", "Lithium Fluoride", Utils.rgbtoHexValue(245, 245, 245))[0]; - + + dustBerylliumFluoride = UtilsItems.generateSpecialUseDusts("BerylliumFluoride", "Beryllium Fluoride", Utils.rgbtoHexValue(175, 175, 175))[0]; //https://en.wikipedia.org/wiki/Beryllium_fluoride + + dustLithiumCarbonate = UtilsItems.generateSpecialUseDusts("LithiumCarbonate", "Lithium Carbonate", Utils.rgbtoHexValue(240, 240, 240))[0]; //https://en.wikipedia.org/wiki/Lithium_carbonate + dustLithiumFluoride = UtilsItems.generateSpecialUseDusts("LithiumFluoride", "Lithium Fluoride", Utils.rgbtoHexValue(245, 245, 245))[0]; //https://en.wikipedia.org/wiki/Lithium_fluoride + dustLithiumPeroxide = UtilsItems.generateSpecialUseDusts("LithiumPeroxide", "Lithium Peroxide", Utils.rgbtoHexValue(250, 250, 250))[0]; //https://en.wikipedia.org/wiki/Lithium_peroxide + dustLithiumHydroxide = UtilsItems.generateSpecialUseDusts("LithiumHydroxide", "Lithium Hydroxide", Utils.rgbtoHexValue(250, 250, 250))[0]; //https://en.wikipedia.org/wiki/Lithium_hydroxide + + if (UtilsItems.getItemStackOfAmountFromOreDict("dustQuicklime", 1).getItem() == ModItems.AAA_Broken || !LoadedMods.IHL){ + dustQuicklime = UtilsItems.generateSpecialUseDusts("Quicklime", "Quicklime", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_oxide + } + dustCalciumHydroxide = UtilsItems.generateSpecialUseDusts("CalciumHydroxide", "Hydrated Lime", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_hydroxide + dustCalciumCarbonate = UtilsItems.generateSpecialUseDusts("CalciumCarbonate", "Calcium Carbonate", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate + dust2LiOH_CaCO3 = UtilsItems.generateSpecialUseDusts("2LiOHCaCO3", "2LiOH & CaCO3 Compound", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate + boolean gtStyleTools = LoadedMods.Gregtech; - + Materials[] rm = Materials.values(); for (Materials m : rm){ MP_GTMATERIAL = UtilsItems.generateMultiPick(gtStyleTools, m); MS_GTMATERIAL = UtilsItems.generateMultiShovel(gtStyleTools, m); } - + //EnderIO Resources if (LoadedMods.EnderIO || LOAD_ALL_CONTENT){ Utils.LOG_INFO("EnderIO Found - Loading Resources."); @@ -263,7 +284,7 @@ public final class ModItems { itemPlateEnergeticAlloy = new BaseItemPlate("itemPlate"+"EnergeticAlloy", "Energetic Alloy", Utils.rgbtoHexValue(252, 152, 45), 2, 0); itemPlateVibrantAlloy = new BaseItemPlate("itemPlate"+"VibrantAlloy", "Vibrant Alloy", Utils.rgbtoHexValue(204, 242, 142), 2, 0); itemPlateConductiveIron = new BaseItemPlate("itemPlate"+"ConductiveIron", "Conductive Iron", Utils.rgbtoHexValue(164, 109, 100), 2, 0); - + } else { Utils.LOG_WARNING("EnderIO not Found - Skipping Resources."); @@ -275,7 +296,7 @@ public final class ModItems { itemPlateBlutonium = new BaseItemPlate("itemPlate"+"Blutonium", "Blutonium", Utils.rgbtoHexValue(0, 0, 255), 2, 0); itemPlateCyanite = new BaseItemPlate("itemPlate"+"Cyanite", "Cyanite", Utils.rgbtoHexValue(0, 191, 255), 2, 0); itemPlateLudicrite = new BaseItemPlate("itemPlate"+"Ludicrite", "Ludicrite", Utils.rgbtoHexValue(167, 5, 179), 2, 0); - + } else { Utils.LOG_WARNING("BigReactors not Found - Skipping Resources."); @@ -285,14 +306,14 @@ public final class ModItems { Utils.LOG_INFO("Thaumcraft Found - Loading Resources."); //Item Init try { - + UtilsItems.getItemForOreDict("Thaumcraft:ItemResource", "ingotVoidMetal", "Void Metal Ingot", 16); itemPlateVoidMetal = new BaseItemPlate("itemPlate"+"Void", "Void Metal", Utils.rgbtoHexValue(82, 17, 82), 2, 0); GT_OreDictUnificator.registerOre("plateVoidMetal", new ItemStack(ModItems.itemPlateVoidMetal)); } catch (NullPointerException e){ e.getClass(); } - + } else { Utils.LOG_WARNING("Thaumcraft not Found - Skipping Resources."); @@ -350,14 +371,14 @@ public final class ModItems { FuelRod_Uranium = new FuelRod_Base("itemFuelRod_Uranium", "Uranium", 2500, 2500); FuelRod_Plutonium = new FuelRod_Base("itemFuelRod_Plutonium", "Plutonium", 5000, 5000); RfEuBattery = new RF2EU_Battery(); - + try {Class baublesTest = Class.forName("baubles.api.IBauble"); - if (baublesTest != null){ - COMPAT_Baubles.run(); - } - else { - Utils.LOG_INFO("Baubles Not Found - Skipping Resources."); - } + if (baublesTest != null){ + COMPAT_Baubles.run(); + } + else { + Utils.LOG_INFO("Baubles Not Found - Skipping Resources."); + } } catch(Throwable T){ Utils.LOG_INFO("Baubles Not Found - Skipping Resources."); } @@ -366,10 +387,10 @@ public final class ModItems { //GameRegistry.registerItem(FuelRod_Thorium, "itemFuelRod_Thorium"); //GameRegistry.registerItem(FuelRod_Uranium, "itemFuelRod_Uranium"); //GameRegistry.registerItem(FuelRod_Plutonium, "itemFuelRod_Plutonium"); - + //FluidCell = new ItemStack(new IC2_ItemFluidCell("itemGT++FluidCell")); - - + + } else { Utils.LOG_WARNING("IndustrialCraft2 not Found - Skipping Resources."); diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index e583e05473..87832a4e4e 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -30,6 +30,7 @@ public class RECIPES_GREGTECH { distilleryRecipes(); extractorRecipes(); chemicalBathRecipes(); + chemicalReactorRecipes(); dehydratorRecipes(); addFuels(); } @@ -190,6 +191,8 @@ public class RECIPES_GREGTECH { 4000); //EU }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");} + + //Raisins from Grapes try { CORE.RA.addDehydratorRecipe( @@ -207,6 +210,45 @@ public class RECIPES_GREGTECH { }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");} + //Calcium Hydroxide + if (UtilsItems.getItemStackOfAmountFromOreDict("dustQuicklime", 1).getItem() != ModItems.AAA_Broken || LoadedMods.IHL){ + try { + + CORE.RA.addDehydratorRecipe( + new ItemStack[]{ + UtilsItems.getItemStackOfAmountFromOreDict("dustQuicklime", 10) + }, //Item input (Array, up to 2) + FluidUtils.getFluidStack("water", 10000), //Fluid input (slot 1) + null, //Fluid output (slot 2) + new ItemStack[]{ + UtilsItems.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 20) + }, //Output Array of Items - Upto 9, + new int[]{0}, + 120*20, //Time in ticks + 120); //EU + + }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");} + + //2 LiOH + CaCO3 + try { + + CORE.RA.addDehydratorRecipe( + new ItemStack[]{ + UtilsItems.getItemStackOfAmountFromOreDict("dust2LiOHCaCO3", 5) + }, //Item input (Array, up to 2) + null, //Fluid input (slot 1) + null, //Fluid output (slot 2) + new ItemStack[]{ + UtilsItems.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 2), + UtilsItems.getItemStackOfAmountFromOreDict("dustCalciumCarbonate", 3) + }, //Output Array of Items - Upto 9, + new int[]{0}, + 120*20, //Time in ticks + 1000); //EU + + }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");} + } + } private static void assemblerRecipes(){ @@ -263,6 +305,26 @@ public class RECIPES_GREGTECH { 90*20, 500); } + + private static void chemicalReactorRecipes(){ + GT_Values.RA.addChemicalRecipe( + UtilsItems.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 5), //Input Stack 1 + UtilsItems.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 5), //Input Stack 2 + null, //Fluid Input + null, //Fluid Output + UtilsItems.getItemStackOfAmountFromOreDict("dust2LiOHCaCO3", 10), //Output Stack + 600*20, + 128); + + GT_Values.RA.addChemicalRecipe( + UtilsItems.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 5), //Input Stack 1 + null, //Input Stack 2 + FluidUtils.getFluidStack("hydrofluoricacid", 2500), //Fluid Input + FluidUtils.getFluidStack("water", 2500), //Fluid Output + UtilsItems.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 5), //Output Stack + 600*20, + 128); + } } \ No newline at end of file -- cgit From b123b87177c907951f695d616c31f1d229412e60 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Sat, 22 Oct 2016 17:41:58 +1000 Subject: + Added Li2BeF4 Fuel Compound. + Added Blast furnace recipe - Will change this though later~ --- src/Java/gtPlusPlus/core/item/ModItems.java | 3 +++ src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 13 +++++++++++++ 2 files changed, 16 insertions(+) (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 7304d15ee0..debf8dbc24 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -147,6 +147,7 @@ public final class ModItems { public static Item dustCalciumHydroxide; public static Item dustCalciumCarbonate; public static Item dust2LiOH_CaCO3; + public static Item dustLi2BeF4; //@SuppressWarnings("unused") @@ -264,6 +265,8 @@ public final class ModItems { dustCalciumCarbonate = UtilsItems.generateSpecialUseDusts("CalciumCarbonate", "Calcium Carbonate", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate dust2LiOH_CaCO3 = UtilsItems.generateSpecialUseDusts("2LiOHCaCO3", "2LiOH & CaCO3 Compound", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate + //FLiBe Fuel Compounds + dustLi2BeF4 = UtilsItems.generateSpecialUseDusts("Li2BeF4", "Li2BeF4 Fuel Compound", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate boolean gtStyleTools = LoadedMods.Gregtech; diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index 87832a4e4e..9debd34283 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -32,6 +32,7 @@ public class RECIPES_GREGTECH { chemicalBathRecipes(); chemicalReactorRecipes(); dehydratorRecipes(); + blastFurnaceRecipes(); addFuels(); } @@ -325,6 +326,18 @@ public class RECIPES_GREGTECH { 600*20, 128); } + + private static void blastFurnaceRecipes(){ + GT_Values.RA.addBlastRecipe( + UtilsItems.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 2), + UtilsItems.getItemStackOfAmountFromOreDict("dustBerylliumFluoride", 1), + GT_Values.NF, GT_Values.NF, + UtilsItems.getItemStackOfAmountFromOreDict("dustLi2BeF4", 3), + null, + 60*20, + 2000, + 3000); + } } \ No newline at end of file -- cgit From 3826cbb1223a25a6d476486d9369d65a22090aec Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Sun, 23 Oct 2016 07:36:05 +1000 Subject: % Massive Material Backend Changes. (Nothing noticeable to players) + Added Chemical Compounds to Dust stacks, so you know how to make/use them. + As an idea, added Deci and Centi dusts, each representing .10 and point .01 of a full dust. (Probably will remove these, or use them for unique crafting options) % Moved Radiation data to Material class. % Created a BaseItemComponent and made all machine components except ingots/dusts utilise it. (Saves boiler-plating 30 lines per class and also it's using OOP for it's real job) --- .classpath | 2 +- src/Java/gtPlusPlus/core/item/ModItems.java | 41 +++--- .../core/item/base/BaseItemComponent.java | 151 ++++++++++++++++++++ .../core/item/base/bolts/BaseItemBolt.java | 63 +------- .../core/item/base/dusts/BaseItemDust.java | 3 + .../item/base/dusts/decimal/BaseItemCentidust.java | 56 ++++++++ .../item/base/dusts/decimal/BaseItemDecidust.java | 56 ++++++++ .../core/item/base/gears/BaseItemGear.java | 64 +-------- .../core/item/base/plates/BaseItemPlate.java | 91 ++---------- .../core/item/base/plates/BaseItemPlateDouble.java | 118 +-------------- .../core/item/base/rings/BaseItemRing.java | 61 +------- .../core/item/base/rods/BaseItemRod.java | 93 ++---------- .../core/item/base/rods/BaseItemRodLong.java | 70 +-------- .../core/item/base/rotors/BaseItemRotor.java | 80 ++--------- .../core/item/base/screws/BaseItemScrew.java | 57 +------- src/Java/gtPlusPlus/core/material/ELEMENT.java | 4 +- src/Java/gtPlusPlus/core/material/Material.java | 158 +++++++++++++++++++-- .../gtPlusPlus/core/material/MaterialStack.java | 14 +- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 8 +- src/Java/gtPlusPlus/core/util/Utils.java | 5 +- src/Java/gtPlusPlus/core/util/item/UtilsItems.java | 79 ++++++++--- .../core/util/materials/MaterialUtils.java | 80 ++++++++++- .../miscutils/textures/items/itemCentidust.png | Bin 0 -> 2878 bytes .../miscutils/textures/items/itemDecidust.png | Bin 0 -> 2906 bytes 24 files changed, 658 insertions(+), 696 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java create mode 100644 src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemCentidust.java create mode 100644 src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemDecidust.java create mode 100644 src/resources/assets/miscutils/textures/items/itemCentidust.png create mode 100644 src/resources/assets/miscutils/textures/items/itemDecidust.png (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/.classpath b/.classpath index 94f92859a9..63adf24f81 100644 --- a/.classpath +++ b/.classpath @@ -13,6 +13,6 @@ - + diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index debf8dbc24..74ea3ed4d3 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -9,6 +9,8 @@ import gtPlusPlus.core.common.compat.COMPAT_Baubles; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.item.base.BaseItemBackpack; import gtPlusPlus.core.item.base.CoreItem; +import gtPlusPlus.core.item.base.dusts.decimal.BaseItemCentidust; +import gtPlusPlus.core.item.base.dusts.decimal.BaseItemDecidust; import gtPlusPlus.core.item.base.foods.BaseItemFood; import gtPlusPlus.core.item.base.foods.BaseItemHotFood; import gtPlusPlus.core.item.base.ingots.BaseItemIngot; @@ -111,6 +113,9 @@ public final class ModItems { public static MultiPickaxeBase MP_GTMATERIAL; public static MultiSpadeBase MS_GTMATERIAL; + + public static BaseItemDecidust itemBaseDecidust; + public static BaseItemCentidust itemBaseCentidust; public static ItemStack FluidCell; @@ -266,7 +271,7 @@ public final class ModItems { dust2LiOH_CaCO3 = UtilsItems.generateSpecialUseDusts("2LiOHCaCO3", "2LiOH & CaCO3 Compound", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate //FLiBe Fuel Compounds - dustLi2BeF4 = UtilsItems.generateSpecialUseDusts("Li2BeF4", "Li2BeF4 Fuel Compound", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate + dustLi2BeF4 = UtilsItems.generateSpecialUseDusts("Li2BeF4", "Li2BeF4 Fuel Compound", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/FLiBe boolean gtStyleTools = LoadedMods.Gregtech; @@ -274,19 +279,21 @@ public final class ModItems { for (Materials m : rm){ MP_GTMATERIAL = UtilsItems.generateMultiPick(gtStyleTools, m); MS_GTMATERIAL = UtilsItems.generateMultiShovel(gtStyleTools, m); + itemBaseDecidust = UtilsItems.generateDecidust(m); + itemBaseCentidust = UtilsItems.generateCentidust(m); } //EnderIO Resources if (LoadedMods.EnderIO || LOAD_ALL_CONTENT){ Utils.LOG_INFO("EnderIO Found - Loading Resources."); //Item Init - itemPlateSoularium = new BaseItemPlate("itemPlate"+"Soularium", "Soularium", Utils.rgbtoHexValue(95, 90, 54), 2, 0); - itemPlateRedstoneAlloy = new BaseItemPlate("itemPlate"+"RedstoneAlloy", "Redstone Alloy", Utils.rgbtoHexValue(178,34,34), 2, 0); - itemPlateElectricalSteel =new BaseItemPlate("itemPlate"+"ElectricalSteel", "Electrical Steel", Utils.rgbtoHexValue(194, 194, 194), 2, 0); - itemPlatePulsatingIron = new BaseItemPlate("itemPlate"+"PhasedIron", "Pulsating Iron", Utils.rgbtoHexValue(50, 91, 21), 2, 0); - itemPlateEnergeticAlloy = new BaseItemPlate("itemPlate"+"EnergeticAlloy", "Energetic Alloy", Utils.rgbtoHexValue(252, 152, 45), 2, 0); - itemPlateVibrantAlloy = new BaseItemPlate("itemPlate"+"VibrantAlloy", "Vibrant Alloy", Utils.rgbtoHexValue(204, 242, 142), 2, 0); - itemPlateConductiveIron = new BaseItemPlate("itemPlate"+"ConductiveIron", "Conductive Iron", Utils.rgbtoHexValue(164, 109, 100), 2, 0); + itemPlateSoularium = new BaseItemPlate("itemPlate"+"Soularium", "Soularium", new short[]{95, 90, 54}, 2, 0); + itemPlateRedstoneAlloy = new BaseItemPlate("itemPlate"+"RedstoneAlloy", "Redstone Alloy", new short[]{178,34,34}, 2, 0); + itemPlateElectricalSteel =new BaseItemPlate("itemPlate"+"ElectricalSteel", "Electrical Steel", new short[]{194, 194, 194}, 2, 0); + itemPlatePulsatingIron = new BaseItemPlate("itemPlate"+"PhasedIron", "Phased Iron", new short[]{50, 91, 21}, 2, 0); + itemPlateEnergeticAlloy = new BaseItemPlate("itemPlate"+"EnergeticAlloy", "Energetic Alloy", new short[]{252, 152, 45}, 2, 0); + itemPlateVibrantAlloy = new BaseItemPlate("itemPlate"+"VibrantAlloy", "Vibrant Alloy", new short[]{204, 242, 142}, 2, 0); + itemPlateConductiveIron = new BaseItemPlate("itemPlate"+"ConductiveIron", "Conductive Iron", new short[]{164, 109, 100}, 2, 0); } else { @@ -296,9 +303,9 @@ public final class ModItems { if (LoadedMods.Big_Reactors|| LOAD_ALL_CONTENT){ Utils.LOG_INFO("BigReactors Found - Loading Resources."); //Item Init - itemPlateBlutonium = new BaseItemPlate("itemPlate"+"Blutonium", "Blutonium", Utils.rgbtoHexValue(0, 0, 255), 2, 0); - itemPlateCyanite = new BaseItemPlate("itemPlate"+"Cyanite", "Cyanite", Utils.rgbtoHexValue(0, 191, 255), 2, 0); - itemPlateLudicrite = new BaseItemPlate("itemPlate"+"Ludicrite", "Ludicrite", Utils.rgbtoHexValue(167, 5, 179), 2, 0); + itemPlateBlutonium = new BaseItemPlate("itemPlate"+"Blutonium", "Blutonium", new short[]{0, 0, 255}, 2, 0); + itemPlateCyanite = new BaseItemPlate("itemPlate"+"Cyanite", "Cyanite", new short[]{0, 191, 255}, 2, 0); + itemPlateLudicrite = new BaseItemPlate("itemPlate"+"Ludicrite", "Ludicrite", new short[]{167, 5, 179}, 2, 0); } else { @@ -311,7 +318,7 @@ public final class ModItems { try { UtilsItems.getItemForOreDict("Thaumcraft:ItemResource", "ingotVoidMetal", "Void Metal Ingot", 16); - itemPlateVoidMetal = new BaseItemPlate("itemPlate"+"Void", "Void Metal", Utils.rgbtoHexValue(82, 17, 82), 2, 0); + itemPlateVoidMetal = new BaseItemPlate("itemPlate"+"Void", "Void", new short[]{82, 17, 82}, 2, 0); GT_OreDictUnificator.registerOre("plateVoidMetal", new ItemStack(ModItems.itemPlateVoidMetal)); } catch (NullPointerException e){ e.getClass(); @@ -340,7 +347,7 @@ public final class ModItems { if (LoadedMods.PneumaticCraft|| LOAD_ALL_CONTENT){ Utils.LOG_INFO("PneumaticCraft Found - Loading Resources."); //Item Init - itemPlateCompressedIron = new BaseItemPlate("itemPlate"+"CompressedIron", "Compressed Iron", Utils.rgbtoHexValue(128, 128, 128), 2, 0); + itemPlateCompressedIron = new BaseItemPlate("itemPlate"+"CompressedIron", "Compressed Iron", new short[]{128, 128, 128}, 2, 0); } else { Utils.LOG_WARNING("PneumaticCraft not Found - Skipping Resources."); @@ -360,7 +367,7 @@ public final class ModItems { if (LoadedMods.RFTools|| LOAD_ALL_CONTENT){ Utils.LOG_INFO("rfTools Found - Loading Resources."); //Item Init - itemPlateDimensionShard = new BaseItemPlate("itemPlate"+"DimensionShard", "Dimensional Shard", Utils.rgbtoHexValue(170, 230, 230), 2, 0); + itemPlateDimensionShard = new BaseItemPlate("itemPlate"+"DimensionShard", "Dimensional Shard", new short[]{170, 230, 230}, 2, 0); } else { Utils.LOG_WARNING("rfTools not Found - Skipping Resources."); @@ -402,8 +409,8 @@ public final class ModItems { //Special Item Handling Case if (configSwitches.enableAlternativeBatteryAlloy) { - ModItems.itemIngotBatteryAlloy = new BaseItemIngot("itemIngotBatteryAlloy", "Battery Alloy", Utils.rgbtoHexValue(35, 228, 141), 0); - ModItems.itemPlateBatteryAlloy = new BaseItemPlate("itemPlateBatteryAlloy", "Battery Alloy", Utils.rgbtoHexValue(35, 228, 141), 2, 0); + //ModItems.itemIngotBatteryAlloy = new BaseItemIngot("itemIngotBatteryAlloy", "Battery Alloy", new short[]{35, 228, 141}, 0); TODO + ModItems.itemPlateBatteryAlloy = new BaseItemPlate("itemPlateBatteryAlloy", "Battery Alloy", new short[]{35, 228, 141}, 2, 0); } @@ -447,4 +454,4 @@ public final class ModItems { //ItemBlockGtFrameBox = new ItemBlockGtFrameBox(ModBlocks.blockGtFrameSet1); //GameRegistry.registerItem(ItemBlockGtFrameBox, "itemGtFrameBoxSet1"); } -} \ No newline at end of file +} diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java new file mode 100644 index 0000000000..46a39a5883 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -0,0 +1,151 @@ +package gtPlusPlus.core.item.base; + +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 java.util.List; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import cpw.mods.fml.common.registry.GameRegistry; + +public class BaseItemComponent extends Item{ + + public final Material componentMaterial; + public final String materialName; + public final String unlocalName; + public final ComponentTypes componentType; + + public BaseItemComponent(Material material, ComponentTypes componentType) { + this.componentMaterial = material; + this.unlocalName = "item"+componentType.COMPONENT_NAME+material.getUnlocalizedName(); + this.materialName = material.getLocalizedName(); + this.componentType = componentType; + this.setCreativeTab(AddToCreativeTab.tabMisc); + this.setUnlocalizedName(unlocalName); + this.setMaxStackSize(64); + this.setTextureName(CORE.MODID + ":" + "item"+componentType.COMPONENT_NAME); + GameRegistry.registerItem(this, unlocalName); + GT_OreDictUnificator.registerOre(componentType.COMPONENT_NAME.toLowerCase()+material.getUnlocalizedName(), UtilsItems.getSimpleStack(this)); + } + + @Override + public String getItemStackDisplayName(ItemStack p_77653_1_) { + + return (componentMaterial.getLocalizedName()+componentType.DISPLAY_NAME); + } + + public final String getMaterialName() { + return materialName; + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { + + if (materialName != null && materialName != "" && !materialName.equals("")){ + + + if (componentType == ComponentTypes.DUST){ + list.add(EnumChatFormatting.GRAY+"A pile of " + materialName + " dust."); + } + if (componentType == ComponentTypes.INGOT){ + list.add(EnumChatFormatting.GRAY+"A solid ingot of " + materialName + "."); + if (materialName != null && materialName != "" && !materialName.equals("") && unlocalName.toLowerCase().contains("ingothot")){ + list.add(EnumChatFormatting.GRAY+"Warning: "+EnumChatFormatting.RED+"Very hot! "+EnumChatFormatting.GRAY+" Avoid direct handling.."); + } + } + if (componentType == ComponentTypes.PLATE){ + list.add(EnumChatFormatting.GRAY+"A flat plate of " + materialName + "."); + } + if (componentType == ComponentTypes.PLATEDOUBLE){ + list.add(EnumChatFormatting.GRAY+"A double plate of " + materialName + "."); + } + if (componentType == ComponentTypes.ROD){ + list.add(EnumChatFormatting.GRAY+"A 40cm Rod of " + materialName + "."); + } + if (componentType == ComponentTypes.RODLONG){ + list.add(EnumChatFormatting.GRAY+"A 80cm Rod of " + materialName + "."); + } + if (componentType == ComponentTypes.ROTOR){ + list.add(EnumChatFormatting.GRAY+"A Rotor made out of " + materialName + ". "); + } + if (componentType == ComponentTypes.BOLT){ + list.add(EnumChatFormatting.GRAY+"A small Bolt, constructed from " + materialName + "."); + } + if (componentType == ComponentTypes.SCREW){ + list.add(EnumChatFormatting.GRAY+"A 8mm Screw, fabricated out of some " + materialName + "."); + } + if (componentType == ComponentTypes.GEAR){ + list.add(EnumChatFormatting.GRAY+"A large Gear, constructed from " + materialName + "."); + } + if (componentType == ComponentTypes.RING){ + list.add(EnumChatFormatting.GRAY+"A " + materialName + " Ring."); + } + if (componentMaterial.isRadioactive){ + list.add(CORE.GT_Tooltip_Radioactive); + } + + } + + super.addInformation(stack, aPlayer, list, bool); + } + + + @Override + public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { + return componentMaterial.getRgbAsHex(); + } + + @Override + public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) { + Utils.applyRadiationDamageToEntity(componentMaterial.vRadioationLevel, world, entityHolding); + } + + + + + + + + + public static enum ComponentTypes { + DUST("Dust", " Dust"), + INGOT("Ingot", " Ingot"), + PLATE("Plate", " Plate"), + PLATEDOUBLE("PlateDouble", " Double Plate"), + ROD("Rod", " Rod"), + RODLONG("RodLong", " Long Rod"), + GEAR("Gear", " Gear"), + SCREW("Screw", " Screw"), + BOLT("Bolt", " Bolt"), + ROTOR("Rotor", " Rotor"), + RING("Ring", " Ring"); + + private String COMPONENT_NAME; + private String DISPLAY_NAME; + private ComponentTypes (final String LocalName, String DisplayName){ + this.COMPONENT_NAME = LocalName; + this.DISPLAY_NAME = DisplayName; + } + + public String getComponent(){ + return COMPONENT_NAME; + } + + public String getName(){ + return DISPLAY_NAME; + } + } + +} + + diff --git a/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java b/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java index 3d56307f39..0bd42e6eac 100644 --- a/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java +++ b/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java @@ -2,80 +2,31 @@ package gtPlusPlus.core.item.base.bolts; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; -import gregtech.api.util.GT_OreDictUnificator; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.UtilsItems; -import gtPlusPlus.core.util.math.MathUtils; - -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import cpw.mods.fml.common.registry.GameRegistry; -public class BaseItemBolt extends Item{ - - final Material boltMaterial; - final String materialName; - final String unlocalName; +public class BaseItemBolt extends BaseItemComponent{ public BaseItemBolt(Material material) { - this.boltMaterial = material; - this.unlocalName = "itemBolt"+material.getUnlocalizedName(); - this.materialName = material.getLocalizedName(); - this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalName); - this.setMaxStackSize(64); - this.setTextureName(CORE.MODID + ":" + "itemBolt"); - GameRegistry.registerItem(this, unlocalName); - GT_OreDictUnificator.registerOre(unlocalName.replace("itemB", "b"), UtilsItems.getSimpleStack(this)); + super(material, BaseItemComponent.ComponentTypes.BOLT); + addExtruderRecipe(); } - @Override - public String getItemStackDisplayName(ItemStack p_77653_1_) { - - return (materialName+ " Bolt"); - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { - if (materialName != null && materialName != "" && !materialName.equals("")){ - list.add(EnumChatFormatting.GRAY+"A small Bolt, constructed from " + materialName + "."); - } - super.addInformation(stack, aPlayer, list, bool); - } - - public final String getMaterialName() { - return materialName; - } - - @Override - public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (boltMaterial.getRgbAsHex() == 0){ - return MathUtils.generateSingularRandomHexValue(); - } - return boltMaterial.getRgbAsHex(); - - } - private void addExtruderRecipe(){ Utils.LOG_WARNING("Adding recipe for "+materialName+" Bolts"); String tempIngot = unlocalName.replace("itemBolt", "ingot"); ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); if (null != tempOutputStack){ GT_Values.RA.addExtruderRecipe(tempOutputStack, - ItemList.Shape_Extruder_Bolt.get(1), + ItemList.Shape_Extruder_Bolt.get(0), UtilsItems.getSimpleStack(this, 8), - (int) Math.max(boltMaterial.getMass() * 2L * 1, 1), - 8 * boltMaterial.vVoltageMultiplier); + (int) Math.max(componentMaterial.getMass() * 2L * 1, 1), + 8 * componentMaterial.vVoltageMultiplier); } - } } diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index f16355593b..be020b7d05 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -113,6 +113,9 @@ public class BaseItemDust extends Item{ if (sRadiation > 0){ list.add(CORE.GT_Tooltip_Radioactive); } + if (dustInfo != null){ + list.add(dustInfo.vChemicalFormula); + } //} super.addInformation(stack, aPlayer, list, bool); } diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemCentidust.java b/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemCentidust.java new file mode 100644 index 0000000000..0faa781fd9 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemCentidust.java @@ -0,0 +1,56 @@ +package gtPlusPlus.core.item.base.dusts.decimal; + +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; + +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import cpw.mods.fml.common.registry.GameRegistry; + +public class BaseItemCentidust extends Item{ + + final Material dustMaterial; + final String materialName; + final String unlocalName; + + public BaseItemCentidust(Material material) { + this.dustMaterial = material; + this.unlocalName = "itemCentidust"+material.getUnlocalizedName(); + this.materialName = material.getLocalizedName(); + this.setCreativeTab(AddToCreativeTab.tabMisc); + this.setUnlocalizedName(unlocalName); + this.setMaxStackSize(10); + this.setTextureName(CORE.MODID + ":" + "itemCentidust"); //TODO + GameRegistry.registerItem(this, unlocalName); + //GT_OreDictUnificator.registerOre(unlocalName.replace("itemR", "r"), UtilsItems.getSimpleStack(this)); //TODO + } + + @Override + public String getItemStackDisplayName(ItemStack p_77653_1_) { + + return (materialName+ " Centidust"); + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { + if (materialName != null && materialName != "" && !materialName.equals("")){ + list.add(EnumChatFormatting.GRAY+"1% of a " + materialName + " dust pile."); + } + super.addInformation(stack, aPlayer, list, bool); + } + + public final String getMaterialName() { + return materialName; + } + + @Override + public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { + return dustMaterial.getRgbAsHex(); + } + +} diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemDecidust.java b/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemDecidust.java new file mode 100644 index 0000000000..afb9eef473 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemDecidust.java @@ -0,0 +1,56 @@ +package gtPlusPlus.core.item.base.dusts.decimal; + +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; + +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import cpw.mods.fml.common.registry.GameRegistry; + +public class BaseItemDecidust extends Item{ + + final Material dustMaterial; + final String materialName; + final String unlocalName; + + public BaseItemDecidust(Material material) { + this.dustMaterial = material; + this.unlocalName = "itemDecidust"+material.getUnlocalizedName(); + this.materialName = material.getLocalizedName(); + this.setCreativeTab(AddToCreativeTab.tabMisc); + this.setUnlocalizedName(unlocalName); + this.setMaxStackSize(10); + this.setTextureName(CORE.MODID + ":" + "itemDecidust"); //TODO + GameRegistry.registerItem(this, unlocalName); + //GT_OreDictUnificator.registerOre(unlocalName.replace("itemR", "r"), UtilsItems.getSimpleStack(this)); //TODO + } + + @Override + public String getItemStackDisplayName(ItemStack p_77653_1_) { + + return (materialName+ " Decidust"); + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { + if (materialName != null && materialName != "" && !materialName.equals("")){ + list.add(EnumChatFormatting.GRAY+"10% of a " + materialName + " dust pile."); + } + super.addInformation(stack, aPlayer, list, bool); + } + + public final String getMaterialName() { + return materialName; + } + + @Override + public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { + return dustMaterial.getRgbAsHex(); + } + +} diff --git a/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java b/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java index 47ce5b7815..56784e8530 100644 --- a/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java +++ b/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java @@ -2,79 +2,29 @@ package gtPlusPlus.core.item.base.gears; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; -import gregtech.api.util.GT_OreDictUnificator; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.UtilsItems; -import gtPlusPlus.core.util.math.MathUtils; - -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import cpw.mods.fml.common.registry.GameRegistry; -public class BaseItemGear extends Item{ - - final Material gearMaterial; - final String materialName; - final String unlocalName; +public class BaseItemGear extends BaseItemComponent{ public BaseItemGear(Material material) { - this.gearMaterial = material; - this.unlocalName = "itemGear"+material.getUnlocalizedName(); - this.materialName = material.getLocalizedName(); - this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalName); - this.setMaxStackSize(64); - this.setTextureName(CORE.MODID + ":" + "itemGear"); - GameRegistry.registerItem(this, unlocalName); - GT_OreDictUnificator.registerOre(unlocalName.replace("itemG", "g"), UtilsItems.getSimpleStack(this)); + super(material, BaseItemComponent.ComponentTypes.GEAR); addExtruderRecipe(); } - @Override - public String getItemStackDisplayName(ItemStack p_77653_1_) { - - return (gearMaterial.getLocalizedName()+ " Gear"); - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { - if (materialName != null && materialName != "" && !materialName.equals("")){ - list.add(EnumChatFormatting.GRAY+"A large Gear, constructed from " + materialName + "."); - } - super.addInformation(stack, aPlayer, list, bool); - } - - public final String getMaterialName() { - return materialName; - } - - @Override - public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (gearMaterial.getRgbAsHex() == 0){ - return MathUtils.generateSingularRandomHexValue(); - } - return gearMaterial.getRgbAsHex(); - - } - private void addExtruderRecipe(){ Utils.LOG_WARNING("Adding recipe for "+materialName+" Gears"); - ItemStack tempOutputStack = gearMaterial.getIngot(8); + ItemStack tempOutputStack = componentMaterial.getIngot(8); if (null != tempOutputStack){ - GT_Values.RA.addExtruderRecipe( tempOutputStack, - ItemList.Shape_Extruder_Gear.get(1), + ItemList.Shape_Extruder_Gear.get(0), UtilsItems.getSimpleStack(this), - (int) Math.max(gearMaterial.getMass() * 5L, 1), - 8 * gearMaterial.vVoltageMultiplier); + (int) Math.max(componentMaterial.getMass() * 5L, 1), + 8 * componentMaterial.vVoltageMultiplier); } } diff --git a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java index 103198a395..3d1153eb6a 100644 --- a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java +++ b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java @@ -1,92 +1,19 @@ package gtPlusPlus.core.item.base.plates; -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.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; -import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.item.base.BaseItemComponent; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.util.materials.MaterialUtils; -import java.util.List; +public class BaseItemPlate extends BaseItemComponent{ -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import cpw.mods.fml.common.registry.GameRegistry; - -public class BaseItemPlate extends Item{ - - protected int colour; - protected String materialName; - protected String unlocalName; - private int mTier; - - public BaseItemPlate(String unlocalizedName, String materialName, int colour, int tier, int sRadioactivity) { - setUnlocalizedName(unlocalizedName); - this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalizedName); - this.unlocalName = unlocalizedName; - this.setMaxStackSize(64); - this.setTextureName(CORE.MODID + ":" + "itemPlate"); - this.colour = colour; - this.mTier = tier; - this.materialName = materialName; - this.sRadiation = sRadioactivity; - GameRegistry.registerItem(this, unlocalizedName); - GT_OreDictUnificator.registerOre(unlocalName.replace("itemP", "p"), UtilsItems.getSimpleStack(this)); - //addBendingRecipe(); - } - - @Override - public String getItemStackDisplayName(ItemStack p_77653_1_) { - - return (materialName+ " Plate"); - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { - if (materialName != null && materialName != "" && !materialName.equals("")){ - list.add(EnumChatFormatting.GRAY+"A flat plate of " + materialName + "."); - } - if (sRadiation > 0){ - list.add(CORE.GT_Tooltip_Radioactive); - } - super.addInformation(stack, aPlayer, list, bool); + public BaseItemPlate(Material material) { + super(material, BaseItemComponent.ComponentTypes.PLATE); } - - public final String getMaterialName() { - return materialName; + + public BaseItemPlate(String unlocalizedName, String materialName, short[] colour, int tier, int sRadioactivity) { + this(MaterialUtils.generateQuickMaterial(materialName, new short[]{colour[0], colour[1], colour[2], 0}, sRadioactivity)); } - @Override - public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (colour == 0){ - return MathUtils.generateSingularRandomHexValue(); - } - return colour; - - } - 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); - } - - private void addBendingRecipe(){ - Utils.LOG_WARNING("Adding recipe for "+materialName+" Plates"); - String tempIngot = unlocalName.replace("itemPlate", "ingot"); - ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); - if (null != tempOutputStack){ - GT_Values.RA.addBenderRecipe(tempOutputStack, - UtilsItems.getSimpleStack(this), - 14*mTier*20, - 64*mTier); - } - } } diff --git a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java index e6bfc1253a..ce8bbe8191 100644 --- a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java +++ b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java @@ -1,126 +1,18 @@ package gtPlusPlus.core.item.base.plates; -import gregtech.api.enums.GT_Values; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; -import gtPlusPlus.core.util.math.MathUtils; - -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; +import gtPlusPlus.core.item.base.BaseItemComponent; +import gtPlusPlus.core.material.Material; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import cpw.mods.fml.common.registry.GameRegistry; - -public class BaseItemPlateDouble extends Item{ - protected int colour; - protected String materialName; - protected String unlocalName; - private int mTier; +public class BaseItemPlateDouble extends BaseItemComponent{ - public BaseItemPlateDouble(String unlocalizedName, String materialName, int colour, int tier, int sRadioactivity) { - setUnlocalizedName(unlocalizedName); - this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalizedName); - this.unlocalName = unlocalizedName; + public BaseItemPlateDouble(Material material) { + super(material, BaseItemComponent.ComponentTypes.PLATEDOUBLE); this.setMaxStackSize(32); - this.setTextureName(CORE.MODID + ":" + "itemPlateDouble"); - this.colour = colour; - this.mTier = tier; - this.materialName = materialName; - this.sRadiation = sRadioactivity; - GameRegistry.registerItem(this, unlocalizedName); - GT_OreDictUnificator.registerOre(unlocalName.replace("itemP", "p"), UtilsItems.getSimpleStack(this)); - //addBendingRecipe(); - //addCraftingRecipe(); } @Override public String getItemStackDisplayName(ItemStack p_77653_1_) { - return ("Double "+materialName+ " Plate"); } - - @Override - public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { - if (materialName != null && materialName != "" && !materialName.equals("")){ - list.add(EnumChatFormatting.GRAY+"A double plate of " + materialName + "."); - } - if (sRadiation > 0){ - list.add(CORE.GT_Tooltip_Radioactive); - } - super.addInformation(stack, aPlayer, list, bool); - } - - public final String getMaterialName() { - return materialName; - } - - @Override - public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (colour == 0){ - return MathUtils.generateSingularRandomHexValue(); - } - return colour; - - } - - 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); - } - - private void addBendingRecipe(){ - Utils.LOG_WARNING("Adding bender recipe for "+materialName+" Double Plates"); - String tempIngot = unlocalName.replace("itemPlateDouble", "ingot"); - String tempPlate = unlocalName.replace("itemPlateDouble", "plate"); - ItemStack inputIngot = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 2); - ItemStack inputPlate = UtilsItems.getItemStackOfAmountFromOreDict(tempPlate, 2); - if (null != inputIngot){ - GT_Values.RA.addBenderRecipe(inputIngot, - UtilsItems.getSimpleStack(this), - 4*20, - 96); - } - if (null != inputPlate){ - GT_Values.RA.addBenderRecipe(inputPlate, - UtilsItems.getSimpleStack(this), - 4*20, - 96); - } - } - - private void addCraftingRecipe(){ - Utils.LOG_WARNING("Adding crafting recipes for "+materialName+" Double Plates"); - String tempPlate = unlocalName.replace("itemPlateDouble", "plate"); - ItemStack inputPlate = UtilsItems.getItemStackOfAmountFromOreDict(tempPlate, 1); - if (null != inputPlate){ - - GT_ModHandler.addCraftingRecipe( - GT_Utility.copyAmount(1L, new Object[]{UtilsItems.getSimpleStack(this)}), - gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, - new Object[]{"I", "B", "h", - Character.valueOf('I'), - inputPlate, - Character.valueOf('B'), - inputPlate}); - - GT_ModHandler.addShapelessCraftingRecipe( - GT_Utility.copyAmount(1L, new Object[]{UtilsItems.getSimpleStack(this)}), - new Object[]{gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, - inputPlate, - inputPlate}); - } - } - } diff --git a/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java b/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java index d03b2b4e2f..fd09276dc3 100644 --- a/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java +++ b/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java @@ -2,69 +2,20 @@ package gtPlusPlus.core.item.base.rings; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; -import gregtech.api.util.GT_OreDictUnificator; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.item.base.BaseItemComponent; 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; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import cpw.mods.fml.common.registry.GameRegistry; -public class BaseItemRing extends Item{ - - final Material ringMaterial; - final String materialName; - final String unlocalName; +public class BaseItemRing extends BaseItemComponent{ public BaseItemRing(Material material) { - this.ringMaterial = material; - this.unlocalName = "itemRing"+material.getUnlocalizedName(); - this.materialName = material.getLocalizedName(); - this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalName); - this.setMaxStackSize(64); - this.setTextureName(CORE.MODID + ":" + "itemRing"); - GameRegistry.registerItem(this, unlocalName); - GT_OreDictUnificator.registerOre(unlocalName.replace("itemR", "r"), UtilsItems.getSimpleStack(this)); + super(material, BaseItemComponent.ComponentTypes.RING); addExtruderRecipe(); } - @Override - public String getItemStackDisplayName(ItemStack p_77653_1_) { - - return (materialName+ " Ring"); - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { - if (materialName != null && materialName != "" && !materialName.equals("")){ - list.add(EnumChatFormatting.GRAY+"A " + materialName + " Ring."); - } - super.addInformation(stack, aPlayer, list, bool); - } - - public final String getMaterialName() { - return materialName; - } - - @Override - public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (ringMaterial.getRgbAsHex() == 0){ - return MathUtils.generateSingularRandomHexValue(); - } - return ringMaterial.getRgbAsHex(); - - } - private void addExtruderRecipe(){ Utils.LOG_WARNING("Adding recipe for "+materialName+" Rings"); @@ -73,10 +24,10 @@ public class BaseItemRing extends Item{ ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); if (null != tempOutputStack){ GT_Values.RA.addExtruderRecipe(tempOutputStack, - ItemList.Shape_Extruder_Ring.get(1), + ItemList.Shape_Extruder_Ring.get(0), UtilsItems.getSimpleStack(this, 4), - (int) Math.max(ringMaterial.getMass() * 2L * 1, 1), - 6 * ringMaterial.vVoltageMultiplier); + (int) Math.max(componentMaterial.getMass() * 2L * 1, 1), + 6 * componentMaterial.vVoltageMultiplier); } //Shaped Recipe diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java index 0e4802ad0c..6f7cf4b6bc 100644 --- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java +++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java @@ -2,43 +2,18 @@ package gtPlusPlus.core.item.base.rods; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; -import gregtech.api.util.GT_OreDictUnificator; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.item.base.BaseItemComponent; 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; import gtPlusPlus.core.util.recipe.UtilsRecipe; - -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import cpw.mods.fml.common.registry.GameRegistry; - -public class BaseItemRod extends Item{ - final Material rodMaterial; - final String materialName; - final String unlocalName; +public class BaseItemRod extends BaseItemComponent{ - public BaseItemRod(Material material, int sRadioactivity) { - this.rodMaterial = material; - this.unlocalName = "itemRod"+material.getUnlocalizedName(); - this.materialName = material.getLocalizedName(); - this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalName); - this.setTextureName(CORE.MODID + ":" + "itemRod"); - this.setMaxStackSize(64); - this.sRadiation = sRadioactivity; - GameRegistry.registerItem(this, unlocalName); - GT_OreDictUnificator.registerOre(unlocalName.replace("itemRod", "stick"), UtilsItems.getSimpleStack(this)); + public BaseItemRod(Material material) { + super(material, BaseItemComponent.ComponentTypes.ROD); if (!material.equals(ELEMENT.URANIUM233)){ addExtruderRecipe(); @@ -46,70 +21,32 @@ public class BaseItemRod extends Item{ } - @Override - public String getItemStackDisplayName(ItemStack p_77653_1_) { - - return (materialName+ " Rod"); - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { - if (materialName != null && materialName != "" && !materialName.equals("")){ - list.add(EnumChatFormatting.GRAY+"A 40cm Rod of " + materialName + "."); - } - if (sRadiation > 0){ - list.add(CORE.GT_Tooltip_Radioactive); - } - super.addInformation(stack, aPlayer, list, bool); - } - - public final String getMaterialName() { - return materialName; - } - - @Override - public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (rodMaterial.getRgbAsHex() == 0){ - return MathUtils.generateSingularRandomHexValue(); - } - 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); - } private void addExtruderRecipe(){ Utils.LOG_WARNING("Adding recipe for "+materialName+" Rods"); - 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); + ItemStack stackStick = componentMaterial.getRod(1); + ItemStack stackStick2 = componentMaterial.getRod(2); + ItemStack stackBolt = componentMaterial.getBolt(4); + ItemStack stackStickLong = componentMaterial.getLongRod(1); + ItemStack stackIngot = componentMaterial.getIngot(1); GT_Values.RA.addExtruderRecipe( stackIngot, - ItemList.Shape_Extruder_Rod.get(1), + ItemList.Shape_Extruder_Rod.get(0), stackStick2, - (int) Math.max(rodMaterial.getMass() * 2L * 1, 1), - 6 * rodMaterial.vVoltageMultiplier); + (int) Math.max(componentMaterial.getMass() * 2L * 1, 1), + 6 * componentMaterial.vVoltageMultiplier); GT_Values.RA.addCutterRecipe( stackStick, stackBolt, null, - (int) Math.max(rodMaterial.getMass() * 2L, 1L), + (int) Math.max(componentMaterial.getMass() * 2L, 1L), 4); - if (sRadiation == 0){ + if (componentMaterial.isRadioactive){ UtilsRecipe.recipeBuilder( stackStick, stackStick, stackStick, stackStick, "craftingToolWrench", stackStick, @@ -118,7 +55,7 @@ public class BaseItemRod extends Item{ } //Shaped Recipe - Bolts - stackBolt = UtilsItems.getItemStackOfAmountFromOreDict(tempBolt, 2); + stackBolt = componentMaterial.getBolt(2); if (null != stackBolt){ UtilsRecipe.recipeBuilder( "craftingToolSaw", null, null, diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java index 6d87fd5872..714f8dc145 100644 --- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java +++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java @@ -1,81 +1,25 @@ package gtPlusPlus.core.item.base.rods; 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.item.base.BaseItemComponent; 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; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import cpw.mods.fml.common.registry.GameRegistry; - -public class BaseItemRodLong extends Item{ - final Material rodLongMaterial; - final String materialName; - final String unlocalName; +public class BaseItemRodLong extends BaseItemComponent{ - public BaseItemRodLong(Material material, int sRadioactivity) { - this.rodLongMaterial = material; - this.unlocalName = "itemRodLong"+material.getUnlocalizedName(); - this.materialName = material.getLocalizedName(); - this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(material.getUnlocalizedName()); - this.setTextureName(CORE.MODID + ":" + "itemRodLong"); - this.setMaxStackSize(64); - this.sRadiation = sRadioactivity; - GameRegistry.registerItem(this, unlocalName); - GT_OreDictUnificator.registerOre(unlocalName.replace("itemRod", "stick"), UtilsItems.getSimpleStack(this)); + public BaseItemRodLong(Material material) { + super(material, BaseItemComponent.ComponentTypes.RODLONG); addExtruderRecipe(); } - + @Override public String getItemStackDisplayName(ItemStack p_77653_1_) { - return ("Long "+materialName+ " Rod"); } - @Override - public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { - if (materialName != null && materialName != "" && !materialName.equals("")){ - list.add(EnumChatFormatting.GRAY+"A 80cm Rod of " + materialName + "."); - } - if (sRadiation > 0){ - list.add(CORE.GT_Tooltip_Radioactive); - } - super.addInformation(stack, aPlayer, list, bool); - } - - public final String getMaterialName() { - return materialName; - } - - @Override - public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (rodLongMaterial.getRgbAsHex() == 0){ - return MathUtils.generateSingularRandomHexValue(); - } - return rodLongMaterial.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); - } - private void addExtruderRecipe(){ Utils.LOG_WARNING("Adding recipe for Long "+materialName+" Rods"); @@ -96,14 +40,14 @@ public class BaseItemRodLong extends Item{ GT_Values.RA.addForgeHammerRecipe( temp, stackLong, - (int) Math.max(rodLongMaterial.getMass(), 1L), + (int) Math.max(componentMaterial.getMass(), 1L), 16); GT_Values.RA.addCutterRecipe( stackLong, temp, null, - (int) Math.max(rodLongMaterial.getMass(), 1L), + (int) Math.max(componentMaterial.getMass(), 1L), 4); //Shaped Recipe - Long Rod to two smalls diff --git a/src/Java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java b/src/Java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java index d8ecea32bd..dd4804125a 100644 --- a/src/Java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java +++ b/src/Java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java @@ -1,88 +1,24 @@ package gtPlusPlus.core.item.base.rotors; -import gregtech.api.util.GT_OreDictUnificator; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.item.base.BaseItemComponent; +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; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import cpw.mods.fml.common.registry.GameRegistry; -public class BaseItemRotor extends Item{ +public class BaseItemRotor extends BaseItemComponent{ - protected int colour; - protected String materialName; - protected String unlocalName; - - public BaseItemRotor(String unlocalizedName, String materialName, int colour) { - setUnlocalizedName(unlocalizedName); - this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalizedName); - this.unlocalName = unlocalizedName; - this.setMaxStackSize(64); - this.setTextureName(CORE.MODID + ":" + "itemRotor"); - this.colour = colour; - this.materialName = materialName; - GameRegistry.registerItem(this, unlocalizedName); - GT_OreDictUnificator.registerOre(unlocalName.replace("itemR", "r"), UtilsItems.getSimpleStack(this)); + public BaseItemRotor(Material material) { + super(material, BaseItemComponent.ComponentTypes.ROTOR); generateRecipe(); } - @Override - public String getItemStackDisplayName(ItemStack p_77653_1_) { - - return (materialName+ " Rotor"); - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { - if (materialName != null && materialName != "" && !materialName.equals("")){ - list.add(EnumChatFormatting.GRAY+"A spindley Rotor made out of " + materialName + ". "); - } - super.addInformation(stack, aPlayer, list, bool); - } - - public final String getMaterialName() { - return materialName; - } - - @Override - public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (colour == 0){ - return MathUtils.generateSingularRandomHexValue(); - } - return colour; - - } - - public static boolean getValidItemStack(ItemStack validStack){ - if (validStack != null){ - return true; - } - return false; - } - public void generateRecipe(){ - Utils.LOG_WARNING("Adding recipe for "+materialName+" Rotors"); - String tempIngot = unlocalName.replace("itemRotor", "plate"); - ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); - Utils.LOG_WARNING("Found for recipe:"+tempIngot+ "isValidStack()="+getValidItemStack(tempOutputStack)); - String screw = unlocalName.replace("itemRotor", "screw"); - ItemStack screwStack = UtilsItems.getItemStackOfAmountFromOreDict(screw, 1); - Utils.LOG_WARNING("Found for recipe:"+screw+ "isValidStack()="+getValidItemStack(screwStack)); - String ring = unlocalName.replace("itemRotor", "ring"); - ItemStack ringStack = UtilsItems.getItemStackOfAmountFromOreDict(ring, 1); - Utils.LOG_WARNING("Found for recipe:"+ring+ "isValidStack()="+getValidItemStack(ringStack)); - + ItemStack tempOutputStack = this.componentMaterial.getPlate(1); + ItemStack screwStack = this.componentMaterial.getScrew(1); + ItemStack ringStack = this.componentMaterial.getRing(1); UtilsRecipe.addShapedGregtechRecipe( tempOutputStack, "craftingToolHardHammer", tempOutputStack, screwStack, ringStack, "craftingToolFile", diff --git a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java index 8d727770ce..84ac759ba8 100644 --- a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java +++ b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java @@ -1,69 +1,20 @@ package gtPlusPlus.core.item.base.screws; 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.item.base.BaseItemComponent; 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; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import cpw.mods.fml.common.registry.GameRegistry; -public class BaseItemScrew extends Item{ - - final Material screwMaterial; - final String materialName; - final String unlocalName; +public class BaseItemScrew extends BaseItemComponent{ public BaseItemScrew(Material material) { - this.screwMaterial = material; - this.unlocalName = "itemScrew"+material.getUnlocalizedName(); - this.materialName = material.getLocalizedName(); - this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalName); - this.setMaxStackSize(64); - this.setTextureName(CORE.MODID + ":" + "itemScrew"); - GameRegistry.registerItem(this, unlocalName); - GT_OreDictUnificator.registerOre(unlocalName.replace("itemS", "s"), UtilsItems.getSimpleStack(this)); + super(material, BaseItemComponent.ComponentTypes.SCREW); addLatheRecipe(); } - @Override - public String getItemStackDisplayName(ItemStack p_77653_1_) { - - return (materialName+ " Screw"); - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { - if (materialName != null && materialName != "" && !materialName.equals("")){ - list.add(EnumChatFormatting.GRAY+"A 8mm Screw, fabricated out of some " + materialName + "."); - } - super.addInformation(stack, aPlayer, list, bool); - } - - public final String getMaterialName() { - return materialName; - } - - @Override - public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (screwMaterial.getRgbAsHex() == 0){ - return MathUtils.generateSingularRandomHexValue(); - } - return screwMaterial.getRgbAsHex(); - - } - private void addLatheRecipe(){ Utils.LOG_WARNING("Adding recipe for "+materialName+" Screws"); ItemStack boltStack = UtilsItems.getItemStackOfAmountFromOreDict(unlocalName.replace("itemScrew", "bolt"), 1); @@ -72,7 +23,7 @@ public class BaseItemScrew extends Item{ boltStack, UtilsItems.getSimpleStack(this), null, - (int) Math.max(screwMaterial.getMass() / 8L, 1L), + (int) Math.max(componentMaterial.getMass() / 8L, 1L), 4); diff --git a/src/Java/gtPlusPlus/core/material/ELEMENT.java b/src/Java/gtPlusPlus/core/material/ELEMENT.java index 307105eaf0..9c05e53165 100644 --- a/src/Java/gtPlusPlus/core/material/ELEMENT.java +++ b/src/Java/gtPlusPlus/core/material/ELEMENT.java @@ -46,7 +46,7 @@ public final class ELEMENT { public static final Material RUBIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Rubidium); public static final Material STRONTIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Strontium); public static final Material YTTRIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Yttrium); - public static final Material ZIRCONIUM = new Material("Zirconium", new short[]{255, 250, 205}, 1855, 4377, 40, 51, false, null);//Not a GT Inherited Material + public static final Material ZIRCONIUM = new Material("Zirconium", new short[]{255, 250, 205}, 1855, 4377, 40, 51, false, null, "Zr", 0);//Not a GT Inherited Material public static final Material NIOBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Niobium); public static final Material MOLYBDENUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Molybdenum); //public static final Material TECHNETIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Technetium); @@ -79,7 +79,7 @@ public final class ELEMENT { public static final Material THORIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Thorium); public static final Material URANIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Uranium); public static final Material PLUTONIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Plutonium); - public static final Material URANIUM233 = new Material("Uranium-233", new short[]{73, 220, 83, 0}, 1132, 4131, 92, 141, false, null);//Not a GT Inherited Material + public static final Material URANIUM233 = new Material("Uranium-233", new short[]{73, 220, 83, 0}, 1132, 4131, 92, 141, false, null, MaterialUtils.superscript("233U"), 0);//Not a GT Inherited Material } diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 3e5c3a4d67..d6f5d77f20 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -9,12 +9,16 @@ public class Material { final String unlocalizedName; final String localizedName; + + protected Object dataVar; private MaterialStack[] materialInput = new MaterialStack[4]; final short[] RGBA; final boolean usesBlastFurnace; + public final boolean isRadioactive; + public final byte vRadioationLevel; final int meltingPointK; final int boilingPointK; @@ -25,8 +29,17 @@ public class Material { final long vMass; public final int vTier; public final int vVoltageMultiplier; + public final String vChemicalFormula; + + public Material(String materialName, short[] rgba, int meltingPoint, int boilingPoint, long protons, long neutrons, boolean blastFurnace, MaterialStack[] inputs){ + this(materialName, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, inputs, "", 0); + } + + public Material(String materialName, short[] rgba, int meltingPoint, int boilingPoint, long protons, long neutrons, boolean blastFurnace, MaterialStack[] inputs, int radiationLevel){ + this(materialName, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, inputs, "", radiationLevel); + } - public Material(String materialName, short[] rgba, int meltingPoint, int boilingPoint, long protons, long neutrons, boolean blastFurnace, MaterialStack[] inputs){ + public Material(String materialName, short[] rgba, int meltingPoint, int boilingPoint, long protons, long neutrons, boolean blastFurnace, MaterialStack[] inputs, String chemicalFormula, int radiationLevel){ this.unlocalizedName = Utils.sanitizeString(materialName); this.localizedName = materialName; @@ -41,6 +54,21 @@ public class Material { this.vProtons = protons; this.vNeutrons = neutrons; this.vMass = getMass(); + if (chemicalFormula.equals("")){ + this.vChemicalFormula = getChemicalFormula(inputs); + } + else{ + this.vChemicalFormula = chemicalFormula; + } + + if (radiationLevel != 0){ + this.isRadioactive = true; + this.vRadioationLevel = (byte) radiationLevel; + } + else { + this.isRadioactive = false; + this.vRadioationLevel = (byte) radiationLevel; + } if (getMeltingPoint_K() >= 0 && getMeltingPoint_K() <= 750){ this.vTier = 1; @@ -91,6 +119,9 @@ public class Material { } } } + + dataVar = MathUtils.generateSingularRandomHexValue(); + Utils.LOG_INFO("Creating a Material instance for "+materialName); Utils.LOG_INFO("Protons: "+vProtons); Utils.LOG_INFO("Neutrons: "+vNeutrons); @@ -110,8 +141,13 @@ public class Material { public short[] getRGBA(){ return RGBA; } - + public int getRgbAsHex(){ + + int returnValue = Utils.rgbtoHexValue(RGBA[0], RGBA[1], RGBA[2]); + if (returnValue == 0){ + return (int) dataVar; + } return Utils.rgbtoHexValue(RGBA[0], RGBA[1], RGBA[2]); } @@ -148,15 +184,15 @@ public class Material { } public ItemStack getDust(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDict("dust"+unlocalizedName, stacksize); } public ItemStack getSmallDust(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustSmall"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDict("dustSmall"+unlocalizedName, stacksize); } public ItemStack getTinyDust(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustTiny"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDict("dustTiny"+unlocalizedName, stacksize); } public ItemStack[] getValidInputStacks(){ @@ -164,23 +200,43 @@ public class Material { } public ItemStack getIngot(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("ingot"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDict("ingot"+unlocalizedName, stacksize); } public ItemStack getPlate(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("plate"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDict("plate"+unlocalizedName, stacksize); } public ItemStack getPlateDouble(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("plateDouble"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDict("plateDouble"+unlocalizedName, stacksize); } - + public ItemStack getGear(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("gear"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDict("gear"+unlocalizedName, stacksize); } - + public ItemStack getRod(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("stick"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDict("stick"+unlocalizedName, stacksize); + } + + public ItemStack getLongRod(int stacksize){ + return UtilsItems.getItemStackOfAmountFromOreDict("stickLong"+unlocalizedName, stacksize); + } + + public ItemStack getBolt(int stacksize){ + return UtilsItems.getItemStackOfAmountFromOreDict("bolt"+unlocalizedName, stacksize); + } + + public ItemStack getScrew(int stacksize){ + return UtilsItems.getItemStackOfAmountFromOreDict("screw"+unlocalizedName, stacksize); + } + + public ItemStack getRing(int stacksize){ + return UtilsItems.getItemStackOfAmountFromOreDict("ring"+unlocalizedName, stacksize); + } + + public ItemStack getRotor(int stacksize){ + return UtilsItems.getItemStackOfAmountFromOreDict("rotor"+unlocalizedName, stacksize); } public ItemStack[] getMaterialComposites(){ @@ -220,5 +276,83 @@ public class Material { } return new int[]{}; } + + + + +private int getInputMaterialCount(MaterialStack[] materialInput){ + int i = 0; + for (int r=0;r<4;r++){ + try { + if (!materialInput[r].equals(null)){ + i++; + } + } catch(Throwable x){ + return i; + } + } + return i; +} + + + public String getChemicalFormula(MaterialStack[] materialInput){ + if (materialInput != null && materialInput.length >= 1){ + int f = getInputMaterialCount(materialInput); + String[] formulaComponents = new String[f]; + for (int i=0;i 255 || g > 255 || b > 255 || r < 0 || g < 0 || b < 0){ + return 0; + } Color c = new Color(r,g,b); String temp = Integer.toHexString( c.getRGB() & 0xFFFFFF ).toUpperCase(); diff --git a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java index 62162e596d..fbda7554df 100644 --- a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java +++ b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java @@ -1,6 +1,7 @@ package gtPlusPlus.core.util.item; import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; @@ -10,6 +11,8 @@ import gtPlusPlus.core.item.base.BasicSpawnEgg; import gtPlusPlus.core.item.base.bolts.BaseItemBolt; import gtPlusPlus.core.item.base.dusts.BaseItemDust; import gtPlusPlus.core.item.base.dusts.BaseItemDustUnique; +import gtPlusPlus.core.item.base.dusts.decimal.BaseItemCentidust; +import gtPlusPlus.core.item.base.dusts.decimal.BaseItemDecidust; import gtPlusPlus.core.item.base.gears.BaseItemGear; import gtPlusPlus.core.item.base.ingots.BaseItemIngot; import gtPlusPlus.core.item.base.ingots.BaseItemIngotHot; @@ -244,7 +247,7 @@ public class UtilsItems { return null; } - + public static ItemStack getItemStackInPlayersHand(){ Minecraft mc = Minecraft.getMinecraft(); ItemStack heldItem = null; @@ -290,7 +293,7 @@ public class UtilsItems { Utils.LOG_INFO(oredictName+" was not valid."); return null; } - + public static ItemStack getItemStackOfAmountFromOreDictNoBrokenExcluding(String excludeModName, String oredictName, int amount){ ItemStack returnValue = getItemStackOfAmountFromOreDict(oredictName, amount); @@ -347,9 +350,9 @@ public class UtilsItems { 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(matInfo, sRadiation); - temp = new BaseItemRodLong(matInfo, sRadiation); + temp = new BaseItemPlate(matInfo); + temp = new BaseItemRod(matInfo); + temp = new BaseItemRodLong(matInfo); } else { @@ -366,14 +369,14 @@ public class UtilsItems { 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 BaseItemPlate(matInfo); + temp = new BaseItemPlateDouble(matInfo); temp = new BaseItemBolt(matInfo); - temp = new BaseItemRod(matInfo, sRadiation); - temp = new BaseItemRodLong(matInfo, sRadiation); + temp = new BaseItemRod(matInfo); + temp = new BaseItemRodLong(matInfo); temp = new BaseItemRing(matInfo); temp = new BaseItemScrew(matInfo); - temp = new BaseItemRotor("itemRotor"+unlocalizedName, materialName, Colour); + temp = new BaseItemRotor(matInfo); temp = new BaseItemGear(matInfo); } @@ -402,22 +405,22 @@ public class UtilsItems { public static MultiPickaxeBase generateMultiPick(boolean GT_Durability, Materials material){ ToolMaterial customMaterial = Utils.generateMaterialFromGT(material); - Utils.LOG_INFO("Generating a Multi-Pick out of "+material.name()); + Utils.LOG_WARNING("Generating a Multi-Pick out of "+material.name()); short[] rgb; rgb = material.getRGBA(); int dur = customMaterial.getMaxUses(); - Utils.LOG_INFO("Determined durability for "+material.name()+" is "+dur); + Utils.LOG_WARNING("Determined durability for "+material.name()+" is "+dur); if (GT_Durability){ dur = material.mDurability*100; - Utils.LOG_INFO("Using gregtech durability value, "+material.name()+" is now "+dur+"."); + Utils.LOG_WARNING("Using gregtech durability value, "+material.name()+" is now "+dur+"."); } else if (dur <= 0){ dur = material.mDurability; - Utils.LOG_INFO("Determined durability too low, "+material.name()+" is now "+dur+" based on the GT material durability."); + Utils.LOG_WARNING("Determined durability too low, "+material.name()+" is now "+dur+" based on the GT material durability."); } if (dur <= 0){ - Utils.LOG_INFO("Still too low, "+material.name()+" will now go unused."); + Utils.LOG_WARNING("Still too low, "+material.name()+" will now go unused."); return null; } @@ -437,22 +440,22 @@ public class UtilsItems { public static MultiSpadeBase generateMultiShovel(boolean GT_Durability, Materials material){ ToolMaterial customMaterial = Utils.generateMaterialFromGT(material); - Utils.LOG_INFO("Generating a Multi-Shovel out of "+material.name()); + Utils.LOG_WARNING("Generating a Multi-Shovel out of "+material.name()); short[] rgb; rgb = material.getRGBA(); int dur = customMaterial.getMaxUses(); - Utils.LOG_INFO("Determined durability for "+material.name()+" is "+dur); + Utils.LOG_WARNING("Determined durability for "+material.name()+" is "+dur); if (GT_Durability){ dur = material.mDurability*100; - Utils.LOG_INFO("Using gregtech durability value, "+material.name()+" is now "+dur+"."); + Utils.LOG_WARNING("Using gregtech durability value, "+material.name()+" is now "+dur+"."); } else if (dur <= 0){ dur = material.mDurability; - Utils.LOG_INFO("Determined durability too low, "+material.name()+" is now "+dur+" based on the GT material durability."); + Utils.LOG_WARNING("Determined durability too low, "+material.name()+" is now "+dur+" based on the GT material durability."); } if (dur <= 0){ - Utils.LOG_INFO("Still too low, "+material.name()+" will now go unused."); + Utils.LOG_WARNING("Still too low, "+material.name()+" will now go unused."); return null; } @@ -470,6 +473,40 @@ public class UtilsItems { } + public static BaseItemDecidust generateDecidust(Materials material){ + if (GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L) != null){ + Material placeholder = MaterialUtils.generateMaterialFromGtENUM(material); + if (placeholder != null) + generateDecidust(placeholder); + } + return null; + } + + public static BaseItemDecidust generateDecidust(Material material){ + if (material.getDust(1) != null && MaterialUtils.hasValidRGBA(material.getRGBA())){ + BaseItemDecidust Decidust = new BaseItemDecidust(material); + return Decidust; + } + return null; + } + + public static BaseItemCentidust generateCentidust(Materials material){ + if (GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L) != null){ + Material placeholder = MaterialUtils.generateMaterialFromGtENUM(material); + if (placeholder != null) + generateCentidust(placeholder); + } + return null; + } + + public static BaseItemCentidust generateCentidust(Material material){ + if (material.getDust(1) != null && MaterialUtils.hasValidRGBA(material.getRGBA())){ + BaseItemCentidust Centidust = new BaseItemCentidust(material); + return Centidust; + } + return null; + } + public static boolean isRadioactive(String materialName){ int sRadiation = 0; if (materialName.toLowerCase().contains("uranium")){ @@ -504,7 +541,7 @@ public class UtilsItems { public static String getArrayStackNames(ItemStack[] aStack){ String itemNames = "Item Array: "; for (ItemStack alph : aStack){ - + if (alph != null){ String temp = itemNames; itemNames = temp + ", " + alph.getDisplayName() + " x" + alph.stackSize; diff --git a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java index 0eae02d827..61171e3688 100644 --- a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java +++ b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java @@ -1,6 +1,7 @@ package gtPlusPlus.core.util.materials; import gregtech.api.enums.Dyes; +import gregtech.api.enums.Element; import gregtech.api.enums.Materials; import gregtech.api.enums.TC_Aspects.TC_AspectStack; import gregtech.api.enums.TextureSet; @@ -51,8 +52,83 @@ public class MaterialUtils { int boiling = material.mBlastFurnaceTemp; long protons = material.getProtons(); long neutrons = material.getNeutrons(); - boolean blastFurnace = material.mBlastFurnaceRequired; - return new Material(name, rgba, melting, boiling, protons, neutrons, blastFurnace, null); + boolean blastFurnace = material.mBlastFurnaceRequired; + String chemicalFormula = material.mChemicalFormula; + Element element = material.mElement; + int radioactivity = 0; + if (material.isRadioactive()){ + radioactivity = 1; + } + if (hasValidRGBA(rgba)){ + return new Material(name, rgba, melting, boiling, protons, neutrons, blastFurnace, null, chemicalFormula, radioactivity); + } + return null; + + } + + public static Material generateQuickMaterial(String materialName, short[] colour, int sRadioactivity) { + Material temp = new Material( + materialName, + colour, + 1000, //melting + 3000, //boiling + 50, //Protons + 50, //Neutrons + false, + null, + sRadioactivity); + return temp; + } + + public static boolean hasValidRGBA(short[] rgba){ + boolean test1 = false; + boolean test2 = false; + boolean test3 = false; + for (int r=0;r Date: Tue, 25 Oct 2016 23:47:58 +1000 Subject: + Tried improving the handling of Blast Smelting. + Tried adding shapeless dust recipes for all of my alloys. (The shapeless recipe system is dumb) + Added a custom GUI for NEI recipes for the Blast Smelter. % Refactored some Utils classes. --- src/Java/gregtech/api/util/Recipe_GT.java | 6 +- src/Java/gtPlusPlus/GTplusplus.java | 10 +- .../tileentity/TileEntityHeliumGenerator.java | 4 +- .../common/compat/COMPAT_CompactWindmills.java | 66 +-- .../core/common/compat/COMPAT_EnderIO.java | 4 +- .../core/common/compat/COMPAT_ExtraUtils.java | 10 +- .../gtPlusPlus/core/common/compat/COMPAT_IC2.java | 6 +- .../core/common/compat/COMPAT_MorePlanets.java | 40 +- .../core/common/compat/COMPAT_Thaumcraft.java | 26 +- .../core/container/Container_Workbench.java | 6 +- .../container/Container_WorkbenchAdvanced.java | 6 +- .../gtPlusPlus/core/fluids/BlockFluidBase.java | 4 +- .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 8 +- src/Java/gtPlusPlus/core/item/ModItems.java | 38 +- .../core/item/base/BaseItemBackpack.java | 4 +- .../core/item/base/BaseItemComponent.java | 4 +- .../core/item/base/dusts/BaseItemDust.java | 18 +- .../core/item/base/dusts/BaseItemDustUnique.java | 6 +- .../core/item/base/foods/BaseItemHotFood.java | 4 +- .../core/item/base/ingots/BaseItemIngot.java | 8 +- .../core/item/base/ingots/BaseItemIngotHot.java | 4 +- .../core/item/base/itemblock/ItemBlockFluid.java | 4 +- .../core/item/base/itemblock/ItemBlockGtBlock.java | 4 +- .../item/base/itemblock/ItemBlockGtFrameBox.java | 4 +- .../core/item/base/rods/BaseItemRodLong.java | 6 +- .../core/item/base/screws/BaseItemScrew.java | 6 +- .../core/item/general/ItemBlueprint.java | 4 +- .../core/item/general/ItemCloakingDevice.java | 4 +- .../core/item/general/ItemHealingDevice.java | 4 +- .../core/item/general/RF2EU_Battery.java | 12 +- src/Java/gtPlusPlus/core/item/init/ItemsFoods.java | 14 +- .../core/item/tool/staballoy/MultiPickaxeBase.java | 12 +- .../core/item/tool/staballoy/MultiSpadeBase.java | 12 +- src/Java/gtPlusPlus/core/material/ALLOY.java | 9 +- src/Java/gtPlusPlus/core/material/Material.java | 122 +++-- .../gtPlusPlus/core/material/MaterialStack.java | 95 +--- .../core/recipe/Gregtech_Recipe_Adder.java | 22 +- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 92 ++-- .../gtPlusPlus/core/recipe/RECIPES_General.java | 18 +- .../gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java | 8 +- .../core/recipe/RECIPES_MachineComponents.java | 82 +-- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 144 +++--- .../gtPlusPlus/core/recipe/RECIPES_Shapeless.java | 6 +- src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java | 18 +- .../gtPlusPlus/core/recipe/RECIPE_Batteries.java | 16 +- .../gtPlusPlus/core/recipe/RECIPE_CONSTANTS.java | 50 +- .../gtPlusPlus/core/recipe/ShapedRecipeObject.java | 4 +- src/Java/gtPlusPlus/core/util/Utils.java | 4 +- src/Java/gtPlusPlus/core/util/item/ItemUtils.java | 567 +++++++++++++++++++++ src/Java/gtPlusPlus/core/util/item/UtilsItems.java | 565 -------------------- .../gtPlusPlus/core/util/recipe/RecipeUtils.java | 382 ++++++++++++++ .../gtPlusPlus/core/util/recipe/UtilsRecipe.java | 377 -------------- .../core/util/recipe/shapeless/ShapelessUtils.java | 56 ++ src/Java/gtPlusPlus/core/util/wrapper/var.java | 8 +- .../forestry/bees/recipe/FR_Gregtech_Recipes.java | 32 +- .../common/blocks/fluid/GregtechFluidHandler.java | 20 +- .../machines/multi/GregtechMTE_NuclearReactor.java | 4 +- .../GregtechMetaTileEntity_MassFabricator.java | 4 +- .../loaders/ProcessingToolHeadChoocher.java | 4 +- .../gregtech/loaders/RecipeGen_BlastSmelter.java | 183 ++++++- .../gregtech/loaders/RecipeGen_DustGeneration.java | 18 +- .../gregtech/loaders/RecipeGen_ShapedCrafting.java | 66 ++- .../xmod/gregtech/recipes/GregtechRecipeAdder.java | 4 +- .../recipes/machines/RECIPEHANDLER_Dehydrator.java | 4 +- .../registration/gregtech/GregtechConduits.java | 58 +-- .../xmod/growthcraft/fishtrap/FishTrapHandler.java | 28 +- .../gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java | 44 +- .../xmod/thermalfoundation/item/TF_Items.java | 10 +- .../recipe/TF_Gregtech_Recipes.java | 4 +- .../textures/gui/basicmachines/BlastSmelter.png | Bin 0 -> 5136 bytes 70 files changed, 1830 insertions(+), 1666 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/util/item/ItemUtils.java delete mode 100644 src/Java/gtPlusPlus/core/util/item/UtilsItems.java create mode 100644 src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java delete mode 100644 src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java create mode 100644 src/Java/gtPlusPlus/core/util/recipe/shapeless/ShapelessUtils.java create mode 100644 src/resources/assets/gregtech/textures/gui/basicmachines/BlastSmelter.png (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gregtech/api/util/Recipe_GT.java b/src/Java/gregtech/api/util/Recipe_GT.java index 979a6f17e5..11a858f641 100644 --- a/src/Java/gregtech/api/util/Recipe_GT.java +++ b/src/Java/gregtech/api/util/Recipe_GT.java @@ -8,7 +8,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.api.objects.GT_ItemStack; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import java.util.ArrayList; import java.util.Collection; @@ -73,7 +73,7 @@ public class Recipe_GT extends GT_Recipe{ protected Recipe_GT(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); - Utils.LOG_SPECIFIC_WARNING(this.getClass().getName()+" | [GregtechRecipe]", "Created new recipe instance for "+UtilsItems.getArrayStackNames(aInputs), 167); + Utils.LOG_SPECIFIC_WARNING(this.getClass().getName()+" | [GregtechRecipe]", "Created new recipe instance for "+ItemUtils.getArrayStackNames(aInputs), 167); } public Recipe_GT(ItemStack aInput1, ItemStack aOutput1, int aFuelValue, int aType) { @@ -235,7 +235,7 @@ public class Recipe_GT extends GT_Recipe{ public static final Gregtech_Recipe_Map_Fuel sRocketFuels = new Gregtech_Recipe_Map_Fuel(new HashSet(10), "gt.recipe.rocketenginefuel", "Rocket Engine Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 3000, " EU", true, true); public static final Gregtech_Recipe_Map_Fuel sGeoThermalFuels = new Gregtech_Recipe_Map_Fuel(new HashSet(10), "gt.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true); public static final GT_Recipe_Map sChemicalDehydratorRecipes = new GT_Recipe_Map(new HashSet(200), "gt.recipe.chemicaldehydrator", "Chemical Dehydrator", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 9, 0, 0, 1, E, 1, E, true, true); - public static final GT_Recipe_Map sAlloyBlastSmelterRecipes = new GT_Recipe_Map(new HashSet(200), "gt.recipe.alloyblastsmelter", "Alloy Blast Smelter", null, RES_PATH_GUI + "basicmachines/Dehydrator", 9, 1, 1, 0, 1, E, 1, E, true, true); + public static final GT_Recipe_Map sAlloyBlastSmelterRecipes = new GT_Recipe_Map(new HashSet(200), "gt.recipe.alloyblastsmelter", "Alloy Blast Smelter", null, RES_PATH_GUI + "basicmachines/BlastSmelter", 9, 1, 1, 0, 1, E, 1, E, true, true); /** * HashMap of Recipes based on their Items diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java index 4bb8a12836..353044e6ee 100644 --- a/src/Java/gtPlusPlus/GTplusplus.java +++ b/src/Java/gtPlusPlus/GTplusplus.java @@ -20,7 +20,7 @@ import gtPlusPlus.core.handler.events.LoginEventHandler; import gtPlusPlus.core.item.general.RF2EU_Battery; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.HANDLER_GT; @@ -204,12 +204,12 @@ implements ActionListener Utils.LOG_INFO("Dumping "+r.mUnlocalizedName+" Recipes for Debug."); for(GT_Recipe newBo : x){ Utils.LOG_INFO("========================"); - Utils.LOG_INFO("Dumping Input: "+UtilsItems.getArrayStackNames(newBo.mInputs)); - Utils.LOG_INFO("Dumping Inputs "+UtilsItems.getFluidArrayStackNames(newBo.mFluidInputs)); + Utils.LOG_INFO("Dumping Input: "+ItemUtils.getArrayStackNames(newBo.mInputs)); + Utils.LOG_INFO("Dumping Inputs "+ItemUtils.getFluidArrayStackNames(newBo.mFluidInputs)); Utils.LOG_INFO("Dumping Duration: "+newBo.mDuration); Utils.LOG_INFO("Dumping EU/t: "+newBo.mEUt); - Utils.LOG_INFO("Dumping Output: "+UtilsItems.getArrayStackNames(newBo.mOutputs)); - Utils.LOG_INFO("Dumping Output: "+UtilsItems.getFluidArrayStackNames(newBo.mFluidOutputs)); + Utils.LOG_INFO("Dumping Output: "+ItemUtils.getArrayStackNames(newBo.mOutputs)); + Utils.LOG_INFO("Dumping Output: "+ItemUtils.getFluidArrayStackNames(newBo.mFluidOutputs)); Utils.LOG_INFO("========================"); } } diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java index 06c13f997a..5ffd70efc4 100644 --- a/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java +++ b/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java @@ -4,7 +4,7 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.block.machine.heliumgen.slots.InvSlotRadiation; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import ic2.api.Direction; import ic2.api.reactor.IReactor; import ic2.api.reactor.IReactorComponent; @@ -51,7 +51,7 @@ public class TileEntityHeliumGenerator extends TileEntityInventory implements II if(++progress >= 40){ //if(++progress >= 300){ if(heliumStack == null) - heliumStack = UtilsItems.getSimpleStack(ModItems.itemHeliumBlob); + heliumStack = ItemUtils.getSimpleStack(ModItems.itemHeliumBlob); else if(heliumStack.getItem() == ModItems.itemHeliumBlob && heliumStack.stackSize < 64) heliumStack.stackSize++; progress = 0; diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java index efa86f0009..c64e332c50 100644 --- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java +++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java @@ -3,7 +3,7 @@ package gtPlusPlus.core.common.compat; import static gtPlusPlus.core.handler.COMPAT_HANDLER.AddRecipeQueue; import static gtPlusPlus.core.handler.COMPAT_HANDLER.RemoveRecipeQueue; import gtPlusPlus.core.recipe.ShapedRecipeObject; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.ItemStack; @@ -11,49 +11,49 @@ import net.minecraft.item.ItemStack; public class COMPAT_CompactWindmills { //Change IC2 Upgrades - public static ItemStack kineticWind = UtilsItems.simpleMetaStack("IC2:blockKineticGenerator", 0, 1); - public static ItemStack shaftIron = UtilsItems.simpleMetaStack("IC2:itemRecipePart", 11, 1); - public static ItemStack cableCopper = UtilsItems.simpleMetaStack("gregtech:gt.blockmachines", 1367, 1); + public static ItemStack kineticWind = ItemUtils.simpleMetaStack("IC2:blockKineticGenerator", 0, 1); + public static ItemStack shaftIron = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 11, 1); + public static ItemStack cableCopper = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 1367, 1); public static String plateRubber = "ore:plateRubber"; //Machine Casings - public static ItemStack elvCasing = UtilsItems.simpleMetaStack("gregtech:gt.blockcasings", 0, 1); - public static ItemStack lvCasing = UtilsItems.simpleMetaStack("gregtech:gt.blockcasings", 1, 1); - public static ItemStack mvCasing = UtilsItems.simpleMetaStack("gregtech:gt.blockcasings", 2, 1); - public static ItemStack hvCasing = UtilsItems.simpleMetaStack("gregtech:gt.blockcasings", 3, 1); - public static ItemStack evCasing = UtilsItems.simpleMetaStack("gregtech:gt.blockcasings", 4, 1); - public static ItemStack ivCasing = UtilsItems.simpleMetaStack("gregtech:gt.blockcasings", 5, 1); + public static ItemStack elvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 0, 1); + public static ItemStack lvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 1, 1); + public static ItemStack mvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 2, 1); + public static ItemStack hvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 3, 1); + public static ItemStack evCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 4, 1); + public static ItemStack ivCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 5, 1); //GT Transformers - public static ItemStack elvTransformer = UtilsItems.simpleMetaStack("gregtech:gt.blockmachines", 20, 1); - public static ItemStack lvTransformer = UtilsItems.simpleMetaStack("gregtech:gt.blockmachines", 21, 1); - public static ItemStack mvTransformer = UtilsItems.simpleMetaStack("gregtech:gt.blockmachines", 22, 1); - public static ItemStack hvTransformer = UtilsItems.simpleMetaStack("gregtech:gt.blockmachines", 23, 1); - public static ItemStack evTransformer = UtilsItems.simpleMetaStack("gregtech:gt.blockmachines", 24, 1); + public static ItemStack elvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 20, 1); + public static ItemStack lvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 21, 1); + public static ItemStack mvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 22, 1); + public static ItemStack hvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 23, 1); + public static ItemStack evTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 24, 1); //Compact Windmills - public static ItemStack elvWindmill = UtilsItems.simpleMetaStack("CompactWindmills:blockCompactWindmill", 0, 1); - public static ItemStack lvWindmill = UtilsItems.simpleMetaStack("CompactWindmills:blockCompactWindmill", 1, 1); - public static ItemStack mvWindmill = UtilsItems.simpleMetaStack("CompactWindmills:blockCompactWindmill", 2, 1); - public static ItemStack hvWindmill = UtilsItems.simpleMetaStack("CompactWindmills:blockCompactWindmill", 3, 1); - public static ItemStack evWindmill = UtilsItems.simpleMetaStack("CompactWindmills:blockCompactWindmill", 4, 1); + public static ItemStack elvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 0, 1); + public static ItemStack lvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 1, 1); + public static ItemStack mvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 2, 1); + public static ItemStack hvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 3, 1); + public static ItemStack evWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 4, 1); //Compact Rotors - public static ItemStack rotor2 = UtilsItems.getItemStack("CompactWindmills:WOOL", 1); - public static ItemStack rotor1 = UtilsItems.getItemStack("CompactWindmills:WOOD", 1); - public static ItemStack rotor3 = UtilsItems.getItemStack("CompactWindmills:ALLOY", 1); - public static ItemStack rotor4 = UtilsItems.getItemStack("CompactWindmills:CARBON", 1); - public static ItemStack rotor5 = UtilsItems.getItemStack("CompactWindmills:IRIDIUM", 1); + public static ItemStack rotor2 = ItemUtils.getItemStack("CompactWindmills:WOOL", 1); + public static ItemStack rotor1 = ItemUtils.getItemStack("CompactWindmills:WOOD", 1); + public static ItemStack rotor3 = ItemUtils.getItemStack("CompactWindmills:ALLOY", 1); + public static ItemStack rotor4 = ItemUtils.getItemStack("CompactWindmills:CARBON", 1); + public static ItemStack rotor5 = ItemUtils.getItemStack("CompactWindmills:IRIDIUM", 1); //IC2 Rotors - public static ItemStack rotorIC1 = UtilsItems.getItemStack("IC2:itemwoodrotor", 1); - public static ItemStack rotorIC2 = UtilsItems.getItemStack("IC2:itemironrotor", 1); - public static ItemStack rotorIC3 = UtilsItems.getItemStack("IC2:itemsteelrotor", 1); - public static ItemStack rotorIC4 = UtilsItems.getItemStack("IC2:itemwcarbonrotor", 1); - public static ItemStack rotorBlade1 = UtilsItems.simpleMetaStack("IC2:itemRecipePart", 7, 1); - public static ItemStack rotorBlade2 = UtilsItems.simpleMetaStack("IC2:itemRecipePart", 8, 1); - public static ItemStack rotorBlade3 = UtilsItems.simpleMetaStack("IC2:itemRecipePart", 10, 1); - public static ItemStack rotorBlade4 = UtilsItems.simpleMetaStack("IC2:itemRecipePart", 9, 1); + public static ItemStack rotorIC1 = ItemUtils.getItemStack("IC2:itemwoodrotor", 1); + public static ItemStack rotorIC2 = ItemUtils.getItemStack("IC2:itemironrotor", 1); + public static ItemStack rotorIC3 = ItemUtils.getItemStack("IC2:itemsteelrotor", 1); + public static ItemStack rotorIC4 = ItemUtils.getItemStack("IC2:itemwcarbonrotor", 1); + public static ItemStack rotorBlade1 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 7, 1); + public static ItemStack rotorBlade2 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 8, 1); + public static ItemStack rotorBlade3 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 10, 1); + public static ItemStack rotorBlade4 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 9, 1); //Plates public static String plateTier1 = "ore:plateMagnalium"; diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java index d538b2df3d..7a5389e37c 100644 --- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java +++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java @@ -2,7 +2,7 @@ package gtPlusPlus.core.common.compat; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.ItemStack; public class COMPAT_EnderIO { @@ -12,7 +12,7 @@ public class COMPAT_EnderIO { } private static final void run(){ - UtilsItems.getItemForOreDict("EnderIO:itemAlloy", "ingotVibrantAlloy", "Vibrant Alloy Ingot", 2); + ItemUtils.getItemForOreDict("EnderIO:itemAlloy", "ingotVibrantAlloy", "Vibrant Alloy Ingot", 2); GT_OreDictUnificator.registerOre("plateConductiveIron", new ItemStack(ModItems.itemPlateConductiveIron)); GT_OreDictUnificator.registerOre("plateDarkSteel", new ItemStack(ModItems.itemPlateDarkSteel)); GT_OreDictUnificator.registerOre("plateElectricalSteel", new ItemStack(ModItems.itemPlateElectricalSteel)); diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java index 5e21c432b5..d8ff219db7 100644 --- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java +++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java @@ -2,25 +2,25 @@ package gtPlusPlus.core.common.compat; import gtPlusPlus.core.lib.CORE.configSwitches; import gtPlusPlus.core.recipe.RECIPES_Tools; -import gtPlusPlus.core.util.item.UtilsItems; -import gtPlusPlus.core.util.recipe.UtilsRecipe; +import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.core.util.recipe.RecipeUtils; import net.minecraft.item.ItemStack; public class COMPAT_ExtraUtils { public static void OreDict(){ - RECIPES_Tools.RECIPE_DivisionSigil = new ItemStack(UtilsItems.getItem("ExtraUtilities:divisionSigil")); + RECIPES_Tools.RECIPE_DivisionSigil = new ItemStack(ItemUtils.getItem("ExtraUtilities:divisionSigil")); run(); } private static final void run(){ - UtilsItems.getItemForOreDict("ExtraUtilities:bedrockiumIngot", "ingotBedrockium", "Bedrockium Ingot", 0); + ItemUtils.getItemForOreDict("ExtraUtilities:bedrockiumIngot", "ingotBedrockium", "Bedrockium Ingot", 0); //GT_OreDictUnificator.registerOre("plateBedrockium", new ItemStack(ModItems.itemPlateBedrockium)); if (configSwitches.enableAlternativeDivisionSigilRecipe){ //Division Sigil - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( "plateNetherStar", "gemIridium", "plateNetherStar", "plateIridium", RECIPES_Tools.craftingToolHardHammer, "plateIridium", "plateNetherStar", "gemIridium", "plateNetherStar", diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_IC2.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_IC2.java index 14ec5dfd4d..c1546bba63 100644 --- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_IC2.java +++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_IC2.java @@ -5,14 +5,14 @@ import static gtPlusPlus.core.handler.COMPAT_HANDLER.RemoveRecipeQueue; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.lib.CORE.configSwitches; import gtPlusPlus.core.recipe.ShapedRecipeObject; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.ItemStack; public class COMPAT_IC2 { - private static ItemStack itemCropnalyzer = UtilsItems.simpleMetaStack("IC2:itemCropnalyzer", 0, 1); - private static ItemStack itemSolarHelmet = UtilsItems.simpleMetaStack("IC2:itemSolarHelmet", 0, 1); + private static ItemStack itemCropnalyzer = ItemUtils.simpleMetaStack("IC2:itemCropnalyzer", 0, 1); + private static ItemStack itemSolarHelmet = ItemUtils.simpleMetaStack("IC2:itemSolarHelmet", 0, 1); public static ShapedRecipeObject Cropnalyzer = new ShapedRecipeObject( "ore:cableGt02Copper", "ore:cableGt02Copper", null, diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_MorePlanets.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_MorePlanets.java index 3a996ed849..9e29458bce 100644 --- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_MorePlanets.java +++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_MorePlanets.java @@ -1,6 +1,6 @@ package gtPlusPlus.core.common.compat; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; public class COMPAT_MorePlanets { @@ -11,27 +11,27 @@ public class COMPAT_MorePlanets { private final static void run(){ //Metals - UtilsItems.getItemForOreDict("MorePlanet:kapteyn-b_item", "ingotFrozenIron", "Frozen Iron Ingot", 0); - UtilsItems.getItemForOreDict("MorePlanet:kapteyn-b_item", "ingotAnyIron", "Frozen Iron Ingot", 0); - UtilsItems.getItemForOreDict("MorePlanet:polongnius_item", "ingotPalladium", "Palladium Ingot", 5); - UtilsItems.getItemForOreDict("MorePlanet:fronos_item", "ingotIridium", "Iridium Ingot", 3); - UtilsItems.getItemForOreDict("MorePlanet:nibiru_item", "ingotNorium", "Norium Ingot", 1); - UtilsItems.getItemForOreDict("MorePlanet:venus_item", "ingotLead", "Lead Ingot", 0); - UtilsItems.getItemForOreDict("MorePlanet:diona_item", "ingotQuontonium", "Quontonium Ingot", 0); - UtilsItems.getItemForOreDict("MorePlanet:diona_item", "ingotFronisium", "Fronisium Ingot", 1); - UtilsItems.getItemForOreDict("MorePlanet:sirius-b_item", "ingotSulfur", "Sulfur Ingot", 3); - UtilsItems.getItemForOreDict("MorePlanet:koentus_item", "ingotKoentusMeteoricIron", "Koentus Meteoric Iron Ingot", 4); - UtilsItems.getItemForOreDict("MorePlanet:mercury_item", "ingotMetallic", "Metallic Ingot", 2); - UtilsItems.getItemForOreDict("MorePlanet:polongnius_item", "ingotPolongiusMeteoricIron", "Polongius Meteoric Iron Ingot", 4); - UtilsItems.getItemForOreDict("MorePlanet:mercury_item", "ingotMeteoricSteel", "Meteoric Steel Ingot", 3); - UtilsItems.getItemForOreDict("MorePlanet:sirius-b_item", "dustSulfur", "Sulfur Dust", 2); + ItemUtils.getItemForOreDict("MorePlanet:kapteyn-b_item", "ingotFrozenIron", "Frozen Iron Ingot", 0); + ItemUtils.getItemForOreDict("MorePlanet:kapteyn-b_item", "ingotAnyIron", "Frozen Iron Ingot", 0); + ItemUtils.getItemForOreDict("MorePlanet:polongnius_item", "ingotPalladium", "Palladium Ingot", 5); + ItemUtils.getItemForOreDict("MorePlanet:fronos_item", "ingotIridium", "Iridium Ingot", 3); + ItemUtils.getItemForOreDict("MorePlanet:nibiru_item", "ingotNorium", "Norium Ingot", 1); + ItemUtils.getItemForOreDict("MorePlanet:venus_item", "ingotLead", "Lead Ingot", 0); + ItemUtils.getItemForOreDict("MorePlanet:diona_item", "ingotQuontonium", "Quontonium Ingot", 0); + ItemUtils.getItemForOreDict("MorePlanet:diona_item", "ingotFronisium", "Fronisium Ingot", 1); + ItemUtils.getItemForOreDict("MorePlanet:sirius-b_item", "ingotSulfur", "Sulfur Ingot", 3); + ItemUtils.getItemForOreDict("MorePlanet:koentus_item", "ingotKoentusMeteoricIron", "Koentus Meteoric Iron Ingot", 4); + ItemUtils.getItemForOreDict("MorePlanet:mercury_item", "ingotMetallic", "Metallic Ingot", 2); + ItemUtils.getItemForOreDict("MorePlanet:polongnius_item", "ingotPolongiusMeteoricIron", "Polongius Meteoric Iron Ingot", 4); + ItemUtils.getItemForOreDict("MorePlanet:mercury_item", "ingotMeteoricSteel", "Meteoric Steel Ingot", 3); + ItemUtils.getItemForOreDict("MorePlanet:sirius-b_item", "dustSulfur", "Sulfur Dust", 2); //Gems - UtilsItems.getItemForOreDict("MorePlanet:fronos_item", "gemBlackDiamond", "Black Diamond Gem", 2); - UtilsItems.getItemForOreDict("MorePlanet:koentus_item", "gemWhiteCrystal", "White Crystal", 0); - UtilsItems.getItemForOreDict("MorePlanet:nibiru_item", "gemRedCrystal", "Red Crystal", 0); - UtilsItems.getItemForOreDict("MorePlanet:pluto_item", "gemXeonius", "Xeonius Gem", 0); - UtilsItems.getItemForOreDict("MorePlanet:kapteyn-b_item", "gemUranium", "Uranium Gem", 1); + ItemUtils.getItemForOreDict("MorePlanet:fronos_item", "gemBlackDiamond", "Black Diamond Gem", 2); + ItemUtils.getItemForOreDict("MorePlanet:koentus_item", "gemWhiteCrystal", "White Crystal", 0); + ItemUtils.getItemForOreDict("MorePlanet:nibiru_item", "gemRedCrystal", "Red Crystal", 0); + ItemUtils.getItemForOreDict("MorePlanet:pluto_item", "gemXeonius", "Xeonius Gem", 0); + ItemUtils.getItemForOreDict("MorePlanet:kapteyn-b_item", "gemUranium", "Uranium Gem", 1); } } diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java index d99e81f48d..b1b7464dd2 100644 --- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java +++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java @@ -3,7 +3,7 @@ package gtPlusPlus.core.common.compat; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.lib.CORE.configSwitches; import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; public class COMPAT_Thaumcraft { @@ -18,26 +18,26 @@ public class COMPAT_Thaumcraft { for(int i=0; i<=6; i++){ //Utils.LOG_INFO(""+i); - UtilsItems.getItemForOreDict("Thaumcraft:ItemShard", "shardAny", "TC Shard "+i, i); - GT_OreDictUnificator.registerOre("shardAny", UtilsItems.getItemStack("Thaumcraft:ItemShard:"+i, 1)); - UtilsItems.getItemForOreDict("Thaumcraft:ItemShard", "gemInfusedAnything", "TC Shard "+i, i); - GT_OreDictUnificator.registerOre("gemInfusedAnything", UtilsItems.getItemStack("Thaumcraft:ItemShard:"+i, 1)); + ItemUtils.getItemForOreDict("Thaumcraft:ItemShard", "shardAny", "TC Shard "+i, i); + GT_OreDictUnificator.registerOre("shardAny", ItemUtils.getItemStack("Thaumcraft:ItemShard:"+i, 1)); + ItemUtils.getItemForOreDict("Thaumcraft:ItemShard", "gemInfusedAnything", "TC Shard "+i, i); + GT_OreDictUnificator.registerOre("gemInfusedAnything", ItemUtils.getItemStack("Thaumcraft:ItemShard:"+i, 1)); //System.out.println("TC Shard registration count is: "+i); } if (LoadedMods.ForbiddenMagic){ for(int i=0; i<=6; i++){ //Utils.LOG_INFO(""+i); - UtilsItems.getItemForOreDict("ForbiddenMagic:NetherShard", "shardAny", "FM Shard "+i, i); - GT_OreDictUnificator.registerOre("shardAny", UtilsItems.getItemStack("ForbiddenMagic:NetherShard:"+i, 1)); - UtilsItems.getItemForOreDict("ForbiddenMagic:NetherShard", "gemInfusedAnything", "FM Shard "+i, i); - GT_OreDictUnificator.registerOre("gemInfusedAnything", UtilsItems.getItemStack("ForbiddenMagic:NetherShard:"+i, 1)); + ItemUtils.getItemForOreDict("ForbiddenMagic:NetherShard", "shardAny", "FM Shard "+i, i); + GT_OreDictUnificator.registerOre("shardAny", ItemUtils.getItemStack("ForbiddenMagic:NetherShard:"+i, 1)); + ItemUtils.getItemForOreDict("ForbiddenMagic:NetherShard", "gemInfusedAnything", "FM Shard "+i, i); + GT_OreDictUnificator.registerOre("gemInfusedAnything", ItemUtils.getItemStack("ForbiddenMagic:NetherShard:"+i, 1)); //System.out.println("TC Shard registration count is: "+i); } - UtilsItems.getItemForOreDict("ForbiddenMagic:GluttonyShard", "shardAny", "FM Gluttony Shard", 0); - GT_OreDictUnificator.registerOre("shardAny", UtilsItems.getItemStack("ForbiddenMagic:GluttonyShard", 1)); - UtilsItems.getItemForOreDict("ForbiddenMagic:GluttonyShard", "gemInfusedAnything", "FM Gluttony Shard", 0); - GT_OreDictUnificator.registerOre("gemInfusedAnything", UtilsItems.getItemStack("ForbiddenMagic:GluttonyShard", 1)); + ItemUtils.getItemForOreDict("ForbiddenMagic:GluttonyShard", "shardAny", "FM Gluttony Shard", 0); + GT_OreDictUnificator.registerOre("shardAny", ItemUtils.getItemStack("ForbiddenMagic:GluttonyShard", 1)); + ItemUtils.getItemForOreDict("ForbiddenMagic:GluttonyShard", "gemInfusedAnything", "FM Gluttony Shard", 0); + GT_OreDictUnificator.registerOre("gemInfusedAnything", ItemUtils.getItemStack("ForbiddenMagic:GluttonyShard", 1)); } } diff --git a/src/Java/gtPlusPlus/core/container/Container_Workbench.java b/src/Java/gtPlusPlus/core/container/Container_Workbench.java index 6e68eb7338..c814f8815e 100644 --- a/src/Java/gtPlusPlus/core/container/Container_Workbench.java +++ b/src/Java/gtPlusPlus/core/container/Container_Workbench.java @@ -14,7 +14,7 @@ import gtPlusPlus.core.slots.SlotNoInput; import gtPlusPlus.core.slots.SlotOutput; import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -216,9 +216,9 @@ public class Container_Workbench extends Container { Utils.LOG_WARNING("Output slot was not empty."); Utils.LOG_WARNING("Trying to manipulate NBT data on the blueprint stack, then replace it with the new one."); tempItemBlueprint.setBlueprint(inventoryHolo.getStackInSlot(1), craftMatrix, inventoryHolo.getStackInSlot(0)); - ItemStack newTempBlueprint = UtilsItems.getSimpleStack(tempItemBlueprint); + ItemStack newTempBlueprint = ItemUtils.getSimpleStack(tempItemBlueprint); inventoryHolo.setInventorySlotContents(1, newTempBlueprint); - Utils.LOG_WARNING(UtilsItems.getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint))); + Utils.LOG_WARNING(ItemUtils.getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint))); } else { if (tempItemBlueprint.hasBlueprint(tempBlueprint)){ diff --git a/src/Java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java b/src/Java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java index 17ec451056..f7dc7bb08c 100644 --- a/src/Java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java +++ b/src/Java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java @@ -14,7 +14,7 @@ import gtPlusPlus.core.slots.SlotNoInput; import gtPlusPlus.core.slots.SlotOutput; import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -182,9 +182,9 @@ public class Container_WorkbenchAdvanced extends Container { Utils.LOG_WARNING("Output slot was not empty."); Utils.LOG_WARNING("Trying to manipulate NBT data on the blueprint stack, then replace it with the new one."); tempItemBlueprint.setBlueprint(inventoryHolo.getStackInSlot(1), craftMatrix, inventoryHolo.getStackInSlot(0)); - ItemStack newTempBlueprint = UtilsItems.getSimpleStack(tempItemBlueprint); + ItemStack newTempBlueprint = ItemUtils.getSimpleStack(tempItemBlueprint); inventoryHolo.setInventorySlotContents(1, newTempBlueprint); - Utils.LOG_WARNING(UtilsItems.getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint))); + Utils.LOG_WARNING(ItemUtils.getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint))); } else { if (tempItemBlueprint.hasBlueprint(tempBlueprint)){ diff --git a/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java b/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java index ebd84f9654..703256267b 100644 --- a/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java +++ b/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java @@ -28,7 +28,7 @@ public class BlockFluidBase extends BlockFluidClassic { @SuppressWarnings("deprecation") public BlockFluidBase(Fluid fluid, Material material) { - super(fluid, net.minecraft.block.material.Material.water); + super(fluid, net.minecraft.block.material.Material.lava); short[] tempColour = material.getRGBA(); this.colour = Utils.rgbtoHexValue(tempColour[0], tempColour[1], tempColour[2]); this.fluidMaterial = material; @@ -40,7 +40,7 @@ public class BlockFluidBase extends BlockFluidClassic { @SuppressWarnings("deprecation") public BlockFluidBase(String fluidName, Fluid fluid, short[] colour) { - super(fluid, net.minecraft.block.material.Material.water); + super(fluid, net.minecraft.block.material.Material.lava); short[] tempColour = colour; this.colour = Utils.rgbtoHexValue(tempColour[0], tempColour[1], tempColour[2]); setCreativeTab(AddToCreativeTab.tabOther); diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index e51dc157c6..c57275edce 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -21,8 +21,8 @@ import gtPlusPlus.core.recipe.RECIPES_GREGTECH; import gtPlusPlus.core.recipe.RECIPES_LaserEngraver; import gtPlusPlus.core.recipe.ShapedRecipeObject; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; -import gtPlusPlus.core.util.recipe.UtilsRecipe; +import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.core.util.recipe.RecipeUtils; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechDehydrator; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechEnergyBuffer; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechGeothermalThermalGenerator; @@ -65,7 +65,7 @@ public class COMPAT_HANDLER { GT_OreDictUnificator.registerOre("craftingToolSandHammer", new ItemStack(ModItems.itemSandstoneHammer)); for(int i=1; i<=10; i++){ - GT_OreDictUnificator.registerOre("bufferCore_"+CORE.VOLTAGES[i-1], new ItemStack(UtilsItems.getItem("miscutils:item.itemBufferCore"+i))); + GT_OreDictUnificator.registerOre("bufferCore_"+CORE.VOLTAGES[i-1], new ItemStack(ItemUtils.getItem("miscutils:item.itemBufferCore"+i))); } } @@ -135,7 +135,7 @@ public class COMPAT_HANDLER { public static void RemoveRecipesFromOtherMods(){ //Removal of Recipes for(Object item : RemoveRecipeQueue){ - UtilsRecipe.removeCraftingRecipe(item); + RecipeUtils.removeCraftingRecipe(item); } } diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index e77f457487..1d1b38bcfc 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -2,7 +2,7 @@ package gtPlusPlus.core.item; import static gtPlusPlus.core.creative.AddToCreativeTab.tabMachines; import static gtPlusPlus.core.creative.AddToCreativeTab.tabMisc; import static gtPlusPlus.core.lib.CORE.LOAD_ALL_CONTENT; -import static gtPlusPlus.core.util.item.UtilsItems.generateItemsFromMaterial; +import static gtPlusPlus.core.util.item.ItemUtils.generateItemsFromMaterial; import gregtech.api.enums.Materials; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.common.compat.COMPAT_Baubles; @@ -33,7 +33,7 @@ import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.debug.DEBUG_INIT; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemFood; @@ -256,32 +256,32 @@ public final class ModItems { //Nuclear Fuel Dusts - dustUraniumTetraFluoride = UtilsItems.generateSpecialUseDusts("UraniumTetrafluoride", "Uranium Tetrafluoride", Utils.rgbtoHexValue(17, 179, 42))[0]; - dustUraniumHexaFluoride = UtilsItems.generateSpecialUseDusts("UraniumHexafluoride", "Uranium Hexafluoride", Utils.rgbtoHexValue(9, 199, 32))[0]; + dustUraniumTetraFluoride = ItemUtils.generateSpecialUseDusts("UraniumTetrafluoride", "Uranium Tetrafluoride", Utils.rgbtoHexValue(17, 179, 42))[0]; + dustUraniumHexaFluoride = ItemUtils.generateSpecialUseDusts("UraniumHexafluoride", "Uranium Hexafluoride", Utils.rgbtoHexValue(9, 199, 32))[0]; - dustBerylliumFluoride = UtilsItems.generateSpecialUseDusts("BerylliumFluoride", "Beryllium Fluoride", Utils.rgbtoHexValue(175, 175, 175))[0]; //https://en.wikipedia.org/wiki/Beryllium_fluoride + dustBerylliumFluoride = ItemUtils.generateSpecialUseDusts("BerylliumFluoride", "Beryllium Fluoride", Utils.rgbtoHexValue(175, 175, 175))[0]; //https://en.wikipedia.org/wiki/Beryllium_fluoride - dustLithiumCarbonate = UtilsItems.generateSpecialUseDusts("LithiumCarbonate", "Lithium Carbonate", Utils.rgbtoHexValue(240, 240, 240))[0]; //https://en.wikipedia.org/wiki/Lithium_carbonate - dustLithiumFluoride = UtilsItems.generateSpecialUseDusts("LithiumFluoride", "Lithium Fluoride", Utils.rgbtoHexValue(245, 245, 245))[0]; //https://en.wikipedia.org/wiki/Lithium_fluoride - dustLithiumPeroxide = UtilsItems.generateSpecialUseDusts("LithiumPeroxide", "Lithium Peroxide", Utils.rgbtoHexValue(250, 250, 250))[0]; //https://en.wikipedia.org/wiki/Lithium_peroxide - dustLithiumHydroxide = UtilsItems.generateSpecialUseDusts("LithiumHydroxide", "Lithium Hydroxide", Utils.rgbtoHexValue(250, 250, 250))[0]; //https://en.wikipedia.org/wiki/Lithium_hydroxide + dustLithiumCarbonate = ItemUtils.generateSpecialUseDusts("LithiumCarbonate", "Lithium Carbonate", Utils.rgbtoHexValue(240, 240, 240))[0]; //https://en.wikipedia.org/wiki/Lithium_carbonate + dustLithiumFluoride = ItemUtils.generateSpecialUseDusts("LithiumFluoride", "Lithium Fluoride", Utils.rgbtoHexValue(245, 245, 245))[0]; //https://en.wikipedia.org/wiki/Lithium_fluoride + dustLithiumPeroxide = ItemUtils.generateSpecialUseDusts("LithiumPeroxide", "Lithium Peroxide", Utils.rgbtoHexValue(250, 250, 250))[0]; //https://en.wikipedia.org/wiki/Lithium_peroxide + dustLithiumHydroxide = ItemUtils.generateSpecialUseDusts("LithiumHydroxide", "Lithium Hydroxide", Utils.rgbtoHexValue(250, 250, 250))[0]; //https://en.wikipedia.org/wiki/Lithium_hydroxide - if (UtilsItems.getItemStackOfAmountFromOreDict("dustQuicklime", 1).getItem() == ModItems.AAA_Broken || !LoadedMods.IHL){ - dustQuicklime = UtilsItems.generateSpecialUseDusts("Quicklime", "Quicklime", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_oxide + if (ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1).getItem() == ModItems.AAA_Broken || !LoadedMods.IHL){ + dustQuicklime = ItemUtils.generateSpecialUseDusts("Quicklime", "Quicklime", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_oxide } - dustCalciumHydroxide = UtilsItems.generateSpecialUseDusts("CalciumHydroxide", "Hydrated Lime", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_hydroxide - dustCalciumCarbonate = UtilsItems.generateSpecialUseDusts("CalciumCarbonate", "Calcium Carbonate", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate - dust2LiOH_CaCO3 = UtilsItems.generateSpecialUseDusts("2LiOHCaCO3", "2LiOH & CaCO3 Compound", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate + dustCalciumHydroxide = ItemUtils.generateSpecialUseDusts("CalciumHydroxide", "Hydrated Lime", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_hydroxide + dustCalciumCarbonate = ItemUtils.generateSpecialUseDusts("CalciumCarbonate", "Calcium Carbonate", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate + dust2LiOH_CaCO3 = ItemUtils.generateSpecialUseDusts("2LiOHCaCO3", "2LiOH & CaCO3 Compound", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate //FLiBe Fuel Compounds - dustLi2BeF4 = UtilsItems.generateSpecialUseDusts("Li2BeF4", "Li2BeF4 Fuel Compound", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/FLiBe + dustLi2BeF4 = ItemUtils.generateSpecialUseDusts("Li2BeF4", "Li2BeF4 Fuel Compound", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/FLiBe boolean gtStyleTools = LoadedMods.Gregtech; Materials[] rm = Materials.values(); for (Materials m : rm){ - MP_GTMATERIAL = UtilsItems.generateMultiPick(gtStyleTools, m); - MS_GTMATERIAL = UtilsItems.generateMultiShovel(gtStyleTools, m); + MP_GTMATERIAL = ItemUtils.generateMultiPick(gtStyleTools, m); + MS_GTMATERIAL = ItemUtils.generateMultiShovel(gtStyleTools, m); /*itemBaseDecidust = UtilsItems.generateDecidust(m); itemBaseCentidust = UtilsItems.generateCentidust(m);*/ } @@ -320,7 +320,7 @@ public final class ModItems { //Item Init try { - UtilsItems.getItemForOreDict("Thaumcraft:ItemResource", "ingotVoidMetal", "Void Metal Ingot", 16); + ItemUtils.getItemForOreDict("Thaumcraft:ItemResource", "ingotVoidMetal", "Void Metal Ingot", 16); itemPlateVoidMetal = new BaseItemPlate("itemPlate"+"Void", "Void", new short[]{82, 17, 82}, 2, 0); GT_OreDictUnificator.registerOre("plateVoidMetal", new ItemStack(ModItems.itemPlateVoidMetal)); } catch (NullPointerException e){ @@ -446,7 +446,7 @@ public final class ModItems { itemStickyRubber = new Item().setUnlocalizedName("itemStickyRubber").setCreativeTab(tabMachines).setTextureName(CORE.MODID + ":itemStickyRubber"); GameRegistry.registerItem(itemStickyRubber, "itemStickyRubber"); - GT_OreDictUnificator.registerOre("ingotRubber", UtilsItems.getItemStack(CORE.MODID+":itemStickyRubber", 1)); + GT_OreDictUnificator.registerOre("ingotRubber", ItemUtils.getItemStack(CORE.MODID+":itemStickyRubber", 1)); itemHeliumBlob = new CoreItem("itemHeliumBlob", tabMisc).setTextureName(CORE.MODID + ":itemHeliumBlob"); //GameRegistry.registerItem(itemHeliumBlob, "itemHeliumBlob"); diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemBackpack.java b/src/Java/gtPlusPlus/core/item/base/BaseItemBackpack.java index 316f922639..391f7bb986 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemBackpack.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemBackpack.java @@ -5,7 +5,7 @@ import gtPlusPlus.GTplusplus; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.handler.GuiHandler; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -28,7 +28,7 @@ public class BaseItemBackpack extends Item{ this.setTextureName(CORE.MODID + ":" + "itemBackpack"); this.colourValue = colour; GameRegistry.registerItem(this, unlocalizedName); - GT_OreDictUnificator.registerOre("storageBackpack", UtilsItems.getSimpleStack(this)); + GT_OreDictUnificator.registerOre("storageBackpack", ItemUtils.getSimpleStack(this)); setMaxStackSize(1); setCreativeTab(AddToCreativeTab.tabOther); } diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index 7ee08cabee..2d4344ce5a 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -5,7 +5,7 @@ import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.entity.EntityUtils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import java.util.List; @@ -34,7 +34,7 @@ public class BaseItemComponent extends Item{ this.setMaxStackSize(64); this.setTextureName(CORE.MODID + ":" + "item"+componentType.COMPONENT_NAME); GameRegistry.registerItem(this, unlocalName); - GT_OreDictUnificator.registerOre(componentType.getOreDictName()+material.getUnlocalizedName(), UtilsItems.getSimpleStack(this)); + GT_OreDictUnificator.registerOre(componentType.getOreDictName()+material.getUnlocalizedName(), ItemUtils.getSimpleStack(this)); } @Override diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index f199f87f68..69d5363240 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -8,7 +8,7 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.entity.EntityUtils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; import java.util.List; @@ -70,7 +70,7 @@ public class BaseItemDust extends Item{ } if (temp != null && temp != ""){ oredictName = temp; - GT_OreDictUnificator.registerOre(temp, UtilsItems.getSimpleStack(this)); + GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this)); } addFurnaceRecipe(); addMacerationRecipe(); @@ -157,8 +157,8 @@ public class BaseItemDust extends Item{ Utils.LOG_WARNING("Generating OreDict Name: "+tempIngot); ItemStack[] outputStacks = {dustInfo.getDust(1)}; if (tempIngot != null && tempIngot != ""){ - tempInputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); - tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempDust, 1); + tempInputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempIngot, 1); + tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempDust, 1); ItemStack tempStackOutput2 = null; int chance = mTier*10/MathUtils.randInt(10, 20); if (outputStacks.length != 0){ @@ -202,19 +202,19 @@ public class BaseItemDust extends Item{ 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); + ItemStack tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempIngot, 1); Utils.LOG_WARNING("This will produce "+tempOutputStack.getDisplayName() + " Debug: "+tempIngot); if (null != tempOutputStack){ - addBlastFurnaceRecipe(UtilsItems.getSimpleStack(this), null, tempOutputStack, null, 350*mTier); + addBlastFurnaceRecipe(ItemUtils.getSimpleStack(this), null, tempOutputStack, null, 350*mTier); } return; } Utils.LOG_WARNING("Adding recipe for "+materialName+" Ingots in a furnace."); - ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1); + ItemStack tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1); Utils.LOG_WARNING("This will produce an ingot of "+tempOutputStack.getDisplayName() + " Debug: "+temp); if (null != tempOutputStack){ if (mTier < 5 || !dustInfo.requiresBlastFurnace()){ - if (CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(UtilsItems.getSimpleStack(this), tempOutputStack)){ + if (CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(ItemUtils.getSimpleStack(this), tempOutputStack)){ Utils.LOG_WARNING("Successfully added a furnace recipe for "+materialName); } else { @@ -225,7 +225,7 @@ public class BaseItemDust extends Item{ Utils.LOG_WARNING("Adding recipe for "+materialName+" Ingots in a Blast furnace."); Utils.LOG_WARNING("This will produce "+tempOutputStack.getDisplayName()); if (null != tempOutputStack){ - addBlastFurnaceRecipe(UtilsItems.getSimpleStack(this), null, tempOutputStack, null, 350*mTier); + addBlastFurnaceRecipe(ItemUtils.getSimpleStack(this), null, tempOutputStack, null, 350*mTier); } return; } diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java index 77e0b7324b..d5dd78a49b 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java @@ -5,7 +5,7 @@ import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.entity.EntityUtils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; import java.util.List; @@ -36,7 +36,7 @@ public class BaseItemDustUnique extends Item{ this.setCreativeTab(tabMisc); this.colour = colour; this.materialName = materialName; - this.sRadiation = UtilsItems.getRadioactivityLevel(materialName); + this.sRadiation = ItemUtils.getRadioactivityLevel(materialName); GameRegistry.registerItem(this, unlocalizedName); String temp = ""; @@ -61,7 +61,7 @@ public class BaseItemDustUnique extends Item{ Utils.LOG_WARNING("Generating OreDict Name: "+temp); } if (temp != null && temp != ""){ - GT_OreDictUnificator.registerOre(temp, UtilsItems.getSimpleStack(this)); + GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this)); } } diff --git a/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java b/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java index aaad22be9c..92b8c8c224 100644 --- a/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java +++ b/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java @@ -1,7 +1,7 @@ package gtPlusPlus.core.item.base.foods; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; import java.util.List; @@ -42,7 +42,7 @@ public class BaseItemHotFood extends BaseItemFood{ if(iStack.getItemDamage() == cooldownTime) { if (entityHolding instanceof EntityPlayer){ Utils.LOG_INFO("Foods Done."); - ((EntityPlayer) entityHolding).inventory.addItemStackToInventory(UtilsItems.getSimpleStack(output)); + ((EntityPlayer) entityHolding).inventory.addItemStackToInventory(ItemUtils.getSimpleStack(output)); ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this); } }else if(iStack.getItemDamage() < cooldownTime){ diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java index d58522756f..9a0ef0d097 100644 --- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java +++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java @@ -6,7 +6,7 @@ import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.entity.EntityUtils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; import java.util.List; @@ -45,7 +45,7 @@ public class BaseItemIngot extends Item{ temp = unlocalName.replace("itemHotIngot", "ingotHot"); } if (temp != null && temp != ""){ - GT_OreDictUnificator.registerOre(temp, UtilsItems.getSimpleStack(this)); + GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this)); } generateCompressorRecipe(); } @@ -85,7 +85,7 @@ public class BaseItemIngot extends Item{ private void generateCompressorRecipe(){ if (unlocalName.contains("itemIngot")){ - ItemStack tempStack = UtilsItems.getSimpleStack(this, 9); + ItemStack tempStack = ItemUtils.getSimpleStack(this, 9); ItemStack tempOutput = null; String temp = getUnlocalizedName().replace("item.itemIngot", "block"); Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+getUnlocalizedName()); @@ -96,7 +96,7 @@ public class BaseItemIngot extends Item{ temp = temp.replace("itemIngot", "block"); Utils.LOG_WARNING("Generating OreDict Name: "+temp); if (temp != null && temp != ""){ - tempOutput = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1); + tempOutput = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1); if (tempOutput != null){ GT_ModHandler.addCompressionRecipe(tempStack, tempOutput); } diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java index 6fa358f36f..6b60e7f8d3 100644 --- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java +++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java @@ -3,7 +3,7 @@ package gtPlusPlus.core.item.base.ingots; import gregtech.api.enums.GT_Values; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import java.util.List; @@ -50,7 +50,7 @@ public class BaseItemIngotHot extends BaseItemIngot{ private void generateRecipe(){ Utils.LOG_WARNING("Adding Vacuum Freezer recipe for a Hot Ingot of "+materialName+"."); - GT_Values.RA.addVacuumFreezerRecipe(UtilsItems.getSimpleStack(this), outputIngot.copy(), 60*mTier); + GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getSimpleStack(this), outputIngot.copy(), 60*mTier); } diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java index 77af69f809..8d3871187a 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java @@ -3,7 +3,7 @@ package gtPlusPlus.core.item.base.itemblock; import gtPlusPlus.core.fluids.BlockFluidBase; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; import java.util.List; @@ -26,7 +26,7 @@ public class ItemBlockFluid extends ItemBlock{ this.baseBlock = (BlockFluidBase) block; this.blockColour = baseBlock.getRenderColor(1); this.thisFluid = baseBlock.getFluidMaterial(); - this.sRadiation=UtilsItems.getRadioactivityLevel(baseBlock.getUnlocalizedName()); + this.sRadiation=ItemUtils.getRadioactivityLevel(baseBlock.getUnlocalizedName()); this.name = baseBlock.getLocalizedName().replace("tile", "").replace("fluid", "").replace("name", "").replace("block", "").replace(".", ""); //GT_OreDictUnificator.registerOre("frameGt"+block.getUnlocalizedName().replace("tile.", "").replace("tile.BlockGtFrame", "").replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox", ""), UtilsItems.getSimpleStack(this)); } diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java index cd89b027d0..8bf5346084 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java @@ -4,7 +4,7 @@ import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.block.base.BlockBaseModular; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.entity.EntityUtils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import java.util.List; @@ -30,7 +30,7 @@ public class ItemBlockGtBlock extends ItemBlock{ else { sRadiation = 0; } - GT_OreDictUnificator.registerOre("block"+block.getUnlocalizedName().replace("tile.block", "").replace("tile.", "").replace("of", "").replace("Of", "").replace("Block", "").replace("-", "").replace("_", "").replace(" ", ""), UtilsItems.getSimpleStack(this)); + GT_OreDictUnificator.registerOre("block"+block.getUnlocalizedName().replace("tile.block", "").replace("tile.", "").replace("of", "").replace("Of", "").replace("Block", "").replace("-", "").replace("_", "").replace(" ", ""), ItemUtils.getSimpleStack(this)); } public int getRenderColor(int aMeta) { diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java index b4628f12ab..9d442e3102 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java @@ -2,7 +2,7 @@ package gtPlusPlus.core.item.base.itemblock; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.block.base.BlockBaseModular; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; @@ -14,7 +14,7 @@ public class ItemBlockGtFrameBox extends ItemBlock{ super(block); BlockBaseModular baseBlock = (BlockBaseModular) block; this.blockColour = baseBlock.getRenderColor(1); - GT_OreDictUnificator.registerOre("frameGt"+block.getUnlocalizedName().replace("tile.", "").replace("tile.BlockGtFrame", "").replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox", ""), UtilsItems.getSimpleStack(this)); + GT_OreDictUnificator.registerOre("frameGt"+block.getUnlocalizedName().replace("tile.", "").replace("tile.BlockGtFrame", "").replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox", ""), ItemUtils.getSimpleStack(this)); } public int getRenderColor(int aMeta) { diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java index 4c1d36f945..882dc8b2bf 100644 --- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java +++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java @@ -4,7 +4,7 @@ import gregtech.api.enums.GT_Values; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.ItemStack; public class BaseItemRodLong extends BaseItemComponent{ @@ -24,8 +24,8 @@ public class BaseItemRodLong extends BaseItemComponent{ String tempStick = unlocalName.replace("itemRodLong", "stick"); String tempStickLong = unlocalName.replace("itemRodLong", "stickLong"); - ItemStack stackStick = UtilsItems.getItemStackOfAmountFromOreDict(tempStick, 1); - ItemStack stackLong = UtilsItems.getItemStackOfAmountFromOreDict(tempStickLong, 1); + ItemStack stackStick = ItemUtils.getItemStackOfAmountFromOreDict(tempStick, 1); + ItemStack stackLong = ItemUtils.getItemStackOfAmountFromOreDict(tempStickLong, 1); ItemStack temp = stackStick; temp.stackSize = 2; diff --git a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java index 212dcd0fc1..93aa5b7526 100644 --- a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java +++ b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java @@ -4,7 +4,7 @@ import gregtech.api.enums.GT_Values; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.ItemStack; public class BaseItemScrew extends BaseItemComponent{ @@ -16,11 +16,11 @@ public class BaseItemScrew extends BaseItemComponent{ private void addLatheRecipe(){ Utils.LOG_WARNING("Adding recipe for "+materialName+" Screws"); - ItemStack boltStack = UtilsItems.getItemStackOfAmountFromOreDict(unlocalName.replace("itemScrew", "bolt"), 1); + ItemStack boltStack = ItemUtils.getItemStackOfAmountFromOreDict(unlocalName.replace("itemScrew", "bolt"), 1); if (null != boltStack){ GT_Values.RA.addLatheRecipe( boltStack, - UtilsItems.getSimpleStack(this), + ItemUtils.getSimpleStack(this), null, (int) Math.max(componentMaterial.getMass() / 8L, 1L), 4); diff --git a/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java b/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java index efecb03d9f..3c8e09e9e5 100644 --- a/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java +++ b/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java @@ -4,7 +4,7 @@ import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.interfaces.IItemBlueprint; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.player.PlayerUtils; @@ -87,7 +87,7 @@ public class ItemBlueprint extends Item implements IItemBlueprint{ public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer par3Entity) { //Let the player know what blueprint is held if (itemStack.hasTagCompound()) { - PlayerUtils.messagePlayer(par3Entity, "This Blueprint holds NBT data. "+"|"+getNBT(itemStack, "mID")+"|"+getNBT(itemStack, "mBlueprint")+"|"+getNBT(itemStack, "mName")+"|"+UtilsItems.getArrayStackNames(readItemsFromNBT(itemStack))); + PlayerUtils.messagePlayer(par3Entity, "This Blueprint holds NBT data. "+"|"+getNBT(itemStack, "mID")+"|"+getNBT(itemStack, "mBlueprint")+"|"+getNBT(itemStack, "mName")+"|"+ItemUtils.getArrayStackNames(readItemsFromNBT(itemStack))); } else { createNBT(itemStack); diff --git a/src/Java/gtPlusPlus/core/item/general/ItemCloakingDevice.java b/src/Java/gtPlusPlus/core/item/general/ItemCloakingDevice.java index 04503c5a62..c5f383955c 100644 --- a/src/Java/gtPlusPlus/core/item/general/ItemCloakingDevice.java +++ b/src/Java/gtPlusPlus/core/item/general/ItemCloakingDevice.java @@ -2,7 +2,7 @@ package gtPlusPlus.core.item.general; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; @@ -38,7 +38,7 @@ public class ItemCloakingDevice extends Item implements IElectricItem, IElectric this.setUnlocalizedName(unlocalizedName); this.setMaxStackSize(1); this.setTextureName(CORE.MODID + ":" + "personalCloakingDevice"); - this.thisStack = UtilsItems.getSimpleStack(this); + this.thisStack = ItemUtils.getSimpleStack(this); this.charge(thisStack, charge, 3, true, false); if (charge == 10000*20*500){ this.setDamage(thisStack, 13); diff --git a/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java b/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java index aa67e0f10c..4f1d7f4ecf 100644 --- a/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java +++ b/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java @@ -3,7 +3,7 @@ package gtPlusPlus.core.item.general; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.player.PlayerUtils; import ic2.api.item.ElectricItem; @@ -37,7 +37,7 @@ public class ItemHealingDevice extends Item implements IElectricItem, IElectricI this.setUnlocalizedName(unlocalizedName); this.setMaxStackSize(1); this.setTextureName(CORE.MODID + ":" + "personalCloakingDevice"); - this.thisStack = UtilsItems.getSimpleStack(this); + this.thisStack = ItemUtils.getSimpleStack(this); GameRegistry.registerItem(this, unlocalizedName); } diff --git a/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java b/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java index f1141e1ef4..7844d96f3f 100644 --- a/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java +++ b/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java @@ -2,7 +2,7 @@ package gtPlusPlus.core.item.general; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; @@ -44,7 +44,7 @@ public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem, this.setUnlocalizedName(unlocalizedName); this.setMaxStackSize(1); this.setTextureName(CORE.MODID + ":" + "itemIngot"); - this.thisStack = UtilsItems.getSimpleStack(this); + this.thisStack = ItemUtils.getSimpleStack(this); GameRegistry.registerItem(this, unlocalizedName); } @@ -206,7 +206,7 @@ public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem, public double discharge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate) { if ((stack.stackTagCompound == null) || (!stack.stackTagCompound.hasKey("Energy"))) { - double euCharge = getCharge(UtilsItems.getSimpleStack(this)); + double euCharge = getCharge(ItemUtils.getSimpleStack(this)); if (euCharge != 0 && euCharge >= 1){ return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU)); } @@ -254,7 +254,7 @@ public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem, public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) { if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) { - double euCharge = getCharge(UtilsItems.getSimpleStack(this)); + double euCharge = getCharge(ItemUtils.getSimpleStack(this)); if (euCharge != 0 && euCharge >= 1){ return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU)); } @@ -277,7 +277,7 @@ public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem, public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) { if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) { - double euCharge = getCharge(UtilsItems.getSimpleStack(this)); + double euCharge = getCharge(ItemUtils.getSimpleStack(this)); if (euCharge != 0 && euCharge >= 1){ return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU)); } @@ -299,7 +299,7 @@ public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem, public int getEnergyStored(ItemStack container) { if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) { - double euCharge = getCharge(UtilsItems.getSimpleStack(this)); + double euCharge = getCharge(ItemUtils.getSimpleStack(this)); if (euCharge != 0 && euCharge >= 1){ return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU)); } diff --git a/src/Java/gtPlusPlus/core/item/init/ItemsFoods.java b/src/Java/gtPlusPlus/core/item/init/ItemsFoods.java index 8f1a2083ac..7fbfca0ac8 100644 --- a/src/Java/gtPlusPlus/core/item/init/ItemsFoods.java +++ b/src/Java/gtPlusPlus/core/item/init/ItemsFoods.java @@ -5,7 +5,7 @@ import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.base.foods.BaseItemFood; import gtPlusPlus.core.item.base.foods.BaseItemHotFood; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; @@ -19,24 +19,24 @@ public class ItemsFoods { //Raisin Bread ModItems.itemIngotRaisinBread = new BaseItemFood("itemIngotRaisinBread", "Raisin Bread", 3, 1.5f, false, new PotionEffect(Potion.weakness.id, 40, 1)).setAlwaysEdible(); - GT_OreDictUnificator.registerOre("foodRaisinBread", UtilsItems.getItemStack(CORE.MODID+":itemIngotRaisinBread", 1)); + GT_OreDictUnificator.registerOre("foodRaisinBread", ItemUtils.getItemStack(CORE.MODID+":itemIngotRaisinBread", 1)); //Hot Raisin Bread ModItems.itemHotIngotRaisinBread = new BaseItemHotFood("itemHotIngotRaisinBread", 1, 0.5f, "Raisin Bread", 120, ModItems.itemIngotRaisinBread); - GT_OreDictUnificator.registerOre("foodHotRaisinBread", UtilsItems.getItemStack(CORE.MODID+":itemHotIngotRaisinBread", 1)); + GT_OreDictUnificator.registerOre("foodHotRaisinBread", ItemUtils.getItemStack(CORE.MODID+":itemHotIngotRaisinBread", 1)); //Raisin Bread ModItems.itemFoodRaisinToast = new BaseItemFood("itemFoodRaisinToast", "Raisin Toast", 1, 0.5f, false).setAlwaysEdible(); - GT_OreDictUnificator.registerOre("foodRaisinToast", UtilsItems.getItemStack(CORE.MODID+":itemFoodRaisinToast", 1)); + GT_OreDictUnificator.registerOre("foodRaisinToast", ItemUtils.getItemStack(CORE.MODID+":itemFoodRaisinToast", 1)); //Hot Raisin Bread ModItems.itemHotFoodRaisinToast = new BaseItemHotFood("itemHotFoodRaisinToast", 1, 0.5f, "Raisin Toast", 20, ModItems.itemFoodRaisinToast); - GT_OreDictUnificator.registerOre("foodHotRaisinToast", UtilsItems.getItemStack(CORE.MODID+":itemHotFoodRaisinToast", 1)); + GT_OreDictUnificator.registerOre("foodHotRaisinToast", ItemUtils.getItemStack(CORE.MODID+":itemHotFoodRaisinToast", 1)); //Raisin Bread ModItems.itemFoodCurriedSausages = new BaseItemFood("itemFoodCurriedSausages", "Curried Sausages", 5, 2f, false); - GT_OreDictUnificator.registerOre("foodCurriedSausages", UtilsItems.getItemStack(CORE.MODID+":itemFoodCurriedSausages", 1)); + GT_OreDictUnificator.registerOre("foodCurriedSausages", ItemUtils.getItemStack(CORE.MODID+":itemFoodCurriedSausages", 1)); //Hot Raisin Bread ModItems.itemHotFoodCurriedSausages = new BaseItemHotFood("itemHotFoodCurriedSausages", 1, 0.5f, "Curried Sausages", 240, ModItems.itemFoodCurriedSausages); - GT_OreDictUnificator.registerOre("foodHotCurriedSausages", UtilsItems.getItemStack(CORE.MODID+":itemHotFoodCurriedSausages", 1)); + GT_OreDictUnificator.registerOre("foodHotCurriedSausages", ItemUtils.getItemStack(CORE.MODID+":itemHotFoodCurriedSausages", 1)); } diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java index 2978579d0b..99ee699dcf 100644 --- a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java +++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java @@ -3,10 +3,10 @@ package gtPlusPlus.core.item.tool.staballoy; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.player.UtilsMining; -import gtPlusPlus.core.util.recipe.UtilsRecipe; +import gtPlusPlus.core.util.recipe.RecipeUtils; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -74,18 +74,18 @@ public class MultiPickaxeBase extends StaballoyPickaxe{ String toolFile = "craftingToolFile"; String toolScrewDriver = "craftingToolScrewdriver"; - if (null == UtilsItems.getItemStackOfAmountFromOreDictNoBroken(rodLong, 1)){ + if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(rodLong, 1)){ return false; } - if (null == UtilsItems.getItemStackOfAmountFromOreDictNoBroken(plateDense, 1)){ + if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDense, 1)){ return false; } - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( plateDense, plateDense, plateDense, toolFile, rodLong, toolHammer, toolWrench, rodLong, toolScrewDriver, - UtilsItems.getSimpleStack(this)); + ItemUtils.getSimpleStack(this)); return true; } diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java index 972ba0ca12..0560893490 100644 --- a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java +++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java @@ -3,9 +3,9 @@ package gtPlusPlus.core.item.tool.staballoy; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.recipe.UtilsRecipe; +import gtPlusPlus.core.util.recipe.RecipeUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; @@ -60,18 +60,18 @@ public class MultiSpadeBase extends StaballoySpade{ String toolFile = "craftingToolFile"; String toolScrewDriver = "craftingToolScrewdriver"; - if (null == UtilsItems.getItemStackOfAmountFromOreDictNoBroken(rodLong, 1)){ + if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(rodLong, 1)){ return false; } - if (null == UtilsItems.getItemStackOfAmountFromOreDictNoBroken(plateDense, 1)){ + if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDense, 1)){ return false; } - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( toolFile, plateDense, toolHammer, null, rodLong, null, toolWrench, rodLong, toolScrewDriver, - UtilsItems.getSimpleStack(this)); + ItemUtils.getSimpleStack(this)); return true; } diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java index e2648c667e..ae1928a749 100644 --- a/src/Java/gtPlusPlus/core/material/ALLOY.java +++ b/src/Java/gtPlusPlus/core/material/ALLOY.java @@ -506,10 +506,11 @@ public final class ALLOY { 128, //Neutrons true, //Uses Blast furnace? new MaterialStack[]{ - new MaterialStack(ELEMENT.NICKEL, 25), - new MaterialStack(ELEMENT.CHROMIUM, 25), - new MaterialStack(ELEMENT.IRON, 25), - new MaterialStack(ELEMENT.TUNGSTEN, 25) + new MaterialStack(ELEMENT.NICKEL, 30), + new MaterialStack(ELEMENT.CHROMIUM, 10), + new MaterialStack(ELEMENT.ZIRCONIUM, 20), + new MaterialStack(ELEMENT.IRON, 30), + new MaterialStack(ELEMENT.TUNGSTEN, 10) }); //Material Stacks with Percentage of required elements. diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 3190486537..78d7d73bd4 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -3,10 +3,12 @@ package gtPlusPlus.core.material; import static gregtech.api.enums.GT_Values.M; import gregtech.api.enums.OrePrefixes; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.fluid.FluidUtils; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.materials.MaterialUtils; import gtPlusPlus.core.util.math.MathUtils; import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; public class Material { @@ -15,7 +17,7 @@ public class Material { protected Object dataVar; - private MaterialStack[] materialInput = new MaterialStack[4]; + private MaterialStack[] vMaterialInput = new MaterialStack[9]; public final long[] vSmallestRatio; final short[] RGBA; @@ -119,21 +121,21 @@ public class Material { this.vVoltageMultiplier = this.getMeltingPoint_K() >= 2800 ? 64 : 16; if (inputs == null){ - this.materialInput = null; + this.vMaterialInput = null; } else { if (inputs.length != 0){ for (int i=0; i < inputs.length; i++){ if (inputs[i] != null){ - this.materialInput[i] = inputs[i]; + this.vMaterialInput[i] = inputs[i]; } } } } - - this.vSmallestRatio = getSmallestRatio(materialInput); + + this.vSmallestRatio = getSmallestRatio(vMaterialInput); int tempSmallestSize = 0; - + if (vSmallestRatio != null){ for (int v=0;v= 1){ this.smallestStackSizeWhenProcessing = tempSmallestSize; //Valid stacksizes } @@ -155,15 +157,15 @@ public class Material { //Makes a Fancy Chemical Tooltip this.vChemicalSymbol = chemicalSymbol; - if (materialInput != null){ + if (vMaterialInput != null){ this.vChemicalFormula = getToolTip(chemicalSymbol, OrePrefixes.dust.mMaterialAmount / M, true); } else if (!this.vChemicalSymbol.equals("")){ - Utils.LOG_INFO("materialInput is null, using a valid chemical symbol."); + Utils.LOG_WARNING("materialInput is null, using a valid chemical symbol."); this.vChemicalFormula = this.vChemicalSymbol; } else{ - Utils.LOG_INFO("MaterialInput == null && chemicalSymbol probably equals nothing"); + Utils.LOG_WARNING("MaterialInput == null && chemicalSymbol probably equals nothing"); this.vChemicalFormula = "??"; } @@ -232,97 +234,104 @@ public class Material { } public ItemStack getDust(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+unlocalizedName, stacksize); + return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust"+unlocalizedName, stacksize); } public ItemStack getSmallDust(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustSmall"+unlocalizedName, stacksize); + return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustSmall"+unlocalizedName, stacksize); } public ItemStack getTinyDust(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustTiny"+unlocalizedName, stacksize); + return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustTiny"+unlocalizedName, stacksize); } public ItemStack[] getValidInputStacks(){ - return UtilsItems.validItemsForOreDict(unlocalizedName); + return ItemUtils.validItemsForOreDict(unlocalizedName); } public ItemStack getIngot(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("ingot"+unlocalizedName, stacksize); + return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingot"+unlocalizedName, stacksize); } public ItemStack getPlate(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("plate"+unlocalizedName, stacksize); + return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plate"+unlocalizedName, stacksize); } public ItemStack getPlateDouble(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("plateDouble"+unlocalizedName, stacksize); + return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDouble"+unlocalizedName, stacksize); } public ItemStack getGear(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("gear"+unlocalizedName, stacksize); + return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("gear"+unlocalizedName, stacksize); } public ItemStack getRod(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("stick"+unlocalizedName, stacksize); + return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("stick"+unlocalizedName, stacksize); } public ItemStack getLongRod(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("stickLong"+unlocalizedName, stacksize); + return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("stickLong"+unlocalizedName, stacksize); } public ItemStack getBolt(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("bolt"+unlocalizedName, stacksize); + return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("bolt"+unlocalizedName, stacksize); } public ItemStack getScrew(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("screw"+unlocalizedName, stacksize); + return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("screw"+unlocalizedName, stacksize); } public ItemStack getRing(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("ring"+unlocalizedName, stacksize); + return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ring"+unlocalizedName, stacksize); } public ItemStack getRotor(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("rotor"+unlocalizedName, stacksize); + return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("rotor"+unlocalizedName, stacksize); } public ItemStack getFrameBox(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("frameGt"+unlocalizedName, stacksize); + return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("frameGt"+unlocalizedName, stacksize); } public ItemStack[] getMaterialComposites(){ //Utils.LOG_INFO("Something requested the materials needed for "+localizedName); - if (materialInput != null && materialInput.length >= 1){ - ItemStack[] temp = new ItemStack[materialInput.length]; - for (int i=0;i= 1){ + ItemStack[] temp = new ItemStack[vMaterialInput.length]; + for (int i=0;i= 1){ - int[] temp = new int[materialInput.length]; - for (int i=0;i= 1){ + int[] temp = new int[vMaterialInput.length]; + for (int i=0;i 0){ - Utils.LOG_INFO("length: "+inputs.length); - Utils.LOG_INFO("(inputs != null): "+(inputs != null)); + Utils.LOG_WARNING("length: "+inputs.length); + Utils.LOG_WARNING("(inputs != null): "+(inputs != null)); //Utils.LOG_INFO("length: "+inputs.length); double tempPercentage=0; long[] tempRatio = new long[inputs.length]; @@ -406,7 +415,7 @@ public class Material { for (int r=0;r= 1){ String dummyFormula = ""; @@ -475,17 +484,22 @@ public class Material { return MaterialUtils.subscript(dummyFormula); //return dummyFormula; } - Utils.LOG_INFO("dummyFormulaArray <= 0"); + Utils.LOG_WARNING("dummyFormulaArray <= 0"); } - Utils.LOG_INFO("dummyFormulaArray == null"); + Utils.LOG_WARNING("dummyFormulaArray == null"); } - Utils.LOG_INFO("tempInput.length <= 0"); + Utils.LOG_WARNING("tempInput.length <= 0"); } - Utils.LOG_INFO("tempInput == null"); + Utils.LOG_WARNING("tempInput == null"); return "??"; } + public FluidStack getMolten(int fluidAmount) { + Utils.LOG_INFO("Getting "+fluidAmount+"L of "+unlocalizedName.toLowerCase()); + return FluidUtils.getFluidStack(unlocalizedName.toLowerCase(), fluidAmount); + } + diff --git a/src/Java/gtPlusPlus/core/material/MaterialStack.java b/src/Java/gtPlusPlus/core/material/MaterialStack.java index 8d9de3faf4..a804a09da2 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialStack.java +++ b/src/Java/gtPlusPlus/core/material/MaterialStack.java @@ -1,6 +1,6 @@ package gtPlusPlus.core.material; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import java.math.BigDecimal; import java.math.RoundingMode; @@ -14,12 +14,9 @@ public class MaterialStack { final double percentageToUse; public MaterialStack(Material inputs, double partOutOf100){ - this.stackMaterial = inputs; this.percentageToUse = partOutOf100; this.vAmount = math(partOutOf100); - - } private int[] math(double val){ @@ -37,6 +34,19 @@ public class MaterialStack { public ItemStack getDustStack(){ return this.stackMaterial.getDust(this.vAmount[0]); } + + public ItemStack getDustStack(int amount){ + return this.stackMaterial.getDust(amount); + } + + public Material getStackMaterial(){ + return this.stackMaterial; + } + + public long[] getSmallestStackSizes(){ + return this.stackMaterial.getSmallestRatio(stackMaterial.getComposites()); + } + public int getPartsPerOneHundred(){ if (this.vAmount != null){ if (this.vAmount[0] >= 1 && this.vAmount[0] <= 100){ @@ -61,83 +71,8 @@ public class MaterialStack { } } - /*public ItemStack getDustStack(){ - int caseStatus = 0; - int amount = 0; - if (percentageToUse >= 0 && percentageToUse <= 0.99){ - caseStatus = 1; - amount = (int) (1/percentageToUse); - //amount = Integer.valueOf(String.valueOf(percentageToUse).charAt(2)); - } - else if (percentageToUse >= 1 && percentageToUse <= 9.99){ - caseStatus = 2; - amount = (int) (percentageToUse); - //amount = Integer.valueOf(String.valueOf(percentageToUse).charAt(0)); - } - else if (percentageToUse >= 10 && percentageToUse <= 99.99){ - caseStatus = 3; - amount = (int) (percentageToUse/10); - //amount = Integer.valueOf(String.valueOf(percentageToUse).charAt(0)); - } - else if (percentageToUse == 100){ - caseStatus = 4; - amount = 10; - } - else { - amount = 0; - } - switch (caseStatus) { - case 1: { - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustTiny"+stackMaterial.unlocalizedName, amount); - } - case 2: { - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustSmall"+stackMaterial.unlocalizedName, amount); - } - case 3: { - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+stackMaterial.unlocalizedName, amount); - } - case 4: { - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+stackMaterial.unlocalizedName, amount); - } - default: - return null; - } - - }*/ - - /*public int getDustCount(){ - int amount = 0; - - //No Dust - if (percentageToUse >= 0 && percentageToUse <= 11.1111111111111111111111110){ - //amount = (int) (1/percentageToUse); - amount = 0; //Less than a tiny dust. - } - - //Tiny Dust - else if (percentageToUse >= 11.1111111111111111111111111 && percentageToUse <= 25){ - amount = (int) (percentageToUse); - } - - //Small Dust - else if (percentageToUse >= 10 && percentageToUse <= 99.99){ - amount = (int) (percentageToUse/10); - } - - //Dust - else if (percentageToUse == 100){ - amount = 10; - } - - //Error - Nothing - else { - amount = 0; - } - return amount; - }*/ - public ItemStack[] getValidItemStacks(){ - return UtilsItems.validItemsForOreDict(stackMaterial.unlocalizedName); + return ItemUtils.validItemsForOreDict(stackMaterial.unlocalizedName); } diff --git a/src/Java/gtPlusPlus/core/recipe/Gregtech_Recipe_Adder.java b/src/Java/gtPlusPlus/core/recipe/Gregtech_Recipe_Adder.java index 0f31c4c61d..bb5732c319 100644 --- a/src/Java/gtPlusPlus/core/recipe/Gregtech_Recipe_Adder.java +++ b/src/Java/gtPlusPlus/core/recipe/Gregtech_Recipe_Adder.java @@ -3,7 +3,7 @@ package gtPlusPlus.core.recipe; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_ModHandler; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -35,28 +35,28 @@ public class Gregtech_Recipe_Adder { resetVars(); if (addMaceratorRecipe){ - inputStack1 = UtilsItems.getSimpleStack(maceratorInput, maceratorInputAmount1); - outputStack1 = UtilsItems.getSimpleStack(maceratorOutput, maceratorOutputAmount1); + inputStack1 = ItemUtils.getSimpleStack(maceratorInput, maceratorInputAmount1); + outputStack1 = ItemUtils.getSimpleStack(maceratorOutput, maceratorOutputAmount1); addMaceratorRecipe(inputStack1, outputStack1); } resetVars(); if (addCompressorRecipe){ - inputStack1 = UtilsItems.getSimpleStack(compressorInput, compressorInputAmount1); - outputStack1 = UtilsItems.getSimpleStack(compressorOutput, compressorOutputAmount1); + inputStack1 = ItemUtils.getSimpleStack(compressorInput, compressorInputAmount1); + outputStack1 = ItemUtils.getSimpleStack(compressorOutput, compressorOutputAmount1); addCompressorRecipe(inputStack1, outputStack1); } resetVars(); if (addBlastFurnaceRecipe){ - inputStack1 = UtilsItems.getSimpleStack(blastFurnaceInput, blastFurnaceInputAmount1); - inputStack2 = UtilsItems.getSimpleStack(blastFurnaceInput2, blastFurnaceInputAmount2); - outputStack1 = UtilsItems.getSimpleStack(blastFurnaceOutput, blastFurnaceOutputAmount1); - outputStack2 = UtilsItems.getSimpleStack(blastFurnaceOutput2, blastFurnaceOutputAmount2); + inputStack1 = ItemUtils.getSimpleStack(blastFurnaceInput, blastFurnaceInputAmount1); + inputStack2 = ItemUtils.getSimpleStack(blastFurnaceInput2, blastFurnaceInputAmount2); + outputStack1 = ItemUtils.getSimpleStack(blastFurnaceOutput, blastFurnaceOutputAmount1); + outputStack2 = ItemUtils.getSimpleStack(blastFurnaceOutput2, blastFurnaceOutputAmount2); addBlastFurnaceRecipe(inputStack1, inputStack2, outputStack1, outputStack2, blastFurnaceTemp); } resetVars(); if (addSmeltingRecipe){ - inputStack1 = UtilsItems.getSimpleStack(smeltingInput, smeltingInputAmount1); - outputStack1 = UtilsItems.getSimpleStack(smeltingOutput, smeltingOutputAmount1); + inputStack1 = ItemUtils.getSimpleStack(smeltingInput, smeltingInputAmount1); + outputStack1 = ItemUtils.getSimpleStack(smeltingOutput, smeltingOutputAmount1); addSmeltingRecipe(inputStack1, outputStack1); } resetVars(); diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index 298e012143..46cf4e0a7d 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -11,7 +11,7 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.fluid.FluidUtils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -61,7 +61,7 @@ public class RECIPES_GREGTECH { GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1L), //Input 2 Materials.SulfuricAcid.getFluid(60L), //Fluid Input Materials.Creosote.getFluid(250L), //Fluid Output - UtilsItems.getItemStack("Railcraft:fuel.coke", 2), //Item Output + ItemUtils.getItemStack("Railcraft:fuel.coke", 2), //Item Output 600, //Time in ticks 120); //EU }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");} @@ -87,7 +87,7 @@ public class RECIPES_GREGTECH { GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1L), //Input 2 FluidUtils.getFluidStack("oxygen", 185), //Fluid Input Materials.Creosote.getFluid(200L), //Fluid Output - UtilsItems.getItemStack("Railcraft:fuel.coke", 2), //Item Output + ItemUtils.getItemStack("Railcraft:fuel.coke", 2), //Item Output 900, //Time in ticks 120); //EU }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");} @@ -134,24 +134,24 @@ public class RECIPES_GREGTECH { }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}*/ try { - ItemStack cells = UtilsItems.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:itemCellEmpty", "Empty Fluid Cells", 0, 12); + ItemStack cells = ItemUtils.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:itemCellEmpty", "Empty Fluid Cells", 0, 12); if (cells == null){ - cells = UtilsItems.getItemStackOfAmountFromOreDictNoBroken("cellEmpty", 12); + cells = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellEmpty", 12); } - ItemStack[] input = {cells, UtilsItems.getItemStackOfAmountFromOreDict("dustLepidolite", 20)}; + ItemStack[] input = {cells, ItemUtils.getItemStackOfAmountFromOreDict("dustLepidolite", 20)}; CORE.RA.addDehydratorRecipe( input, //Item input (Array, up to 2) FluidUtils.getFluidStack("sulfuricacid", 10000), //Fluid input (slot 1) FluidUtils.getFluidStack("sulfuriclithium", 10000), //Fluid output (slot 2) new ItemStack[]{ - UtilsItems.getItemStackOfAmountFromOreDict("dustPotassium", 1), - UtilsItems.getItemStackOfAmountFromOreDict("dustAluminium", 4), - UtilsItems.getItemStackOfAmountFromOreDict("cellOxygen", 10), - UtilsItems.getItemStackOfAmountFromOreDict("cellFluorine", 2), - UtilsItems.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 3), //LithiumCarbonate + ItemUtils.getItemStackOfAmountFromOreDict("dustPotassium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 4), + ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 10), + ItemUtils.getItemStackOfAmountFromOreDict("cellFluorine", 2), + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 3), //LithiumCarbonate }, //Output Array of Items - Upto 9, new int[]{0}, 75*20, //Time in ticks @@ -162,13 +162,13 @@ public class RECIPES_GREGTECH { CORE.RA.addDehydratorRecipe( new ItemStack[]{ - UtilsItems.getItemStackOfAmountFromOreDict("cellWater", 10) + ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 10) }, //Item input (Array, up to 2) FluidUtils.getFluidStack("uraniumtetrafluoride", 1440), //Fluid input (slot 1) null, //Fluid output (slot 2) new ItemStack[]{ - UtilsItems.getItemStackOfAmountFromOreDict("dustUraniumTetrafluoride", 10), - UtilsItems.getItemStackOfAmountFromOreDictNoBroken("cellEmpty", 10) + ItemUtils.getItemStackOfAmountFromOreDict("dustUraniumTetrafluoride", 10), + ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellEmpty", 10) }, //Output Array of Items - Upto 9, new int[]{0}, 150*20, //Time in ticks @@ -179,13 +179,13 @@ public class RECIPES_GREGTECH { CORE.RA.addDehydratorRecipe( new ItemStack[]{ - UtilsItems.getItemStackOfAmountFromOreDict("cellWater", 10) + ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 10) }, //Item input (Array, up to 2) FluidUtils.getFluidStack("uraniumhexafluoride", 1440), //Fluid input (slot 1) null, //Fluid output (slot 2) new ItemStack[]{ - UtilsItems.getItemStackOfAmountFromOreDict("dustUraniumHexafluoride", 10), - UtilsItems.getItemStackOfAmountFromOreDictNoBroken("cellEmpty", 10) + ItemUtils.getItemStackOfAmountFromOreDict("dustUraniumHexafluoride", 10), + ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellEmpty", 10) }, //Output Array of Items - Upto 9, new int[]{0}, 300*20, //Time in ticks @@ -198,12 +198,12 @@ public class RECIPES_GREGTECH { CORE.RA.addDehydratorRecipe( new ItemStack[]{ - UtilsItems.getItemStackOfAmountFromOreDict("cropGrape", 1) + ItemUtils.getItemStackOfAmountFromOreDict("cropGrape", 1) }, //Item input (Array, up to 2) null, //Fluid input (slot 1) null, //Fluid output (slot 2) new ItemStack[]{ - UtilsItems.getItemStackOfAmountFromOreDict("foodRaisins", 1) + ItemUtils.getItemStackOfAmountFromOreDict("foodRaisins", 1) }, //Output Array of Items - Upto 9, new int[]{0}, 10*20, //Time in ticks @@ -212,17 +212,17 @@ public class RECIPES_GREGTECH { }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");} //Calcium Hydroxide - if (UtilsItems.getItemStackOfAmountFromOreDict("dustQuicklime", 1).getItem() != ModItems.AAA_Broken || LoadedMods.IHL){ + if (ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1).getItem() != ModItems.AAA_Broken || LoadedMods.IHL){ try { CORE.RA.addDehydratorRecipe( new ItemStack[]{ - UtilsItems.getItemStackOfAmountFromOreDict("dustQuicklime", 10) + ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 10) }, //Item input (Array, up to 2) FluidUtils.getFluidStack("water", 10000), //Fluid input (slot 1) null, //Fluid output (slot 2) new ItemStack[]{ - UtilsItems.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 20) + ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 20) }, //Output Array of Items - Upto 9, new int[]{0}, 120*20, //Time in ticks @@ -235,13 +235,13 @@ public class RECIPES_GREGTECH { CORE.RA.addDehydratorRecipe( new ItemStack[]{ - UtilsItems.getItemStackOfAmountFromOreDict("dust2LiOHCaCO3", 5) + ItemUtils.getItemStackOfAmountFromOreDict("dust2LiOHCaCO3", 5) }, //Item input (Array, up to 2) null, //Fluid input (slot 1) null, //Fluid output (slot 2) new ItemStack[]{ - UtilsItems.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 2), - UtilsItems.getItemStackOfAmountFromOreDict("dustCalciumCarbonate", 3) + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 2), + ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumCarbonate", 3) }, //Output Array of Items - Upto 9, new int[]{0}, 120*20, //Time in ticks @@ -261,21 +261,21 @@ public class RECIPES_GREGTECH { private static void distilleryRecipes(){ Utils.LOG_INFO("Registering Distillery/Distillation Tower Recipes."); GT_Values.RA.addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 4L, new Object[0]), FluidUtils.getFluidStack("air", 1000), FluidUtils.getFluidStack("helium", 1), 400, 30, false); - GT_Values.RA.addDistillationTowerRecipe(FluidUtils.getFluidStack("air", 20000), FluidUtils.getFluidStackArray("helium", 25), UtilsItems.getSimpleStack(ModItems.itemHeliumBlob, 1), 200, 60); + GT_Values.RA.addDistillationTowerRecipe(FluidUtils.getFluidStack("air", 20000), FluidUtils.getFluidStackArray("helium", 25), ItemUtils.getSimpleStack(ModItems.itemHeliumBlob, 1), 200, 60); } private static void addFuels(){ Utils.LOG_INFO("Registering New Fuels."); - GT_Values.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketFire_water", 0, 1), null, 120, 0); - GT_Values.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketRocket_fuel", 0, 1), null, 112, 0); - GT_Values.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketHootch", 0, 1), null, 36, 0); + GT_Values.RA.addFuel(ItemUtils.simpleMetaStack("EnderIO:bucketFire_water", 0, 1), null, 120, 0); + GT_Values.RA.addFuel(ItemUtils.simpleMetaStack("EnderIO:bucketRocket_fuel", 0, 1), null, 112, 0); + GT_Values.RA.addFuel(ItemUtils.simpleMetaStack("EnderIO:bucketHootch", 0, 1), null, 36, 0); //CORE.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketRocket_fuel", 0, 1), null, 112, 0); - GT_Values.RA.addFuel(UtilsItems.getSimpleStack(Items.lava_bucket), null, 32, 2); - GT_Values.RA.addFuel(UtilsItems.getIC2Cell(2), null, 32, 2); - GT_Values.RA.addFuel(UtilsItems.getIC2Cell(11), null, 24, 2); + GT_Values.RA.addFuel(ItemUtils.getSimpleStack(Items.lava_bucket), null, 32, 2); + GT_Values.RA.addFuel(ItemUtils.getIC2Cell(2), null, 32, 2); + GT_Values.RA.addFuel(ItemUtils.getIC2Cell(11), null, 24, 2); //System.exit(1); } @@ -288,18 +288,18 @@ public class RECIPES_GREGTECH { private static void chemicalBathRecipes(){ int[] chances = {10000, 5000, 2500}; - GT_Values.RA.addChemicalBathRecipe(UtilsItems.getItemStackOfAmountFromOreDict("dustTin", 12), FluidUtils.getFluidStack("chlorine", 2400), - UtilsItems.getItemStackOfAmountFromOreDict("dustZirconium", 1), - UtilsItems.getItemStackOfAmountFromOreDict("dustZirconium", 1), - UtilsItems.getItemStackOfAmountFromOreDict("dustZirconium", 1), + GT_Values.RA.addChemicalBathRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 12), FluidUtils.getFluidStack("chlorine", 2400), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), chances, 30*20, 240); GT_Values.RA.addChemicalBathRecipe( - UtilsItems.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 10), + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 10), FluidUtils.getFluidStack("hydrofluoricacid", 20000), - UtilsItems.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 5), + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 5), null, null, new int[]{}, @@ -309,30 +309,30 @@ public class RECIPES_GREGTECH { private static void chemicalReactorRecipes(){ GT_Values.RA.addChemicalRecipe( - UtilsItems.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 5), //Input Stack 1 - UtilsItems.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 5), //Input Stack 2 + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 5), //Input Stack 1 + ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 5), //Input Stack 2 null, //Fluid Input null, //Fluid Output - UtilsItems.getItemStackOfAmountFromOreDict("dust2LiOHCaCO3", 10), //Output Stack + ItemUtils.getItemStackOfAmountFromOreDict("dust2LiOHCaCO3", 10), //Output Stack 600*20 ); GT_Values.RA.addChemicalRecipe( - UtilsItems.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 5), //Input Stack 1 + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 5), //Input Stack 1 null, //Input Stack 2 FluidUtils.getFluidStack("hydrofluoricacid", 2500), //Fluid Input FluidUtils.getFluidStack("water", 2500), //Fluid Output - UtilsItems.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 5), //Output Stack + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 5), //Output Stack 600*20 ); } private static void blastFurnaceRecipes(){ GT_Values.RA.addBlastRecipe( - UtilsItems.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 2), - UtilsItems.getItemStackOfAmountFromOreDict("dustBerylliumFluoride", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 2), + ItemUtils.getItemStackOfAmountFromOreDict("dustBerylliumFluoride", 1), GT_Values.NF, GT_Values.NF, - UtilsItems.getItemStackOfAmountFromOreDict("dustLi2BeF4", 3), + ItemUtils.getItemStackOfAmountFromOreDict("dustLi2BeF4", 3), null, 60*20, 2000, diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java index 5d1a4cc353..aa3026133e 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java @@ -3,8 +3,8 @@ package gtPlusPlus.core.recipe; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.util.item.UtilsItems; -import gtPlusPlus.core.util.recipe.UtilsRecipe; +import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.core.util.recipe.RecipeUtils; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; @@ -12,19 +12,19 @@ import net.minecraft.item.ItemStack; public class RECIPES_General { - static ItemStack RECIPE_Paper = UtilsItems.getSimpleStack(Items.paper); + static ItemStack RECIPE_Paper = ItemUtils.getSimpleStack(Items.paper); static String RECIPE_LapisDust = "dustLazurite"; - static ItemStack OUTPUT_Blueprint = UtilsItems.getSimpleStack(ModItems.itemBlueprintBase); - static ItemStack RECIPE_CraftingTable = UtilsItems.getSimpleStack(Item.getItemFromBlock(Blocks.crafting_table)); + static ItemStack OUTPUT_Blueprint = ItemUtils.getSimpleStack(ModItems.itemBlueprintBase); + static ItemStack RECIPE_CraftingTable = ItemUtils.getSimpleStack(Item.getItemFromBlock(Blocks.crafting_table)); static String RECIPE_BronzePlate = "plateAnyBronze"; static ItemStack RECIPE_BasicCasingIC2; - static ItemStack OUTPUT_Workbench_Bronze = UtilsItems.getSimpleStack(Item.getItemFromBlock(ModBlocks.blockWorkbench)); + static ItemStack OUTPUT_Workbench_Bronze = ItemUtils.getSimpleStack(Item.getItemFromBlock(ModBlocks.blockWorkbench)); static ItemStack NULL = null; public static void RECIPES_LOAD(){ if (LoadedMods.Gregtech){ - RECIPE_BasicCasingIC2 = UtilsItems.getItemStack("IC2:blockMachine", 1); + RECIPE_BasicCasingIC2 = ItemUtils.getItemStack("IC2:blockMachine", 1); run(); } } @@ -32,13 +32,13 @@ public class RECIPES_General { private static void run(){ - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( RECIPE_Paper, RECIPE_LapisDust, NULL, RECIPE_Paper, RECIPE_LapisDust, NULL, RECIPE_LapisDust, RECIPE_LapisDust, NULL, OUTPUT_Blueprint); - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( RECIPE_BronzePlate, RECIPE_CraftingTable, RECIPE_BronzePlate, RECIPE_BronzePlate, RECIPE_BasicCasingIC2, RECIPE_BronzePlate, RECIPE_BronzePlate, RECIPE_BronzePlate, RECIPE_BronzePlate, diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java index 6d81ba42ad..14f4a1c998 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java @@ -1,8 +1,8 @@ package gtPlusPlus.core.recipe; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; -import gtPlusPlus.core.util.recipe.UtilsRecipe; +import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.core.util.recipe.RecipeUtils; import gtPlusPlus.core.util.wrapper.var; import java.util.ArrayList; @@ -70,7 +70,7 @@ public class RECIPES_MTWRAPPER { * */ - ItemStack outputItem = UtilsItems.getCorrectStacktype(item_Output, 1); + ItemStack outputItem = ItemUtils.getCorrectStacktype(item_Output, 1); ArrayList validSlots = new ArrayList(); String a,b,c,d,e,f,g,h,i; @@ -92,7 +92,7 @@ public class RECIPES_MTWRAPPER { validSlots.add(2, lineThree); try { - UtilsRecipe.recipeBuilder((Object[]) validSlots.toArray(), outputItem.copy()); + RecipeUtils.recipeBuilder((Object[]) validSlots.toArray(), outputItem.copy()); MT_RECIPES_LOADED++; } catch(NullPointerException | ClassCastException k){ diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java index 2e69775b78..e3f47844c7 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java @@ -8,7 +8,7 @@ import gregtech.api.enums.SubTag; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.recipe.UtilsRecipe; +import gtPlusPlus.core.util.recipe.RecipeUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; public class RECIPES_MachineComponents { @@ -99,176 +99,176 @@ public class RECIPES_MachineComponents { private static void run(){ //Electric Motors - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( cableTier7, wireTier7, rodTier7a, wireTier7, rodTier7b, wireTier7, rodTier7a, wireTier7, cableTier7, RECIPE_CONSTANTS.electricMotor_LuV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( cableTier8, wireTier8, rodTier8a, wireTier8, rodTier8b, wireTier8, rodTier8a, wireTier8, cableTier8, RECIPE_CONSTANTS.electricMotor_ZPM); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( cableTier9, wireTier9, rodTier9a, wireTier9, rodTier9b, wireTier9, rodTier9a, wireTier9, cableTier9, RECIPE_CONSTANTS.electricMotor_UV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( cableTier10, wireTier10, rodTier10a, wireTier10, rodTier10b, wireTier10, rodTier10a, wireTier10, cableTier10, RECIPE_CONSTANTS.electricMotor_MAX); //Electric Pump - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( cableTier7, rotorTier7, itemRubberRing, craftingToolScrewdriver, pipeTier7, craftingToolWrench, itemRubberRing, RECIPE_CONSTANTS.electricMotor_LuV, cableTier7, RECIPE_CONSTANTS.electricPump_LuV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( cableTier8, rotorTier8, itemRubberRing, craftingToolScrewdriver, pipeTier8, craftingToolWrench, itemRubberRing, RECIPE_CONSTANTS.electricMotor_ZPM, cableTier8, RECIPE_CONSTANTS.electricPump_ZPM); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( cableTier9, rotorTier9, itemRubberRing, craftingToolScrewdriver, pipeTier9, craftingToolWrench, itemRubberRing, RECIPE_CONSTANTS.electricMotor_UV, cableTier9, RECIPE_CONSTANTS.electricPump_UV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( cableTier10, rotorTier10, itemRubberRing, craftingToolScrewdriver, pipeTier10, craftingToolWrench, itemRubberRing, RECIPE_CONSTANTS.electricMotor_MAX, cableTier10, RECIPE_CONSTANTS.electricPump_MAX); //Electric Pump - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier7, plateTier7, plateTier7, cableTier7, rodTier7a, rodTier7a, cableTier7, RECIPE_CONSTANTS.electricMotor_LuV, smallGearTier7, RECIPE_CONSTANTS.electricPiston_LuV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier8, plateTier8, plateTier8, cableTier8, rodTier8a, rodTier8a, cableTier8, RECIPE_CONSTANTS.electricMotor_ZPM, smallGearTier8, RECIPE_CONSTANTS.electricPiston_ZPM); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier9, plateTier9, plateTier9, cableTier9, rodTier9a, rodTier9a, cableTier9, RECIPE_CONSTANTS.electricMotor_UV, smallGearTier9, RECIPE_CONSTANTS.electricPiston_UV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier10, plateTier10, plateTier10, cableTier10, rodTier10a, rodTier10a, cableTier10, RECIPE_CONSTANTS.electricMotor_MAX, smallGearTier10, RECIPE_CONSTANTS.electricPiston_MAX); //Robot Arms - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( cableTier7, cableTier7, cableTier7, RECIPE_CONSTANTS.electricMotor_LuV, rodTier7a, RECIPE_CONSTANTS.electricMotor_LuV, RECIPE_CONSTANTS.electricPiston_LuV, circuitTier7, rodTier7a, RECIPE_CONSTANTS.robotArm_LuV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( cableTier8, cableTier8, cableTier8, RECIPE_CONSTANTS.electricMotor_ZPM, rodTier8a, RECIPE_CONSTANTS.electricMotor_ZPM, RECIPE_CONSTANTS.electricPiston_ZPM, circuitTier8, rodTier8a, RECIPE_CONSTANTS.robotArm_ZPM); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( cableTier9, cableTier9, cableTier9, RECIPE_CONSTANTS.electricMotor_UV, rodTier9a, RECIPE_CONSTANTS.electricMotor_UV, RECIPE_CONSTANTS.electricPiston_UV, circuitTier9, rodTier9a, RECIPE_CONSTANTS.robotArm_UV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( cableTier10, cableTier10, cableTier10, RECIPE_CONSTANTS.electricMotor_MAX, rodTier10a, RECIPE_CONSTANTS.electricMotor_MAX, RECIPE_CONSTANTS.electricPiston_MAX, circuitTier10, rodTier10a, RECIPE_CONSTANTS.robotArm_MAX); //Conveyor Modules - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateRubber, plateRubber, plateRubber, RECIPE_CONSTANTS.electricMotor_LuV, cableTier7, RECIPE_CONSTANTS.electricMotor_LuV, plateRubber, plateRubber, plateRubber, RECIPE_CONSTANTS.conveyorModule_LuV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateRubber, plateRubber, plateRubber, RECIPE_CONSTANTS.electricMotor_ZPM, cableTier8, RECIPE_CONSTANTS.electricMotor_ZPM, plateRubber, plateRubber, plateRubber, RECIPE_CONSTANTS.conveyorModule_ZPM); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateRubber, plateRubber, plateRubber, RECIPE_CONSTANTS.electricMotor_UV, cableTier9, RECIPE_CONSTANTS.electricMotor_UV, plateRubber, plateRubber, plateRubber, RECIPE_CONSTANTS.conveyorModule_UV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateRubber, plateRubber, plateRubber, RECIPE_CONSTANTS.electricMotor_MAX, cableTier10, RECIPE_CONSTANTS.electricMotor_MAX, plateRubber, plateRubber, plateRubber, RECIPE_CONSTANTS.conveyorModule_MAX); //Emitter Modules - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( rodTier7c, rodTier7c, circuitTier7, cableTier7, circuitTier6, rodTier7c, circuitTier7, cableTier7, rodTier7c, RECIPE_CONSTANTS.emitter_LuV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( rodTier8c, rodTier8c, circuitTier8, cableTier8, circuitTier7, rodTier8c, circuitTier8, cableTier8, rodTier8c, RECIPE_CONSTANTS.emitter_ZPM); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( rodTier9c, rodTier9c, circuitTier9, cableTier9, circuitTier8, rodTier9c, circuitTier9, cableTier9, rodTier9c, RECIPE_CONSTANTS.emitter_UV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( rodTier10c, rodTier10c, circuitTier10, cableTier10, circuitTier9, rodTier10c, circuitTier10, cableTier10, rodTier10c, RECIPE_CONSTANTS.emitter_MAX); //Field Generator Modules - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( wireTier7, circuitTier7, wireTier7, circuitTier7, circuitTier6, circuitTier7, wireTier7, circuitTier7, wireTier7, RECIPE_CONSTANTS.fieldGenerator_LuV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( wireTier8, circuitTier8, wireTier8, circuitTier8, circuitTier7, circuitTier8, wireTier8, circuitTier8, wireTier8, RECIPE_CONSTANTS.fieldGenerator_ZPM); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( wireTier9, circuitTier9, wireTier9, circuitTier9, circuitTier8, circuitTier9, wireTier9, circuitTier9, wireTier9, RECIPE_CONSTANTS.fieldGenerator_UV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( wireTier10, circuitTier10, wireTier10, circuitTier10, circuitTier9, circuitTier10, wireTier10, circuitTier10, wireTier10, RECIPE_CONSTANTS.fieldGenerator_MAX); //Sensor Modules - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier7, null, circuitTier6, plateTier7, rodTier7c, null, circuitTier7, plateTier7, plateTier7, RECIPE_CONSTANTS.sensor_LuV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier8, null, circuitTier7, plateTier8, rodTier8c, null, circuitTier8, plateTier8, plateTier8, RECIPE_CONSTANTS.sensor_ZPM); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier9, null, circuitTier8, plateTier9, rodTier9c, null, circuitTier9, plateTier9, plateTier9, RECIPE_CONSTANTS.sensor_UV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier10, null, circuitTier9, plateTier10, rodTier10c, null, circuitTier10, plateTier10, plateTier10, @@ -279,42 +279,42 @@ public class RECIPES_MachineComponents { } private static void onlyMaxComponents(){ - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( cableTier10, wireTier10, rodTier10a, wireTier10, rodTier10b, wireTier10, rodTier10a, wireTier10, cableTier10, RECIPE_CONSTANTS.electricMotor_MAX); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( cableTier10, rotorTier10, itemRubberRing, craftingToolScrewdriver, pipeTier10, craftingToolWrench, itemRubberRing, RECIPE_CONSTANTS.electricMotor_MAX, cableTier10, RECIPE_CONSTANTS.electricPump_MAX); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier10, plateTier10, plateTier10, cableTier10, rodTier10a, rodTier10a, cableTier10, RECIPE_CONSTANTS.electricMotor_MAX, smallGearTier10, RECIPE_CONSTANTS.electricPiston_MAX); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( cableTier10, cableTier10, cableTier10, RECIPE_CONSTANTS.electricMotor_MAX, rodTier10a, RECIPE_CONSTANTS.electricMotor_MAX, RECIPE_CONSTANTS.electricPiston_MAX, circuitTier10, rodTier10a, RECIPE_CONSTANTS.robotArm_MAX); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateRubber, plateRubber, plateRubber, RECIPE_CONSTANTS.electricMotor_MAX, cableTier10, RECIPE_CONSTANTS.electricMotor_MAX, plateRubber, plateRubber, plateRubber, RECIPE_CONSTANTS.conveyorModule_MAX); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( rodTier10c, rodTier10c, circuitTier10, cableTier10, circuitTier9, rodTier10c, circuitTier10, cableTier10, rodTier10c, RECIPE_CONSTANTS.emitter_MAX); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( wireTier10, circuitTier10, wireTier10, circuitTier10, circuitTier9, circuitTier10, wireTier10, circuitTier10, wireTier10, RECIPE_CONSTANTS.fieldGenerator_MAX); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier10, null, circuitTier9, plateTier10, rodTier10c, null, circuitTier10, plateTier10, plateTier10, diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index eac35d586f..4e317d6b7e 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -4,8 +4,8 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; -import gtPlusPlus.core.util.recipe.UtilsRecipe; +import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.core.util.recipe.RecipeUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; @@ -51,16 +51,16 @@ public class RECIPES_Machines { //Buffer Cores - static ItemStack RECIPE_BufferCore_ULV = UtilsItems.getItemStack("miscutils:item.itemBufferCore1", 1); - static ItemStack RECIPE_BufferCore_LV = UtilsItems.getItemStack("miscutils:item.itemBufferCore2", 1); - static ItemStack RECIPE_BufferCore_MV = UtilsItems.getItemStack("miscutils:item.itemBufferCore3", 1); - static ItemStack RECIPE_BufferCore_HV = UtilsItems.getItemStack("miscutils:item.itemBufferCore4", 1); - static ItemStack RECIPE_BufferCore_EV = UtilsItems.getItemStack("miscutils:item.itemBufferCore5", 1); - static ItemStack RECIPE_BufferCore_IV = UtilsItems.getItemStack("miscutils:item.itemBufferCore6", 1); - static ItemStack RECIPE_BufferCore_LuV = UtilsItems.getItemStack("miscutils:item.itemBufferCore7", 1); - static ItemStack RECIPE_BufferCore_ZPM = UtilsItems.getItemStack("miscutils:item.itemBufferCore8", 1); - static ItemStack RECIPE_BufferCore_UV = UtilsItems.getItemStack("miscutils:item.itemBufferCore9", 1); - static ItemStack RECIPE_BufferCore_MAX = UtilsItems.getItemStack("miscutils:item.itemBufferCore10", 1); + static ItemStack RECIPE_BufferCore_ULV = ItemUtils.getItemStack("miscutils:item.itemBufferCore1", 1); + static ItemStack RECIPE_BufferCore_LV = ItemUtils.getItemStack("miscutils:item.itemBufferCore2", 1); + static ItemStack RECIPE_BufferCore_MV = ItemUtils.getItemStack("miscutils:item.itemBufferCore3", 1); + static ItemStack RECIPE_BufferCore_HV = ItemUtils.getItemStack("miscutils:item.itemBufferCore4", 1); + static ItemStack RECIPE_BufferCore_EV = ItemUtils.getItemStack("miscutils:item.itemBufferCore5", 1); + static ItemStack RECIPE_BufferCore_IV = ItemUtils.getItemStack("miscutils:item.itemBufferCore6", 1); + static ItemStack RECIPE_BufferCore_LuV = ItemUtils.getItemStack("miscutils:item.itemBufferCore7", 1); + static ItemStack RECIPE_BufferCore_ZPM = ItemUtils.getItemStack("miscutils:item.itemBufferCore8", 1); + static ItemStack RECIPE_BufferCore_UV = ItemUtils.getItemStack("miscutils:item.itemBufferCore9", 1); + static ItemStack RECIPE_BufferCore_MAX = ItemUtils.getItemStack("miscutils:item.itemBufferCore10", 1); //Wire @@ -173,7 +173,7 @@ public class RECIPES_Machines { //Lava Boiler static ItemStack boiler_Coal; - static ItemStack blockBricks = UtilsItems.getItemStack("minecraft:brick_block", 1); + static ItemStack blockBricks = ItemUtils.getItemStack("minecraft:brick_block", 1); //Batteries static String batteryBasic = "batteryBasic"; @@ -258,11 +258,11 @@ public class RECIPES_Machines { private static void initModItems(){ if (LoadedMods.IndustrialCraft2){ - IC2MFE = UtilsItems.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:blockElectric", "IC2_MFE", 1, 1); - IC2MFSU = UtilsItems.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:blockElectric", "IC2_MFSU", 2, 1); + IC2MFE = ItemUtils.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:blockElectric", "IC2_MFE", 1, 1); + IC2MFSU = ItemUtils.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:blockElectric", "IC2_MFSU", 2, 1); } if (LoadedMods.Gregtech){ - RECIPES_Shapeless.dustStaballoy = UtilsItems.getItemStackWithMeta(LoadedMods.MiscUtils, "gregtech:gt.metaitem.01", "Staballoy Dust", 2319, 2); + RECIPES_Shapeless.dustStaballoy = ItemUtils.getItemStackWithMeta(LoadedMods.MiscUtils, "gregtech:gt.metaitem.01", "Staballoy Dust", 2319, 2); machineCasing_ULV = ItemList.Casing_ULV.get(1); machineCasing_LV = ItemList.Casing_LV.get(1); machineCasing_MV = ItemList.Casing_MV.get(1); @@ -339,11 +339,11 @@ public class RECIPES_Machines { if(LoadedMods.Railcraft){ //Misc - INPUT_RCCokeOvenBlock = UtilsItems.getItemStackWithMeta(LoadedMods.Railcraft, "Railcraft:machine.alpha", "Coke_Oven_RC", 7, 1); + INPUT_RCCokeOvenBlock = ItemUtils.getItemStackWithMeta(LoadedMods.Railcraft, "Railcraft:machine.alpha", "Coke_Oven_RC", 7, 1); } if(LoadedMods.ImmersiveEngineering){ //Misc - INPUT_IECokeOvenBlock = UtilsItems.getItemStackWithMeta(LoadedMods.ImmersiveEngineering, "ImmersiveEngineering:stoneDecoration", "Coke_Oven_IE", 1, 1); + INPUT_IECokeOvenBlock = ItemUtils.getItemStackWithMeta(LoadedMods.ImmersiveEngineering, "ImmersiveEngineering:stoneDecoration", "Coke_Oven_IE", 1, 1); } runModRecipes(); } @@ -351,141 +351,141 @@ public class RECIPES_Machines { private static void runModRecipes(){ if (LoadedMods.Gregtech){ - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( ItemList.Electric_Piston_EV, GregtechOrePrefixes.circuit.get(Materials.Ultimate), ItemList.Electric_Piston_EV, ItemList.Electric_Motor_EV, machineCasing_EV, ItemList.Electric_Motor_EV, "gearGtTitanium", "cableGt02Aluminium", "gearGtTitanium", - UtilsItems.simpleMetaStack("gregtech:gt.blockmachines", 793, 1)); - UtilsRecipe.addShapedGregtechRecipe( + ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 793, 1)); + RecipeUtils.addShapedGregtechRecipe( ItemList.Electric_Piston_IV, GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic), ItemList.Electric_Piston_IV, ItemList.Electric_Motor_IV, machineCasing_IV, ItemList.Electric_Motor_IV, "gearGtTungstenSteel", "cableGt02Platinum", "gearGtTungstenSteel", - UtilsItems.simpleMetaStack("gregtech:gt.blockmachines", 794, 1)); - UtilsRecipe.addShapedGregtechRecipe( + ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 794, 1)); + RecipeUtils.addShapedGregtechRecipe( RECIPE_CONSTANTS.electricPiston_LuV, GregtechOrePrefixes.circuit.get(GT_Materials.Neutronic), RECIPE_CONSTANTS.electricPiston_LuV, RECIPE_CONSTANTS.electricMotor_LuV, machineCasing_LuV, RECIPE_CONSTANTS.electricMotor_LuV, "gearGtChrome", "cableGt02Tungsten", "gearGtChrome", - UtilsItems.simpleMetaStack("gregtech:gt.blockmachines", 795, 1)); + ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 795, 1)); //Buffer Core - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier1, cableTier1, plateTier1, circuitPrimitive, IC2MFE, circuitPrimitive, plateTier1, cableTier1, plateTier1, RECIPE_BufferCore_ULV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier2, cableTier2, plateTier2, circuitTier1, IC2MFE, circuitTier1, plateTier2, cableTier2, plateTier2, RECIPE_BufferCore_LV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier3, cableTier3, plateTier3, RECIPE_BufferCore_LV, circuitTier2, RECIPE_BufferCore_LV, plateTier3, cableTier3, plateTier3, RECIPE_BufferCore_MV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier4, cableTier4, plateTier4, RECIPE_BufferCore_MV, circuitTier3, RECIPE_BufferCore_MV, plateTier4, cableTier4, plateTier4, RECIPE_BufferCore_HV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier5, cableTier5, plateTier5, RECIPE_BufferCore_HV, circuitTier4, RECIPE_BufferCore_HV, plateTier5, cableTier5, plateTier5, RECIPE_BufferCore_EV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier6, cableTier6, plateTier6, RECIPE_BufferCore_EV, circuitTier5, RECIPE_BufferCore_EV, plateTier6, cableTier6, plateTier6, RECIPE_BufferCore_IV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier7, cableTier7, plateTier7, RECIPE_BufferCore_IV, circuitTier6, RECIPE_BufferCore_IV, plateTier7, cableTier7, plateTier7, RECIPE_BufferCore_LuV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier8, cableTier8, plateTier8, RECIPE_BufferCore_LuV, circuitTier7, RECIPE_BufferCore_LuV, plateTier8, cableTier8, plateTier8, RECIPE_BufferCore_ZPM); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier9, cableTier9, plateTier9, RECIPE_BufferCore_ZPM, circuitTier8, RECIPE_BufferCore_ZPM, plateTier9, cableTier9, plateTier9, RECIPE_BufferCore_UV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier10, cableTier10, plateTier10, RECIPE_BufferCore_UV, circuitTier9, RECIPE_BufferCore_UV, plateTier10, cableTier10, plateTier10, RECIPE_BufferCore_MAX); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( wireTier1, RECIPE_BufferCore_ULV, wireTier1, wireTier1, machineCasing_ULV, wireTier1, circuitPrimitive, circuitTier1, circuitPrimitive, RECIPE_Buffer_ULV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( wireTier2, RECIPE_BufferCore_LV, wireTier2, wireTier2, machineCasing_LV, wireTier2, circuitTier1, RECIPE_BufferCore_LV, circuitTier1, RECIPE_Buffer_LV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( wireTier3, RECIPE_BufferCore_MV, wireTier3, wireTier3, machineCasing_MV, wireTier3, circuitTier2, RECIPE_BufferCore_MV, circuitTier2, RECIPE_Buffer_MV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( wireTier4, RECIPE_BufferCore_HV, wireTier4, wireTier4, machineCasing_HV, wireTier4, circuitTier3, RECIPE_BufferCore_HV, circuitTier3, RECIPE_Buffer_HV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( wireTier5, RECIPE_BufferCore_EV, wireTier5, wireTier5, machineCasing_EV, wireTier5, circuitTier4, RECIPE_BufferCore_EV, circuitTier4, RECIPE_Buffer_EV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( wireTier6, RECIPE_BufferCore_IV, wireTier6, wireTier6, machineCasing_IV, wireTier6, circuitTier5, RECIPE_BufferCore_IV, circuitTier5, RECIPE_Buffer_IV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( wireTier7, RECIPE_BufferCore_LuV, wireTier7, wireTier7, machineCasing_LuV, wireTier7, circuitTier6, RECIPE_BufferCore_LuV, circuitTier6, RECIPE_Buffer_LuV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( wireTier8, RECIPE_BufferCore_ZPM, wireTier8, wireTier8, machineCasing_ZPM, wireTier8, circuitTier7, RECIPE_BufferCore_ZPM, circuitTier7, RECIPE_Buffer_ZPM); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( wireTier9, RECIPE_BufferCore_UV, wireTier9, wireTier9, machineCasing_UV, wireTier9, circuitTier8, RECIPE_BufferCore_UV, circuitTier8, RECIPE_Buffer_UV); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier11, RECIPE_BufferCore_MAX, plateTier11, wireTier10, machineCasing_MAX, wireTier10, circuitTier9, RECIPE_BufferCore_MAX, circuitTier9, RECIPE_Buffer_MAX); //Steam Condenser - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( pipeLargeCopper, pipeHugeSteel, pipeLargeCopper, plateEnergeticAlloy, electricPump_HV, plateEnergeticAlloy, plateEnergeticAlloy, pipeLargeCopper, plateEnergeticAlloy, RECIPE_SteamCondenser); //Iron BF - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( "plateDoubleAnyIron", "craftingFurnace", "plateDoubleAnyIron", boiler_Coal, machineCasing_ULV, boiler_Coal, "plateDoubleAnyIron", "bucketLava", "plateDoubleAnyIron", RECIPE_IronBlastFurnace); //Iron plated Bricks - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( "plateAnyIron", RECIPES_Tools.craftingToolHardHammer, "plateAnyIron", "plateAnyIron", blockBricks, "plateAnyIron", "plateAnyIron", RECIPES_Tools.craftingToolWrench, "plateAnyIron", @@ -505,13 +505,13 @@ public class RECIPES_Machines { RECIPE_IndustrialCentrifugeController);*/ //Industrial Centrifuge - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( circuitTier6, pipeHugeStainlessSteel, circuitTier6, plateTier6, IV_MACHINE_Centrifuge, plateTier6, plateTier8, machineCasing_IV, plateTier8, RECIPE_IndustrialCentrifugeController); //Centrifuge Casing - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier6, "stickTumbaga", plateTier6, plateTier8, "stickTumbaga", plateTier8, plateTier6, "stickTumbaga", plateTier6, @@ -519,7 +519,7 @@ public class RECIPES_Machines { if (LoadedMods.Railcraft){ //Industrial Coke Oven - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateCobalt, circuitTier4, plateCobalt, machineCasing_HV, INPUT_RCCokeOvenBlock, machineCasing_HV, plateCobalt, circuitTier5, plateCobalt, @@ -527,78 +527,78 @@ public class RECIPES_Machines { } if (LoadedMods.ImmersiveEngineering){ //Industrial Coke Oven - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier8, circuitTier4, plateTier8, machineCasing_HV, INPUT_IECokeOvenBlock, machineCasing_HV, plateTier8, circuitTier3, plateTier8, RECIPE_IndustrialCokeOvenController); } //Coke Oven Frame Casing - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier7, rodTier7, plateTier7, rodTier7, "frameGtTantalloy61", rodTier7, plateTier7, rodTier7, plateTier7, RECIPE_IndustrialCokeOvenFrame); //Coke Oven Coil 1 - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateBronze, plateBronze, plateBronze, "frameGtBronze", gearboxCasing_Tier_1, "frameGtBronze", plateBronze, plateBronze, plateBronze, RECIPE_IndustrialCokeOvenCasingA); //Coke Oven Coil 2 - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateSteel, plateSteel, plateSteel, "frameGtSteel", gearboxCasing_Tier_2, "frameGtSteel", plateSteel, plateSteel, plateSteel, RECIPE_IndustrialCokeOvenCasingB); //Electrolyzer Frame Casing - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( "platePotin", "stickLongChrome", "platePotin", "stickLongPotin", "frameGtPotin", "stickLongPotin", "platePotin", "stickLongPotin", "platePotin", RECIPE_IndustrialElectrolyzerFrame); //Industrial Electrolyzer - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( "plateStellite", circuitTier6, "plateStellite", machineCasing_EV, IV_MACHINE_Electrolyzer, machineCasing_EV, "plateStellite", "rotorStellite", "plateStellite", RECIPE_IndustrialElectrolyzerController); //Material Press Frame Casing - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( "plateTitanium", "stickLongTumbaga", "plateTitanium", "stickTantalloy60", "frameGtTumbaga", "stickTantalloy60", "plateTitanium", "stickLongTumbaga", "plateTitanium", RECIPE_IndustrialMaterialPressFrame); //Industrial Material Press - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( "plateTitanium", circuitTier5, "plateTitanium", machineCasing_EV, IV_MACHINE_BendingMachine, machineCasing_EV, "plateTitanium", circuitTier5, "plateTitanium", RECIPE_IndustrialMaterialPressController); //Maceration Frame Casing - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( "platePalladium", "platePalladium", "platePalladium", "stickPlatinum", "frameGtInconel625", "stickPlatinum", "platePalladium", "stickLongPalladium", "platePalladium", RECIPE_IndustrialMacerationStackFrame); //Industrial Maceration stack - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( "plateTungstenCarbide", IV_MACHINE_Macerator, "plateTungstenCarbide", IV_MACHINE_Macerator, circuitTier8, IV_MACHINE_Macerator, "plateTungstenCarbide", machineCasing_IV, "plateTungstenCarbide", RECIPE_IndustrialMacerationStackController); //Wire Factory Frame Casing - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( "plateBlueSteel", "stickBlueSteel", "plateBlueSteel", "stickBlueSteel", "frameGtBlueSteel", "stickBlueSteel", "plateBlueSteel", "stickBlueSteel", "plateBlueSteel", RECIPE_IndustrialWireFactoryFrame); //Industrial Wire Factory - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( "plateZeron100", machineCasing_IV, "plateZeron100", circuitTier6, IV_MACHINE_Wiremill, circuitTier6, "plateZeron100", machineCasing_IV, "plateZeron100", @@ -607,52 +607,52 @@ public class RECIPES_Machines { //Tiered Tanks - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier1, plateTier1, plateTier1, plateTier1, pipeTier1, plateTier1, plateTier1, GregtechItemList.Fluid_Cell_144L.get(1), plateTier1, GregtechItemList.GT_FluidTank_ULV.get(1)); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier2, plateTier2, plateTier2, plateTier2, pipeTier2, plateTier2, plateTier2, electricPump_LV, plateTier2, GregtechItemList.GT_FluidTank_LV.get(1)); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier3, plateTier3, plateTier3, plateTier3, pipeTier3, plateTier3, plateTier3, electricPump_MV, plateTier3, GregtechItemList.GT_FluidTank_MV.get(1)); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier4, plateTier4, plateTier4, plateTier4, pipeTier4, plateTier4, plateTier4, electricPump_HV, plateTier4, GregtechItemList.GT_FluidTank_HV.get(1)); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier5, plateTier5, plateTier5, plateTier5, pipeTier5, plateTier5, plateTier5, electricPump_EV, plateTier5, GregtechItemList.GT_FluidTank_EV.get(1)); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier6, plateTier6, plateTier6, plateTier6, pipeTier6, plateTier6, plateTier6, electricPump_IV, plateTier6, GregtechItemList.GT_FluidTank_IV.get(1)); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier7, plateTier7, plateTier7, plateTier7, pipeTier7, plateTier7, plateTier7, RECIPE_CONSTANTS.electricPump_LuV, plateTier7, GregtechItemList.GT_FluidTank_LuV.get(1)); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier8, plateTier8, plateTier8, plateTier8, pipeTier8, plateTier8, plateTier8, RECIPE_CONSTANTS.electricPump_ZPM, plateTier8, GregtechItemList.GT_FluidTank_ZPM.get(1)); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier9, plateTier9, plateTier9, plateTier9, pipeTier9, plateTier9, plateTier9, RECIPE_CONSTANTS.electricPump_UV, plateTier9, GregtechItemList.GT_FluidTank_UV.get(1)); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( plateTier10, plateTier10, plateTier10, plateTier10, pipeTier10, plateTier10, plateTier10, RECIPE_CONSTANTS.electricPump_MAX, plateTier10, diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Shapeless.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Shapeless.java index 2a79aa92c9..fa11783f70 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Shapeless.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Shapeless.java @@ -3,7 +3,7 @@ package gtPlusPlus.core.recipe; import gregtech.api.enums.ItemList; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.recipe.UtilsRecipe; +import gtPlusPlus.core.util.recipe.RecipeUtils; import net.minecraft.item.ItemStack; public class RECIPES_Shapeless { @@ -31,12 +31,12 @@ public class RECIPES_Shapeless { if (LoadedMods.Gregtech){ gearboxCasing_Tier_1 = ItemList.Casing_Gearbox_Bronze.get(1); - UtilsRecipe.shapelessBuilder(dustStaballoy, + RecipeUtils.shapelessBuilder(dustStaballoy, "dustTitanium", "dustUranium", "dustUranium", "dustUranium", "dustUranium", "dustUranium", "dustUranium", "dustUranium", "dustUranium"); - UtilsRecipe.shapelessBuilder(gearboxCasing_Tier_1, + RecipeUtils.shapelessBuilder(gearboxCasing_Tier_1, circuitPrimitive, circuitPrimitive, circuitPrimitive, circuitPrimitive, circuitPrimitive, circuitPrimitive, circuitPrimitive, circuitPrimitive, circuitPrimitive); diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java index 91337d3e0f..17fa4ef93d 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java @@ -2,8 +2,8 @@ package gtPlusPlus.core.recipe; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.util.item.UtilsItems; -import gtPlusPlus.core.util.recipe.UtilsRecipe; +import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.core.util.recipe.RecipeUtils; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -119,7 +119,7 @@ public class RECIPES_Tools { public static ItemStack sandHammer = new ItemStack (ModItems.itemSandstoneHammer, 1, OreDictionary.WILDCARD_VALUE); public static String craftingToolSandHammer = "craftingToolSandHammer"; - public static ItemStack personalCloakingDevice = UtilsItems.getSimpleStack(ModItems.itemPersonalCloakingDevice); + public static ItemStack personalCloakingDevice = ItemUtils.getSimpleStack(ModItems.itemPersonalCloakingDevice); public static String plateDoubleNiChrome = "plateDoubleNichrome"; public static String plateIridiumAlloy = "plateAlloyIridium"; @@ -132,21 +132,21 @@ public class RECIPES_Tools { private static void run(){ //Staballoy Pickaxe - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( plateStaballoy, plateStaballoy, ingotStaballoy, craftingToolFile, stickTungsten, craftingToolHardHammer, craftingToolWrench, stickTungsten, craftingToolHardHammer, RECIPE_StaballoyPickaxe); //Staballoy Axe - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( plateStaballoy, ingotStaballoy, craftingToolHardHammer, plateStaballoy, stickTungsten, craftingToolHardHammer, craftingToolFile, stickTungsten, craftingToolWrench, RECIPE_StaballoyAxe); //Cobble to Sand - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( CobbleStone, CobbleStone, CobbleStone, CobbleStone, sandHammer, CobbleStone, CobbleStone, CobbleStone, CobbleStone, @@ -154,7 +154,7 @@ public class RECIPES_Tools { if (LoadedMods.Baubles){ //Cloaking Device - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( plateDoubleNiChrome, plateIridiumAlloy, plateDoubleNiChrome, plateIridiumAlloy, batteryUltimate, plateIridiumAlloy, plateDoubleNiChrome, plateIridiumAlloy, plateDoubleNiChrome, @@ -162,14 +162,14 @@ public class RECIPES_Tools { } //Sand to Sandstone - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( Sand, Sand, Sand, Sand, sandHammer, Sand, Sand, Sand, Sand, RECIPE_SandStone); //Sandstone Hammer - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( plateElectrum, ingotElectrum, plateElectrum, craftingToolScrewdriver, stickBronze, craftingToolHardHammer, null, stickSteel, null, diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPE_Batteries.java b/src/Java/gtPlusPlus/core/recipe/RECIPE_Batteries.java index 80ee79e292..440f8815bc 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPE_Batteries.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPE_Batteries.java @@ -2,8 +2,8 @@ package gtPlusPlus.core.recipe; import gregtech.api.enums.ItemList; import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.util.item.UtilsItems; -import gtPlusPlus.core.util.recipe.UtilsRecipe; +import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.core.util.recipe.RecipeUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import net.minecraft.item.ItemStack; @@ -12,9 +12,9 @@ public class RECIPE_Batteries { static ItemStack RECIPE_Battery_Sodium = GregtechItemList.Battery_RE_EV_Sodium.get(1); static ItemStack RECIPE_Battery_Cadmium = GregtechItemList.Battery_RE_EV_Cadmium.get(1); static ItemStack RECIPE_Battery_Lithium = GregtechItemList.Battery_RE_EV_Lithium.get(1); - static ItemStack GT_Battery_Sodium = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32539, 1); - static ItemStack GT_Battery_Cadmium = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32537, 1); - static ItemStack GT_Battery_Lithium = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32538, 1); + static ItemStack GT_Battery_Sodium = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32539, 1); + static ItemStack GT_Battery_Cadmium = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32537, 1); + static ItemStack GT_Battery_Lithium = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32538, 1); static ItemStack machineTransformer_EV; public static void RECIPES_LOAD(){ @@ -28,17 +28,17 @@ public class RECIPE_Batteries { private static void run(){ - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( GT_Battery_Sodium, RECIPES_Machines.cableTier4, GT_Battery_Sodium, RECIPES_Machines.circuitTier3, machineTransformer_EV, RECIPES_Machines.circuitTier3, GT_Battery_Sodium, RECIPES_Machines.cableTier4, GT_Battery_Sodium, RECIPE_Battery_Sodium); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( GT_Battery_Cadmium, RECIPES_Machines.cableTier4, GT_Battery_Cadmium, RECIPES_Machines.circuitTier3, machineTransformer_EV, RECIPES_Machines.circuitTier3, GT_Battery_Cadmium, RECIPES_Machines.cableTier4, GT_Battery_Cadmium, RECIPE_Battery_Cadmium); - UtilsRecipe.addShapedGregtechRecipe( + RecipeUtils.addShapedGregtechRecipe( GT_Battery_Lithium, RECIPES_Machines.cableTier4, GT_Battery_Lithium, RECIPES_Machines.circuitTier3, machineTransformer_EV, RECIPES_Machines.circuitTier3, GT_Battery_Lithium, RECIPES_Machines.cableTier4, GT_Battery_Lithium, diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPE_CONSTANTS.java b/src/Java/gtPlusPlus/core/recipe/RECIPE_CONSTANTS.java index b294dd9cef..c0548e9e74 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPE_CONSTANTS.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPE_CONSTANTS.java @@ -1,7 +1,7 @@ package gtPlusPlus.core.recipe; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import net.minecraft.item.ItemStack; @@ -52,30 +52,30 @@ public class RECIPE_CONSTANTS { private static void registerGTExperimentalComponents(){ //Machine Components - electricMotor_LuV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32606, 1); - electricMotor_ZPM = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32607, 1); - electricMotor_UV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32608, 1); - electricPump_LuV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32620, 1); - electricPump_ZPM = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32621, 1); - electricPump_UV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32622, 1); - electricPiston_LuV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32645, 1); - electricPiston_ZPM = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32646, 1); - electricPiston_UV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32647, 1); - robotArm_LuV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32655, 1); - robotArm_ZPM = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32656, 1); - robotArm_UV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32657, 1); - conveyorModule_LuV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32636, 1); - conveyorModule_ZPM = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32637, 1); - conveyorModule_UV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32638, 1); - emitter_LuV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32685, 1); - emitter_ZPM = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32686, 1); - emitter_UV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32687, 1); - fieldGenerator_LuV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32675, 1); - fieldGenerator_ZPM = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32676, 1); - fieldGenerator_UV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32677, 1); - sensor_LuV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32695, 1); - sensor_ZPM = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32696, 1); - sensor_UV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32697, 1); + electricMotor_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32606, 1); + electricMotor_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32607, 1); + electricMotor_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32608, 1); + electricPump_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32620, 1); + electricPump_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32621, 1); + electricPump_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32622, 1); + electricPiston_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32645, 1); + electricPiston_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32646, 1); + electricPiston_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32647, 1); + robotArm_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32655, 1); + robotArm_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32656, 1); + robotArm_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32657, 1); + conveyorModule_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32636, 1); + conveyorModule_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32637, 1); + conveyorModule_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32638, 1); + emitter_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32685, 1); + emitter_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32686, 1); + emitter_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32687, 1); + fieldGenerator_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32675, 1); + fieldGenerator_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32676, 1); + fieldGenerator_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32677, 1); + sensor_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32695, 1); + sensor_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32696, 1); + sensor_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32697, 1); //Max Tier Components Blood Never added... Useless, lol. electricMotor_MAX = GregtechItemList.Electric_Motor_MAX.get(1); diff --git a/src/Java/gtPlusPlus/core/recipe/ShapedRecipeObject.java b/src/Java/gtPlusPlus/core/recipe/ShapedRecipeObject.java index c6dc1ede1b..348f9907c0 100644 --- a/src/Java/gtPlusPlus/core/recipe/ShapedRecipeObject.java +++ b/src/Java/gtPlusPlus/core/recipe/ShapedRecipeObject.java @@ -1,7 +1,7 @@ package gtPlusPlus.core.recipe; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.recipe.UtilsRecipe; +import gtPlusPlus.core.util.recipe.RecipeUtils; import net.minecraft.item.ItemStack; public class ShapedRecipeObject { @@ -36,7 +36,7 @@ public class ShapedRecipeObject { } public void buildRecipe(){ - UtilsRecipe.recipeBuilder(object_A, object_B, object_C, object_D, object_E, object_F, object_G, object_H, object_I, object_OUTPUT); + RecipeUtils.recipeBuilder(object_A, object_B, object_C, object_D, object_E, object_F, object_G, object_H, object_I, object_OUTPUT); } } diff --git a/src/Java/gtPlusPlus/core/util/Utils.java b/src/Java/gtPlusPlus/core/util/Utils.java index 93621200ab..2e25b8b0e9 100644 --- a/src/Java/gtPlusPlus/core/util/Utils.java +++ b/src/Java/gtPlusPlus/core/util/Utils.java @@ -6,7 +6,7 @@ import gregtech.api.enums.TC_Aspects.TC_AspectStack; import gtPlusPlus.GTplusplus; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.fluid.FluidUtils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; import ic2.core.Ic2Items; import ic2.core.init.InternalName; @@ -488,7 +488,7 @@ public class Utils { ItemStack temp = (ItemStack) methode.invoke(item, cellID++, yourName, new Block[0]); Utils.LOG_INFO("Successfully created "+temp.getDisplayName()+"s."); FluidContainerRegistry.registerFluidContainer(FluidUtils.getFluidStack(s.toLowerCase(), 0), temp.copy(), Ic2Items.cell.copy()); - UtilsItems.addItemToOreDictionary(temp.copy(), "cell"+s); + ItemUtils.addItemToOreDictionary(temp.copy(), "cell"+s); return temp; } catch(Exception e){ diff --git a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java new file mode 100644 index 0000000000..89d78413c0 --- /dev/null +++ b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java @@ -0,0 +1,567 @@ +package gtPlusPlus.core.util.item; + +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; +import gtPlusPlus.core.block.base.BlockBaseModular; +import gtPlusPlus.core.item.ModItems; +import gtPlusPlus.core.item.base.BasicSpawnEgg; +import gtPlusPlus.core.item.base.bolts.BaseItemBolt; +import gtPlusPlus.core.item.base.dusts.BaseItemDust; +import gtPlusPlus.core.item.base.dusts.BaseItemDustUnique; +import gtPlusPlus.core.item.base.dusts.decimal.BaseItemCentidust; +import gtPlusPlus.core.item.base.dusts.decimal.BaseItemDecidust; +import gtPlusPlus.core.item.base.gears.BaseItemGear; +import gtPlusPlus.core.item.base.ingots.BaseItemIngot; +import gtPlusPlus.core.item.base.ingots.BaseItemIngotHot; +import gtPlusPlus.core.item.base.plates.BaseItemPlate; +import gtPlusPlus.core.item.base.plates.BaseItemPlateDouble; +import gtPlusPlus.core.item.base.rings.BaseItemRing; +import gtPlusPlus.core.item.base.rods.BaseItemRod; +import gtPlusPlus.core.item.base.rods.BaseItemRodLong; +import gtPlusPlus.core.item.base.rotors.BaseItemRotor; +import gtPlusPlus.core.item.base.screws.BaseItemScrew; +import gtPlusPlus.core.item.tool.staballoy.MultiPickaxeBase; +import gtPlusPlus.core.item.tool.staballoy.MultiSpadeBase; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.material.Material; +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_BlastSmelter; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_DustGeneration; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Extruder; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Plates; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_ShapedCrafting; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.Item.ToolMaterial; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.registry.GameRegistry; + +public class ItemUtils { + + public static ItemStack getSimpleStack(Item x){ + return getSimpleStack(x, 1); + } + public static ItemStack getSimpleStack(Item x, int i){ + try { + ItemStack r = new ItemStack(x, i); + return r; + } catch(Throwable e){ + return null; + } + } + public static ItemStack getSimpleStack(ItemStack x, int i){ + try { + ItemStack r = x.copy(); + r.stackSize = i; + return r; + } catch(Throwable e){ + return null; + } + } + + public static ItemStack getIC2Cell(String S){ + ItemStack moreTemp = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+S, 1); + + if (moreTemp == null){ + int cellID = 0; + ItemStack temp =GT_ModHandler.getModItem("IC2", "itemCellEmpty", 1L, cellID); + return temp != null ? temp : null; + } + + return moreTemp; + } + + public static ItemStack getIC2Cell(int meta){ + ItemStack temp = GT_ModHandler.getModItem("IC2", "itemCellEmpty", 1L, meta); + return temp != null ? temp : null; + } + + + public static void getItemForOreDict(String FQRN, String oreDictName, String itemName, int meta){ + try { + Item em = null; + Item em1 = getItem(FQRN); + Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta); + if (em1 != null){ + em = em1; + } + if (em != null){ + + ItemStack metaStack = new ItemStack(em,1,meta); + GT_OreDictUnificator.registerOre(oreDictName, metaStack); + + /*ItemStack itemStackWithMeta = new ItemStack(em,1,meta); + GT_OreDictUnificator.registerOre(oreDictName, new ItemStack(itemStackWithMeta.getItem()));*/ + } + } catch (NullPointerException e) { + Utils.LOG_ERROR(itemName+" not found. [NULL]"); + } + } + + public static void addItemToOreDictionary(ItemStack stack, String oreDictName){ + try { + GT_OreDictUnificator.registerOre(oreDictName, stack); + } catch (NullPointerException e) { + Utils.LOG_ERROR(stack.getDisplayName()+" not registered. [NULL]"); + } + } + + @SuppressWarnings("unused") + public static ItemStack getItemStackWithMeta(boolean MOD, String FQRN, String itemName, int meta, int itemstackSize){ + if (MOD){ + try { + Item em = null; + Item em1 = getItem(FQRN); + Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta); + if (em1 != null){ + if (null == em){ + em = em1; + } + if (em != null){ + ItemStack metaStack = new ItemStack(em,itemstackSize,meta); + return metaStack; + } + } + return null; + } catch (NullPointerException e) { + Utils.LOG_ERROR(itemName+" not found. [NULL]"); + return null; + } + } + return null; + } + + @SuppressWarnings("unused") + public static ItemStack simpleMetaStack(String FQRN, int meta, int itemstackSize){ + try { + Item em = null; + Item em1 = getItem(FQRN); + Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta); + if (em1 != null){ + if (null == em){ + em = em1; + } + if (em != null){ + ItemStack metaStack = new ItemStack(em,itemstackSize,meta); + return metaStack; + } + } + return null; + } catch (NullPointerException e) { + Utils.LOG_ERROR(FQRN+" not found. [NULL]"); + return null; + } + } + + @SuppressWarnings("unused") + public static ItemStack simpleMetaStack(Item item, int meta, int itemstackSize){ + try { + Item em = item; + Item em1 = item; + Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta); + if (em1 != null){ + if (null == em){ + em = em1; + } + if (em != null){ + ItemStack metaStack = new ItemStack(em,itemstackSize,meta); + return metaStack; + } + } + return null; + } catch (NullPointerException e) { + Utils.LOG_ERROR(item.getUnlocalizedName()+" not found. [NULL]"); + return null; + } + } + + public static ItemStack getCorrectStacktype(String fqrn, int stackSize){ + String oreDict = "ore:"; + ItemStack temp; + if (fqrn.toLowerCase().contains(oreDict.toLowerCase())){ + String sanitizedName = fqrn.replace(oreDict, ""); + temp = ItemUtils.getItemStack(sanitizedName, stackSize); + return temp; + } + String[] fqrnSplit = fqrn.split(":"); + if(fqrnSplit[2] == null){fqrnSplit[2] = "0";} + temp = ItemUtils.getItemStackWithMeta(LoadedMods.MiscUtils, fqrn, fqrnSplit[1], Integer.parseInt(fqrnSplit[2]), stackSize); + return temp; + } + + public static ItemStack getCorrectStacktype(Object item_Input, int stackSize) { + if (item_Input instanceof String){ + return getCorrectStacktype(item_Input, stackSize); + } + else if (item_Input instanceof ItemStack){ + return (ItemStack) item_Input; + } + if (item_Input instanceof var){ + return ((var) item_Input).getStack(stackSize); + } + return null; + } + + public static Item getItem(String fqrn) // fqrn = fully qualified resource name + { + String[] fqrnSplit = fqrn.split(":"); + return GameRegistry.findItem(fqrnSplit[0], fqrnSplit[1]); + } + + public static ItemStack getItemStack(String fqrn, int Size) // fqrn = fully qualified resource name + { + String[] fqrnSplit = fqrn.split(":"); + return GameRegistry.findItemStack(fqrnSplit[0], fqrnSplit[1], Size); + } + + // TODO + /*public static FluidStack getFluidStack(Materials m, int Size) // fqrn = fully qualified resource name + { + String[] fqrnSplit = fqrn.split(":"); + + FluidStack x = (FluidStack) "Materials."+m+".getFluid"(Size); + + return GameRegistry.findItemStack(fqrnSplit[0], fqrnSplit[1], Size); + }*/ + + + public static void generateSpawnEgg(String entityModID, String parSpawnName, int colourEgg, int colourOverlay){ + Item itemSpawnEgg = new BasicSpawnEgg(entityModID, parSpawnName, colourEgg, colourOverlay).setUnlocalizedName("spawn_egg_"+parSpawnName.toLowerCase()).setTextureName(CORE.MODID+":spawn_egg"); + GameRegistry.registerItem(itemSpawnEgg, "spawnEgg"+parSpawnName); + } + + + public static ItemStack[] validItemsForOreDict(String oredictName){ + List validNames = MaterialUtils.oreDictValuesForEntry(oredictName); + ItemStack[] inputs = null; + for (int i=0; i oreDictList = OreDictionary.getOres(oredictName); + if (!oreDictList.isEmpty()){ + ItemStack returnValue = oreDictList.get(0).copy(); + returnValue.stackSize = amount; + return returnValue; + } + return getSimpleStack(ModItems.AAA_Broken, amount); + } + + public static ItemStack getItemStackOfAmountFromOreDictNoBroken(String oredictName, int amount){ + ItemStack returnValue = getItemStackOfAmountFromOreDict(oredictName, amount); + + if (returnValue.getItem().getClass() != ModItems.AAA_Broken.getClass() || returnValue.getItem() != ModItems.AAA_Broken){ + return returnValue; + } + Utils.LOG_INFO(oredictName+" was not valid."); + return null; + } + + public static ItemStack getItemStackOfAmountFromOreDictNoBrokenExcluding(String excludeModName, String oredictName, int amount){ + ItemStack returnValue = getItemStackOfAmountFromOreDict(oredictName, amount); + + if (returnValue.getItem().getClass() != ModItems.AAA_Broken.getClass() || returnValue.getItem() != ModItems.AAA_Broken){ + if (returnValue.getClass().toString().toLowerCase().contains(excludeModName.toLowerCase())){ + ArrayList oreDictList = OreDictionary.getOres(oredictName); + if (!oreDictList.isEmpty()){ + returnValue = oreDictList.get(1).copy(); + returnValue.stackSize = amount; + return returnValue; + } + } + else { + ArrayList oreDictList = OreDictionary.getOres(oredictName); + if (!oreDictList.isEmpty()){ + returnValue = oreDictList.get(1).copy(); + returnValue.stackSize = amount; + return returnValue; + } + } + return returnValue; + } + Utils.LOG_INFO(oredictName+" was not valid."); + return null; + } + + public static void generateItemsFromMaterial(Material matInfo){ + + String unlocalizedName = matInfo.getUnlocalizedName(); + String materialName = matInfo.getLocalizedName(); + short[] C = matInfo.getRGBA(); + int Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]); + boolean hotIngot = matInfo.requiresBlastFurnace(); + int materialTier = matInfo.vTier; //TODO + + if (materialTier > 10 || materialTier <= 0){ + materialTier = 2; + } + + + + int sRadiation = 0; + if (isRadioactive(materialName)){ + sRadiation = getRadioactivityLevel(materialName); + } + + if (sRadiation >= 1){ + Item temp; + Block tempBlock; + 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", 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(matInfo); + temp = new BaseItemRod(matInfo); + temp = new BaseItemRodLong(matInfo); + } + + else { + Item temp; + Block tempBlock; + tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour); + tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.FRAME, Colour); + temp = new BaseItemIngot("itemIngot"+unlocalizedName, materialName, Colour, sRadiation); + if (hotIngot){ + Item tempIngot = temp; + temp = new BaseItemIngotHot("itemHotIngot"+unlocalizedName, materialName, ItemUtils.getSimpleStack(tempIngot, 1), materialTier); + } + 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(matInfo); + temp = new BaseItemPlateDouble(matInfo); + temp = new BaseItemBolt(matInfo); + temp = new BaseItemRod(matInfo); + temp = new BaseItemRodLong(matInfo); + temp = new BaseItemRing(matInfo); + temp = new BaseItemScrew(matInfo); + temp = new BaseItemRotor(matInfo); + temp = new BaseItemGear(matInfo); + } + + //Add A jillion Recipes + RecipeGen_Plates.generateRecipes(matInfo); + RecipeGen_Extruder.generateRecipes(matInfo); + RecipeGen_ShapedCrafting.generateRecipes(matInfo); + RecipeGen_DustGeneration.generateRecipes(matInfo); + RecipeGen_BlastSmelter.generateARecipe(matInfo); + + FluidUtils.generateFluid(matInfo, 1); + + } + + 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", materialTier, radioactive), + new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, radioactive), + new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, radioactive)}; + return output; + } + + public static Item[] generateSpecialUseDusts(String unlocalizedName, String materialName, int Colour){ + Item[] output = { + new BaseItemDustUnique("itemDust"+unlocalizedName, materialName, Colour, "Dust"), + new BaseItemDustUnique("itemDustSmall"+unlocalizedName, materialName, Colour, "Small"), + new BaseItemDustUnique("itemDustTiny"+unlocalizedName, materialName, Colour, "Tiny")}; + return output; + } + + public static MultiPickaxeBase generateMultiPick(boolean GT_Durability, Materials material){ + ToolMaterial customMaterial = Utils.generateMaterialFromGT(material); + Utils.LOG_WARNING("Generating a Multi-Pick out of "+material.name()); + short[] rgb; + rgb = material.getRGBA(); + int dur = customMaterial.getMaxUses(); + Utils.LOG_WARNING("Determined durability for "+material.name()+" is "+dur); + if (GT_Durability){ + dur = material.mDurability*100; + Utils.LOG_WARNING("Using gregtech durability value, "+material.name()+" is now "+dur+"."); + } + else if (dur <= 0){ + dur = material.mDurability; + Utils.LOG_WARNING("Determined durability too low, "+material.name()+" is now "+dur+" based on the GT material durability."); + } + + if (dur <= 0){ + Utils.LOG_WARNING("Still too low, "+material.name()+" will now go unused."); + return null; + } + + MultiPickaxeBase MP_Redstone = new MultiPickaxeBase( + material.name()+" Multipick", + (customMaterial), + dur, + Utils.rgbtoHexValue(rgb[0],rgb[1],rgb[2]) + ); + + if (MP_Redstone.isValid){ + return MP_Redstone; + } + return null; + + } + + public static MultiSpadeBase generateMultiShovel(boolean GT_Durability, Materials material){ + ToolMaterial customMaterial = Utils.generateMaterialFromGT(material); + Utils.LOG_WARNING("Generating a Multi-Shovel out of "+material.name()); + short[] rgb; + rgb = material.getRGBA(); + int dur = customMaterial.getMaxUses(); + Utils.LOG_WARNING("Determined durability for "+material.name()+" is "+dur); + if (GT_Durability){ + dur = material.mDurability*100; + Utils.LOG_WARNING("Using gregtech durability value, "+material.name()+" is now "+dur+"."); + } + else if (dur <= 0){ + dur = material.mDurability; + Utils.LOG_WARNING("Determined durability too low, "+material.name()+" is now "+dur+" based on the GT material durability."); + } + + if (dur <= 0){ + Utils.LOG_WARNING("Still too low, "+material.name()+" will now go unused."); + return null; + } + + MultiSpadeBase MP_Redstone = new MultiSpadeBase( + material.name()+" Multishovel", + (customMaterial), + dur, + Utils.rgbtoHexValue(rgb[0],rgb[1],rgb[2]) + ); + + if (MP_Redstone.isValid){ + return MP_Redstone; + } + return null; + + } + + public static BaseItemDecidust generateDecidust(Materials material){ + if (GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L) != null){ + Material placeholder = MaterialUtils.generateMaterialFromGtENUM(material); + if (placeholder != null) + generateDecidust(placeholder); + } + return null; + } + + public static BaseItemDecidust generateDecidust(Material material){ + if (material.getDust(1) != null && MaterialUtils.hasValidRGBA(material.getRGBA())){ + BaseItemDecidust Decidust = new BaseItemDecidust(material); + return Decidust; + } + return null; + } + + public static BaseItemCentidust generateCentidust(Materials material){ + if (GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L) != null){ + Material placeholder = MaterialUtils.generateMaterialFromGtENUM(material); + if (placeholder != null) + generateCentidust(placeholder); + } + return null; + } + + public static BaseItemCentidust generateCentidust(Material material){ + if (material.getDust(1) != null && MaterialUtils.hasValidRGBA(material.getRGBA())){ + BaseItemCentidust Centidust = new BaseItemCentidust(material); + return Centidust; + } + return null; + } + + public static boolean isRadioactive(String materialName){ + int sRadiation = 0; + if (materialName.toLowerCase().contains("uranium")){ + sRadiation = 2; + } + else if (materialName.toLowerCase().contains("plutonium")){ + sRadiation = 4; + } + else if (materialName.toLowerCase().contains("thorium")){ + sRadiation = 1; + } + if (sRadiation >= 1){ + return true; + } + return false; + } + + public static int getRadioactivityLevel(String materialName){ + int sRadiation = 0; + if (materialName.toLowerCase().contains("uranium")){ + sRadiation = 2; + } + else if (materialName.toLowerCase().contains("plutonium")){ + sRadiation = 4; + } + else if (materialName.toLowerCase().contains("thorium")){ + sRadiation = 1; + } + return sRadiation; + } + + public static String getArrayStackNames(ItemStack[] aStack){ + String itemNames = "Item Array: "; + for (ItemStack alph : aStack){ + + if (alph != null){ + String temp = itemNames; + itemNames = temp + ", " + alph.getDisplayName() + " x" + alph.stackSize; + } + else { + String temp = itemNames; + itemNames = temp + ", " + "null" + " x" + "0"; + } + } + return itemNames; + + } + + public static String[] getArrayStackNamesAsArray(ItemStack[] aStack){ + String[] itemNames = {}; + int arpos = 0; + for (ItemStack alph : aStack){ + itemNames[arpos] = alph.getDisplayName(); + arpos++; + } + return itemNames; + + } + + public static String getFluidArrayStackNames(FluidStack[] aStack){ + String itemNames = "Fluid Array: "; + for (FluidStack alph : aStack){ + String temp = itemNames; + itemNames = temp + ", " + alph.getFluid().getName() + " x" + alph.amount; + } + return itemNames; + + } + + public static ItemStack getGregtechCircuit(int Meta){ + return ItemUtils.getItemStackWithMeta(LoadedMods.Gregtech, "gregtech:gt.integrated_circuit", "Gregtech Circuit", Meta, 0); + } + +} diff --git a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java deleted file mode 100644 index dcc73860d0..0000000000 --- a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java +++ /dev/null @@ -1,565 +0,0 @@ -package gtPlusPlus.core.util.item; - -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; -import gtPlusPlus.core.block.base.BlockBaseModular; -import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.item.base.BasicSpawnEgg; -import gtPlusPlus.core.item.base.bolts.BaseItemBolt; -import gtPlusPlus.core.item.base.dusts.BaseItemDust; -import gtPlusPlus.core.item.base.dusts.BaseItemDustUnique; -import gtPlusPlus.core.item.base.dusts.decimal.BaseItemCentidust; -import gtPlusPlus.core.item.base.dusts.decimal.BaseItemDecidust; -import gtPlusPlus.core.item.base.gears.BaseItemGear; -import gtPlusPlus.core.item.base.ingots.BaseItemIngot; -import gtPlusPlus.core.item.base.ingots.BaseItemIngotHot; -import gtPlusPlus.core.item.base.plates.BaseItemPlate; -import gtPlusPlus.core.item.base.plates.BaseItemPlateDouble; -import gtPlusPlus.core.item.base.rings.BaseItemRing; -import gtPlusPlus.core.item.base.rods.BaseItemRod; -import gtPlusPlus.core.item.base.rods.BaseItemRodLong; -import gtPlusPlus.core.item.base.rotors.BaseItemRotor; -import gtPlusPlus.core.item.base.screws.BaseItemScrew; -import gtPlusPlus.core.item.tool.staballoy.MultiPickaxeBase; -import gtPlusPlus.core.item.tool.staballoy.MultiSpadeBase; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.material.Material; -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_DustGeneration; -import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Extruder; -import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Plates; -import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_ShapedCrafting; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.Item.ToolMaterial; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; -import cpw.mods.fml.common.registry.GameRegistry; - -public class UtilsItems { - - public static ItemStack getSimpleStack(Item x){ - return getSimpleStack(x, 1); - } - public static ItemStack getSimpleStack(Item x, int i){ - try { - ItemStack r = new ItemStack(x, i); - return r; - } catch(Throwable e){ - return null; - } - } - public static ItemStack getSimpleStack(ItemStack x, int i){ - try { - ItemStack r = x.copy(); - r.stackSize = i; - return r; - } catch(Throwable e){ - return null; - } - } - - public static ItemStack getIC2Cell(String S){ - ItemStack moreTemp = UtilsItems.getItemStackOfAmountFromOreDictNoBroken("cell"+S, 1); - - if (moreTemp == null){ - int cellID = 0; - ItemStack temp =GT_ModHandler.getModItem("IC2", "itemCellEmpty", 1L, cellID); - return temp != null ? temp : null; - } - - return moreTemp; - } - - public static ItemStack getIC2Cell(int meta){ - ItemStack temp = GT_ModHandler.getModItem("IC2", "itemCellEmpty", 1L, meta); - return temp != null ? temp : null; - } - - - public static void getItemForOreDict(String FQRN, String oreDictName, String itemName, int meta){ - try { - Item em = null; - Item em1 = getItem(FQRN); - Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta); - if (em1 != null){ - em = em1; - } - if (em != null){ - - ItemStack metaStack = new ItemStack(em,1,meta); - GT_OreDictUnificator.registerOre(oreDictName, metaStack); - - /*ItemStack itemStackWithMeta = new ItemStack(em,1,meta); - GT_OreDictUnificator.registerOre(oreDictName, new ItemStack(itemStackWithMeta.getItem()));*/ - } - } catch (NullPointerException e) { - Utils.LOG_ERROR(itemName+" not found. [NULL]"); - } - } - - public static void addItemToOreDictionary(ItemStack stack, String oreDictName){ - try { - GT_OreDictUnificator.registerOre(oreDictName, stack); - } catch (NullPointerException e) { - Utils.LOG_ERROR(stack.getDisplayName()+" not registered. [NULL]"); - } - } - - @SuppressWarnings("unused") - public static ItemStack getItemStackWithMeta(boolean MOD, String FQRN, String itemName, int meta, int itemstackSize){ - if (MOD){ - try { - Item em = null; - Item em1 = getItem(FQRN); - Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta); - if (em1 != null){ - if (null == em){ - em = em1; - } - if (em != null){ - ItemStack metaStack = new ItemStack(em,itemstackSize,meta); - return metaStack; - } - } - return null; - } catch (NullPointerException e) { - Utils.LOG_ERROR(itemName+" not found. [NULL]"); - return null; - } - } - return null; - } - - @SuppressWarnings("unused") - public static ItemStack simpleMetaStack(String FQRN, int meta, int itemstackSize){ - try { - Item em = null; - Item em1 = getItem(FQRN); - Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta); - if (em1 != null){ - if (null == em){ - em = em1; - } - if (em != null){ - ItemStack metaStack = new ItemStack(em,itemstackSize,meta); - return metaStack; - } - } - return null; - } catch (NullPointerException e) { - Utils.LOG_ERROR(FQRN+" not found. [NULL]"); - return null; - } - } - - @SuppressWarnings("unused") - public static ItemStack simpleMetaStack(Item item, int meta, int itemstackSize){ - try { - Item em = item; - Item em1 = item; - Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta); - if (em1 != null){ - if (null == em){ - em = em1; - } - if (em != null){ - ItemStack metaStack = new ItemStack(em,itemstackSize,meta); - return metaStack; - } - } - return null; - } catch (NullPointerException e) { - Utils.LOG_ERROR(item.getUnlocalizedName()+" not found. [NULL]"); - return null; - } - } - - public static ItemStack getCorrectStacktype(String fqrn, int stackSize){ - String oreDict = "ore:"; - ItemStack temp; - if (fqrn.toLowerCase().contains(oreDict.toLowerCase())){ - String sanitizedName = fqrn.replace(oreDict, ""); - temp = UtilsItems.getItemStack(sanitizedName, stackSize); - return temp; - } - String[] fqrnSplit = fqrn.split(":"); - if(fqrnSplit[2] == null){fqrnSplit[2] = "0";} - temp = UtilsItems.getItemStackWithMeta(LoadedMods.MiscUtils, fqrn, fqrnSplit[1], Integer.parseInt(fqrnSplit[2]), stackSize); - return temp; - } - - public static ItemStack getCorrectStacktype(Object item_Input, int stackSize) { - if (item_Input instanceof String){ - return getCorrectStacktype(item_Input, stackSize); - } - else if (item_Input instanceof ItemStack){ - return (ItemStack) item_Input; - } - if (item_Input instanceof var){ - return ((var) item_Input).getStack(stackSize); - } - return null; - } - - public static Item getItem(String fqrn) // fqrn = fully qualified resource name - { - String[] fqrnSplit = fqrn.split(":"); - return GameRegistry.findItem(fqrnSplit[0], fqrnSplit[1]); - } - - public static ItemStack getItemStack(String fqrn, int Size) // fqrn = fully qualified resource name - { - String[] fqrnSplit = fqrn.split(":"); - return GameRegistry.findItemStack(fqrnSplit[0], fqrnSplit[1], Size); - } - - // TODO - /*public static FluidStack getFluidStack(Materials m, int Size) // fqrn = fully qualified resource name - { - String[] fqrnSplit = fqrn.split(":"); - - FluidStack x = (FluidStack) "Materials."+m+".getFluid"(Size); - - return GameRegistry.findItemStack(fqrnSplit[0], fqrnSplit[1], Size); - }*/ - - - public static void generateSpawnEgg(String entityModID, String parSpawnName, int colourEgg, int colourOverlay){ - Item itemSpawnEgg = new BasicSpawnEgg(entityModID, parSpawnName, colourEgg, colourOverlay).setUnlocalizedName("spawn_egg_"+parSpawnName.toLowerCase()).setTextureName(CORE.MODID+":spawn_egg"); - GameRegistry.registerItem(itemSpawnEgg, "spawnEgg"+parSpawnName); - } - - - public static ItemStack[] validItemsForOreDict(String oredictName){ - List validNames = MaterialUtils.oreDictValuesForEntry(oredictName); - ItemStack[] inputs = null; - for (int i=0; i oreDictList = OreDictionary.getOres(oredictName); - if (!oreDictList.isEmpty()){ - ItemStack returnValue = oreDictList.get(0).copy(); - returnValue.stackSize = amount; - return returnValue; - } - return getSimpleStack(ModItems.AAA_Broken, amount); - } - - public static ItemStack getItemStackOfAmountFromOreDictNoBroken(String oredictName, int amount){ - ItemStack returnValue = getItemStackOfAmountFromOreDict(oredictName, amount); - - if (returnValue.getItem().getClass() != ModItems.AAA_Broken.getClass() || returnValue.getItem() != ModItems.AAA_Broken){ - return returnValue; - } - Utils.LOG_INFO(oredictName+" was not valid."); - return null; - } - - public static ItemStack getItemStackOfAmountFromOreDictNoBrokenExcluding(String excludeModName, String oredictName, int amount){ - ItemStack returnValue = getItemStackOfAmountFromOreDict(oredictName, amount); - - if (returnValue.getItem().getClass() != ModItems.AAA_Broken.getClass() || returnValue.getItem() != ModItems.AAA_Broken){ - if (returnValue.getClass().toString().toLowerCase().contains(excludeModName.toLowerCase())){ - ArrayList oreDictList = OreDictionary.getOres(oredictName); - if (!oreDictList.isEmpty()){ - returnValue = oreDictList.get(1).copy(); - returnValue.stackSize = amount; - return returnValue; - } - } - else { - ArrayList oreDictList = OreDictionary.getOres(oredictName); - if (!oreDictList.isEmpty()){ - returnValue = oreDictList.get(1).copy(); - returnValue.stackSize = amount; - return returnValue; - } - } - return returnValue; - } - Utils.LOG_INFO(oredictName+" was not valid."); - return null; - } - - public static void generateItemsFromMaterial(Material matInfo){ - - String unlocalizedName = matInfo.getUnlocalizedName(); - String materialName = matInfo.getLocalizedName(); - short[] C = matInfo.getRGBA(); - int Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]); - boolean hotIngot = matInfo.requiresBlastFurnace(); - int materialTier = matInfo.vTier; //TODO - - if (materialTier > 10 || materialTier <= 0){ - materialTier = 2; - } - - - - int sRadiation = 0; - if (isRadioactive(materialName)){ - sRadiation = getRadioactivityLevel(materialName); - } - - if (sRadiation >= 1){ - Item temp; - Block tempBlock; - 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", 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(matInfo); - temp = new BaseItemRod(matInfo); - temp = new BaseItemRodLong(matInfo); - } - - else { - Item temp; - Block tempBlock; - tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour); - tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.FRAME, Colour); - temp = new BaseItemIngot("itemIngot"+unlocalizedName, materialName, Colour, sRadiation); - if (hotIngot){ - Item tempIngot = temp; - temp = new BaseItemIngotHot("itemHotIngot"+unlocalizedName, materialName, UtilsItems.getSimpleStack(tempIngot, 1), materialTier); - } - 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(matInfo); - temp = new BaseItemPlateDouble(matInfo); - temp = new BaseItemBolt(matInfo); - temp = new BaseItemRod(matInfo); - temp = new BaseItemRodLong(matInfo); - temp = new BaseItemRing(matInfo); - temp = new BaseItemScrew(matInfo); - temp = new BaseItemRotor(matInfo); - temp = new BaseItemGear(matInfo); - } - - //Add A jillion Recipes - RecipeGen_Plates.generateRecipes(matInfo); - RecipeGen_Extruder.generateRecipes(matInfo); - RecipeGen_ShapedCrafting.generateRecipes(matInfo); - RecipeGen_DustGeneration.generateRecipes(matInfo); - - FluidUtils.generateFluid(matInfo, 1); - - } - - 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", materialTier, radioactive), - new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, radioactive), - new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, radioactive)}; - return output; - } - - public static Item[] generateSpecialUseDusts(String unlocalizedName, String materialName, int Colour){ - Item[] output = { - new BaseItemDustUnique("itemDust"+unlocalizedName, materialName, Colour, "Dust"), - new BaseItemDustUnique("itemDustSmall"+unlocalizedName, materialName, Colour, "Small"), - new BaseItemDustUnique("itemDustTiny"+unlocalizedName, materialName, Colour, "Tiny")}; - return output; - } - - public static MultiPickaxeBase generateMultiPick(boolean GT_Durability, Materials material){ - ToolMaterial customMaterial = Utils.generateMaterialFromGT(material); - Utils.LOG_WARNING("Generating a Multi-Pick out of "+material.name()); - short[] rgb; - rgb = material.getRGBA(); - int dur = customMaterial.getMaxUses(); - Utils.LOG_WARNING("Determined durability for "+material.name()+" is "+dur); - if (GT_Durability){ - dur = material.mDurability*100; - Utils.LOG_WARNING("Using gregtech durability value, "+material.name()+" is now "+dur+"."); - } - else if (dur <= 0){ - dur = material.mDurability; - Utils.LOG_WARNING("Determined durability too low, "+material.name()+" is now "+dur+" based on the GT material durability."); - } - - if (dur <= 0){ - Utils.LOG_WARNING("Still too low, "+material.name()+" will now go unused."); - return null; - } - - MultiPickaxeBase MP_Redstone = new MultiPickaxeBase( - material.name()+" Multipick", - (customMaterial), - dur, - Utils.rgbtoHexValue(rgb[0],rgb[1],rgb[2]) - ); - - if (MP_Redstone.isValid){ - return MP_Redstone; - } - return null; - - } - - public static MultiSpadeBase generateMultiShovel(boolean GT_Durability, Materials material){ - ToolMaterial customMaterial = Utils.generateMaterialFromGT(material); - Utils.LOG_WARNING("Generating a Multi-Shovel out of "+material.name()); - short[] rgb; - rgb = material.getRGBA(); - int dur = customMaterial.getMaxUses(); - Utils.LOG_WARNING("Determined durability for "+material.name()+" is "+dur); - if (GT_Durability){ - dur = material.mDurability*100; - Utils.LOG_WARNING("Using gregtech durability value, "+material.name()+" is now "+dur+"."); - } - else if (dur <= 0){ - dur = material.mDurability; - Utils.LOG_WARNING("Determined durability too low, "+material.name()+" is now "+dur+" based on the GT material durability."); - } - - if (dur <= 0){ - Utils.LOG_WARNING("Still too low, "+material.name()+" will now go unused."); - return null; - } - - MultiSpadeBase MP_Redstone = new MultiSpadeBase( - material.name()+" Multishovel", - (customMaterial), - dur, - Utils.rgbtoHexValue(rgb[0],rgb[1],rgb[2]) - ); - - if (MP_Redstone.isValid){ - return MP_Redstone; - } - return null; - - } - - public static BaseItemDecidust generateDecidust(Materials material){ - if (GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L) != null){ - Material placeholder = MaterialUtils.generateMaterialFromGtENUM(material); - if (placeholder != null) - generateDecidust(placeholder); - } - return null; - } - - public static BaseItemDecidust generateDecidust(Material material){ - if (material.getDust(1) != null && MaterialUtils.hasValidRGBA(material.getRGBA())){ - BaseItemDecidust Decidust = new BaseItemDecidust(material); - return Decidust; - } - return null; - } - - public static BaseItemCentidust generateCentidust(Materials material){ - if (GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L) != null){ - Material placeholder = MaterialUtils.generateMaterialFromGtENUM(material); - if (placeholder != null) - generateCentidust(placeholder); - } - return null; - } - - public static BaseItemCentidust generateCentidust(Material material){ - if (material.getDust(1) != null && MaterialUtils.hasValidRGBA(material.getRGBA())){ - BaseItemCentidust Centidust = new BaseItemCentidust(material); - return Centidust; - } - return null; - } - - public static boolean isRadioactive(String materialName){ - int sRadiation = 0; - if (materialName.toLowerCase().contains("uranium")){ - sRadiation = 2; - } - else if (materialName.toLowerCase().contains("plutonium")){ - sRadiation = 4; - } - else if (materialName.toLowerCase().contains("thorium")){ - sRadiation = 1; - } - if (sRadiation >= 1){ - return true; - } - return false; - } - - public static int getRadioactivityLevel(String materialName){ - int sRadiation = 0; - if (materialName.toLowerCase().contains("uranium")){ - sRadiation = 2; - } - else if (materialName.toLowerCase().contains("plutonium")){ - sRadiation = 4; - } - else if (materialName.toLowerCase().contains("thorium")){ - sRadiation = 1; - } - return sRadiation; - } - - public static String getArrayStackNames(ItemStack[] aStack){ - String itemNames = "Item Array: "; - for (ItemStack alph : aStack){ - - if (alph != null){ - String temp = itemNames; - itemNames = temp + ", " + alph.getDisplayName() + " x" + alph.stackSize; - } - else { - String temp = itemNames; - itemNames = temp + ", " + "null" + " x" + "0"; - } - } - return itemNames; - - } - - public static String[] getArrayStackNamesAsArray(ItemStack[] aStack){ - String[] itemNames = {}; - int arpos = 0; - for (ItemStack alph : aStack){ - itemNames[arpos] = alph.getDisplayName(); - arpos++; - } - return itemNames; - - } - - public static String getFluidArrayStackNames(FluidStack[] aStack){ - String itemNames = "Fluid Array: "; - for (FluidStack alph : aStack){ - String temp = itemNames; - itemNames = temp + ", " + alph.getFluid().getName() + " x" + alph.amount; - } - return itemNames; - - } - - public static ItemStack getGregtechCircuit(int Meta){ - return UtilsItems.getItemStackWithMeta(LoadedMods.Gregtech, "gregtech:gt.integrated_circuit", "Gregtech Circuit", Meta, 0); - } - -} diff --git a/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java b/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java new file mode 100644 index 0000000000..39a118e440 --- /dev/null +++ b/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java @@ -0,0 +1,382 @@ +package gtPlusPlus.core.util.recipe; + +import gregtech.api.util.GT_ModHandler; +import gtPlusPlus.core.handler.COMPAT_HANDLER; +import gtPlusPlus.core.handler.Recipes.LateRegistrationHandler; +import gtPlusPlus.core.handler.Recipes.RegistrationHandler; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.core.util.recipe.shapeless.ShapelessUtils; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; +import cpw.mods.fml.common.registry.GameRegistry; + +public class RecipeUtils { + + public static boolean recipeBuilder(Object slot_1, Object slot_2, Object slot_3, Object slot_4, Object slot_5, Object slot_6, Object slot_7, Object slot_8, Object slot_9, ItemStack resultItem){ + + ArrayList validSlots = new ArrayList(); + + Utils.LOG_INFO("Trying to add a recipe for "+resultItem.toString()); + String a,b,c,d,e,f,g,h,i; + if (slot_1 == null){ a = " ";} else { a = "1";validSlots.add('1');validSlots.add(slot_1);} + Utils.LOG_WARNING(a); + if (slot_2 == null){ b = " ";} else { b = "2";validSlots.add('2');validSlots.add(slot_2);} + Utils.LOG_WARNING(b); + if (slot_3 == null){ c = " ";} else { c = "3";validSlots.add('3');validSlots.add(slot_3);} + Utils.LOG_WARNING(c); + if (slot_4 == null){ d = " ";} else { d = "4";validSlots.add('4');validSlots.add(slot_4);} + Utils.LOG_WARNING(d); + if (slot_5 == null){ e = " ";} else { e = "5";validSlots.add('5');validSlots.add(slot_5);} + Utils.LOG_WARNING(e); + if (slot_6 == null){ f = " ";} else { f = "6";validSlots.add('6');validSlots.add(slot_6);} + Utils.LOG_WARNING(f); + if (slot_7 == null){ g = " ";} else { g = "7";validSlots.add('7');validSlots.add(slot_7);} + Utils.LOG_WARNING(g); + if (slot_8 == null){ h = " ";} else { h = "8";validSlots.add('8');validSlots.add(slot_8);} + Utils.LOG_WARNING(h); + if (slot_9 == null){ i = " ";} else { i = "9";validSlots.add('9');validSlots.add(slot_9);} + Utils.LOG_WARNING(i); + + + Utils.LOG_ERROR("_______"); + String lineOne = a+b+c; + Utils.LOG_ERROR("|"+a+"|"+b+"|"+c+"|"); + Utils.LOG_ERROR("_______"); + String lineTwo = d+e+f; + Utils.LOG_ERROR("|"+d+"|"+e+"|"+f+"|"); + Utils.LOG_ERROR("_______"); + String lineThree = g+h+i; + Utils.LOG_ERROR("|"+g+"|"+h+"|"+i+"|"); + Utils.LOG_ERROR("_______"); + + validSlots.add(0, lineOne); + validSlots.add(1, lineTwo); + validSlots.add(2, lineThree); + boolean advancedLog = false; + if (CORE.DEBUG){ + advancedLog = true; + } + if (advancedLog){ + int j = 0; + int l = validSlots.size(); + Utils.LOG_WARNING("l:"+l); + while (j <= l) { + Utils.LOG_WARNING("j:"+j); + if (j <= 2){ + Utils.LOG_WARNING("ArrayList Values: "+validSlots.get(j)); + Utils.LOG_WARNING("Adding 1."); + j++; + } + else if (j >= 3){ + Utils.LOG_WARNING("ArrayList Values: '"+validSlots.get(j)+"' "+validSlots.get(j+1)); + if (j < (l-2)){ + Utils.LOG_WARNING("Adding 2."); + j=j+2; + } + else { + Utils.LOG_WARNING("Done iteration."); + break; + } + } + else if (j == l){ + Utils.LOG_WARNING("Done iteration."); + break; + } + if (validSlots.get(j) instanceof String || validSlots.get(j) instanceof ItemStack){ + //Utils.LOG_WARNING("Is Valid: "+validSlots.get(j)); + } + } + } + + try { + GameRegistry.addRecipe(new ShapedOreRecipe(resultItem.copy(), (Object[]) validSlots.toArray())); + Utils.LOG_INFO("Success! Added a recipe for "+resultItem.getDisplayName()); + if (!COMPAT_HANDLER.areInitItemsLoaded){ + RegistrationHandler.recipesSuccess++; + } + else { + LateRegistrationHandler.recipesSuccess++; + } + return true; + } + catch(NullPointerException | ClassCastException k){ + k.getMessage(); + k.getClass(); + k.printStackTrace(); + k.getLocalizedMessage(); + Utils.LOG_WARNING("@@@: Invalid Recipe detected for: "+resultItem.getUnlocalizedName()); + if (!COMPAT_HANDLER.areInitItemsLoaded){ + RegistrationHandler.recipesFailed++; + } + else { + LateRegistrationHandler.recipesFailed++; + } + return false; + } + } + + public static void shapelessBuilder(ItemStack Output, Object slot_1, Object slot_2, Object slot_3, Object slot_4, Object slot_5, Object slot_6, Object slot_7, Object slot_8, Object slot_9){ + //Item output_ITEM = Output.getItem(); + + ArrayList validSlots = new ArrayList(); + + Utils.LOG_INFO("Trying to add a recipe for "+Output.toString()); + String a,b,c,d,e,f,g,h,i; + if (slot_1 == null){ a = " ";} else { a = "1";validSlots.add('1');validSlots.add(slot_1);} + Utils.LOG_WARNING(a); + if (slot_2 == null){ b = " ";} else { b = "2";validSlots.add('2');validSlots.add(slot_2);} + Utils.LOG_WARNING(b); + if (slot_3 == null){ c = " ";} else { c = "3";validSlots.add('3');validSlots.add(slot_3);} + Utils.LOG_WARNING(c); + if (slot_4 == null){ d = " ";} else { d = "4";validSlots.add('4');validSlots.add(slot_4);} + Utils.LOG_WARNING(d); + if (slot_5 == null){ e = " ";} else { e = "5";validSlots.add('5');validSlots.add(slot_5);} + Utils.LOG_WARNING(e); + if (slot_6 == null){ f = " ";} else { f = "6";validSlots.add('6');validSlots.add(slot_6);} + Utils.LOG_WARNING(f); + if (slot_7 == null){ g = " ";} else { g = "7";validSlots.add('7');validSlots.add(slot_7);} + Utils.LOG_WARNING(g); + if (slot_8 == null){ h = " ";} else { h = "8";validSlots.add('8');validSlots.add(slot_8);} + Utils.LOG_WARNING(h); + if (slot_9 == null){ i = " ";} else { i = "9";validSlots.add('9');validSlots.add(slot_9);} + Utils.LOG_WARNING(i); + + + Utils.LOG_ERROR("_______"); + Utils.LOG_ERROR("|"+a+"|"+b+"|"+c+"|"); + Utils.LOG_ERROR("_______"); + Utils.LOG_ERROR("|"+d+"|"+e+"|"+f+"|"); + Utils.LOG_ERROR("_______"); + Utils.LOG_ERROR("|"+g+"|"+h+"|"+i+"|"); + Utils.LOG_ERROR("_______"); + + validSlots.add(0, a); + validSlots.add(1, b); + validSlots.add(2, c); + validSlots.add(3, d); + validSlots.add(4, e); + validSlots.add(5, f); + validSlots.add(6, g); + validSlots.add(7, h); + validSlots.add(8, i); + + try { + //GameRegistry.addRecipe(new ShapelessOreRecipe(Output, outputAmount), (Object[]) validSlots.toArray()); + GameRegistry.addRecipe(new ShapelessOreRecipe(Output, (Object[]) validSlots.toArray())); + //GameRegistry.addShapelessRecipe(new ItemStack(output_ITEM, 1), new Object[] {slot_1, slot_2}); + Utils.LOG_INFO("Success! Added a recipe for "+Output.getDisplayName()); + RegistrationHandler.recipesSuccess++; + } + catch(RuntimeException k){ + k.getMessage(); + k.getClass(); + k.printStackTrace(); + k.getLocalizedMessage(); + Utils.LOG_WARNING("@@@: Invalid Recipe detected for: "+Output.getUnlocalizedName()); + RegistrationHandler.recipesFailed++; + } + + + //GameRegistry.addShapelessRecipe(new ItemStack(output_ITEM, 1), new Object[] {slot_1, slot_2}); + } + + public static void recipeBuilder(Object[] array, ItemStack outPut) { + Utils.LOG_SPECIFIC_WARNING("object Array - recipeBuilder", "Attempting to build a recipe using an object array as an input, splitting it, then running the normal recipeBuilder() method.", 396); + Object a=null; + Object b=null; + Object c=null; + Object d=null; + Object e=null; + Object f=null; + Object g=null; + Object h=null; + Object i=null; + for(int z =0; z <= array.length; z++){ + array[z].toString(); + switch(z) + { + case 0: + a = array[z]; + break; + case 1: + b = array[z]; + break; + case 2: + c = array[z]; + break; + case 3: + d = array[z]; + break; + case 4: + e = array[z]; + break; + case 5: + f = array[z]; + break; + case 6: + g = array[z]; + break; + case 7: + h = array[z]; + break; + case 8: + i = array[z]; + break; + default: + break; + } + recipeBuilder(a, b, c, d, e, f, g, h, i, outPut); + } + } + + public static boolean removeCraftingRecipe(Object x){ + if (null == x){return false;} + if (x instanceof String){ + Item R = ItemUtils.getItem((String) x); + if (R != null){ + x = R; + } + else { + return false; + } + } + if (x instanceof Item || x instanceof ItemStack){ + if (x instanceof Item){ + ItemStack r = new ItemStack((Item) x); + Utils.LOG_INFO("Removing Recipe for "+r.getUnlocalizedName()); + } + else { + Utils.LOG_INFO("Removing Recipe for "+((ItemStack) x).getUnlocalizedName()); + } + if (x instanceof ItemStack){ + Item r = ((ItemStack) x).getItem(); + if (null != r){ + x = r; + } + else { + Utils.LOG_INFO("Recipe removal failed - Tell Alkalus."); + return false; + } + } + if (RecipeUtils.attemptRecipeRemoval((Item) x)){ + Utils.LOG_INFO("Recipe removal successful"); + return true; + } + Utils.LOG_INFO("Recipe removal failed - Tell Alkalus."); + return false; + } + return false; + } + + private static boolean attemptRecipeRemoval(Item I){ + Utils.LOG_WARNING("Create list of recipes."); + List recipes = CraftingManager.getInstance().getRecipeList(); + Iterator items = recipes.iterator(); + Utils.LOG_WARNING("Begin list iteration."); + while (items.hasNext()) { + ItemStack is = items.next().getRecipeOutput(); + if (is != null && is.getItem() == I){ + items.remove(); + Utils.LOG_INFO("Remove a recipe with "+I.getUnlocalizedName()+" as output."); + continue; + } + } + Utils.LOG_WARNING("All recipes should be gone?"); + if (!items.hasNext()){ + Utils.LOG_WARNING("We iterated once, let's try again to double check."); + Iterator items2 = recipes.iterator(); + while (items2.hasNext()) { + ItemStack is = items2.next().getRecipeOutput(); + if (is != null && is.getItem() == I){ + items.remove(); + Utils.LOG_WARNING("REMOVING MISSED RECIPE - RECHECK CONSTRUCTORS"); + return true; + } + } + Utils.LOG_WARNING("Should be all gone now after double checking, so return true."); + return true; + } + Utils.LOG_INFO("Return false, because something went wrong."); + return false; + } + + + + + + + public static boolean addShapedGregtechRecipe( + Object InputItem1, Object InputItem2, Object InputItem3, + Object InputItem4, Object InputItem5, Object InputItem6, + Object InputItem7, Object InputItem8, Object InputItem9, + ItemStack OutputItem){ + + if ((!(InputItem1 instanceof ItemStack) && !(InputItem1 instanceof String) && (InputItem1 != null)) || + (!(InputItem2 instanceof ItemStack) && !(InputItem2 instanceof String) && (InputItem2 != null)) || + (!(InputItem3 instanceof ItemStack) && !(InputItem3 instanceof String) && (InputItem3 != null)) || + (!(InputItem4 instanceof ItemStack) && !(InputItem4 instanceof String) && (InputItem4 != null)) || + (!(InputItem5 instanceof ItemStack) && !(InputItem5 instanceof String) && (InputItem5 != null)) || + (!(InputItem6 instanceof ItemStack) && !(InputItem6 instanceof String) && (InputItem6 != null)) || + (!(InputItem7 instanceof ItemStack) && !(InputItem7 instanceof String) && (InputItem7 != null)) || + (!(InputItem8 instanceof ItemStack) && !(InputItem8 instanceof String) && (InputItem8 != null)) || + (!(InputItem9 instanceof ItemStack) && !(InputItem9 instanceof String) && (InputItem9 != null))){ + Utils.LOG_INFO("One Input item was not an ItemStack of an OreDict String."); + return false; + } + + if (GT_ModHandler.addCraftingRecipe(OutputItem, + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | + GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, + new Object[]{"ABC", "DEF", "GHI", + 'A', InputItem1, + 'B', InputItem2, + 'C', InputItem3, + 'D', InputItem4, + 'E', InputItem5, + 'F', InputItem6, + 'G', InputItem7, + 'H', InputItem8, + 'I', InputItem9})){ + Utils.LOG_INFO("Success! Added a recipe for "+OutputItem.getDisplayName()); + RegistrationHandler.recipesSuccess++; + return true; + } + return false; + } + + public static void addShapelessGregtechRecipe(ItemStack OutputItem, Object... inputItems){ + + for(Object whatever : inputItems){ + if (!(whatever instanceof ItemStack) && !(whatever instanceof String)){ + Utils.LOG_INFO("One Input item was not an ItemStack of an OreDict String."); + return; + } + } + + GT_ModHandler.addShapelessCraftingRecipe(OutputItem, + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{inputItems}); + } + + public static ItemStack getItemStackFromOreDict(String oredictName){ + ArrayList oreDictList = OreDictionary.getOres(oredictName); + return oreDictList.get(0); + } + + public static boolean buildShapelessRecipe(ItemStack output, Object[] input){ + return ShapelessUtils.addShapelessRecipe(output, input); + } + +} diff --git a/src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java b/src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java deleted file mode 100644 index ee582c0646..0000000000 --- a/src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java +++ /dev/null @@ -1,377 +0,0 @@ -package gtPlusPlus.core.util.recipe; - -import gregtech.api.util.GT_ModHandler; -import gtPlusPlus.core.handler.COMPAT_HANDLER; -import gtPlusPlus.core.handler.Recipes.LateRegistrationHandler; -import gtPlusPlus.core.handler.Recipes.RegistrationHandler; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; -import cpw.mods.fml.common.registry.GameRegistry; - -public class UtilsRecipe { - - public static boolean recipeBuilder(Object slot_1, Object slot_2, Object slot_3, Object slot_4, Object slot_5, Object slot_6, Object slot_7, Object slot_8, Object slot_9, ItemStack resultItem){ - - ArrayList validSlots = new ArrayList(); - - Utils.LOG_INFO("Trying to add a recipe for "+resultItem.toString()); - String a,b,c,d,e,f,g,h,i; - if (slot_1 == null){ a = " ";} else { a = "1";validSlots.add('1');validSlots.add(slot_1);} - Utils.LOG_WARNING(a); - if (slot_2 == null){ b = " ";} else { b = "2";validSlots.add('2');validSlots.add(slot_2);} - Utils.LOG_WARNING(b); - if (slot_3 == null){ c = " ";} else { c = "3";validSlots.add('3');validSlots.add(slot_3);} - Utils.LOG_WARNING(c); - if (slot_4 == null){ d = " ";} else { d = "4";validSlots.add('4');validSlots.add(slot_4);} - Utils.LOG_WARNING(d); - if (slot_5 == null){ e = " ";} else { e = "5";validSlots.add('5');validSlots.add(slot_5);} - Utils.LOG_WARNING(e); - if (slot_6 == null){ f = " ";} else { f = "6";validSlots.add('6');validSlots.add(slot_6);} - Utils.LOG_WARNING(f); - if (slot_7 == null){ g = " ";} else { g = "7";validSlots.add('7');validSlots.add(slot_7);} - Utils.LOG_WARNING(g); - if (slot_8 == null){ h = " ";} else { h = "8";validSlots.add('8');validSlots.add(slot_8);} - Utils.LOG_WARNING(h); - if (slot_9 == null){ i = " ";} else { i = "9";validSlots.add('9');validSlots.add(slot_9);} - Utils.LOG_WARNING(i); - - - Utils.LOG_ERROR("_______"); - String lineOne = a+b+c; - Utils.LOG_ERROR("|"+a+"|"+b+"|"+c+"|"); - Utils.LOG_ERROR("_______"); - String lineTwo = d+e+f; - Utils.LOG_ERROR("|"+d+"|"+e+"|"+f+"|"); - Utils.LOG_ERROR("_______"); - String lineThree = g+h+i; - Utils.LOG_ERROR("|"+g+"|"+h+"|"+i+"|"); - Utils.LOG_ERROR("_______"); - - validSlots.add(0, lineOne); - validSlots.add(1, lineTwo); - validSlots.add(2, lineThree); - boolean advancedLog = false; - if (CORE.DEBUG){ - advancedLog = true; - } - if (advancedLog){ - int j = 0; - int l = validSlots.size(); - Utils.LOG_WARNING("l:"+l); - while (j <= l) { - Utils.LOG_WARNING("j:"+j); - if (j <= 2){ - Utils.LOG_WARNING("ArrayList Values: "+validSlots.get(j)); - Utils.LOG_WARNING("Adding 1."); - j++; - } - else if (j >= 3){ - Utils.LOG_WARNING("ArrayList Values: '"+validSlots.get(j)+"' "+validSlots.get(j+1)); - if (j < (l-2)){ - Utils.LOG_WARNING("Adding 2."); - j=j+2; - } - else { - Utils.LOG_WARNING("Done iteration."); - break; - } - } - else if (j == l){ - Utils.LOG_WARNING("Done iteration."); - break; - } - if (validSlots.get(j) instanceof String || validSlots.get(j) instanceof ItemStack){ - //Utils.LOG_WARNING("Is Valid: "+validSlots.get(j)); - } - } - } - - try { - GameRegistry.addRecipe(new ShapedOreRecipe(resultItem.copy(), (Object[]) validSlots.toArray())); - Utils.LOG_INFO("Success! Added a recipe for "+resultItem.getDisplayName()); - if (!COMPAT_HANDLER.areInitItemsLoaded){ - RegistrationHandler.recipesSuccess++; - } - else { - LateRegistrationHandler.recipesSuccess++; - } - return true; - } - catch(NullPointerException | ClassCastException k){ - k.getMessage(); - k.getClass(); - k.printStackTrace(); - k.getLocalizedMessage(); - Utils.LOG_WARNING("@@@: Invalid Recipe detected for: "+resultItem.getUnlocalizedName()); - if (!COMPAT_HANDLER.areInitItemsLoaded){ - RegistrationHandler.recipesFailed++; - } - else { - LateRegistrationHandler.recipesFailed++; - } - return false; - } - } - - public static void shapelessBuilder(ItemStack Output, Object slot_1, Object slot_2, Object slot_3, Object slot_4, Object slot_5, Object slot_6, Object slot_7, Object slot_8, Object slot_9){ - //Item output_ITEM = Output.getItem(); - - ArrayList validSlots = new ArrayList(); - - Utils.LOG_INFO("Trying to add a recipe for "+Output.toString()); - String a,b,c,d,e,f,g,h,i; - if (slot_1 == null){ a = " ";} else { a = "1";validSlots.add('1');validSlots.add(slot_1);} - Utils.LOG_WARNING(a); - if (slot_2 == null){ b = " ";} else { b = "2";validSlots.add('2');validSlots.add(slot_2);} - Utils.LOG_WARNING(b); - if (slot_3 == null){ c = " ";} else { c = "3";validSlots.add('3');validSlots.add(slot_3);} - Utils.LOG_WARNING(c); - if (slot_4 == null){ d = " ";} else { d = "4";validSlots.add('4');validSlots.add(slot_4);} - Utils.LOG_WARNING(d); - if (slot_5 == null){ e = " ";} else { e = "5";validSlots.add('5');validSlots.add(slot_5);} - Utils.LOG_WARNING(e); - if (slot_6 == null){ f = " ";} else { f = "6";validSlots.add('6');validSlots.add(slot_6);} - Utils.LOG_WARNING(f); - if (slot_7 == null){ g = " ";} else { g = "7";validSlots.add('7');validSlots.add(slot_7);} - Utils.LOG_WARNING(g); - if (slot_8 == null){ h = " ";} else { h = "8";validSlots.add('8');validSlots.add(slot_8);} - Utils.LOG_WARNING(h); - if (slot_9 == null){ i = " ";} else { i = "9";validSlots.add('9');validSlots.add(slot_9);} - Utils.LOG_WARNING(i); - - - Utils.LOG_ERROR("_______"); - Utils.LOG_ERROR("|"+a+"|"+b+"|"+c+"|"); - Utils.LOG_ERROR("_______"); - Utils.LOG_ERROR("|"+d+"|"+e+"|"+f+"|"); - Utils.LOG_ERROR("_______"); - Utils.LOG_ERROR("|"+g+"|"+h+"|"+i+"|"); - Utils.LOG_ERROR("_______"); - - validSlots.add(0, a); - validSlots.add(1, b); - validSlots.add(2, c); - validSlots.add(3, d); - validSlots.add(4, e); - validSlots.add(5, f); - validSlots.add(6, g); - validSlots.add(7, h); - validSlots.add(8, i); - - try { - //GameRegistry.addRecipe(new ShapelessOreRecipe(Output, outputAmount), (Object[]) validSlots.toArray()); - GameRegistry.addRecipe(new ShapelessOreRecipe(Output, (Object[]) validSlots.toArray())); - //GameRegistry.addShapelessRecipe(new ItemStack(output_ITEM, 1), new Object[] {slot_1, slot_2}); - Utils.LOG_INFO("Success! Added a recipe for "+Output.getDisplayName()); - RegistrationHandler.recipesSuccess++; - } - catch(RuntimeException k){ - k.getMessage(); - k.getClass(); - k.printStackTrace(); - k.getLocalizedMessage(); - Utils.LOG_WARNING("@@@: Invalid Recipe detected for: "+Output.getUnlocalizedName()); - RegistrationHandler.recipesFailed++; - } - - - //GameRegistry.addShapelessRecipe(new ItemStack(output_ITEM, 1), new Object[] {slot_1, slot_2}); - } - - public static void recipeBuilder(Object[] array, ItemStack outPut) { - Utils.LOG_SPECIFIC_WARNING("object Array - recipeBuilder", "Attempting to build a recipe using an object array as an input, splitting it, then running the normal recipeBuilder() method.", 396); - Object a=null; - Object b=null; - Object c=null; - Object d=null; - Object e=null; - Object f=null; - Object g=null; - Object h=null; - Object i=null; - for(int z =0; z <= array.length; z++){ - array[z].toString(); - switch(z) - { - case 0: - a = array[z]; - break; - case 1: - b = array[z]; - break; - case 2: - c = array[z]; - break; - case 3: - d = array[z]; - break; - case 4: - e = array[z]; - break; - case 5: - f = array[z]; - break; - case 6: - g = array[z]; - break; - case 7: - h = array[z]; - break; - case 8: - i = array[z]; - break; - default: - break; - } - recipeBuilder(a, b, c, d, e, f, g, h, i, outPut); - } - } - - public static boolean removeCraftingRecipe(Object x){ - if (null == x){return false;} - if (x instanceof String){ - Item R = UtilsItems.getItem((String) x); - if (R != null){ - x = R; - } - else { - return false; - } - } - if (x instanceof Item || x instanceof ItemStack){ - if (x instanceof Item){ - ItemStack r = new ItemStack((Item) x); - Utils.LOG_INFO("Removing Recipe for "+r.getUnlocalizedName()); - } - else { - Utils.LOG_INFO("Removing Recipe for "+((ItemStack) x).getUnlocalizedName()); - } - if (x instanceof ItemStack){ - Item r = ((ItemStack) x).getItem(); - if (null != r){ - x = r; - } - else { - Utils.LOG_INFO("Recipe removal failed - Tell Alkalus."); - return false; - } - } - if (UtilsRecipe.attemptRecipeRemoval((Item) x)){ - Utils.LOG_INFO("Recipe removal successful"); - return true; - } - Utils.LOG_INFO("Recipe removal failed - Tell Alkalus."); - return false; - } - return false; - } - - private static boolean attemptRecipeRemoval(Item I){ - Utils.LOG_WARNING("Create list of recipes."); - List recipes = CraftingManager.getInstance().getRecipeList(); - Iterator items = recipes.iterator(); - Utils.LOG_WARNING("Begin list iteration."); - while (items.hasNext()) { - ItemStack is = items.next().getRecipeOutput(); - if (is != null && is.getItem() == I){ - items.remove(); - Utils.LOG_INFO("Remove a recipe with "+I.getUnlocalizedName()+" as output."); - continue; - } - } - Utils.LOG_WARNING("All recipes should be gone?"); - if (!items.hasNext()){ - Utils.LOG_WARNING("We iterated once, let's try again to double check."); - Iterator items2 = recipes.iterator(); - while (items2.hasNext()) { - ItemStack is = items2.next().getRecipeOutput(); - if (is != null && is.getItem() == I){ - items.remove(); - Utils.LOG_WARNING("REMOVING MISSED RECIPE - RECHECK CONSTRUCTORS"); - return true; - } - } - Utils.LOG_WARNING("Should be all gone now after double checking, so return true."); - return true; - } - Utils.LOG_INFO("Return false, because something went wrong."); - return false; - } - - - - - - - public static boolean addShapedGregtechRecipe( - Object InputItem1, Object InputItem2, Object InputItem3, - Object InputItem4, Object InputItem5, Object InputItem6, - Object InputItem7, Object InputItem8, Object InputItem9, - ItemStack OutputItem){ - - if ((!(InputItem1 instanceof ItemStack) && !(InputItem1 instanceof String) && (InputItem1 != null)) || - (!(InputItem2 instanceof ItemStack) && !(InputItem2 instanceof String) && (InputItem2 != null)) || - (!(InputItem3 instanceof ItemStack) && !(InputItem3 instanceof String) && (InputItem3 != null)) || - (!(InputItem4 instanceof ItemStack) && !(InputItem4 instanceof String) && (InputItem4 != null)) || - (!(InputItem5 instanceof ItemStack) && !(InputItem5 instanceof String) && (InputItem5 != null)) || - (!(InputItem6 instanceof ItemStack) && !(InputItem6 instanceof String) && (InputItem6 != null)) || - (!(InputItem7 instanceof ItemStack) && !(InputItem7 instanceof String) && (InputItem7 != null)) || - (!(InputItem8 instanceof ItemStack) && !(InputItem8 instanceof String) && (InputItem8 != null)) || - (!(InputItem9 instanceof ItemStack) && !(InputItem9 instanceof String) && (InputItem9 != null))){ - Utils.LOG_INFO("One Input item was not an ItemStack of an OreDict String."); - return false; - } - - if (GT_ModHandler.addCraftingRecipe(OutputItem, - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | - GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[]{"ABC", "DEF", "GHI", - 'A', InputItem1, - 'B', InputItem2, - 'C', InputItem3, - 'D', InputItem4, - 'E', InputItem5, - 'F', InputItem6, - 'G', InputItem7, - 'H', InputItem8, - 'I', InputItem9})){ - Utils.LOG_INFO("Success! Added a recipe for "+OutputItem.getDisplayName()); - RegistrationHandler.recipesSuccess++; - return true; - } - return false; - } - - public static void addShapelessGregtechRecipe(ItemStack OutputItem, Object... inputItems){ - - for(Object whatever : inputItems){ - if (!(whatever instanceof ItemStack) && !(whatever instanceof String)){ - Utils.LOG_INFO("One Input item was not an ItemStack of an OreDict String."); - return; - } - } - - GT_ModHandler.addShapelessCraftingRecipe(OutputItem, - GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{inputItems}); - } - - public static ItemStack getItemStackFromOreDict(String oredictName){ - ArrayList oreDictList = OreDictionary.getOres(oredictName); - return oreDictList.get(0); - } - -} diff --git a/src/Java/gtPlusPlus/core/util/recipe/shapeless/ShapelessUtils.java b/src/Java/gtPlusPlus/core/util/recipe/shapeless/ShapelessUtils.java new file mode 100644 index 0000000000..bf9d4960d8 --- /dev/null +++ b/src/Java/gtPlusPlus/core/util/recipe/shapeless/ShapelessUtils.java @@ -0,0 +1,56 @@ +package gtPlusPlus.core.util.recipe.shapeless; + +import gtPlusPlus.core.util.Utils; + +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.ShapelessRecipes; + +public class ShapelessUtils { + + + public static boolean addShapelessRecipe(ItemStack output, Object ... params) + { + ArrayList arraylist = new ArrayList(); + Object[] aobject = params; + int i = params.length; + + for (int j = 0; j < i; ++j) + { + Object object1 = aobject[j]; + + if (object1 instanceof ItemStack) + { + arraylist.add(((ItemStack)object1).copy()); + } + else if (object1 instanceof Item) + { + arraylist.add(new ItemStack((Item)object1)); + } + else + { + if ((object1 == null)) + { + Utils.LOG_INFO(("Invalid shapeless input, ignoring!")); + } + else if (!(object1 instanceof Block) && (object1 != null)) + { + Utils.LOG_INFO(("Invalid shapeless recipe!")); + return false; + } + else { + arraylist.add(new ItemStack((Block)object1)); + } + } + } + CraftingManager.getInstance().getRecipeList().add(new ShapelessRecipes(output, arraylist)); + //CraftingManager.getInstance().addShapelessRecipe(output, arraylist); + return true; + } + + +} diff --git a/src/Java/gtPlusPlus/core/util/wrapper/var.java b/src/Java/gtPlusPlus/core/util/wrapper/var.java index d5e55bd658..3e7413ed85 100644 --- a/src/Java/gtPlusPlus/core/util/wrapper/var.java +++ b/src/Java/gtPlusPlus/core/util/wrapper/var.java @@ -2,7 +2,7 @@ package gtPlusPlus.core.util.wrapper; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.ItemStack; public class var{ @@ -42,7 +42,7 @@ public class var{ } private ItemStack getOreDictStack(int stackSize){ - ItemStack v = UtilsItems.getItemStack(sanitizedName, stackSize); + ItemStack v = ItemUtils.getItemStack(sanitizedName, stackSize); return v; } @@ -56,10 +56,10 @@ public class var{ String meta = "0"; try { if(fqrnSplit[2] != null){meta = fqrnSplit[2];} - temp = UtilsItems.getItemStackWithMeta(LoadedMods.MiscUtils, fqrn, fqrnSplit[1], Integer.parseInt(meta), stackSize); + temp = ItemUtils.getItemStackWithMeta(LoadedMods.MiscUtils, fqrn, fqrnSplit[1], Integer.parseInt(meta), stackSize); } catch (ArrayIndexOutOfBoundsException a){ - temp = UtilsItems.getItemStackWithMeta(LoadedMods.MiscUtils, fqrn, fqrnSplit[1], Integer.parseInt(meta), stackSize); + temp = ItemUtils.getItemStackWithMeta(LoadedMods.MiscUtils, fqrn, fqrnSplit[1], Integer.parseInt(meta), stackSize); } return temp; } diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java b/src/Java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java index 95049df43b..ced6dd1d27 100644 --- a/src/Java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java +++ b/src/Java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java @@ -1,8 +1,8 @@ package gtPlusPlus.xmod.forestry.bees.recipe; import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.util.item.UtilsItems; -import gtPlusPlus.core.util.recipe.UtilsRecipe; +import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.core.util.recipe.RecipeUtils; import gtPlusPlus.xmod.forestry.bees.items.FR_ItemRegistry; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -16,17 +16,17 @@ public class FR_Gregtech_Recipes { private static String rod_Uranium = "stickUranium"; private static String rod_LongUranium = "stickLongUranium"; private static String foil_Uranium235 = "foilUranium235"; - private static ItemStack hiveFrameAccelerated = UtilsItems.getSimpleStack(FR_ItemRegistry.hiveFrameAccelerated); - private static ItemStack hiveFrameMutagenic = UtilsItems.getSimpleStack(FR_ItemRegistry.hiveFrameMutagenic); + private static ItemStack hiveFrameAccelerated = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameAccelerated); + private static ItemStack hiveFrameMutagenic = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameMutagenic); - private static ItemStack hiveFrameCocoa = UtilsItems.getSimpleStack(FR_ItemRegistry.hiveFrameCocoa); - private static ItemStack hiveFrameCaged = UtilsItems.getSimpleStack(FR_ItemRegistry.hiveFrameCaged); - private static ItemStack hiveFrameSoul = UtilsItems.getSimpleStack(FR_ItemRegistry.hiveFrameSoul); - private static ItemStack hiveFrameClay = UtilsItems.getSimpleStack(FR_ItemRegistry.hiveFrameClay); - private static ItemStack hiveFrameNova = UtilsItems.getSimpleStack(FR_ItemRegistry.hiveFrameNova); + private static ItemStack hiveFrameCocoa = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameCocoa); + private static ItemStack hiveFrameCaged = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameCaged); + private static ItemStack hiveFrameSoul = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameSoul); + private static ItemStack hiveFrameClay = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameClay); + private static ItemStack hiveFrameNova = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameNova); - private static ItemStack hiveFrameImpregnated = UtilsItems.getItemStack("Forestry:frameImpregnated", 1); + private static ItemStack hiveFrameImpregnated = ItemUtils.getItemStack("Forestry:frameImpregnated", 1); private static ItemStack blockSoulSand = new ItemStack(Blocks.soul_sand, 1); private static ItemStack blockIronBars = new ItemStack (Blocks.iron_bars, 1); private static ItemStack itemClayDust = new ItemStack(Items.clay_ball, 1); @@ -36,13 +36,13 @@ public class FR_Gregtech_Recipes { public static void registerItems(){ //Magic Bee Like Frames - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( rod_LongElectrumFlux, rod_ElectrumFlux, rod_LongElectrumFlux, rod_LongElectrumFlux, foil_Electrum, rod_LongElectrumFlux, rod_ElectrumFlux, rod_ElectrumFlux, rod_ElectrumFlux, hiveFrameAccelerated); - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( rod_LongUranium, rod_Uranium, rod_LongUranium, rod_LongUranium, foil_Uranium235, rod_LongUranium, rod_Uranium, rod_Uranium, rod_Uranium, @@ -50,25 +50,25 @@ public class FR_Gregtech_Recipes { if (!LoadedMods.ExtraBees){ //Extra Bee Like Frames - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( null, itemCocoaBeans, null, itemCocoaBeans, hiveFrameImpregnated, itemCocoaBeans, null, itemCocoaBeans, null, hiveFrameCocoa); - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( hiveFrameImpregnated, blockIronBars, null, null, null, null, null, null, null, hiveFrameCaged); - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( hiveFrameImpregnated, blockSoulSand, null, null, null, null, null, null, null, hiveFrameSoul); - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( null, itemClayDust, null, itemClayDust, hiveFrameImpregnated, itemClayDust, null, itemClayDust, null, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java index b30b0144bc..4ed8c6caae 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java @@ -7,7 +7,7 @@ import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.fluid.FluidUtils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import net.minecraftforge.fluids.FluidStack; @@ -69,7 +69,7 @@ public class GregtechFluidHandler { //Check for IHL Hydrogen Chloride - if (!LoadedMods.IHL || UtilsItems.getItemStackOfAmountFromOreDict("cellHydrogenChloride", 1) == null){ + if (!LoadedMods.IHL || ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenChloride", 1) == null){ if (FluidUtils.getFluidStack("hydrogenchloride", 1) == null){ if (LoadedMods.IHL){ Utils.LOG_INFO("IHL Loaded but hydrogen chloride could not be found for some reason. How about we add our own."); @@ -101,11 +101,11 @@ public class GregtechFluidHandler { //Chemical Bath Recipes GT_Values.RA.addChemicalRecipe( - UtilsItems.getItemStackOfAmountFromOreDict("dustApatite", 16), + ItemUtils.getItemStackOfAmountFromOreDict("dustApatite", 16), null, FluidUtils.getFluidStack("sulfuricacid", 144*32), FluidUtils.getFluidStack("sulfuricapatite", 144*4), - UtilsItems.getItemStackOfAmountFromOreDict("dustSmallSulfur", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustSmallSulfur", 1), 20*20); /*GT_Values.RA.addChemicalRecipe( @@ -117,8 +117,8 @@ public class GregtechFluidHandler { 20*20);*/ GT_Values.RA.addChemicalRecipe( - UtilsItems.getItemStackOfAmountFromOreDict("cellOxygen", 1), - UtilsItems.getItemStackOfAmountFromOreDict("dustLithium", 16), + ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustLithium", 16), FluidUtils.getFluidStack("water", 1000), FluidUtils.getFluidStack("lithiumhydroxide", 144*4), null, @@ -132,9 +132,9 @@ public class GregtechFluidHandler { //Mixer Recipes - GT_Values.RA.addMixerRecipe(UtilsItems.getItemStackOfAmountFromOreDict("dustSulfur", 1), null, null, null, FluidUtils.getFluidStack("oxygen", 288), FluidUtils.getFluidStack("sulfurdioxide", 432), null, 600, 60); - GT_Values.RA.addMixerRecipe(UtilsItems.getItemStackOfAmountFromOreDict("dustUranium235", 1), UtilsItems.getItemStackOfAmountFromOreDict("dustUranium235", 1), null, null, FluidUtils.getFluidStack("hydrofluoricacid", 2000), FluidUtils.getFluidStack("uraniumtetrafluoride", 288), null, 3000, 500); - GT_Values.RA.addMixerRecipe(UtilsItems.getItemStackOfAmountFromOreDict("cellFluorine", 1), UtilsItems.getItemStackOfAmountFromOreDict("cellFluorine", 1), null, null, FluidUtils.getFluidStack("uraniumtetrafluoride", 720), FluidUtils.getFluidStack("uraniumhexafluoride", 288), null, 5000, 2000); + GT_Values.RA.addMixerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1), null, null, null, FluidUtils.getFluidStack("oxygen", 288), FluidUtils.getFluidStack("sulfurdioxide", 432), null, 600, 60); + GT_Values.RA.addMixerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustUranium235", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustUranium235", 1), null, null, FluidUtils.getFluidStack("hydrofluoricacid", 2000), FluidUtils.getFluidStack("uraniumtetrafluoride", 288), null, 3000, 500); + GT_Values.RA.addMixerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellFluorine", 1), ItemUtils.getItemStackOfAmountFromOreDict("cellFluorine", 1), null, null, FluidUtils.getFluidStack("uraniumtetrafluoride", 720), FluidUtils.getFluidStack("uraniumhexafluoride", 288), null, 5000, 2000); @@ -177,7 +177,7 @@ public class GregtechFluidHandler { GT_Values.RA.addDistillationTowerRecipe( FluidUtils.getFluidStack("sulfurdioxide", 144*3), sulfurdioxideOutput, - UtilsItems.getItemStackOfAmountFromOreDict("dustSulfur", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1), 5*20, 30); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java index db984d18b8..202647913c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java @@ -13,7 +13,7 @@ import gregtech.api.util.Recipe_GT; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; import java.util.ArrayList; @@ -34,7 +34,7 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase public static int sDurationMultiplier = 3215; public static boolean sRequiresUUA = false; private int recipeCounter = 0; - private static Block IC2Glass = Block.getBlockFromItem(UtilsItems.getItem("IC2:blockAlloyGlass")); + private static Block IC2Glass = Block.getBlockFromItem(ItemUtils.getItem("IC2:blockAlloyGlass")); //public FluidStack mFluidOut = Materials.UUMatter.getFluid(1L); public GregtechMTE_NuclearReactor(int aID, String aName, String aNameRegional) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java index 9bd6bdb2a6..f474effec5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java @@ -16,7 +16,7 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.fluid.FluidUtils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MatterFab; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlocks; @@ -39,7 +39,7 @@ public class GregtechMetaTileEntity_MassFabricator extends GT_MetaTileEntity_Mul public static boolean sRequiresUUA = false; private int mAmplifierUsed = 0; private int mMatterProduced = 0; - private static Block IC2Glass = Block.getBlockFromItem(UtilsItems.getItem("IC2:blockAlloyGlass")); + private static Block IC2Glass = Block.getBlockFromItem(ItemUtils.getItem("IC2:blockAlloyGlass")); FluidStack tempFake = FluidUtils.getFluidStack("uuamplifier", 1); GT_Recipe fakeRecipe; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java index fe27c09fef..b34aead51e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java @@ -7,7 +7,7 @@ import gregtech.api.enums.ToolDictNames; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.recipe.UtilsRecipe; +import gtPlusPlus.core.util.recipe.RecipeUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator; @@ -56,7 +56,7 @@ public class ProcessingToolHeadChoocher implements Interface_OreRecipeRegistrato ItemStack hammerhead = GT_OreDictUnificator.get(OrePrefixes.toolHeadHammer, aMaterial, 1L); if (null != plate && null != ingot && null != hammerhead && null != longrod && null != screw){ - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( hammerhead, ToolDictNames.craftingToolScrewdriver.name(), plate, ingot, plate, plate, longrod, screw, null, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java index 875375cc12..4c5606b125 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java @@ -6,8 +6,10 @@ import gregtech.api.enums.SubTag; import gregtech.api.objects.MaterialStack; import gregtech.api.util.GT_OreDictUnificator; 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.item.ItemUtils; +import gtPlusPlus.core.util.recipe.RecipeUtils; import net.minecraft.item.ItemStack; public class RecipeGen_BlastSmelter { @@ -18,10 +20,13 @@ public class RecipeGen_BlastSmelter { for (Materials M : GregMaterials){ - if (!M.equals(Materials.Osmiridium)){ + if (M.equals(Materials.Iridium) || M.equals(Materials.Osmium) || M.equals(Materials.Osmiridium) + /*|| !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium) + || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium) + || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium) + || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium)*/ + ){ - } - else { //Add a Blast Smelting Recipe, Let's go! ItemStack tStack; @@ -33,26 +38,26 @@ public class RecipeGen_BlastSmelter { short counter=0; int inputStackCount=0; int fluidAmount=0; - boolean doTest = false; + boolean doTest = true; //This Bad boy here is what dictates unique recipes. Fuck life, right? - ItemStack circuitGT = UtilsItems.getGregtechCircuit(0); + ItemStack circuitGT = ItemUtils.getGregtechCircuit(0); //Set a duration int duration = 0; - if (M.mBlastFurnaceTemp > 100){ - duration = (int) Math.max(M.getMass() / 30L, 1L) * M.mBlastFurnaceTemp; + if (M.mBlastFurnaceTemp > 150){ + duration = (int) Math.max(M.getMass() / 50L, 1L) * M.mBlastFurnaceTemp; } else { - duration = (int) Math.max(M.getMass() / 30L, 1L) * 200; + duration = (int) Math.max(M.getMass() / 50L, 1L) * 150; } //Make a simple one Material Materialstack[] and log it for validity. tMaterial = new MaterialStack[]{new MaterialStack(M, 1)}; - circuitGT = UtilsItems.getGregtechCircuit(1); - ItemStack[] tItemStackTest = new ItemStack[]{circuitGT, UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+M, 1)}; + circuitGT = ItemUtils.getGregtechCircuit(1); + ItemStack[] tItemStackTest = new ItemStack[]{circuitGT, ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust"+M, 1)}; inputStackCount = 1; fluidAmount = 144*inputStackCount; Utils.LOG_INFO("Adding an Alloy Blast Smelter Recipe for "+M+". Gives "+fluidAmount+"L of molten metal."); @@ -64,10 +69,10 @@ public class RecipeGen_BlastSmelter { //Generate Recipes for all singular materials that can be made molten. if (M.mBlastFurnaceRequired) { - doTest = CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getMolten(fluidAmount), 100, duration, 240); + //doTest = CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getMolten(fluidAmount), 100, duration, 240); } else { - doTest = CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getMolten(fluidAmount), 100, duration/2, 120); + //doTest = CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getMolten(fluidAmount), 100, duration/2, 120); } if (doTest){ @@ -84,7 +89,7 @@ public class RecipeGen_BlastSmelter { //If this Material has some kind of compound list, proceed if (mMaterialListSize > 1){ MaterialStack[] tempStack = new MaterialStack[mMaterialListSize]; - circuitGT = UtilsItems.getGregtechCircuit(mMaterialListSize); + circuitGT = ItemUtils.getGregtechCircuit(mMaterialListSize); //Just double checking if (tempStack.length > 1){ @@ -102,7 +107,7 @@ public class RecipeGen_BlastSmelter { for (MaterialStack aOutputPart : tempStack){ if (aOutputPart != null){ Utils.LOG_INFO("Finding dust: "+aOutputPart.mMaterial); - ItemStack rStack = UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+aOutputPart.mMaterial, (int) aOutputPart.mAmount); + ItemStack rStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust"+aOutputPart.mMaterial, (int) aOutputPart.mAmount); if (rStack != null){ Utils.LOG_INFO("Found dust: "+aOutputPart.mMaterial); components[counter] = rStack; @@ -112,20 +117,28 @@ public class RecipeGen_BlastSmelter { counter++; } - ItemStack[] components_NoCircuit = components; - - //Builds me an ItemStack[] of the materials. - With a circuit - components = new ItemStack[components_NoCircuit.length+1]; - for (int fr=0;fr 0 && mMaterialListSize < 9){ + ItemStack[] components_NoCircuit = components; + //Builds me an ItemStack[] of the materials. - With a circuit + components = new ItemStack[components_NoCircuit.length+1]; + for (int fr=0;fr 150){ + duration = (int) Math.max(M.getMass() / 50L, 1L) * M.getMeltingPoint_K(); + } + else { + duration = (int) Math.max(M.getMass() / 50L, 1L) * 150; + } + + + //Make a simple one Material Materialstack[] and log it for validity. + circuitGT = ItemUtils.getGregtechCircuit(1); + ItemStack[] tItemStackTest = new ItemStack[]{/*circuitGT,*/ tStack}; + inputStackCount = 1; + fluidAmount = 144*inputStackCount; + Utils.LOG_INFO("Adding an Alloy Blast Smelter Recipe for "+M.getLocalizedName()+". Gives "+fluidAmount+"L of molten metal."); + for (int das=0;das 1){ + gtPlusPlus.core.material.MaterialStack[] tempStack = new gtPlusPlus.core.material.MaterialStack[mMaterialListSize]; + circuitGT = ItemUtils.getGregtechCircuit(mMaterialListSize); + //Just double checking + if (tempStack.length > 1){ + + //Builds me a MaterialStack[] from the MaterialList of M. + int ooo=0; + for (gtPlusPlus.core.material.MaterialStack xMaterial : M.getComposites()){ + if (xMaterial != null){ + Utils.LOG_INFO("FOUND: "+xMaterial.getStackMaterial().getLocalizedName()); + Utils.LOG_INFO("ADDING: "+xMaterial.getStackMaterial().getLocalizedName()); + tempStack[ooo] = xMaterial; + } + ooo++; + } + + //Builds me an ItemStack[] of the materials. - Without a circuit - this gets a good count for the 144L fluid multiplier + components = new ItemStack[9]; + inputStackCount=0; + for (int irc=0;irc 0){ - Utils.LOG_INFO(UtilsItems.getArrayStackNames(inputStacks)); + Utils.LOG_INFO(ItemUtils.getArrayStackNames(inputStacks)); long[] inputStackSize = material.vSmallestRatio; if (inputStackSize != null){ for (short x=0;x 1){ + for (ItemStack I : material.getMaterialComposites()){ + if (I != null && material.vSmallestRatio != null){ + shapelessInput[arrayLocation] = I; + shapelessInput[arrayLocation].stackSize = (int) material.vSmallestRatio[arrayLocation]; + } + } + if (RecipeUtils.buildShapelessRecipe( + material.getDust(material.smallestStackSizeWhenProcessing), + shapelessInput + )){ + Utils.LOG_INFO("Shapeless Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("Shapeless Recipe: "+material.getLocalizedName()+" - Failed"); + } + } + + //Shaped Recipe - Bolts if (!material.isRadioactive){ - if (UtilsRecipe.recipeBuilder( + if (RecipeUtils.recipeBuilder( "craftingToolSaw", null, null, null, material.getRod(1), null, null, null, null, @@ -90,7 +114,7 @@ public class RecipeGen_ShapedCrafting { //Shaped Recipe - Ingot to Rod - if (UtilsRecipe.recipeBuilder( + if (RecipeUtils.recipeBuilder( "craftingToolFile", null, null, null, material.getIngot(1), null, null, null, null, @@ -103,7 +127,7 @@ public class RecipeGen_ShapedCrafting { //Shaped Recipe - Long Rod to two smalls - if (UtilsRecipe.recipeBuilder( + if (RecipeUtils.recipeBuilder( "craftingToolSaw", null, null, material.getLongRod(1), null, null, null, null, null, @@ -115,7 +139,7 @@ public class RecipeGen_ShapedCrafting { } //Two small to long rod - if (UtilsRecipe.recipeBuilder( + if (RecipeUtils.recipeBuilder( material.getRod(1), "craftingToolHardHammer", material.getRod(1), null, null, null, null, null, null, @@ -128,7 +152,7 @@ public class RecipeGen_ShapedCrafting { //Rotor Recipe if (!material.isRadioactive){ - if (UtilsRecipe.recipeBuilder( + if (RecipeUtils.recipeBuilder( material.getPlate(1), "craftingToolHardHammer", material.getPlate(1), material.getScrew(1), material.getRing(1), "craftingToolFile", material.getPlate(1), "craftingToolScrewdriver", material.getPlate(1), @@ -142,7 +166,7 @@ public class RecipeGen_ShapedCrafting { //Screws if (!material.isRadioactive){ - if (UtilsRecipe.recipeBuilder( + if (RecipeUtils.recipeBuilder( "craftingToolFile", material.getBolt(1), null, material.getBolt(1), null, null, null, null, null, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index 428042501d..b2e5c7ca09 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -4,7 +4,7 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.util.Recipe_GT; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder; import gtPlusPlus.xmod.gregtech.recipes.machines.RECIPEHANDLER_CokeOven; import gtPlusPlus.xmod.gregtech.recipes.machines.RECIPEHANDLER_MatterFabricator; @@ -204,7 +204,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { return false; } if (aOutputItems != null){ - Utils.LOG_INFO("Recipe will output: "+UtilsItems.getArrayStackNames(aOutputItems)); + Utils.LOG_INFO("Recipe will output: "+ItemUtils.getArrayStackNames(aOutputItems)); } if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java index ea30cc1e6f..0a5094412f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java @@ -1,7 +1,7 @@ package gtPlusPlus.xmod.gregtech.recipes.machines; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -72,7 +72,7 @@ public class RECIPEHANDLER_Dehydrator { outputFluidName = "null"; } - Utils.LOG_INFO("Successfully added a Chemical Dehydrator recipe for: "+UtilsItems.getArrayStackNames(aOutput)+" & "+outputFluidName+", Using "+inputAname+" & "+inputBname+" & liquid "+inputFluidname+". This takes "+(aDuration/20)+" seconds for "+aEUt+"eu/t."); + Utils.LOG_INFO("Successfully added a Chemical Dehydrator recipe for: "+ItemUtils.getArrayStackNames(aOutput)+" & "+outputFluidName+", Using "+inputAname+" & "+inputBname+" & liquid "+inputFluidname+". This takes "+(aDuration/20)+" seconds for "+aEUt+"eu/t."); Utils.LOG_WARNING("=================================================================================="); Utils.LOG_WARNING("=================================================================================="); Utils.LOG_WARNING("=================================================================================="); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java index 7834d4dc9d..791d7b5ea4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java @@ -13,8 +13,8 @@ import gtPlusPlus.core.material.ALLOY; 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.recipe.UtilsRecipe; +import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.core.util.recipe.RecipeUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaPipeEntityFluid; @@ -241,15 +241,15 @@ public class GregtechConduits { Utils.LOG_INFO("Generating "+output+" pipes & respective recipes."); - ItemStack pipeIngot = UtilsItems.getItemStackOfAmountFromOreDict("ingot"+output, 1).copy(); - ItemStack pipePlate = UtilsItems.getItemStackOfAmountFromOreDict("plate"+output, 1).copy(); + ItemStack pipeIngot = ItemUtils.getItemStackOfAmountFromOreDict("ingot"+output, 1).copy(); + ItemStack pipePlate = ItemUtils.getItemStackOfAmountFromOreDict("plate"+output, 1).copy(); //Check all pipes are not null - Utils.LOG_INFO("Generated pipeTiny from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Tiny"+output, 1) != null) ? true : false)); - Utils.LOG_INFO("Generated pipeSmall from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 1) != null) ? true : false)); - Utils.LOG_INFO("Generated pipeNormal from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 1) != null) ? true : false)); - Utils.LOG_INFO("Generated pipeLarge from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1) != null) ? true : false)); - Utils.LOG_INFO("Generated pipeHuge from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1) != null) ? true : false)); + Utils.LOG_INFO("Generated pipeTiny from "+ materialName +"? "+ ((ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Tiny"+output, 1) != null) ? true : false)); + Utils.LOG_INFO("Generated pipeSmall from "+ materialName +"? "+ ((ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 1) != null) ? true : false)); + Utils.LOG_INFO("Generated pipeNormal from "+ materialName +"? "+ ((ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 1) != null) ? true : false)); + Utils.LOG_INFO("Generated pipeLarge from "+ materialName +"? "+ ((ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1) != null) ? true : false)); + Utils.LOG_INFO("Generated pipeHuge from "+ materialName +"? "+ ((ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1) != null) ? true : false)); int eut = 128; int time = 0; @@ -260,62 +260,62 @@ public class GregtechConduits { //Add the Three Shaped Recipes First - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( pipePlate, "craftingToolWrench", pipePlate, pipePlate, null, pipePlate, pipePlate, "craftingToolHardHammer", pipePlate, - UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 6)); + ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 6)); - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( pipePlate, pipePlate, pipePlate, "craftingToolWrench", null, "craftingToolHardHammer", pipePlate, pipePlate, pipePlate, - UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 2)); + ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 2)); - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( pipePlate, "craftingToolHardHammer", pipePlate, pipePlate, null, pipePlate, pipePlate, "craftingToolWrench", pipePlate, - UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1)); + ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1)); GT_Values.RA.addExtruderRecipe( - UtilsItems.getSimpleStack(pipeIngot, 1), + ItemUtils.getSimpleStack(pipeIngot, 1), ItemList.Shape_Extruder_Pipe_Tiny.get(0), - UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Tiny"+output, 2), + ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Tiny"+output, 2), time, eut); GT_Values.RA.addExtruderRecipe( - UtilsItems.getSimpleStack(pipeIngot, 1), + ItemUtils.getSimpleStack(pipeIngot, 1), ItemList.Shape_Extruder_Pipe_Small.get(0), - UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 1), + ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 1), time+=bonusMulti, eut); GT_Values.RA.addExtruderRecipe( - UtilsItems.getSimpleStack(pipeIngot, 3), + ItemUtils.getSimpleStack(pipeIngot, 3), ItemList.Shape_Extruder_Pipe_Medium.get(0), - UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 1), + ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 1), time+=bonusMulti, eut); GT_Values.RA.addExtruderRecipe( - UtilsItems.getSimpleStack(pipeIngot, 6), + ItemUtils.getSimpleStack(pipeIngot, 6), ItemList.Shape_Extruder_Pipe_Large.get(0), - UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1), + ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1), time+=bonusMulti, eut); GT_Values.RA.addExtruderRecipe( - UtilsItems.getSimpleStack(pipeIngot, 12), + ItemUtils.getSimpleStack(pipeIngot, 12), ItemList.Shape_Extruder_Pipe_Huge.get(0), - UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1), + ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1), time+=bonusMulti, eut); if (eut < 512 && !output.equals("Void")){ - ItemStack pipePlateDouble = UtilsItems.getItemStackOfAmountFromOreDict("plateDouble"+output, 1).copy(); + ItemStack pipePlateDouble = ItemUtils.getItemStackOfAmountFromOreDict("plateDouble"+output, 1).copy(); if (pipePlateDouble != null) - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( pipePlateDouble, "craftingToolHardHammer", pipePlateDouble, pipePlateDouble, null, pipePlateDouble, pipePlateDouble, "craftingToolWrench", pipePlateDouble, - UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1)); + ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1)); else Utils.LOG_INFO("Failed to add a recipe for "+materialName+" Huge pipes. Double plates probably do not exist."); } @@ -330,6 +330,6 @@ public class GregtechConduits { returnValue.stackSize = amount; return returnValue; } - return UtilsItems.getSimpleStack(ModItems.AAA_Broken, amount); + return ItemUtils.getSimpleStack(ModItems.AAA_Broken, amount); } } diff --git a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java index 64eee08fd4..7f62c7fe53 100644 --- a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java +++ b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java @@ -5,7 +5,7 @@ import gregtech.api.util.GT_ModHandler; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.fluid.FluidUtils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.ItemStack; public class FishTrapHandler { @@ -48,21 +48,21 @@ public class FishTrapHandler { for (int i = 0; i < harvestcraftFish.length; i++){ String itemName = prefix+harvestcraftFish[i]+suffix; int lootChance = getLootChance(harvestcraftFish[i]); - if (UtilsItems.getItemStackOfAmountFromOreDictNoBroken(itemName, 1) != null){ - addFish("fish", UtilsItems.getItemStackOfAmountFromOreDict(itemName, 1), lootChance); - addGregtechMaceratorRecipe(UtilsItems.getItemStackOfAmountFromOreDict(itemName, 1)); - addGregtechCentrifugeRecipe(UtilsItems.getItemStackOfAmountFromOreDict(itemName, 1)); - addGregtechFluidRecipe(UtilsItems.getItemStackOfAmountFromOreDict(itemName, 1)); + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(itemName, 1) != null){ + addFish("fish", ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1), lootChance); + addGregtechMaceratorRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1)); + addGregtechCentrifugeRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1)); + addGregtechFluidRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1)); } } - if (UtilsItems.getItemStackOfAmountFromOreDictNoBroken(greenheartFish, 1) != null){ - addFish("fish", UtilsItems.getItemStackOfAmountFromOreDict(greenheartFish, 1), getLootChance(greenheartFish)); - addGregtechMaceratorRecipe(UtilsItems.getItemStackOfAmountFromOreDict(greenheartFish, 1)); - addGregtechCentrifugeRecipe(UtilsItems.getItemStackOfAmountFromOreDict(greenheartFish, 1)); - addGregtechFluidRecipe(UtilsItems.getItemStackOfAmountFromOreDict(greenheartFish, 1)); + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(greenheartFish, 1) != null){ + addFish("fish", ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1), getLootChance(greenheartFish)); + addGregtechMaceratorRecipe(ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1)); + addGregtechCentrifugeRecipe(ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1)); + addGregtechFluidRecipe(ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1)); } - if (UtilsItems.getItemStackOfAmountFromOreDictNoBroken(seaweed, 1) != null){ - addFish("junk", UtilsItems.getItemStackOfAmountFromOreDict(seaweed, 1), getLootChance(seaweed)); + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(seaweed, 1) != null){ + addFish("junk", ItemUtils.getItemStackOfAmountFromOreDict(seaweed, 1), getLootChance(seaweed)); } } @@ -155,7 +155,7 @@ public class FishTrapHandler { private static void addGregtechMaceratorRecipe(ItemStack input){ if (LoadedMods.Gregtech){ - GT_ModHandler.addPulverisationRecipe(input, UtilsItems.getItemStackOfAmountFromOreDict("dustMeatRaw", 1), UtilsItems.getItemStackOfAmountFromOreDict("dustTinyBone", 1), 0); + GT_ModHandler.addPulverisationRecipe(input, ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustTinyBone", 1), 0); } } diff --git a/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java b/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java index af648e73e2..6b95487773 100644 --- a/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java +++ b/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java @@ -9,8 +9,8 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; -import gtPlusPlus.core.util.recipe.UtilsRecipe; +import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.core.util.recipe.RecipeUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.ic2.item.IC2_Items; import net.minecraft.item.ItemStack; @@ -32,20 +32,20 @@ public class RECIPE_IC2 { public static String ingot_T3 = "ingotVibrantAlloy"; public static String ingot_T4 = "ingotIridium"; - private static ItemStack rotor_blade_T1 = UtilsItems.getSimpleStack(IC2_Items.rotor_Blade_Material_1.getItem()); - private static ItemStack rotor_blade_T2 = UtilsItems.getSimpleStack(IC2_Items.rotor_Blade_Material_2.getItem()); - private static ItemStack rotor_blade_T3 = UtilsItems.getSimpleStack(IC2_Items.rotor_Blade_Material_3.getItem()); - private static ItemStack rotor_blade_T4 = UtilsItems.getSimpleStack(IC2_Items.rotor_Blade_Material_4.getItem()); + private static ItemStack rotor_blade_T1 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_1.getItem()); + private static ItemStack rotor_blade_T2 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_2.getItem()); + private static ItemStack rotor_blade_T3 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_3.getItem()); + private static ItemStack rotor_blade_T4 = ItemUtils.getSimpleStack(IC2_Items.rotor_Blade_Material_4.getItem()); - private static ItemStack shaft_T1 = UtilsItems.getSimpleStack(IC2_Items.shaft_Material_1.getItem()); - private static ItemStack shaft_T2 = UtilsItems.getSimpleStack(IC2_Items.shaft_Material_2.getItem()); - private static ItemStack shaft_T3 = UtilsItems.getSimpleStack(IC2_Items.shaft_Material_3.getItem()); - private static ItemStack shaft_T4 = UtilsItems.getSimpleStack(IC2_Items.shaft_Material_4.getItem()); + private static ItemStack shaft_T1 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_1.getItem()); + private static ItemStack shaft_T2 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_2.getItem()); + private static ItemStack shaft_T3 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_3.getItem()); + private static ItemStack shaft_T4 = ItemUtils.getSimpleStack(IC2_Items.shaft_Material_4.getItem()); - private static ItemStack rotor_T1 = UtilsItems.getSimpleStack(IC2_Items.rotor_Material_1.getItem()); - private static ItemStack rotor_T2 = UtilsItems.getSimpleStack(IC2_Items.rotor_Material_2.getItem()); - private static ItemStack rotor_T3 = UtilsItems.getSimpleStack(IC2_Items.rotor_Material_3.getItem()); - private static ItemStack rotor_T4 = UtilsItems.getSimpleStack(IC2_Items.rotor_Material_4.getItem()); + private static ItemStack rotor_T1 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_1.getItem()); + private static ItemStack rotor_T2 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_2.getItem()); + private static ItemStack rotor_T3 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_3.getItem()); + private static ItemStack rotor_T4 = ItemUtils.getSimpleStack(IC2_Items.rotor_Material_4.getItem()); private static void checkForEnderIO(){ if(!LoadedMods.EnderIO){ @@ -69,25 +69,25 @@ public class RECIPE_IC2 { public static void initRecipes(){ //Rotor Blade Recipes - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( plate_T1, ingot_T1, plate_T1, plate_T1, ingot_T1, plate_T1, plate_T1, ingot_T1, plate_T1, rotor_blade_T1); - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( plate_T2, ingot_T2, plate_T2, plate_T2, ingot_T2, plate_T2, plate_T2, ingot_T2, plate_T2, rotor_blade_T2); - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( plate_T3, ingot_T3, plate_T3, plate_T3, ingot_T3, plate_T3, plate_T3, ingot_T3, plate_T3, rotor_blade_T3); - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( plate_T4, ingot_T4, plate_T4, plate_T4, ingot_T4, plate_T4, plate_T4, ingot_T4, plate_T4, @@ -120,25 +120,25 @@ public class RECIPE_IC2 { Utils.LOG_INFO("Added recipe for GT5 Extruder: Windmill Shaft [Iridium]"); //Rotor Recipes - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( null, rotor_blade_T1, null, rotor_blade_T1, shaft_T1, rotor_blade_T1, null, rotor_blade_T1, null, rotor_T1); - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( null, rotor_blade_T2, null, rotor_blade_T2, shaft_T2, rotor_blade_T2, null, rotor_blade_T2, null, rotor_T2); - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( null, rotor_blade_T3, null, rotor_blade_T3, shaft_T3, rotor_blade_T3, null, rotor_blade_T3, null, rotor_T3); - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( null, rotor_blade_T4, null, rotor_blade_T4, shaft_T4, rotor_blade_T4, null, rotor_blade_T4, null, diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java index 880bad71cc..4d89207817 100644 --- a/src/Java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java +++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java @@ -1,7 +1,7 @@ package gtPlusPlus.xmod.thermalfoundation.item; import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.xmod.thermalfoundation.block.TF_Blocks; import gtPlusPlus.xmod.thermalfoundation.fluid.TF_Fluids; import net.minecraft.init.Items; @@ -46,10 +46,10 @@ public class TF_Items { FurnaceFuelHandler.registerFuel(dustPyrotheum, 2400); - itemRodBlizz = UtilsItems.simpleMetaStack(itemMaterial, 1, 1); - itemDustBlizz = UtilsItems.simpleMetaStack(itemMaterial, 2, 1); - itemDustPyrotheum = UtilsItems.simpleMetaStack(itemMaterial, 3, 1); - itemDustCryotheum = UtilsItems.simpleMetaStack(itemMaterial, 4, 1); + itemRodBlizz = ItemUtils.simpleMetaStack(itemMaterial, 1, 1); + itemDustBlizz = ItemUtils.simpleMetaStack(itemMaterial, 2, 1); + itemDustPyrotheum = ItemUtils.simpleMetaStack(itemMaterial, 3, 1); + itemDustCryotheum = ItemUtils.simpleMetaStack(itemMaterial, 4, 1); diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java index 24096749f2..cab0741da2 100644 --- a/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java +++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java @@ -6,7 +6,7 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.xmod.thermalfoundation.item.TF_Items; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -24,7 +24,7 @@ public class TF_Gregtech_Recipes { ItemStack dust_Cryotheum = TF_Items.itemDustCryotheum.copy(); ItemStack dust_Pyrotheum = TF_Items.itemDustPyrotheum.copy(); ItemStack dust_Blizz = TF_Items.itemDustBlizz.copy(); - ItemStack dust_Blizz3 = UtilsItems.simpleMetaStack(TF_Items.itemMaterial, 2, 3); + ItemStack dust_Blizz3 = ItemUtils.simpleMetaStack(TF_Items.itemMaterial, 2, 3); ItemStack rod_Blizz = TF_Items.itemRodBlizz.copy(); FluidStack moltenRedstone = getFluidStack("molten.redstone", 250); diff --git a/src/resources/assets/gregtech/textures/gui/basicmachines/BlastSmelter.png b/src/resources/assets/gregtech/textures/gui/basicmachines/BlastSmelter.png new file mode 100644 index 0000000000..9495864a0f Binary files /dev/null and b/src/resources/assets/gregtech/textures/gui/basicmachines/BlastSmelter.png differ -- cgit From a63116828448048cf8fc311ad4bf12e6d6cfeb9a Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Thu, 27 Oct 2016 06:09:06 +1000 Subject: + Added recipes for the Blast Smelter Blocks. --- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 37 +++++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 4e317d6b7e..c8aa454e9a 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -48,6 +48,10 @@ public class RECIPES_Machines { // static ItemStack RECIPE_IndustrialWireFactoryController = GregtechItemList.Industrial_WireFactory.get(1); static ItemStack RECIPE_IndustrialWireFactoryFrame = GregtechItemList.Casing_WireFactory.get(1); + //Industrial Coke Oven + static ItemStack RECIPE_IndustrialBlastSmelterController = GregtechItemList.Industrial_AlloyBlastSmelter.get(1); + static ItemStack RECIPE_IndustrialBlastSmelterFrame = GregtechItemList.Casing_BlastSmelter.get(1); + static ItemStack RECIPE_IndustrialBlastSmelterCoil = GregtechItemList.Casing_Coil_BlastSmelter.get(1); //Buffer Cores @@ -113,7 +117,7 @@ public class RECIPES_Machines { static String rodTier9 = "stickZeron100"; static String rodTier10 = "stickNaquadahEnriched"; static String rodTier11 = "stickNeutronium"; - + static String pipeTier1 = "pipeHuge"+"Potin"; static String pipeTier2 = "pipeHuge"+"Steel"; static String pipeTier3 = "pipeHuge"+"StainlessSteel"; @@ -503,7 +507,7 @@ public class RECIPES_Machines { machineCasing_EV, IV_MACHINE_Electrolyzer, machineCasing_EV, "plateStellite", "rotorStellite", "plateStellite", RECIPE_IndustrialCentrifugeController);*/ - + //Industrial Centrifuge RecipeUtils.addShapedGregtechRecipe( circuitTier6, pipeHugeStainlessSteel, circuitTier6, @@ -603,9 +607,9 @@ public class RECIPES_Machines { circuitTier6, IV_MACHINE_Wiremill, circuitTier6, "plateZeron100", machineCasing_IV, "plateZeron100", RECIPE_IndustrialWireFactoryController); - - - + + + //Tiered Tanks RecipeUtils.addShapedGregtechRecipe( plateTier1, plateTier1, plateTier1, @@ -659,6 +663,29 @@ public class RECIPES_Machines { GregtechItemList.GT_FluidTank_MAX.get(1)); + + + + //Blast Smelter + RecipeUtils.addShapedGregtechRecipe( + "plateZirconiumCarbide", circuitTier4, "plateZirconiumCarbide", + cableTier4, machineCasing_EV, cableTier4, + "plateZirconiumCarbide", circuitTier3, "plateZirconiumCarbide", + RECIPE_IndustrialBlastSmelterController); + //Blast Smelter Frame Casing + RecipeUtils.addShapedGregtechRecipe( + "plateZirconiumCarbide", rodTier5, "plateZirconiumCarbide", + rodTier5, "frameGtTumbaga", rodTier5, + "plateZirconiumCarbide", rodTier5, "plateZirconiumCarbide", + RECIPE_IndustrialBlastSmelterFrame); + //Blast Smelter Coil + RecipeUtils.addShapedGregtechRecipe( + "plateStaballoy", "plateStaballoy", "plateStaballoy", + "frameGtStaballoy", gearboxCasing_Tier_3, "frameGtStaballoy", + "plateStaballoy", "plateStaballoy", "plateStaballoy", + RECIPE_IndustrialBlastSmelterCoil); + + } -- cgit