diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-07-27 00:26:22 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-07-27 00:26:22 +1000 |
commit | 926af00c0b3da2ba168f578eafb3ed8c7c2d9dba (patch) | |
tree | dc1a749573a9a9cc624671e9c63b785aae4fac40 | |
parent | 28c115270dc90e6b7358cc45b77242ce9cdc0372 (diff) | |
download | GT5-Unofficial-926af00c0b3da2ba168f578eafb3ed8c7c2d9dba.tar.gz GT5-Unofficial-926af00c0b3da2ba168f578eafb3ed8c7c2d9dba.tar.bz2 GT5-Unofficial-926af00c0b3da2ba168f578eafb3ed8c7c2d9dba.zip |
+ Added a Plate Bender Recipe for Staballoy.
+ Added a Blast Furnace Recipe for Staballoy.
+ Added a Vacuum Freezer Recipe for Staballoy.
+ Added Some Raisin Bread for ImQ009.
+ Added a placeholder item for invalid recipes, so that broken recipes show up and hidden/unavailable stuff doesn't.
+ Added a handler for generating ingots & Hot ingots.
% Changed Staballoy to generate from this new ingotHandler.
% Changed getItemStackOfAmountFromOreDict to handle meta, thanks to Greg for pointing that out.
% Changed Matter Fabricator to actually have an output (It was returning 0 previously, thought worked)
- Removed pollution value from the Matter Fabricator.
15 files changed, 436 insertions, 104 deletions
diff --git a/build.gradle b/build.gradle index 81bf88b5c1..1d6e397aeb 100644 --- a/build.gradle +++ b/build.gradle @@ -40,7 +40,7 @@ sourceCompatibility = 1.7 targetCompatibility = 1.7 archivesBaseName = "GT++" -version = "1.4.3.5-Experimental" +version = "1.4.3.6-Experimental" minecraft.version = "1.7.10-10.13.4.1448-1.7.10" task sourceJar(type: Jar) { diff --git a/src/Java/miscutil/core/item/ModItems.java b/src/Java/miscutil/core/item/ModItems.java index 7cfea7fe6d..db6b081fd1 100644 --- a/src/Java/miscutil/core/item/ModItems.java +++ b/src/Java/miscutil/core/item/ModItems.java @@ -6,6 +6,8 @@ import gregtech.api.util.GT_OreDictUnificator; import miscutil.core.creative.AddToCreativeTab; import miscutil.core.item.base.CoreItem; import miscutil.core.item.base.dusts.BaseItemDust; +import miscutil.core.item.base.ingots.BaseItemIngot; +import miscutil.core.item.base.ingots.BaseItemIngotHot; import miscutil.core.item.effects.RarityUncommon; import miscutil.core.item.general.BufferCore; import miscutil.core.item.general.fuelrods.FuelRod_Base; @@ -61,6 +63,8 @@ Gold Tool: 22*/ //public static ToolMaterial TUTORIAL = EnumHelper.addToolMaterial("TUTORIAL", harvestLevel, durability, miningSpeed, damageVsEntities, enchantability); public static ToolMaterial STABALLOY = EnumHelper.addToolMaterial("Staballoy", 3, 2500, 7, 1.0F, 18); + public static Item AAA_Broken; + public static Item itemDebugShapeSpawner; public static Item itemBaseSpawnEgg; @@ -121,9 +125,16 @@ Gold Tool: 22*/ public static Item itemBedLocator_Base; public static Item itemBaseItemWithCharge; + public static Item itemHotIngotStaballoy; + + public static Item itemIngotRaisinBread; + public static Item itemHotIngotRaisinBread; + //@SuppressWarnings("unused") public static final void init(){ + AAA_Broken = new BaseItemIngot("AAA_Broken", "Errors - Tell Alkalus", Utils.rgbtoHexValue(128, 128, 0)); + //Debug Loading if (CORE.DEBUG){ DEBUG_INIT.registerItems(); @@ -264,12 +275,17 @@ Gold Tool: 22*/ GameRegistry.registerItem(itemStaballoyPickaxe, itemStaballoyPickaxe.getUnlocalizedName()); itemStaballoyAxe = new StaballoyAxe("itemStaballoyAxe", STABALLOY).setCreativeTab(AddToCreativeTab.tabTools); GameRegistry.registerItem(itemStaballoyAxe, itemStaballoyAxe.getUnlocalizedName()); + //Staballoy Ingot/Plate - itemIngotStaballoy = new Item().setUnlocalizedName("itemIngotStaballoy").setCreativeTab(tabMisc).setTextureName(CORE.MODID + ":itemIngotStaballoy"); - GameRegistry.registerItem(itemIngotStaballoy, "itemIngotStaballoy"); + itemIngotStaballoy = new BaseItemIngot("itemIngotStaballoy", "Staballoy", Utils.rgbtoHexValue(68, 75, 66)); + GT_OreDictUnificator.registerOre("ingotStaballoy", UtilsItems.getItemStack(CORE.MODID+":itemIngotStaballoy", 1)); itemPlateStaballoy = new Item().setUnlocalizedName("itemPlateStaballoy").setCreativeTab(tabMisc).setTextureName(CORE.MODID + ":itemPlateStaballoy"); GameRegistry.registerItem(itemPlateStaballoy, "itemPlateStaballoy"); - + GT_OreDictUnificator.registerOre("plateStaballoy", UtilsItems.getItemStack(CORE.MODID+":itemPlateStaballoy", 1)); + /*itemIngotStaballoy = new Item().setUnlocalizedName("itemIngotStaballoy").setCreativeTab(tabMisc).setTextureName(CORE.MODID + ":itemIngotStaballoy"); + GameRegistry.registerItem(itemIngotStaballoy, "itemIngotStaballoy"); + */ + //Staballoy Dusts itemDustStaballoy = new BaseItemDust("itemDustStaballoy", "Staballoy", Utils.rgbtoHexValue(68, 75, 66), "Dust").setCreativeTab(tabMisc); @@ -295,6 +311,18 @@ Gold Tool: 22*/ GT_OreDictUnificator.registerOre("dustSmallBloodSteel", UtilsItems.getItemStack(CORE.MODID+":itemDustSmallBloodSteel", 1)); + //Hot Staballoy Ingot + itemHotIngotStaballoy = new BaseItemIngotHot("itemHotIngotStaballoy", "Staballoy", UtilsItems.getItemStack(CORE.MODID+":itemIngotStaballoy", 1)); + GT_OreDictUnificator.registerOre("ingotHotStaballoy", UtilsItems.getItemStack(CORE.MODID+":itemHotIngotStaballoy", 1)); + + //Raisin Bread Ingot + itemIngotRaisinBread = new BaseItemIngot("itemIngotRaisinBread", "Raisin Bread", Utils.rgbtoHexValue(255, 255, 255)); + GT_OreDictUnificator.registerOre("itemIngotRaisinBread", UtilsItems.getItemStack(CORE.MODID+":itemIngotRaisinBread", 1)); + //Hot Raisin Bread Ingot + itemHotIngotRaisinBread = new BaseItemIngotHot("itemHotIngotRaisinBread", "Raisin Bread", UtilsItems.getItemStack(CORE.MODID+":itemIngotStaballoy", 1)); + GT_OreDictUnificator.registerOre("itemHotIngotRaisinBread", UtilsItems.getItemStack(CORE.MODID+":itemHotIngotRaisinBread", 1)); + + //Sandstone Hammer itemSandstoneHammer = new SandstoneHammer("itemSandstoneHammer").setCreativeTab(AddToCreativeTab.tabTools); GameRegistry.registerItem(itemSandstoneHammer, itemSandstoneHammer.getUnlocalizedName()); diff --git a/src/Java/miscutil/core/item/base/ingots/BaseItemIngot.java b/src/Java/miscutil/core/item/base/ingots/BaseItemIngot.java new file mode 100644 index 0000000000..95da94db62 --- /dev/null +++ b/src/Java/miscutil/core/item/base/ingots/BaseItemIngot.java @@ -0,0 +1,78 @@ +package miscutil.core.item.base.ingots; + +import gregtech.api.enums.GT_Values; +import gregtech.api.util.GT_Utility; + +import java.util.List; + +import miscutil.core.creative.AddToCreativeTab; +import miscutil.core.lib.CORE; +import miscutil.core.util.Utils; +import miscutil.core.util.item.UtilsItems; +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 BaseItemIngot extends Item{ + + protected int colour; + protected String materialName; + protected String unlocalName; + + public BaseItemIngot(String unlocalizedName, String materialName, int colour) { + setUnlocalizedName(unlocalizedName); + this.setCreativeTab(AddToCreativeTab.tabMisc); + this.setUnlocalizedName(unlocalizedName); + this.unlocalName = unlocalizedName; + this.setMaxStackSize(64); + if (unlocalizedName.contains("RaisinBread")){ + this.setTextureName(CORE.MODID + ":" + "itemBread"); + } + else { + this.setTextureName(CORE.MODID + ":" + "itemIngot"); + } + this.setMaxStackSize(64); + this.colour = colour; + this.materialName = materialName; + GameRegistry.registerItem(this, unlocalizedName); + addBendingRecipe(); + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { + if (materialName != null && materialName != "" && !materialName.equals("") && !unlocalName.contains("HotIngot") && !unlocalName.toLowerCase().contains("raisinbread")){ + list.add(EnumChatFormatting.GRAY+"A solid ingot of " + materialName + "."); + } + else if (materialName != null && materialName != "" && !materialName.equals("") && unlocalName.toLowerCase().contains("ingothot") && !unlocalName.toLowerCase().contains("raisinbread")){ + list.add(EnumChatFormatting.GRAY+"Warning: Very hot! Avoid direct handling.."); + } + else if (materialName != null && materialName != "" && !materialName.equals("") && !unlocalName.toLowerCase().contains("ingothot") && unlocalName.toLowerCase().contains("raisinbread")){ + list.add(EnumChatFormatting.GRAY+"We all know that " + materialName + " is delicious!"); + } + 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 Utils.generateSingularRandomHexValue(); + } + return colour; + + } + + private void addBendingRecipe(){ + if (!unlocalName.toLowerCase().contains("ingothot") && !unlocalName.toLowerCase().contains("raisinbread")){ + GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(1L, new Object[]{this}), + UtilsItems.getItemStackOfAmountFromOreDict("plate"+materialName, 1), + 1200, 24); + } + } + +} diff --git a/src/Java/miscutil/core/item/base/ingots/BaseItemIngotHot.java b/src/Java/miscutil/core/item/base/ingots/BaseItemIngotHot.java new file mode 100644 index 0000000000..89ceebe922 --- /dev/null +++ b/src/Java/miscutil/core/item/base/ingots/BaseItemIngotHot.java @@ -0,0 +1,42 @@ +package miscutil.core.item.base.ingots; + +import gregtech.api.enums.GT_Values; +import gregtech.api.util.GT_Utility; + +import java.util.List; + +import miscutil.core.lib.CORE; +import miscutil.core.util.Utils; +import miscutil.core.util.UtilsText; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; + +public class BaseItemIngotHot extends BaseItemIngot{ + + private ItemStack outputIngot; + + public BaseItemIngotHot(String unlocalizedName, String materialName, ItemStack coldIngot) { + super(unlocalizedName, materialName, Utils.rgbtoHexValue(225, 225, 225)); + this.setTextureName(CORE.MODID + ":" + "itemIngotHot"); + this.outputIngot = coldIngot; + generateRecipe(); + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { + if (materialName != null && materialName != "" && !materialName.equals("")){ + list.add(EnumChatFormatting.GRAY+"A "+UtilsText.red.colour()+"burning hot"+UtilsText.lightGray.colour()+" ingot of " + materialName + "."); + } + super.addInformation(stack, aPlayer, list, bool); + } + + @Override + public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { + return Utils.rgbtoHexValue(225, 225, 225); + } + + private void generateRecipe(){ + GT_Values.RA.addVacuumFreezerRecipe(GT_Utility.copyAmount(1L, new Object[]{this}), GT_Utility.copyAmount(1L, new Object[]{outputIngot}), 500); + } +} diff --git a/src/Java/miscutil/core/recipe/RECIPES_GREGTECH.java b/src/Java/miscutil/core/recipe/RECIPES_GREGTECH.java index 2529dc60b1..cb963c1b23 100644 --- a/src/Java/miscutil/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/miscutil/core/recipe/RECIPES_GREGTECH.java @@ -30,6 +30,8 @@ public class RECIPES_GREGTECH { extractorRecipes(); addFuels(); blastFurnaceRecipes(); + vacuumFreezerRecipes(); + benderRecipes(); } private static void cokeOvenRecipes(){ @@ -88,7 +90,7 @@ public class RECIPES_GREGTECH { 120); //EU }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");} } - + private static void matterFabRecipes(){ Utils.LOG_INFO("Loading Recipes for Matter Fabricator."); @@ -116,13 +118,13 @@ public class RECIPES_GREGTECH { //GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 6L), ItemList.Casing_Turbine.get(1L, new Object[0]), ItemList.Casing_Turbine3.get(1L, new Object[0]), 50, 16); } - + 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", 20000), FluidUtils.getFluidStack("helium", 1), 400, 30, false); GT_Values.RA.addDistillationTowerRecipe(FluidUtils.getFluidStack("air", 20000), FluidUtils.getFluidStackArray("helium", 1), null, 160, 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); @@ -130,61 +132,78 @@ public class RECIPES_GREGTECH { GT_Values.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketHootch", 0, 1), null, 36, 0); //System.exit(1); } - + private static void mixerRecipes(){ Utils.LOG_INFO("Registering Mixer Recipes."); GT_Values.RA.addMixerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Uranium, 8L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Titanium, 1L), null, null, GT_Values.NF, GT_Values.NF, UtilsItems.getSimpleStack(ModItems.itemDustStaballoy, 2), 32, 8); GT_Values.RA.addMixerRecipe(GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Uranium, 8L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Titanium, 1L), null, null, GT_Values.NF, GT_Values.NF, UtilsItems.getSimpleStack(ModItems.itemDustSmallStaballoy, 2), 32, 8); GT_Values.RA.addMixerRecipe(GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Uranium, 8L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Titanium, 1L), null, null, GT_Values.NF, GT_Values.NF, UtilsItems.getSimpleStack(ModItems.itemDustTinyStaballoy, 2), 32, 8); } - + private static void extractorRecipes(){ Utils.LOG_INFO("Registering Extractor Recipes."); - GT_ModHandler.addExtractionRecipe(GregtechItemList.Battery_RE_EV_Sodium.get(1L, new Object[0]), ItemList.Battery_Hull_HV.get(4L, new Object[0])); - GT_ModHandler.addExtractionRecipe(GregtechItemList.Battery_RE_EV_Cadmium.get(1L, new Object[0]), ItemList.Battery_Hull_HV.get(4L, new Object[0])); - GT_ModHandler.addExtractionRecipe(GregtechItemList.Battery_RE_EV_Lithium.get(1L, new Object[0]), ItemList.Battery_Hull_HV.get(4L, new Object[0])); + GT_ModHandler.addExtractionRecipe(GregtechItemList.Battery_RE_EV_Sodium.get(1L, new Object[0]), ItemList.Battery_Hull_HV.get(4L, new Object[0])); + GT_ModHandler.addExtractionRecipe(GregtechItemList.Battery_RE_EV_Cadmium.get(1L, new Object[0]), ItemList.Battery_Hull_HV.get(4L, new Object[0])); + GT_ModHandler.addExtractionRecipe(GregtechItemList.Battery_RE_EV_Lithium.get(1L, new Object[0]), ItemList.Battery_Hull_HV.get(4L, new Object[0])); } - + 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)}); } - + private static void blastFurnaceRecipes(){ Utils.LOG_INFO("Registering Blast Furnace Recipes."); - + if (!CORE.disableStaballoyBlastFurnaceRecipe){ - GT_Values.RA.addBlastRecipe( - UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 11028, 1), - UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 11098, 1), - GT_Values.NF, GT_Values.NF, - UtilsItems.getSimpleStack(ModItems.itemIngotStaballoy, 1), - GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Titanium, 1L), - (int) Math.max(GT_Materials.Staballoy.getMass() / 80L, 1L) * GT_Materials.Staballoy.mBlastFurnaceTemp, - 1000, GT_Materials.Staballoy.mBlastFurnaceTemp); - GT_Values.RA.addBlastRecipe( - UtilsItems.getSimpleStack(ModItems.itemDustStaballoy, 1), - null, - GT_Values.NF, GT_Values.NF, - UtilsItems.getSimpleStack(ModItems.itemIngotStaballoy, 1), - GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Titanium, 1L), - (int) Math.max(GT_Materials.Staballoy.getMass() / 80L, 1L) * GT_Materials.Staballoy.mBlastFurnaceTemp, - 2000, GT_Materials.Staballoy.mBlastFurnaceTemp); - GT_Values.RA.addBlastRecipe( - UtilsItems.getSimpleStack(ModItems.itemDustSmallStaballoy, 4), - null, - GT_Values.NF, GT_Values.NF, - UtilsItems.getSimpleStack(ModItems.itemIngotStaballoy, 1), - GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Titanium, 1L), - (int) Math.max(GT_Materials.Staballoy.getMass() / 80L, 1L) * GT_Materials.Staballoy.mBlastFurnaceTemp, - 2000, GT_Materials.Staballoy.mBlastFurnaceTemp); - GT_Values.RA.addBlastRecipe( - UtilsItems.getSimpleStack(ModItems.itemDustTinyStaballoy, 9), - null, - GT_Values.NF, GT_Values.NF, + GT_Values.RA.addBlastRecipe( + UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 11028, 1), + UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 11098, 1), + GT_Values.NF, GT_Values.NF, + UtilsItems.getSimpleStack(ModItems.itemHotIngotStaballoy, 1), + GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Titanium, 1L), + (int) Math.max(GT_Materials.Staballoy.getMass() / 80L, 1L) * GT_Materials.Staballoy.mBlastFurnaceTemp, + 1000, GT_Materials.Staballoy.mBlastFurnaceTemp); + GT_Values.RA.addBlastRecipe( + UtilsItems.getSimpleStack(ModItems.itemDustStaballoy, 1), + null, + GT_Values.NF, GT_Values.NF, + UtilsItems.getSimpleStack(ModItems.itemHotIngotStaballoy, 1), + GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Titanium, 1L), + (int) Math.max(GT_Materials.Staballoy.getMass() / 80L, 1L) * GT_Materials.Staballoy.mBlastFurnaceTemp, + 2000, GT_Materials.Staballoy.mBlastFurnaceTemp); + GT_Values.RA.addBlastRecipe( + UtilsItems.getSimpleStack(ModItems.itemDustSmallStaballoy, 4), + null, + GT_Values.NF, GT_Values.NF, + UtilsItems.getSimpleStack(ModItems.itemHotIngotStaballoy, 1), + GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Titanium, 1L), + (int) Math.max(GT_Materials.Staballoy.getMass() / 80L, 1L) * GT_Materials.Staballoy.mBlastFurnaceTemp, + 2000, GT_Materials.Staballoy.mBlastFurnaceTemp); + GT_Values.RA.addBlastRecipe( + UtilsItems.getSimpleStack(ModItems.itemDustTinyStaballoy, 9), + null, + GT_Values.NF, GT_Values.NF, + UtilsItems.getSimpleStack(ModItems.itemHotIngotStaballoy, 1), + GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Titanium, 1L), + (int) Math.max(GT_Materials.Staballoy.getMass() / 80L, 1L) * GT_Materials.Staballoy.mBlastFurnaceTemp, + 2000, GT_Materials.Staballoy.mBlastFurnaceTemp); + } + } + + private static void vacuumFreezerRecipes(){ + + GT_Values.RA.addVacuumFreezerRecipe( + UtilsItems.getSimpleStack(ModItems.itemHotIngotStaballoy, 1), UtilsItems.getSimpleStack(ModItems.itemIngotStaballoy, 1), - GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Titanium, 1L), - (int) Math.max(GT_Materials.Staballoy.getMass() / 80L, 1L) * GT_Materials.Staballoy.mBlastFurnaceTemp, - 2000, GT_Materials.Staballoy.mBlastFurnaceTemp); + 2000); + } + + private static void benderRecipes(){ + GT_Values.RA.addBenderRecipe( + UtilsItems.getSimpleStack(ModItems.itemIngotStaballoy, 1), + UtilsItems.getSimpleStack(ModItems.itemPlateStaballoy, 1), + 400, + 48); } }
\ No newline at end of file diff --git a/src/Java/miscutil/core/util/Utils.java b/src/Java/miscutil/core/util/Utils.java index 026e86ef48..8f6a988a27 100644 --- a/src/Java/miscutil/core/util/Utils.java +++ b/src/Java/miscutil/core/util/Utils.java @@ -119,28 +119,28 @@ public class Utils { //Non-Dev Comments public static void LOG_INFO(String s){ //if (CORE.DEBUG){ - FMLLog.info("MiscUtils: "+s); + FMLLog.info("GT++: "+s); //} } //Developer Comments public static void LOG_WARNING(String s){ if (CORE.DEBUG){ - FMLLog.warning("MiscUtils: "+s); + FMLLog.warning("GT++: "+s); } } //Errors public static void LOG_ERROR(String s){ if (CORE.DEBUG){ - FMLLog.severe("MiscUtils: "+s); + FMLLog.severe("GT++: "+s); } } //Developer Logger public static void LOG_SPECIFIC_WARNING(String whatToLog, String msg, int line){ if (CORE.DEBUG){ - FMLLog.warning("MiscUtils |"+line+"| "+whatToLog+" | "+msg); + FMLLog.warning("GT++ |"+line+"| "+whatToLog+" | "+msg); } } diff --git a/src/Java/miscutil/core/util/UtilsText.java b/src/Java/miscutil/core/util/UtilsText.java new file mode 100644 index 0000000000..79f2b4d4ac --- /dev/null +++ b/src/Java/miscutil/core/util/UtilsText.java @@ -0,0 +1,32 @@ +package miscutil.core.util; + +public enum UtilsText { + + blue('1'), + green('2'), + teal('3'), + maroon('4'), + purple('5'), + orange('6'), + lightGray('7'), + darkGray('8'), + lightBlue('9'), + black('0'), + lime('a'), + aqua('b'), + red('c'), + pink('d'), + yellow('e'), + white('f'); + + private char colourValue; + private UtilsText (char value) + { + this.colourValue = value; + } + + public String colour() { + return "§"+colourValue; + } + +} diff --git a/src/Java/miscutil/core/util/item/UtilsItems.java b/src/Java/miscutil/core/util/item/UtilsItems.java index f8bf9fc029..bda8849768 100644 --- a/src/Java/miscutil/core/util/item/UtilsItems.java +++ b/src/Java/miscutil/core/util/item/UtilsItems.java @@ -4,6 +4,7 @@ import gregtech.api.util.GT_OreDictUnificator; import java.util.ArrayList; +import miscutil.core.item.ModItems; import miscutil.core.item.base.BasicSpawnEgg; import miscutil.core.lib.CORE; import miscutil.core.lib.LoadedMods; @@ -44,7 +45,7 @@ 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); @@ -100,49 +101,49 @@ public class UtilsItems { } 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; - } + try { + Item em = null; + Item em1 = getItem(FQRN); + Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta); + if (em1 != null){ + if (null == em){ + em = em1; } - return null; - } catch (NullPointerException e) { - Utils.LOG_ERROR(FQRN+" not found. [NULL]"); - return null; - } + 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; - } + try { + Item em = item; + Item em1 = item; + Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta); + if (em1 != null){ + if (null == em){ + em = em1; } - return null; - } catch (NullPointerException e) { - Utils.LOG_ERROR(item.getUnlocalizedName()+" not found. [NULL]"); - return null; - } + 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){ @@ -158,7 +159,7 @@ public class UtilsItems { 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); @@ -207,7 +208,7 @@ public class UtilsItems { 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"); GameRegistry.registerItem(itemSpawnEgg, "spawnEgg"+parSpawnName); @@ -215,9 +216,12 @@ public class UtilsItems { public static ItemStack getItemStackOfAmountFromOreDict(String oredictName, int amount){ ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName); - ItemStack temp = oreDictList.get(0); - ItemStack returnValue = new ItemStack(temp.getItem(), amount); + if (!oreDictList.isEmpty()){ + ItemStack returnValue = oreDictList.get(0).copy(); + returnValue.stackSize = amount; return returnValue; + } + return getSimpleStack(ModItems.AAA_Broken, amount); } - + } diff --git a/src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java index acb317401d..f483cc02f4 100644 --- a/src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java +++ b/src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java @@ -116,8 +116,8 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { } GregtechItemList.Circuit_IV.set(addItem(tLastID = 704, "Symbiotic Circuit (IV)", "A Symbiotic Data Processor", new Object[]{GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic)})); - GregtechItemList.Circuit_LuV.set(addItem(tLastID = 705, "Neutronic Circuit (LuV)", "A Neutron Particle Processor", new Object[]{OrePrefixes.circuit.get(GT_Materials.Neutronic)})); - GregtechItemList.Circuit_ZPM.set(addItem(tLastID = 706, "Quantum Circuit (ZPM)", "A Singlularity Processor", new Object[]{OrePrefixes.circuit.get(GT_Materials.Quantum)})); + GregtechItemList.Circuit_LuV.set(addItem(tLastID = 705, "Neutronic Circuit (LuV)", "A Neutron Particle Processor", new Object[]{GregtechOrePrefixes.circuit.get(GT_Materials.Neutronic)})); + GregtechItemList.Circuit_ZPM.set(addItem(tLastID = 706, "Quantum Circuit (ZPM)", "A Singlularity Processor", new Object[]{GregtechOrePrefixes.circuit.get(GT_Materials.Quantum)})); GregtechItemList.Circuit_Board_IV.set(addItem(tLastID = 710, "IV Circuit Board", "An IV Voltage Rated Circuit Board", new Object[0])); GregtechItemList.Circuit_Board_LuV.set(addItem(tLastID = 711, "LuV Circuit Board", "An LuV Voltage Rated Circuit Board", new Object[0])); GregtechItemList.Circuit_Board_ZPM.set(addItem(tLastID = 712, "ZPM Processor Board", "A ZPM Voltage Rated Processor Board", new Object[0])); diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java index 177769092d..7e2c552eed 100644 --- a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java +++ b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java @@ -9,10 +9,9 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; import java.util.ArrayList; -import java.util.Arrays; +import java.util.List; import miscutil.core.block.ModBlocks; import miscutil.core.lib.CORE; @@ -27,6 +26,8 @@ import net.minecraft.server.MinecraftServer; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.ArrayUtils; + public class GregtechMetaTileEntityIndustrialCentrifuge extends GregtechMeta_MultiBlockBase { private static boolean controller; @@ -76,14 +77,14 @@ extends GregtechMeta_MultiBlockBase { "Centrifuge Casings for the rest (16 at least)",}; } - + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? frontFaceActive : frontFace : Textures.BlockIcons.CASING_BLOCKS[57]}; } - - + + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "IndustrialCentrifuge.png"); @@ -104,6 +105,130 @@ extends GregtechMeta_MultiBlockBase { @Override public boolean checkRecipe(ItemStack aStack) { + /*if (!isCorrectMachinePart(mInventory[1])) { + return false; + }*/ + GT_Recipe.GT_Recipe_Map map = getRecipeMap(); + if (map == null) { + return false; + } + ArrayList<ItemStack> tInputList = getStoredInputs(); + int tTier = 0; + if (mInventory[1].getUnlocalizedName().endsWith("1")) { + tTier = 1; + } + if (mInventory[1].getUnlocalizedName().endsWith("2")) { + tTier = 2; + } + if (mInventory[1].getUnlocalizedName().endsWith("3")) { + tTier = 3; + } + if (mInventory[1].getUnlocalizedName().endsWith("4")) { + tTier = 4; + } + if (mInventory[1].getUnlocalizedName().endsWith("5")) { + tTier = 5; + } + if (mInventory[1].getUnlocalizedName().endsWith("6")) { + tTier = 6; + } + if (mInventory[1].getUnlocalizedName().endsWith("7")) { + tTier = 7; + } + if (mInventory[1].getUnlocalizedName().endsWith("8")) { + tTier = 8; + } + ItemStack[] tInputs = (ItemStack[]) tInputList.toArray(new ItemStack[tInputList.size()]); + ArrayList<FluidStack> tFluidList = getStoredFluids(); + FluidStack[] tFluids = (FluidStack[]) tFluidList.toArray(new FluidStack[tFluidList.size()]); + if (tInputList.size() > 0 || tFluids.length > 0) { + GT_Recipe tRecipe = map.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + if (tRecipe != null) { + mLastRecipe = tRecipe; + this.mEUt = 0; + this.mOutputItems = null; + this.mOutputFluids = null; + int machines = Math.min(16, mInventory[1].stackSize); + int i = 0; + for (; i < machines; i++) { + if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { + if (i == 0) { + return false; + } + break; + } + } + this.mMaxProgresstime = tRecipe.mDuration; + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + if (tRecipe.mEUt <= 16) { + this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1)); + } else { + this.mEUt = tRecipe.mEUt; + this.mMaxProgresstime = tRecipe.mDuration; + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { + this.mEUt *= 4; + this.mMaxProgresstime /= 2; + } + } + this.mEUt *= i; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length]; + for (int h = 0; h < tRecipe.mOutputs.length; h++) { + tOut[h] = tRecipe.getOutput(h).copy(); + tOut[h].stackSize = 0; + } + FluidStack tFOut = null; + if (tRecipe.getFluidOutput(0) != null) tFOut = tRecipe.getFluidOutput(0).copy(); + for (int f = 0; f < tOut.length; f++) { + if (tRecipe.mOutputs[f] != null && tOut[f] != null) { + for (int g = 0; g < i; g++) { + if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) + tOut[f].stackSize += tRecipe.mOutputs[f].stackSize; + } + } + } + if (tFOut != null) { + int tSize = tFOut.amount; + tFOut.amount = tSize * i; + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + List<ItemStack> overStacks = new ArrayList<ItemStack>(); + for (int f = 0; f < tOut.length; f++) { + if (tOut[f].getMaxStackSize() < tOut[f].stackSize) { + while (tOut[f].getMaxStackSize() < tOut[f].stackSize) { + ItemStack tmp = tOut[f].copy(); + tmp.stackSize = tmp.getMaxStackSize(); + tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize(); + overStacks.add(tmp); + } + } + } + if (overStacks.size() > 0) { + ItemStack[] tmp = new ItemStack[overStacks.size()]; + tmp = overStacks.toArray(tmp); + tOut = ArrayUtils.addAll(tOut, tmp); + } + List<ItemStack> tSList = new ArrayList<ItemStack>(); + for (ItemStack tS : tOut) { + if (tS.stackSize > 0) tSList.add(tS); + } + tOut = tSList.toArray(new ItemStack[tSList.size()]); + this.mOutputItems = tOut; + this.mOutputFluids = new FluidStack[]{tFOut}; + updateSlots(); + Utils.LOG_WARNING("Centrifuge: True"); + return true; + } + } + Utils.LOG_WARNING("Centrifuge: False"); + return false; + } + + /*public boolean checkRecipe(ItemStack aStack) { ArrayList<ItemStack> tInputList = getStoredInputs(); Utils.LOG_WARNING("Stored Input Items: "+tInputList.size()); for (int i = 0; i < tInputList.size() - 1; i++) { @@ -170,7 +295,7 @@ extends GregtechMeta_MultiBlockBase { } Utils.LOG_WARNING("Centrifuge: False"); return false; - } + }*/ @SuppressWarnings("static-method") public Block getCasingBlock() { @@ -192,7 +317,7 @@ extends GregtechMeta_MultiBlockBase { if (CORE.disableCentrifugeFormation){ EntityPlayerMP player = MinecraftServer.getServer().getConfigurationManager().func_152612_a(this.getBaseMetaTileEntity().getOwnerName()); if (!player.getEntityWorld().isRemote && isDisabled == false) - Utils.messagePlayer(player, "This Multiblock is disabled via the config. [Only re-enable if you're bugtesting.]"); + Utils.messagePlayer(player, "This Multiblock is disabled via the config. [Only re-enable if you're bugtesting.]"); isDisabled = true; return false; } @@ -272,5 +397,5 @@ extends GregtechMeta_MultiBlockBase { public boolean explodesOnComponentBreak(ItemStack aStack) { return false; } - + }
\ No newline at end of file diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java index 67b204c1a6..92d8d23372 100644 --- a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java +++ b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java @@ -276,7 +276,7 @@ public class GregtechMetaTileEntityMassFabricator extends GT_MetaTileEntity_Mult @Override public int getPollutionPerTick(ItemStack aStack) { - return 20; + return 0; } @Override @@ -286,7 +286,7 @@ public class GregtechMetaTileEntityMassFabricator extends GT_MetaTileEntity_Mult @Override public int getAmountOfOutputs() { - return 0; + return 1; } @Override diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index e7f09d3d9a..791c0dd576 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -139,3 +139,7 @@ item.itemDustBloodSteel.name=BloodSteel Dust item.itemDustSmallBloodSteel.name=Small pile of BloodSteel Dust item.itemDustTinyBloodSteel.name=Tiny pile of BloodSteel Dust +item.itemHotIngotStaballoy.name=Hot Staballoy Ingot +item.itemHotIngotRaisinBread.name= Hot Loaf of Raisin Bread +item.AAA_Broken.name=[Non-existent Item] Report This Recipe On Github, Please. +item.itemIngotRaisinBread.name=§5ImQ009's §fRaisin Bread
\ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/items/itemBread.png b/src/resources/assets/miscutils/textures/items/itemBread.png Binary files differnew file mode 100644 index 0000000000..e2b05916a5 --- /dev/null +++ b/src/resources/assets/miscutils/textures/items/itemBread.png diff --git a/src/resources/assets/miscutils/textures/items/itemIngot.png b/src/resources/assets/miscutils/textures/items/itemIngot.png Binary files differnew file mode 100644 index 0000000000..685dbcbfd8 --- /dev/null +++ b/src/resources/assets/miscutils/textures/items/itemIngot.png diff --git a/src/resources/assets/miscutils/textures/items/itemIngotHot.png b/src/resources/assets/miscutils/textures/items/itemIngotHot.png Binary files differnew file mode 100644 index 0000000000..a0d2e6162a --- /dev/null +++ b/src/resources/assets/miscutils/textures/items/itemIngotHot.png |