diff options
Diffstat (limited to 'src/Java/gtPlusPlus/core/item')
8 files changed, 24 insertions, 182 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); } } |