diff options
Diffstat (limited to 'src')
5 files changed, 149 insertions, 6 deletions
diff --git a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java new file mode 100644 index 0000000000..47ffe70cd7 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java @@ -0,0 +1,126 @@ +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 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 BaseItemPlateDouble(String unlocalizedName, String materialName, int colour, int tier, int sRadioactivity) { + setUnlocalizedName(unlocalizedName); + this.setCreativeTab(AddToCreativeTab.tabMisc); + this.setUnlocalizedName(unlocalizedName); + this.unlocalName = unlocalizedName; + 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/util/item/UtilsItems.java b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java index d6d4a85b23..d68174f7bb 100644 --- a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java +++ b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java @@ -13,6 +13,7 @@ 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; @@ -317,6 +318,7 @@ public class UtilsItems { temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", hotIngot, materialTier, sRadiation); temp = new BaseItemPlate("itemPlate"+unlocalizedName, materialName, Colour, materialTier, sRadiation); + temp = new BaseItemPlateDouble("itemPlateDouble"+unlocalizedName, materialName, Colour, materialTier, sRadiation); temp = new BaseItemRod("itemRod"+unlocalizedName, materialName, Colour, materialTier, sRadiation); temp = new BaseItemRodLong("itemRodLong"+unlocalizedName, materialName, Colour, materialTier, sRadiation); temp = new BaseItemRing("itemRing"+unlocalizedName, materialName, Colour, materialTier); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java index 54560fd9e1..e2f3ea79d3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java @@ -191,10 +191,10 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { GregtechItemList.Fluid_Cell_1L.set(addItem(tLastID = 64, "1L Wrought Iron Fluid Cell", "Holds exactly one litre worth of liquid.", new Object[]{new ItemData(Materials.WroughtIron, OrePrefixes.plate.mMaterialAmount * 8L + 4L * OrePrefixes.ring.mMaterialAmount, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L)})); setFluidContainerStats(32000 + tLastID, 1L, 64L); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.WroughtIron, 8L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.WroughtIron, 4L), GregtechItemList.Fluid_Cell_1L.get(4L, new Object[0]), 50, 32); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Bronze, 8L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Bronze, 4L), GregtechItemList.Fluid_Cell_16L.get(4L, new Object[0]), 50, 32); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Brass, 8L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Brass, 4L), GregtechItemList.Fluid_Cell_36L.get(4L, new Object[0]), 75, 32); - GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Invar, 8L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Invar, 4L), GregtechItemList.Fluid_Cell_144L.get(4L, new Object[0]), 75, 32); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.WroughtIron, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.WroughtIron, 8L), GregtechItemList.Fluid_Cell_1L.get(4L, new Object[0]), 50, 32); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Bronze, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Bronze, 8L), GregtechItemList.Fluid_Cell_16L.get(4L, new Object[0]), 50, 32); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Brass, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Brass, 8L), GregtechItemList.Fluid_Cell_36L.get(4L, new Object[0]), 75, 32); + GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Invar, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Invar, 8L), GregtechItemList.Fluid_Cell_144L.get(4L, new Object[0]), 75, 32); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java index 0d9193ba3c..28b86a8b10 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java @@ -228,10 +228,15 @@ public class GregtechConduits { Utils.LOG_WARNING("Generated pipeHuge from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1) != null) ? true : false)); int eut = 128; - if (materialName.toLowerCase().contains("hastelloy") || + if ( + materialName.toLowerCase().contains("hastelloy") || materialName.toLowerCase().contains("staballoy") || materialName.toLowerCase().contains("tantalloy") || - materialName.toLowerCase().contains("europium")){ + materialName.toLowerCase().contains("europium") || + materialName.toLowerCase().contains("crystal") || + materialName.toLowerCase().contains("zeron") || + materialName.toLowerCase().contains("inconel") + ){ eut = 512; } else { @@ -287,6 +292,16 @@ public class GregtechConduits { UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1), 4*20, eut); + if (eut < 512){ + ItemStack pipePlateDouble = UtilsItems.getItemStackOfAmountFromOreDict("plateDouble"+output, 1).copy(); + UtilsRecipe.recipeBuilder( + pipePlateDouble, "craftingToolHardHammer", pipePlateDouble, + pipePlateDouble, null, pipePlateDouble, + pipePlateDouble, "craftingToolWrench", pipePlateDouble, + UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1)); + } + + } private static ItemStack getOredictStack(String oredictName, int amount){ diff --git a/src/resources/assets/miscutils/textures/items/itemPlateDouble.png b/src/resources/assets/miscutils/textures/items/itemPlateDouble.png Binary files differnew file mode 100644 index 0000000000..edb7970730 --- /dev/null +++ b/src/resources/assets/miscutils/textures/items/itemPlateDouble.png |