diff options
Diffstat (limited to 'src/Java/gtPlusPlus/core')
11 files changed, 50 insertions, 197 deletions
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index 46a39a5883..02f8f63175 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -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.COMPONENT_NAME.toLowerCase()+material.getUnlocalizedName(), UtilsItems.getSimpleStack(this)); + GT_OreDictUnificator.registerOre(componentType.getOreDictName()+material.getUnlocalizedName(), UtilsItems.getSimpleStack(this)); } @Override @@ -118,23 +118,25 @@ public class BaseItemComponent extends Item{ 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"); + DUST("Dust", " Dust", "dust"), + INGOT("Ingot", " Ingot", "ingot"), + PLATE("Plate", " Plate", "plate"), + PLATEDOUBLE("PlateDouble", " Double Plate", "plateDouble"), + ROD("Rod", " Rod", "stick"), + RODLONG("RodLong", " Long Rod", "stickLong"), + GEAR("Gear", " Gear", "gear"), + SCREW("Screw", " Screw", "screw"), + BOLT("Bolt", " Bolt", "bolt"), + ROTOR("Rotor", " Rotor", "rotor"), + RING("Ring", " Ring", "ring"); private String COMPONENT_NAME; private String DISPLAY_NAME; - private ComponentTypes (final String LocalName, String DisplayName){ + private String OREDICT_NAME; + private ComponentTypes (final String LocalName, String DisplayName, String OreDictName){ this.COMPONENT_NAME = LocalName; this.DISPLAY_NAME = DisplayName; + this.OREDICT_NAME = OreDictName; } public String getComponent(){ @@ -144,6 +146,11 @@ public class BaseItemComponent extends Item{ public String getName(){ return DISPLAY_NAME; } + + public String getOreDictName(){ + return OREDICT_NAME; + } + } } diff --git a/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java b/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java index 0bd42e6eac..6292c5cde6 100644 --- a/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java +++ b/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java @@ -1,32 +1,11 @@ package gtPlusPlus.core.item.base.bolts; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; -import net.minecraft.item.ItemStack; public class BaseItemBolt extends BaseItemComponent{ public BaseItemBolt(Material material) { super(material, BaseItemComponent.ComponentTypes.BOLT); - - addExtruderRecipe(); } - - 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(0), - UtilsItems.getSimpleStack(this, 8), - (int) Math.max(componentMaterial.getMass() * 2L * 1, 1), - 8 * componentMaterial.vVoltageMultiplier); - } - } - } diff --git a/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java b/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java index 56784e8530..7c4fe89568 100644 --- a/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java +++ b/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java @@ -1,31 +1,11 @@ package gtPlusPlus.core.item.base.gears; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; -import net.minecraft.item.ItemStack; public class BaseItemGear extends BaseItemComponent{ public BaseItemGear(Material material) { super(material, BaseItemComponent.ComponentTypes.GEAR); - addExtruderRecipe(); } - - private void addExtruderRecipe(){ - Utils.LOG_WARNING("Adding recipe for "+materialName+" Gears"); - ItemStack tempOutputStack = componentMaterial.getIngot(8); - if (null != tempOutputStack){ - GT_Values.RA.addExtruderRecipe( - tempOutputStack, - ItemList.Shape_Extruder_Gear.get(0), - UtilsItems.getSimpleStack(this), - (int) Math.max(componentMaterial.getMass() * 5L, 1), - 8 * componentMaterial.vVoltageMultiplier); - } - } - } diff --git a/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java b/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java index fd09276dc3..6ad3509876 100644 --- a/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java +++ b/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java @@ -1,45 +1,11 @@ package gtPlusPlus.core.item.base.rings; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; 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.recipe.UtilsRecipe; -import net.minecraft.item.ItemStack; public class BaseItemRing extends BaseItemComponent{ public BaseItemRing(Material material) { super(material, BaseItemComponent.ComponentTypes.RING); - addExtruderRecipe(); } - - private void addExtruderRecipe(){ - Utils.LOG_WARNING("Adding recipe for "+materialName+" Rings"); - - //Extruder Recipe - String tempIngot = unlocalName.replace("itemRing", "ingot"); - ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); - if (null != tempOutputStack){ - GT_Values.RA.addExtruderRecipe(tempOutputStack, - ItemList.Shape_Extruder_Ring.get(0), - UtilsItems.getSimpleStack(this, 4), - (int) Math.max(componentMaterial.getMass() * 2L * 1, 1), - 6 * componentMaterial.vVoltageMultiplier); - } - - //Shaped Recipe - tempIngot = unlocalName.replace("itemRing", "stick"); - tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); - if (null != tempOutputStack){ - UtilsRecipe.addShapedGregtechRecipe( - "craftingToolWrench", null, null, - null, tempOutputStack, null, - null, null, null, - UtilsItems.getSimpleStack(this, 1)); - } - } - } diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java index 6f7cf4b6bc..2e4acd6ccb 100644 --- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java +++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java @@ -1,43 +1,24 @@ package gtPlusPlus.core.item.base.rods; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; 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.recipe.UtilsRecipe; import net.minecraft.item.ItemStack; public class BaseItemRod extends BaseItemComponent{ public BaseItemRod(Material material) { super(material, BaseItemComponent.ComponentTypes.ROD); - - if (!material.equals(ELEMENT.URANIUM233)){ - addExtruderRecipe(); - } - + addExtruderRecipe(); } private void addExtruderRecipe(){ - Utils.LOG_WARNING("Adding recipe for "+materialName+" Rods"); + Utils.LOG_WARNING("Adding cutter recipe for "+materialName+" Rods"); 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(0), - stackStick2, - (int) Math.max(componentMaterial.getMass() * 2L * 1, 1), - 6 * componentMaterial.vVoltageMultiplier); GT_Values.RA.addCutterRecipe( stackStick, @@ -45,34 +26,6 @@ public class BaseItemRod extends BaseItemComponent{ null, (int) Math.max(componentMaterial.getMass() * 2L, 1L), 4); - - if (componentMaterial.isRadioactive){ - UtilsRecipe.recipeBuilder( - stackStick, stackStick, stackStick, - stackStick, "craftingToolWrench", stackStick, - stackStick, stackStick, stackStick, - UtilsItems.getItemStackOfAmountFromOreDict(unlocalName.replace("itemRod", "frameGt"), 2)); - } - - //Shaped Recipe - Bolts - stackBolt = componentMaterial.getBolt(2); - if (null != stackBolt){ - UtilsRecipe.recipeBuilder( - "craftingToolSaw", null, null, - null, stackStick, null, - null, null, null, - stackBolt); - } - - //Shaped Recipe - Ingot to Rod - if (null != stackIngot){ - UtilsRecipe.recipeBuilder( - "craftingToolFile", null, null, - null, stackIngot, null, - null, null, null, - stackStick); - } - } } diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java index 714f8dc145..4c1d36f945 100644 --- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java +++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java @@ -5,7 +5,6 @@ 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.recipe.UtilsRecipe; import net.minecraft.item.ItemStack; public class BaseItemRodLong extends BaseItemComponent{ @@ -28,12 +27,6 @@ public class BaseItemRodLong extends BaseItemComponent{ ItemStack stackStick = UtilsItems.getItemStackOfAmountFromOreDict(tempStick, 1); ItemStack stackLong = UtilsItems.getItemStackOfAmountFromOreDict(tempStickLong, 1); - UtilsRecipe.addShapedGregtechRecipe( - stackStick, "craftingToolHardHammer", stackStick, - null, null, null, - null, null, null, - stackLong); - ItemStack temp = stackStick; temp.stackSize = 2; @@ -48,17 +41,7 @@ public class BaseItemRodLong extends BaseItemComponent{ temp, null, (int) Math.max(componentMaterial.getMass(), 1L), - 4); - - //Shaped Recipe - Long Rod to two smalls - if (null != stackLong){ - stackStick.stackSize = 2; - UtilsRecipe.recipeBuilder( - "craftingToolSaw", null, null, - stackLong, null, null, - null, null, null, - stackStick); - } + 4); } } diff --git a/src/Java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java b/src/Java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java index dd4804125a..f993cc64b2 100644 --- a/src/Java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java +++ b/src/Java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java @@ -2,28 +2,10 @@ package gtPlusPlus.core.item.base.rotors; 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.recipe.UtilsRecipe; -import net.minecraft.item.ItemStack; public class BaseItemRotor extends BaseItemComponent{ public BaseItemRotor(Material material) { super(material, BaseItemComponent.ComponentTypes.ROTOR); - generateRecipe(); } - - public void generateRecipe(){ - Utils.LOG_WARNING("Adding recipe for "+materialName+" Rotors"); - 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", - tempOutputStack, "craftingToolScrewdriver", tempOutputStack, - UtilsItems.getSimpleStack(this)); - } - } diff --git a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java index 84ac759ba8..212dcd0fc1 100644 --- a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java +++ b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java @@ -5,7 +5,6 @@ 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.recipe.UtilsRecipe; import net.minecraft.item.ItemStack; public class BaseItemScrew extends BaseItemComponent{ @@ -24,14 +23,7 @@ public class BaseItemScrew extends BaseItemComponent{ UtilsItems.getSimpleStack(this), null, (int) Math.max(componentMaterial.getMass() / 8L, 1L), - 4); - - - UtilsRecipe.recipeBuilder( - "craftingToolFile", boltStack, null, - boltStack, null, null, - null, null, null, - UtilsItems.getSimpleStack(this)); + 4); } } diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index d6f5d77f20..27a9f53ced 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -184,15 +184,15 @@ public class Material { } public ItemStack getDust(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDict("dust"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+unlocalizedName, stacksize); } public ItemStack getSmallDust(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDict("dustSmall"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustSmall"+unlocalizedName, stacksize); } public ItemStack getTinyDust(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDict("dustTiny"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustTiny"+unlocalizedName, stacksize); } public ItemStack[] getValidInputStacks(){ @@ -200,43 +200,47 @@ public class Material { } public ItemStack getIngot(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDict("ingot"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("ingot"+unlocalizedName, stacksize); } public ItemStack getPlate(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDict("plate"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("plate"+unlocalizedName, stacksize); } public ItemStack getPlateDouble(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDict("plateDouble"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("plateDouble"+unlocalizedName, stacksize); } public ItemStack getGear(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDict("gear"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("gear"+unlocalizedName, stacksize); } public ItemStack getRod(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDict("stick"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("stick"+unlocalizedName, stacksize); } public ItemStack getLongRod(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDict("stickLong"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("stickLong"+unlocalizedName, stacksize); } public ItemStack getBolt(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDict("bolt"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("bolt"+unlocalizedName, stacksize); } public ItemStack getScrew(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDict("screw"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("screw"+unlocalizedName, stacksize); } public ItemStack getRing(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDict("ring"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("ring"+unlocalizedName, stacksize); } public ItemStack getRotor(int stacksize){ - return UtilsItems.getItemStackOfAmountFromOreDict("rotor"+unlocalizedName, stacksize); + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("rotor"+unlocalizedName, stacksize); + } + + public ItemStack getFrameBox(int stacksize){ + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("frameGt"+unlocalizedName, stacksize); } public ItemStack[] getMaterialComposites(){ diff --git a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java index fbda7554df..530ac24f98 100644 --- a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java +++ b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java @@ -32,7 +32,9 @@ 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_Extruder; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Plates; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_ShapedCrafting; import java.util.ArrayList; import java.util.List; @@ -380,7 +382,10 @@ public class UtilsItems { temp = new BaseItemGear(matInfo); } + //Add A jillion Recipes RecipeGen_Plates.generateRecipes(matInfo); + RecipeGen_Extruder.generateRecipes(matInfo); + RecipeGen_ShapedCrafting.generateRecipes(matInfo); FluidUtils.generateFluid(matInfo, 1); diff --git a/src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java b/src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java index 727e40f570..624bde2ead 100644 --- a/src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java +++ b/src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java @@ -314,7 +314,7 @@ public class UtilsRecipe { - public static void addShapedGregtechRecipe( + public static boolean addShapedGregtechRecipe( Object InputItem1, Object InputItem2, Object InputItem3, Object InputItem4, Object InputItem5, Object InputItem6, Object InputItem7, Object InputItem8, Object InputItem9, @@ -330,7 +330,7 @@ public class UtilsRecipe { (!(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; + return false; } if (GT_ModHandler.addCraftingRecipe(OutputItem, @@ -348,7 +348,9 @@ public class UtilsRecipe { '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){ |