diff options
Diffstat (limited to 'src/Java/gtPlusPlus/core/item/base')
9 files changed, 213 insertions, 143 deletions
diff --git a/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java b/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java index 0f56730177..3d56307f39 100644 --- a/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java +++ b/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java @@ -5,6 +5,7 @@ import gregtech.api.enums.ItemList; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.core.util.math.MathUtils; @@ -19,22 +20,19 @@ import cpw.mods.fml.common.registry.GameRegistry; public class BaseItemBolt extends Item{ - protected int colour; - protected String materialName; - protected String unlocalName; - private int mTier; + final Material boltMaterial; + final String materialName; + final String unlocalName; - public BaseItemBolt(String unlocalizedName, String materialName, int colour, int tier) { - setUnlocalizedName(unlocalizedName); + public BaseItemBolt(Material material) { + this.boltMaterial = material; + this.unlocalName = "itemBolt"+material.getUnlocalizedName(); + this.materialName = material.getLocalizedName(); this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalizedName); - this.unlocalName = unlocalizedName; + this.setUnlocalizedName(unlocalName); this.setMaxStackSize(64); this.setTextureName(CORE.MODID + ":" + "itemBolt"); - this.colour = colour; - this.mTier = tier; - this.materialName = materialName; - GameRegistry.registerItem(this, unlocalizedName); + GameRegistry.registerItem(this, unlocalName); GT_OreDictUnificator.registerOre(unlocalName.replace("itemB", "b"), UtilsItems.getSimpleStack(this)); addExtruderRecipe(); } @@ -59,10 +57,10 @@ public class BaseItemBolt extends Item{ @Override public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (colour == 0){ + if (boltMaterial.getRgbAsHex() == 0){ return MathUtils.generateSingularRandomHexValue(); } - return colour; + return boltMaterial.getRgbAsHex(); } @@ -74,9 +72,10 @@ public class BaseItemBolt extends Item{ GT_Values.RA.addExtruderRecipe(tempOutputStack, ItemList.Shape_Extruder_Bolt.get(1), UtilsItems.getSimpleStack(this, 8), - 30*mTier*20, - 24*mTier); - } + (int) Math.max(boltMaterial.getMass() * 2L * 1, 1), + 8 * boltMaterial.vVoltageMultiplier); + } + } } diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index 0342f7f104..236edca24d 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -26,13 +26,12 @@ public class BaseItemDust extends Item{ protected int colour; protected String materialName; protected String pileType; - protected boolean useBlastFurnace; String name = ""; private int mTier; private Material dustInfo; private String oredictName; - public BaseItemDust(String unlocalizedName, String materialName, Material matInfo, int colour, String pileSize, boolean blastFurnaceRequired, int tier, int sRadioactivity) { + public BaseItemDust(String unlocalizedName, String materialName, Material matInfo, int colour, String pileSize, int tier, int sRadioactivity) { setUnlocalizedName(unlocalizedName); this.setUnlocalizedName(unlocalizedName); this.setMaxStackSize(64); @@ -44,7 +43,6 @@ public class BaseItemDust extends Item{ this.colour = colour; this.mTier = tier; this.materialName = materialName; - this.useBlastFurnace = blastFurnaceRequired; this.dustInfo = matInfo; this.sRadiation = sRadioactivity; GameRegistry.registerItem(this, unlocalizedName); @@ -272,7 +270,7 @@ public class BaseItemDust extends Item{ temp = temp.replace("itemDust", "ingot"); if (temp != null && temp != ""){ - if (this.useBlastFurnace){ + if (dustInfo.requiresBlastFurnace()){ Utils.LOG_WARNING("Adding recipe for Hot "+materialName+" Ingots in a Blast furnace."); String tempIngot = temp.replace("ingot", "ingotHot"); ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); @@ -286,10 +284,10 @@ public class BaseItemDust extends Item{ ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1); Utils.LOG_WARNING("This will produce an ingot of "+tempOutputStack.getDisplayName() + " Debug: "+temp); if (null != tempOutputStack){ - if (mTier < 5){ + if (mTier < 5 || !dustInfo.requiresBlastFurnace()){ CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(UtilsItems.getSimpleStack(this), tempOutputStack); } - else if (mTier >= 5){ + else if (mTier >= 5 || dustInfo.requiresBlastFurnace()){ Utils.LOG_WARNING("Adding recipe for "+materialName+" Ingots in a Blast furnace."); Utils.LOG_WARNING("This will produce "+tempOutputStack.getDisplayName()); if (null != tempOutputStack){ diff --git a/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java b/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java index ba41625b25..47ce5b7815 100644 --- a/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java +++ b/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java @@ -5,6 +5,7 @@ import gregtech.api.enums.ItemList; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.core.util.math.MathUtils; @@ -19,22 +20,19 @@ import cpw.mods.fml.common.registry.GameRegistry; public class BaseItemGear extends Item{ - protected int colour; - protected String materialName; - protected String unlocalName; - private int mTier; + final Material gearMaterial; + final String materialName; + final String unlocalName; - public BaseItemGear(String unlocalizedName, String materialName, int colour, int tier) { - setUnlocalizedName(unlocalizedName); + public BaseItemGear(Material material) { + this.gearMaterial = material; + this.unlocalName = "itemGear"+material.getUnlocalizedName(); + this.materialName = material.getLocalizedName(); this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalizedName); - this.unlocalName = unlocalizedName; + this.setUnlocalizedName(unlocalName); this.setMaxStackSize(64); this.setTextureName(CORE.MODID + ":" + "itemGear"); - this.colour = colour; - this.mTier = tier; - this.materialName = materialName; - GameRegistry.registerItem(this, unlocalizedName); + GameRegistry.registerItem(this, unlocalName); GT_OreDictUnificator.registerOre(unlocalName.replace("itemG", "g"), UtilsItems.getSimpleStack(this)); addExtruderRecipe(); } @@ -42,7 +40,7 @@ public class BaseItemGear extends Item{ @Override public String getItemStackDisplayName(ItemStack p_77653_1_) { - return (materialName+ " Gear"); + return (gearMaterial.getLocalizedName()+ " Gear"); } @Override @@ -59,23 +57,24 @@ public class BaseItemGear extends Item{ @Override public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (colour == 0){ + if (gearMaterial.getRgbAsHex() == 0){ return MathUtils.generateSingularRandomHexValue(); } - return colour; + return gearMaterial.getRgbAsHex(); } private void addExtruderRecipe(){ Utils.LOG_WARNING("Adding recipe for "+materialName+" Gears"); - String tempIngot = unlocalName.replace("itemGear", "ingot"); - ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 8); + ItemStack tempOutputStack = gearMaterial.getIngot(8); if (null != tempOutputStack){ - GT_Values.RA.addExtruderRecipe(tempOutputStack, + + GT_Values.RA.addExtruderRecipe( + tempOutputStack, ItemList.Shape_Extruder_Gear.get(1), UtilsItems.getSimpleStack(this), - 40*mTier*20, - 24*mTier); + (int) Math.max(gearMaterial.getMass() * 5L, 1), + 8 * gearMaterial.vVoltageMultiplier); } } diff --git a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java index 9d21198033..103198a395 100644 --- a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java +++ b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java @@ -38,7 +38,7 @@ public class BaseItemPlate extends Item{ this.sRadiation = sRadioactivity; GameRegistry.registerItem(this, unlocalizedName); GT_OreDictUnificator.registerOre(unlocalName.replace("itemP", "p"), UtilsItems.getSimpleStack(this)); - addBendingRecipe(); + //addBendingRecipe(); } @Override diff --git a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java index 47ffe70cd7..e6bfc1253a 100644 --- a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java +++ b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java @@ -40,8 +40,8 @@ public class BaseItemPlateDouble extends Item{ this.sRadiation = sRadioactivity; GameRegistry.registerItem(this, unlocalizedName); GT_OreDictUnificator.registerOre(unlocalName.replace("itemP", "p"), UtilsItems.getSimpleStack(this)); - addBendingRecipe(); - addCraftingRecipe(); + //addBendingRecipe(); + //addCraftingRecipe(); } @Override diff --git a/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java b/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java index d5c513c37d..d03b2b4e2f 100644 --- a/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java +++ b/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java @@ -5,9 +5,11 @@ import gregtech.api.enums.ItemList; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.util.recipe.UtilsRecipe; import java.util.List; @@ -19,22 +21,19 @@ import cpw.mods.fml.common.registry.GameRegistry; public class BaseItemRing extends Item{ - protected int colour; - protected String materialName; - protected String unlocalName; - private int mTier; + final Material ringMaterial; + final String materialName; + final String unlocalName; - public BaseItemRing(String unlocalizedName, String materialName, int colour, int tier) { - setUnlocalizedName(unlocalizedName); + public BaseItemRing(Material material) { + this.ringMaterial = material; + this.unlocalName = "itemRing"+material.getUnlocalizedName(); + this.materialName = material.getLocalizedName(); this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalizedName); - this.unlocalName = unlocalizedName; + this.setUnlocalizedName(unlocalName); this.setMaxStackSize(64); this.setTextureName(CORE.MODID + ":" + "itemRing"); - this.colour = colour; - this.mTier = tier; - this.materialName = materialName; - GameRegistry.registerItem(this, unlocalizedName); + GameRegistry.registerItem(this, unlocalName); GT_OreDictUnificator.registerOre(unlocalName.replace("itemR", "r"), UtilsItems.getSimpleStack(this)); addExtruderRecipe(); } @@ -59,24 +58,37 @@ public class BaseItemRing extends Item{ @Override public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (colour == 0){ + if (ringMaterial.getRgbAsHex() == 0){ return MathUtils.generateSingularRandomHexValue(); } - return colour; + return ringMaterial.getRgbAsHex(); } private void addExtruderRecipe(){ Utils.LOG_WARNING("Adding recipe for "+materialName+" Rings"); + + //Extruder Recipe String tempIngot = unlocalName.replace("itemRing", "ingot"); ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); if (null != tempOutputStack){ GT_Values.RA.addExtruderRecipe(tempOutputStack, ItemList.Shape_Extruder_Ring.get(1), UtilsItems.getSimpleStack(this, 4), - 12*mTier*20, - 24*mTier); - } + (int) Math.max(ringMaterial.getMass() * 2L * 1, 1), + 6 * ringMaterial.vVoltageMultiplier); + } + + //Shaped Recipe + tempIngot = unlocalName.replace("itemRing", "stick"); + tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); + if (null != tempOutputStack){ + UtilsRecipe.addShapedGregtechRecipe( + "craftingToolWrench", null, null, + null, tempOutputStack, null, + null, null, null, + UtilsItems.getSimpleStack(this, 1)); + } } } diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java index 320b398f22..0e4802ad0c 100644 --- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java +++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java @@ -5,6 +5,8 @@ import gregtech.api.enums.ItemList; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.ELEMENT; +import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.core.util.math.MathUtils; @@ -22,25 +24,26 @@ import cpw.mods.fml.common.registry.GameRegistry; public class BaseItemRod extends Item{ - protected int colour; - protected String materialName; - protected String unlocalName; - private int mTier; + final Material rodMaterial; + final String materialName; + final String unlocalName; - public BaseItemRod(String unlocalizedName, String materialName, int colour, int tier, int sRadioactivity) { - setUnlocalizedName(unlocalizedName); + public BaseItemRod(Material material, int sRadioactivity) { + this.rodMaterial = material; + this.unlocalName = "itemRod"+material.getUnlocalizedName(); + this.materialName = material.getLocalizedName(); this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalizedName); - this.unlocalName = unlocalizedName; + this.setUnlocalizedName(unlocalName); this.setTextureName(CORE.MODID + ":" + "itemRod"); this.setMaxStackSize(64); - this.colour = colour; - this.mTier = tier; - this.materialName = materialName; this.sRadiation = sRadioactivity; - GameRegistry.registerItem(this, unlocalizedName); + GameRegistry.registerItem(this, unlocalName); GT_OreDictUnificator.registerOre(unlocalName.replace("itemRod", "stick"), UtilsItems.getSimpleStack(this)); - addExtruderRecipe(); + + if (!material.equals(ELEMENT.URANIUM233)){ + addExtruderRecipe(); + } + } @Override @@ -56,7 +59,7 @@ public class BaseItemRod extends Item{ } if (sRadiation > 0){ list.add(CORE.GT_Tooltip_Radioactive); - } + } super.addInformation(stack, aPlayer, list, bool); } @@ -66,37 +69,73 @@ public class BaseItemRod extends Item{ @Override public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (colour == 0){ + if (rodMaterial.getRgbAsHex() == 0){ return MathUtils.generateSingularRandomHexValue(); } - return colour; + return rodMaterial.getRgbAsHex(); } - + protected final int sRadiation; - @Override - public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) { - Utils.applyRadiationDamageToEntity(sRadiation, world, entityHolding); - } - + @Override + public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) { + Utils.applyRadiationDamageToEntity(sRadiation, world, entityHolding); + } + private void addExtruderRecipe(){ Utils.LOG_WARNING("Adding recipe for "+materialName+" Rods"); - String tempIngot = unlocalName.replace("itemRod", "ingot"); - ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); - if (null != tempOutputStack){ - GT_Values.RA.addExtruderRecipe(tempOutputStack, - ItemList.Shape_Extruder_Rod.get(1), - UtilsItems.getSimpleStack(this, 2), - 12*mTier*20, 24*mTier); - } - ItemStack rods = UtilsItems.getSimpleStack(this, 1); + + String tempStick = unlocalName.replace("itemRod", "stick"); + String tempStickLong = unlocalName.replace("itemRod", "stickLong"); + String tempBolt = unlocalName.replace("itemRod", "bolt"); + ItemStack stackStick = UtilsItems.getItemStackOfAmountFromOreDict(tempStick, 1); + ItemStack stackStick2 = UtilsItems.getItemStackOfAmountFromOreDict(tempStick, 2); + ItemStack stackBolt = UtilsItems.getItemStackOfAmountFromOreDict(tempBolt, 4); + ItemStack stackStickLong = UtilsItems.getItemStackOfAmountFromOreDict(tempStickLong, 1); + ItemStack stackIngot = rodMaterial.getIngot(1); + + + GT_Values.RA.addExtruderRecipe( + stackIngot, + ItemList.Shape_Extruder_Rod.get(1), + stackStick2, + (int) Math.max(rodMaterial.getMass() * 2L * 1, 1), + 6 * rodMaterial.vVoltageMultiplier); + + GT_Values.RA.addCutterRecipe( + stackStick, + stackBolt, + null, + (int) Math.max(rodMaterial.getMass() * 2L, 1L), + 4); + if (sRadiation == 0){ - UtilsRecipe.addShapedGregtechRecipe( - rods, rods, rods, - rods, "craftingToolWrench", rods, - rods, rods, rods, + UtilsRecipe.recipeBuilder( + stackStick, stackStick, stackStick, + stackStick, "craftingToolWrench", stackStick, + stackStick, stackStick, stackStick, UtilsItems.getItemStackOfAmountFromOreDict(unlocalName.replace("itemRod", "frameGt"), 2)); } + + //Shaped Recipe - Bolts + stackBolt = UtilsItems.getItemStackOfAmountFromOreDict(tempBolt, 2); + if (null != stackBolt){ + UtilsRecipe.recipeBuilder( + "craftingToolSaw", null, null, + null, stackStick, null, + null, null, null, + stackBolt); + } + + //Shaped Recipe - Ingot to Rod + if (null != stackIngot){ + UtilsRecipe.recipeBuilder( + "craftingToolFile", null, null, + null, stackIngot, null, + null, null, null, + stackStick); + } + } } diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java index 4e157d22b1..6d87fd5872 100644 --- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java +++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java @@ -4,6 +4,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.core.util.math.MathUtils; @@ -21,23 +22,20 @@ import cpw.mods.fml.common.registry.GameRegistry; public class BaseItemRodLong extends Item{ - protected int colour; - protected String materialName; - protected String unlocalName; - private int mTier; + final Material rodLongMaterial; + final String materialName; + final String unlocalName; - public BaseItemRodLong(String unlocalizedName, String materialName, int colour, int tier, int sRadioactivity) { - setUnlocalizedName(unlocalizedName); + public BaseItemRodLong(Material material, int sRadioactivity) { + this.rodLongMaterial = material; + this.unlocalName = "itemRodLong"+material.getUnlocalizedName(); + this.materialName = material.getLocalizedName(); this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalizedName); - this.unlocalName = unlocalizedName; + this.setUnlocalizedName(material.getUnlocalizedName()); this.setTextureName(CORE.MODID + ":" + "itemRodLong"); this.setMaxStackSize(64); - this.colour = colour; - this.mTier = tier; - this.materialName = materialName; this.sRadiation = sRadioactivity; - GameRegistry.registerItem(this, unlocalizedName); + GameRegistry.registerItem(this, unlocalName); GT_OreDictUnificator.registerOre(unlocalName.replace("itemRod", "stick"), UtilsItems.getSimpleStack(this)); addExtruderRecipe(); } @@ -65,10 +63,10 @@ public class BaseItemRodLong extends Item{ @Override public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (colour == 0){ + if (rodLongMaterial.getRgbAsHex() == 0){ return MathUtils.generateSingularRandomHexValue(); } - return colour; + return rodLongMaterial.getRgbAsHex(); } @@ -80,20 +78,43 @@ public class BaseItemRodLong extends Item{ private void addExtruderRecipe(){ Utils.LOG_WARNING("Adding recipe for Long "+materialName+" Rods"); - String tempIngot = unlocalName.replace("itemRodLong", "stick"); - ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 2); - if (null != tempOutputStack){ - GT_Values.RA.addForgeHammerRecipe(tempOutputStack, - UtilsItems.getSimpleStack(this, 1), - 12*mTier*20, 24*mTier); - } - ItemStack rods = UtilsItems.getSimpleStack(this, 1); - ItemStack tempOutputStack2 = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); + + String tempStick = unlocalName.replace("itemRodLong", "stick"); + String tempStickLong = unlocalName.replace("itemRodLong", "stickLong"); + ItemStack stackStick = UtilsItems.getItemStackOfAmountFromOreDict(tempStick, 1); + ItemStack stackLong = UtilsItems.getItemStackOfAmountFromOreDict(tempStickLong, 1); + UtilsRecipe.addShapedGregtechRecipe( - tempOutputStack2, "craftingToolHardHammer", tempOutputStack2, + stackStick, "craftingToolHardHammer", stackStick, null, null, null, null, null, null, - rods); + stackLong); + + ItemStack temp = stackStick; + temp.stackSize = 2; + + GT_Values.RA.addForgeHammerRecipe( + temp, + stackLong, + (int) Math.max(rodLongMaterial.getMass(), 1L), + 16); + + GT_Values.RA.addCutterRecipe( + stackLong, + temp, + null, + (int) Math.max(rodLongMaterial.getMass(), 1L), + 4); + + //Shaped Recipe - Long Rod to two smalls + if (null != stackLong){ + stackStick.stackSize = 2; + UtilsRecipe.recipeBuilder( + "craftingToolSaw", null, null, + stackLong, null, null, + null, null, null, + stackStick); + } } } diff --git a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java index 953c3a99a3..8d727770ce 100644 --- a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java +++ b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java @@ -4,6 +4,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.core.util.math.MathUtils; @@ -19,23 +20,19 @@ import cpw.mods.fml.common.registry.GameRegistry; public class BaseItemScrew extends Item{ - protected int colour; - protected String materialName; - protected String unlocalName; - private int mTier; + final Material screwMaterial; + final String materialName; + final String unlocalName; - public BaseItemScrew(String unlocalizedName, String materialName, int colour, int tier) { - setUnlocalizedName(unlocalizedName); + public BaseItemScrew(Material material) { + this.screwMaterial = material; + this.unlocalName = "itemScrew"+material.getUnlocalizedName(); + this.materialName = material.getLocalizedName(); this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalizedName); - this.unlocalName = unlocalizedName; + this.setUnlocalizedName(unlocalName); this.setMaxStackSize(64); this.setTextureName(CORE.MODID + ":" + "itemScrew"); - this.setMaxStackSize(64); - this.colour = colour; - this.mTier = tier; - this.materialName = materialName; - GameRegistry.registerItem(this, unlocalizedName); + GameRegistry.registerItem(this, unlocalName); GT_OreDictUnificator.registerOre(unlocalName.replace("itemS", "s"), UtilsItems.getSimpleStack(this)); addLatheRecipe(); } @@ -60,21 +57,26 @@ public class BaseItemScrew extends Item{ @Override public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (colour == 0){ + if (screwMaterial.getRgbAsHex() == 0){ return MathUtils.generateSingularRandomHexValue(); } - return colour; + return screwMaterial.getRgbAsHex(); } private void addLatheRecipe(){ Utils.LOG_WARNING("Adding recipe for "+materialName+" Screws"); ItemStack boltStack = UtilsItems.getItemStackOfAmountFromOreDict(unlocalName.replace("itemScrew", "bolt"), 1); - if (null != boltStack){ - GT_Values.RA.addLatheRecipe(boltStack, - UtilsItems.getSimpleStack(this), null, - 60*mTier, 16*mTier); - UtilsRecipe.addShapedGregtechRecipe( + if (null != boltStack){ + GT_Values.RA.addLatheRecipe( + boltStack, + UtilsItems.getSimpleStack(this), + null, + (int) Math.max(screwMaterial.getMass() / 8L, 1L), + 4); + + + UtilsRecipe.recipeBuilder( "craftingToolFile", boltStack, null, boltStack, null, null, null, null, null, |