From 64ee916e758e62399e0d4392a0f5a416a172544f Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Sat, 20 Apr 2019 00:34:55 +0800 Subject: update translation --- src/resources/assets/gregtech/lang/zh_CN.lang | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/resources/assets/gregtech/lang') diff --git a/src/resources/assets/gregtech/lang/zh_CN.lang b/src/resources/assets/gregtech/lang/zh_CN.lang index 750961610a..dddc9a7b43 100644 --- a/src/resources/assets/gregtech/lang/zh_CN.lang +++ b/src/resources/assets/gregtech/lang/zh_CN.lang @@ -46,7 +46,12 @@ GTPP.nanohealer.tooltip.4=不会阻止死亡 GTPP.nanohealer.tooltip.5=Shift+右键来切换信息 GTPP.nanohealer.hidden=隐藏信息? - +//10/4/19 +//Tooltips for the Mob Killing Baubles +GTPP.monsterkiller.tooltip.1=在Baubles的护身符栏内使用 +GTPP.monsterkiller.tooltip.2=排泄 +GTPP.monsterkiller.tooltip.3=每击杀 +GTPP.monsterkiller.tooltip.4=目标类型: @@ -190,4 +195,4 @@ achievement.decay.technetium99.desc=回旋加速器产品 -//This zh_CN.lang is translation by huajijam for GregTech++ (18/2/19) \ No newline at end of file +//This zh_CN.lang is translation by huajijam for GregTech++ (20/4/19) \ No newline at end of file -- cgit From f3b1d965f5b7eebfa0ca4c1673a15f9b3ed66169 Mon Sep 17 00:00:00 2001 From: ‭huajijam Date: Sat, 20 Apr 2019 00:46:14 +0800 Subject: fix a simple bug that i have never mind --- src/resources/assets/gregtech/lang/zh_CN.lang | 2 +- src/resources/assets/miscutils/lang/zh_CN.lang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/resources/assets/gregtech/lang') diff --git a/src/resources/assets/gregtech/lang/zh_CN.lang b/src/resources/assets/gregtech/lang/zh_CN.lang index dddc9a7b43..d398cfd6b2 100644 --- a/src/resources/assets/gregtech/lang/zh_CN.lang +++ b/src/resources/assets/gregtech/lang/zh_CN.lang @@ -195,4 +195,4 @@ achievement.decay.technetium99.desc=回旋加速器产品 -//This zh_CN.lang is translation by huajijam for GregTech++ (20/4/19) \ No newline at end of file +//This zh_CN.lang is translated by huajijam for GregTech++ (20/4/19) \ No newline at end of file diff --git a/src/resources/assets/miscutils/lang/zh_CN.lang b/src/resources/assets/miscutils/lang/zh_CN.lang index 07a9652388..8752bc5d40 100644 --- a/src/resources/assets/miscutils/lang/zh_CN.lang +++ b/src/resources/assets/miscutils/lang/zh_CN.lang @@ -2872,4 +2872,4 @@ item.itemGearwhiteMetal.name=白物质齿轮 item.itemCellwhiteMetal.name=白物质单元 tile.Block of white Metal.name=白物质块 tile.white Metal Frame Box.name=白物质框架 -//This zh_CN.lang is translation by huajijam for GregTech++ (20/4/19) \ No newline at end of file +//This zh_CN.lang is translated by huajijam for GregTech++ (20/4/19) \ No newline at end of file -- cgit From 828d9f0f8256f39d976f5ce6aedd6cb3b9cf560e Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sat, 17 Aug 2019 19:11:38 +0100 Subject: + Added Air consumption to the LRE. % Made the LRE longer. (10, up from 4) % Greatly improved NEI handling for decayables. $ Improved logic of LRE. $ Fixed NEI crash. $ Fixed bug in underlying GT code causing depleteInput to return false wrongly. --- .../core/item/chemistry/RocketFuels.java | 177 +++--- .../gtPlusPlus/nei/DecayableRecipeHandler.java | 151 ++++- .../gtPlusPlus/nei/handlers/NeiTextureHandler.java | 85 +++ .../base/GregtechMeta_MultiBlockBase.java | 72 ++- .../GregtechMetaTileEntity_Cyclotron.java | 1 + .../GregtechMetaTileEntity_LargeRocketEngine.java | 684 +++++++++++++-------- .../gregtech/GregtechRocketFuelGenerator.java | 2 +- src/resources/assets/gregtech/lang/en_US.lang | 59 +- src/resources/assets/miscutils/lang/en_US.lang | 3 +- .../miscutils/textures/gui/nei/decayables.png | Bin 0 -> 2623 bytes .../assets/miscutils/textures/gui/nei/widgets.png | Bin 0 -> 1876 bytes 11 files changed, 852 insertions(+), 382 deletions(-) create mode 100644 src/Java/gtPlusPlus/nei/handlers/NeiTextureHandler.java create mode 100644 src/resources/assets/miscutils/textures/gui/nei/decayables.png create mode 100644 src/resources/assets/miscutils/textures/gui/nei/widgets.png (limited to 'src/resources/assets/gregtech/lang') diff --git a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java index 7ade6d0371..c02e767dcd 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java @@ -25,7 +25,7 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; public class RocketFuels extends ItemPackage { - + public static HashSet mValidRocketFuelNames = new HashSet(); public static HashMap mValidRocketFuels = new HashMap(); @@ -52,16 +52,16 @@ public class RocketFuels extends ItemPackage { public static Item Ammonium_Nitrate_Dust; public static Item Formaldehyde_Catalyst; - + public static void createKerosene(){ - - - + + + FluidStack fuelA = FluidUtils.getFluidStack("diesel", 300); FluidStack fuelB = FluidUtils.getFluidStack("fuel", 300); - - - + + + if (fuelA != null){ //GT_Values.RA.addDistilleryRecipe(23, fuelA, FluidUtils.getFluidStack(Kerosene, 50), 200, 64, false); GT_Values.RA.addDistilleryRecipe(CI.getNumberedCircuit(23), fuelA, FluidUtils.getFluidStack(Kerosene, 100), 200, 64, false); @@ -135,7 +135,11 @@ public class RocketFuels extends ItemPackage { private static void createLOX() { GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1), ItemUtils.getItemStackOfAmountFromOreDict("cellLiquidOxygen", 1), 20*16); CORE.RA.addAdvancedFreezerRecipe(new ItemStack[] {}, new FluidStack[] {FluidUtils.getFluidStack("oxygen", 3000)}, new FluidStack[] {FluidUtils.getFluidStack(Liquid_Oxygen, 3000)}, new ItemStack[] {}, new int[] {}, 20*16, 240, 0); + } + private static void createLOH() { + GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), ItemUtils.getItemStackOfAmountFromOreDict("cellLiquidhydrogen", 1), 20*16); + CORE.RA.addAdvancedFreezerRecipe(new ItemStack[] {}, new FluidStack[] {FluidUtils.getFluidStack("hydrogen", 300)}, new FluidStack[] {FluidUtils.getFluidStack(Liquid_Hydrogen, 300)}, new ItemStack[] {}, new int[] {}, 20*4, 540, 0); } private static void createHydratedAmmoniumNitrateSlurry() { @@ -214,7 +218,7 @@ public class RocketFuels extends ItemPackage { 0, 0, 256)); //Fuel Value - + mRocketFuels.put(1, new Recipe_GT( true, new ItemStack[] {}, @@ -226,7 +230,7 @@ public class RocketFuels extends ItemPackage { 0, 0, 512)); //Fuel Value - + mRocketFuels.put(2, new Recipe_GT( true, new ItemStack[] {}, @@ -238,7 +242,7 @@ public class RocketFuels extends ItemPackage { 0, 0, 768)); //Fuel Value - + mRocketFuels.put(3, new Recipe_GT( true, new ItemStack[] {}, @@ -250,8 +254,8 @@ public class RocketFuels extends ItemPackage { 0, 0, 1024)); //Fuel Value - - + + //Add in default Diesel for the Buggy mValidRocketFuels.put(-1, Diesel); @@ -349,7 +353,7 @@ public class RocketFuels extends ItemPackage { 20*48, 480); } - + GT_Values.RA.addCentrifugeRecipe( CI.getNumberedCircuit(23), @@ -430,6 +434,7 @@ public class RocketFuels extends ItemPackage { if (!CORE.GTNH) { createLOX(); } + createLOH(); createHydratedAmmoniumNitrateSlurry(); @@ -440,18 +445,18 @@ public class RocketFuels extends ItemPackage { createRocketFuels(); addRocketFuelsToMap(); - + return true; } @Override public boolean onLoadComplete(FMLLoadCompleteEvent event) { - + if (MathUtils.randInt(1, 2) > 0) { return false; } - + Materials aMaterial_Chloramine = MaterialUtils.getMaterial("Chloramine"); Materials aMaterial_Dimethylamine = MaterialUtils.getMaterial("Dimethylamine"); @@ -459,19 +464,19 @@ public class RocketFuels extends ItemPackage { Materials aMaterial_NitrogenDioxide = MaterialUtils.getMaterial("NitrogenDioxide"); Materials aMaterial_DinitrogenTetroxide = MaterialUtils.getMaterial("DinitrogenTetroxide"); Materials aMaterial_Dimethylhydrazine = MaterialUtils.getMaterial("Dimethylhydrazine"); - + Materials aMaterial_Oxygen = Materials.Oxygen; Materials aMaterial_Water = Materials.Water; Materials aMaterial_HypochlorousAcid = MaterialUtils.getMaterial("HypochlorousAcid"); Materials aMaterial_Ammonia = MaterialUtils.getMaterial("Ammonia"); Materials aMaterial_Methanol = MaterialUtils.getMaterial("Methanol"); - + if (aMaterial_Chloramine == null || aMaterial_Dimethylamine == null || aMaterial_DilutedHydrochloricAcid == null || aMaterial_Dimethylhydrazine == null || aMaterial_NitrogenDioxide == null || aMaterial_DinitrogenTetroxide == null || aMaterial_HypochlorousAcid == null || aMaterial_Ammonia == null || aMaterial_Methanol == null) { return false; } - + ItemStack aCellEmpty = CI.emptyCells(1); ItemStack aCellWater = aMaterial_Water.getCells(1); @@ -482,10 +487,10 @@ public class RocketFuels extends ItemPackage { ItemStack aCellNitrogenDioxide = aMaterial_NitrogenDioxide.getCells(1); ItemStack aCellDinitrogenTetroxide = aMaterial_DinitrogenTetroxide.getCells(1); ItemStack aCellDimethylhydrazine = aMaterial_Dimethylhydrazine.getCells(1); - - - - + + + + GT_Recipe aChemReactor_1 = new Recipe_GT( @@ -511,10 +516,10 @@ public class RocketFuels extends ItemPackage { 0, //Dura 0, //Eu 0); //Special - - - - + + + + GT_Recipe aChemReactor_Basic_1 = new Recipe_GT( true, //Optimise new ItemStack[] {}, //I @@ -562,18 +567,18 @@ public class RocketFuels extends ItemPackage { 0, //Dura 0, //Eu 0); //Special - - - - - - - - - - - - + + + + + + + + + + + + GT_Recipe aChemReactor_Adv_1 = new Recipe_GT( true, //Optimise @@ -599,26 +604,26 @@ public class RocketFuels extends ItemPackage { 0, //Eu 0); //Special - - + + //RecipeUtils.removeGtRecipe(aChemReactor_Basic_1, GT_Recipe.GT_Recipe_Map.sChemicalRecipes); //RecipeUtils.removeGtRecipe(aChemReactor_Basic_1, GT_Recipe.GT_Recipe_Map.sChemicalRecipes); //RecipeUtils.removeGtRecipe(aChemReactor_Basic_1, GT_Recipe.GT_Recipe_Map.sChemicalRecipes); //RecipeUtils.removeGtRecipe(aChemReactor_Basic_1, GT_Recipe.GT_Recipe_Map.sChemicalRecipes); - - - - - - /* GT_Values.RA.addChemicalRecipe( Materials.Chloramine.getCells(2), GT_Utility.getIntegratedCircuit(1), Materials.Dimethylamine.getGas(5000), Materials.Dimethylhydrazine.getFluid(6000), Materials.DilutedHydrochloricAcid.getCells(1), Materials.Empty.getCells(1), 960, 480); + + + + + + /* GT_Values.RA.addChemicalRecipe( Materials.Chloramine.getCells(2), GT_Utility.getIntegratedCircuit(1), Materials.Dimethylamine.getGas(5000), Materials.Dimethylhydrazine.getFluid(6000), Materials.DilutedHydrochloricAcid.getCells(1), Materials.Empty.getCells(1), 960, 480); GT_Values.RA.addChemicalRecipe( Materials.Dimethylamine.getCells(5), GT_Utility.getIntegratedCircuit(1), Materials.Chloramine.getFluid(2000), Materials.Dimethylhydrazine.getFluid(6000), Materials.DilutedHydrochloricAcid.getCells(1), Materials.Empty.getCells(4), 960, 480); GT_Values.RA.addChemicalRecipeForBasicMachineOnly(Materials.Chloramine.getCells(2), Materials.Empty.getCells(4), Materials.Dimethylamine.getGas(5000), Materials.DilutedHydrochloricAcid.getFluid(1000), Materials.Dimethylhydrazine.getCells(6), GT_Values.NI, 960, 480); GT_Values.RA.addChemicalRecipeForBasicMachineOnly(Materials.Dimethylamine.getCells(5), Materials.Empty.getCells(1), Materials.Chloramine.getFluid(2000), Materials.DilutedHydrochloricAcid.getFluid(1000), Materials.Dimethylhydrazine.getCells(6), GT_Values.NI, 960, 480); GT_Values.RA.addChemicalRecipeForBasicMachineOnly(Materials.Dimethylamine.getCells(5), Materials.Chloramine.getCells(2), Materials.Chloramine.getFluid(2000), Materials.DilutedHydrochloricAcid.getFluid(1000), Materials.Dimethylhydrazine.getCells(6), Materials.DilutedHydrochloricAcid.getCells(1), 960, 480); GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(24)}, new FluidStack[]{Materials.HypochlorousAcid.getFluid(3000), Materials.Ammonia.getGas(8000), Materials.Methanol.getFluid(12000)}, new FluidStack[]{Materials.Dimethylhydrazine.getFluid(12000), Materials.DilutedHydrochloricAcid.getFluid(2000), Materials.Water.getFluid(9000)}, null, 1040, 480); - + GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2), GT_Values.NI, Materials.NitrogenDioxide.getGas(1000), Materials.DinitrogenTetroxide.getGas(1000), GT_Values.NI, 640); GT_Values.RA.addChemicalRecipe(Materials.NitrogenDioxide.getCells(1), GT_Utility.getIntegratedCircuit(2), GT_Values.NF, Materials.DinitrogenTetroxide.getGas(1000), Materials.Empty.getCells(1), 640); GT_Values.RA.addChemicalRecipe(Materials.NitrogenDioxide.getCells(1), GT_Utility.getIntegratedCircuit(12), GT_Values.NF, GT_Values.NF, Materials.DinitrogenTetroxide.getCells(1), 640); @@ -630,25 +635,25 @@ public class RocketFuels extends ItemPackage { GT_Values.RA.addMixerRecipe(Materials.Dimethylhydrazine.getCells(2), GT_Values.NI, GT_Values.NI, GT_Values.NI, Materials.Oxygen.getGas(1000), new FluidStack(ItemList.sRocketFuel, 3000), Materials.Empty.getCells(2), 60, 16); GT_Values.RA.addMixerRecipe(Materials.Oxygen.getCells(1), GT_Values.NI, GT_Values.NI, GT_Values.NI, Materials.Dimethylhydrazine.getFluid(2000), new FluidStack(ItemList.sRocketFuel, 3000), Materials.Empty.getCells(1), 60, 16); - - */ - - - - - - - - - + + */ + + + + + + + + + //Get Rocket Fuel - + //Find recipes using default values - + //Remove - + //Rebake map - + return true; }; @@ -663,16 +668,16 @@ public class RocketFuels extends ItemPackage { @Override public void fluids() { - + //Register default fluids Diesel = MaterialUtils.getMaterial("Fuel", "Diesel").getFluid(1).getFluid(); Oil_Heavy = MaterialUtils.getMaterial("OilHeavy", "Oil").getFluid(1).getFluid(); - - + + //Create Kerosene Kerosene = FluidUtils.generateFluidNonMolten("Kerosene", "Kerosene", 500, new short[]{150, 40, 150, 100}, null, null); CoalTar.Coal_Oil = Kerosene; - + //RP! Focket Fuel RP1 = FluidUtils.generateFluidNonMolten("RP1Fuel", "RP-1 Rocket Fuel", 500, new short[]{210, 50, 50, 100}, null, null); @@ -698,7 +703,7 @@ public class RocketFuels extends ItemPackage { new BaseItemComponent("NitrousOxide", "Nitrous Oxide", new short[] {10, 10, 175}); } } - + //Unsymmetrical_Dimethylhydrazine if (FluidUtils.getFluidStack("1,1dimethylhydrazine", 1) == null){ Unsymmetrical_Dimethylhydrazine = FluidUtils.generateFluidNonMolten("UnsymmetricalDimethylhydrazine", "Unsymmetrical Dimethylhydrazine", -57, new short[]{70, 210, 20, 100}, null, null); @@ -728,31 +733,31 @@ public class RocketFuels extends ItemPackage { new BaseItemComponent("LiquidOxygen", "Liquid Oxygen", new short[] {10, 10, 175}); } } - + //Create Liquid_Hydrogen - if (FluidUtils.getFluidStack("LiquidHydrogen", 1) == null && FluidUtils.getFluidStack("liquidhydrogen", 1) == null){ - Liquid_Hydrogen = FluidUtils.generateFluidNonMolten("LiquidHydrogen", "Liquid Hydrogen", -240, new short[]{75, 75, 220, 100}, null, null); - } - else { - if (FluidUtils.getFluidStack("LiquidHydrogen", 1) != null ) { - Liquid_Hydrogen = FluidUtils.getFluidStack("LiquidHydrogen", 1).getFluid(); - } - else { - Liquid_Hydrogen = FluidUtils.getFluidStack("liquidhydrogen", 1).getFluid(); - } - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellLiquidHydrogen", 1) == null){ - new BaseItemComponent("LiquidHydrogen", "Liquid Hydrogen", new short[] {10, 10, 175}); - } - } + if (FluidUtils.getFluidStack("LiquidHydrogen", 1) == null && FluidUtils.getFluidStack("liquidhydrogen", 1) == null){ + Liquid_Hydrogen = FluidUtils.generateFluidNonMolten("LiquidHydrogen", "Liquid Hydrogen", -240, new short[]{75, 75, 220, 100}, null, null); + } + else { + if (FluidUtils.getFluidStack("LiquidHydrogen", 1) != null ) { + Liquid_Hydrogen = FluidUtils.getFluidStack("LiquidHydrogen", 1).getFluid(); + } + else { + Liquid_Hydrogen = FluidUtils.getFluidStack("liquidhydrogen", 1).getFluid(); + } + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellLiquidHydrogen", 1) == null){ + new BaseItemComponent("LiquidHydrogen", "Liquid Hydrogen", new short[] {10, 10, 175}); + } + } Formaldehyde = FluidUtils.generateFluidNonMolten("Formaldehyde", "Formaldehyde", -92, new short[]{150, 75, 150, 100}, null, null); - + Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide = FluidUtils.generateFluidNonMolten("RocketFuelMixA", "H8N4C2O4 Rocket Fuel", -185, new short[]{50, 220, 50, 100}, null, null); RP1_Plus_Liquid_Oxygen = FluidUtils.generateFluidNonMolten("RocketFuelMixB", "Rp-1 Fuel Mixture", -250, new short[]{250, 50, 50, 100}, null, null); Monomethylhydrazine_Plus_Nitric_Acid = FluidUtils.generateFluidNonMolten("RocketFuelMixC", "CN3H7O3 Rocket Fuel", -300, new short[]{125, 75, 180, 100}, null, null); Dense_Hydrazine_Mix = FluidUtils.generateFluidNonMolten("RocketFuelMixD", "Dense Hydrazine Fuel Mixture", -250, new short[]{175, 80, 120, 100}, null, null); - + } diff --git a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java index 6b7f24ed37..5144a56663 100644 --- a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java +++ b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java @@ -1,27 +1,33 @@ package gtPlusPlus.nei; import java.awt.Rectangle; -import java.util.Collection; import java.util.List; +import codechicken.lib.gui.GuiDraw; import codechicken.nei.PositionedStack; import codechicken.nei.recipe.TemplateRecipeHandler; -import crazypants.enderio.gui.IconEIO; import crazypants.enderio.machine.enchanter.GuiEnchanter; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.handler.Recipes.DecayableRecipe; import gtPlusPlus.core.item.materials.DustDecayable; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.lib.VanillaColours; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.nei.handlers.NeiTextureHandler; import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; public class DecayableRecipeHandler extends TemplateRecipeHandler { public String getRecipeName() { - return StatCollector.translateToLocal("gtpp.nei.decayables"); + return StatCollector.translateToLocal("GTPP.container.decaychest.name"); } public String getGuiTexture() { - return "enderio:textures/gui/enchanter.png"; + return CORE.MODID+":textures/gui/nei/decayables.png"; } public Class getGuiClass() { @@ -31,20 +37,31 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { public String getOverlayIdentifier() { return "GTPP_Decayables"; } + + public int recipiesPerPage() { + return 1; + } public void loadTransferRects() { - this.transferRects.add(new RecipeTransferRect(new Rectangle(149, -3, 16, 16), "GTPP_Decayables", new Object[0])); + this.transferRects.add(new RecipeTransferRect(new Rectangle(6, 3, 16, 16), "GTPP_Decayables", new Object[0])); } public void loadCraftingRecipes(ItemStack result) { if (result == null || !DustDecayable.class.isInstance(result.getItem())) { return; } + if (result != null) { + Logger.INFO("Looking up crafting recipes for "+ItemUtils.getItemName(result)); + } final List recipes = DecayableRecipe.mRecipes; for (final DecayableRecipe recipe : recipes) { if (recipe.isValid()) { final ItemStack input = recipe.mInput.copy(); final ItemStack output = recipe.mOutput.copy(); + if (!GT_Utility.areStacksEqual(result, output, true)) { + continue; + } + Logger.INFO("Showing Usage result for "+ItemUtils.getItemName(result)); final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime); this.arecipes.add(rec); } @@ -70,35 +87,128 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { public void loadUsageRecipes(ItemStack ingredient) { final List recipes = DecayableRecipe.mRecipes; + if (ingredient != null) { + Logger.INFO("Looking up Usage results for "+ItemUtils.getItemName(ingredient)); + } for (final DecayableRecipe recipe : recipes) { if (recipe.isValid()) { final ItemStack input = recipe.mInput.copy(); final ItemStack output = recipe.mOutput.copy(); - final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime); - if (!rec.contains((Collection)rec.input, ingredient)) { + if (!GT_Utility.areStacksEqual(ingredient, input, true)) { continue; - } - rec.setIngredientPermutation((Collection) rec.input, ingredient); + } + Logger.INFO("Showing up Usage results for "+ItemUtils.getItemName(ingredient)); + final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime); + //rec.setIngredientPermutation((Collection) rec.input, ingredient); this.arecipes.add(rec); } }} public void drawExtras(int recipeIndex) { DecayableRecipeNEI recipe = (DecayableRecipeNEI) this.arecipes.get(recipeIndex); - //GuiDraw.drawStringC(recipe.getEnchantName(), 83, 10, 8421504, false); - /* - * int cost = TileEnchanter.getEnchantmentCost(recipe.recipe, 1); if (cost > 0) - * { String s = I18n.format("container.repair.cost", new Object[]{cost}); - * GuiDraw.drawStringC(s, 83, 46, 8453920); } - */ - - IconEIO.RECIPE_BUTTON.renderIcon(149.0D, -3.0D, 16.0D, 16.0D, 0.0D, true); + + //GuiDraw.drawStringC(I18n.format("GTPP.container.decaychest.result", new Object[]{}), 43, 10, 8421504, false); + + int cost = recipe.time; + if (cost > 0){ + + // NEI Strings + String s = I18n.format("GTPP.nei.info", new Object[]{cost}); + String s0 = I18n.format("GTPP.nei.timetaken", new Object[]{cost}); + + // Time Strings + String s1 = I18n.format("GTPP.time.ticks", new Object[]{cost}); + String s2 = I18n.format("GTPP.time.seconds", new Object[]{cost}); + String s3 = I18n.format("GTPP.time.minutes", new Object[]{cost}); + String s4 = I18n.format("GTPP.time.hours", new Object[]{cost}); + String s5 = I18n.format("GTPP.time.days", new Object[]{cost}); + String s6 = I18n.format("GTPP.time.months", new Object[]{cost}); + int y = 20; + + int secs = cost / 20; + int mins = secs / 60; + int hours = mins / 60; + int days = hours / 24; + int months = days / 30; + + + String suffix; + int formattedTime; + if (cost <= 20) { + suffix = s1; + formattedTime = cost; + } + else if (cost <= (20 * 60)) { + suffix = s2; + formattedTime = secs; + } + else if (cost <= (20 * 60 * 60)) { + suffix = s3; + formattedTime = mins; + } + else if (cost <= (20 * 60 * 60 * 24)) { + suffix = s4; + formattedTime = hours; + } + else if (cost < (20 * 60 * 60 * 24 * 30)) { + suffix = s5; + formattedTime = days; + } + else if (cost <= (20 * 60 * 60 * 24 * 30)) { + suffix = s6; + formattedTime = months; + } + else { + suffix = s1; + formattedTime = cost; + } + + + + int x = 5; + GuiDraw.drawString(s, x, 25, VanillaColours.DYE_BLACK.getAsInt(), false); + GuiDraw.drawString(s0, x, 40, VanillaColours.DYE_BLACK.getAsInt(), false); + + + + + + GuiDraw.drawString(suffix, x + 16, y+30, VanillaColours.DYE_BLACK.getAsInt(), false); + + //Values + GuiDraw.drawString((""+formattedTime), x, y+30, VanillaColours.DYE_GREEN.getAsInt(), false); + + + if (hours > 1) { + int aLeftoverMinutes = (cost - (hours * (20 * 60 * 60))); + if (aLeftoverMinutes > 0) { + int secs2 = aLeftoverMinutes / 20; + int mins2 = secs2 / 60; + GuiDraw.drawString(s3, x + 16, y+42, VanillaColours.DYE_BLACK.getAsInt(), false); + GuiDraw.drawString((""+mins2), x, y+42, VanillaColours.DYE_GREEN.getAsInt(), false); + + } + + } + + + + + } + + NeiTextureHandler.RECIPE_BUTTON.renderIcon(6.0D, 3.0D, 16.0D, 16.0D, 0.0D, true); } public class DecayableRecipeNEI extends TemplateRecipeHandler.CachedRecipe { private PositionedStack input; - private PositionedStack output; + private PositionedStack output; + public int time; + + @Override + public PositionedStack getIngredient() { + return this.input; + } public PositionedStack getResult() { return this.output; @@ -106,8 +216,9 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { public DecayableRecipeNEI(final ItemStack input, final ItemStack result, final int time) { super(); - this.input = new PositionedStack(input, 22, 24); - this.output = new PositionedStack(result, 129, 24); + this.input = new PositionedStack(input, 93, 24); + this.output = new PositionedStack(result, 142, 42); + this.time = time; } } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/nei/handlers/NeiTextureHandler.java b/src/Java/gtPlusPlus/nei/handlers/NeiTextureHandler.java new file mode 100644 index 0000000000..f433def57d --- /dev/null +++ b/src/Java/gtPlusPlus/nei/handlers/NeiTextureHandler.java @@ -0,0 +1,85 @@ +package gtPlusPlus.nei.handlers; + +import crazypants.render.RenderUtil; +import gtPlusPlus.core.lib.CORE; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +/** + * Based on crazypants.enderio.gui.IconEIO + * @author Original EIO Author + * + */ +public final class NeiTextureHandler { + + public static final NeiTextureHandler RECIPE = new NeiTextureHandler(16, 132, 16, 16); + public static final NeiTextureHandler RECIPE_BUTTON = new NeiTextureHandler(128, 116, 24, 24); + + public final double minU; + public final double maxU; + public final double minV; + public final double maxV; + public final double width; + public final double height; + + public static final ResourceLocation TEXTURE = new ResourceLocation(CORE.MODID+":textures/gui/nei/widgets.png"); + + public NeiTextureHandler(int x, int y) { + this(x, y, 16, 16); + } + + public NeiTextureHandler(int x, int y, int width, int height) { + this((double) width, (double) height, (double) ((float) (0.00390625D * (double) x)), + (double) ((float) (0.00390625D * (double) (x + width))), (double) ((float) (0.00390625D * (double) y)), + (double) ((float) (0.00390625D * (double) (y + height)))); + } + + public NeiTextureHandler(double width, double height, double minU, double maxU, double minV, double maxV) { + this.width = width; + this.height = height; + this.minU = minU; + this.maxU = maxU; + this.minV = minV; + this.maxV = maxV; + } + + public void renderIcon(double x, double y) { + this.renderIcon(x, y, this.width, this.height, 0.0D, false); + } + + public void renderIcon(double x, double y, boolean doDraw) { + this.renderIcon(x, y, this.width, this.height, 0.0D, doDraw); + } + + public void renderIcon(double x, double y, double width, double height, double zLevel, boolean doDraw) { + this.renderIcon(x, y, width, height, zLevel, doDraw, false); + } + + public void renderIcon(double x, double y, double width, double height, double zLevel, boolean doDraw, + boolean flipY) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Tessellator tessellator = Tessellator.instance; + if (doDraw) { + RenderUtil.bindTexture(TEXTURE); + tessellator.startDrawingQuads(); + } + + if (flipY) { + tessellator.addVertexWithUV(x, y + height, zLevel, this.minU, this.minV); + tessellator.addVertexWithUV(x + width, y + height, zLevel, this.maxU, this.minV); + tessellator.addVertexWithUV(x + width, y + 0.0D, zLevel, this.maxU, this.maxV); + tessellator.addVertexWithUV(x, y + 0.0D, zLevel, this.minU, this.maxV); + } else { + tessellator.addVertexWithUV(x, y + height, zLevel, this.minU, this.maxV); + tessellator.addVertexWithUV(x + width, y + height, zLevel, this.maxU, this.maxV); + tessellator.addVertexWithUV(x + width, y + 0.0D, zLevel, this.maxU, this.minV); + tessellator.addVertexWithUV(x, y + 0.0D, zLevel, this.minU, this.minV); + } + + if (doDraw) { + tessellator.draw(); + } + + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 31909b4018..cb091264dd 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -53,6 +53,7 @@ import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_MultiMachine; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; import gtPlusPlus.xmod.gregtech.api.gui.GUI_Multi_Basic_Slotted; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_ControlCore; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBattery; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBattery; @@ -98,6 +99,7 @@ GT_MetaTileEntity_MultiBlockBase { //Control Core Hatch public ArrayList mControlCoreBus = new ArrayList(); + public ArrayList mAirIntakes = new ArrayList(); public ArrayList mChargeHatches = new ArrayList(); public ArrayList mDischargeHatches = new ArrayList(); @@ -835,7 +837,7 @@ GT_MetaTileEntity_MultiBlockBase { log("GOOD RETURN - 1"); return true; -} + } @@ -932,10 +934,10 @@ GT_MetaTileEntity_MultiBlockBase { ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { - + long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - + log("Running checkRecipeGeneric(0)"); GT_Recipe tRecipe = aRecipe != null ? aRecipe : findRecipe( @@ -943,12 +945,12 @@ GT_MetaTileEntity_MultiBlockBase { gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); log("Running checkRecipeGeneric(1)"); - + //First we check whether or not we have an input cached for boosting. //If not, we set it to the current recipe. //If we do, we compare it against the current recipe, if thy are the same, we try return a boosted recipe, if not, we boost a new recipe. boolean isRecipeInputTheSame = false; - + //No cached recipe inputs, assume first run. if (mInputVerificationForBoosting == null) { mInputVerificationForBoosting = tRecipe.mInputs; @@ -963,7 +965,7 @@ GT_MetaTileEntity_MultiBlockBase { isRecipeInputTheSame = false; } } - + //Inputs are the same, let's see if there's a boosted version. if (isRecipeInputTheSame) { //Yes, let's just set that as the recipe @@ -999,14 +1001,14 @@ GT_MetaTileEntity_MultiBlockBase { mHasBoostedCurrentRecipe = false; } } - + //Bad modify, let's just use the original recipe. if (!mHasBoostedCurrentRecipe || mBoostedRecipe == null) { tRecipe = aRecipe != null ? aRecipe : findRecipe( getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); } - + // Remember last recipe - an optimization for findRecipe() this.mLastRecipe = tRecipe; @@ -1188,6 +1190,7 @@ GT_MetaTileEntity_MultiBlockBase { this.mChargeHatches.clear(); this.mDischargeHatches.clear(); this.mControlCoreBus.clear(); + this.mAirIntakes.clear(); this.mMultiDynamoHatches.clear(); } } @@ -1252,7 +1255,7 @@ GT_MetaTileEntity_MultiBlockBase { ItemStack guiSlot = this.mInventory[1]; return guiSlot; } - + protected boolean setGUIItemStack(ItemStack aNewGuiSlotContents) { boolean result = false; if (this.mInventory[1] == null) { @@ -1263,11 +1266,11 @@ GT_MetaTileEntity_MultiBlockBase { } return result; } - + protected boolean clearGUIItemSlot() { return setGUIItemStack(null); } - + public ItemStack findItemInInventory(Item aSearchStack) { return findItemInInventory(aSearchStack, 0); @@ -1276,7 +1279,7 @@ GT_MetaTileEntity_MultiBlockBase { public ItemStack findItemInInventory(Item aSearchStack, int aMeta) { return findItemInInventory(ItemUtils.simpleMetaStack(aSearchStack, aMeta, 1)); } - + public ItemStack findItemInInventory(ItemStack aSearchStack) { if (aSearchStack != null && this.mInputBusses.size() > 0) { for (GT_MetaTileEntity_Hatch_InputBus bus : this.mInputBusses) { @@ -1365,14 +1368,14 @@ GT_MetaTileEntity_MultiBlockBase { if (aTileEntity == null) { return false; } - + //Check type /* * Class aHatchType = ReflectionUtils.getTypeOfGenericObject(aList); if * (!aHatchType.isInstance(aTileEntity)) { return false; } */ - - + + if (aList.isEmpty()) { if (aTileEntity instanceof GT_MetaTileEntity_Hatch) { if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) { @@ -1546,6 +1549,20 @@ GT_MetaTileEntity_MultiBlockBase { return addToMachineList(aTileEntity, aBaseCasingIndex); } + public boolean addAirIntakeToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } + final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_AirIntake) { + this.mAirIntakes.add((GT_MetaTileEntity_Hatch_AirIntake)aMetaTileEntity); + } + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + public boolean addFluidInputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { if (aTileEntity == null) { return false; @@ -2103,6 +2120,31 @@ GT_MetaTileEntity_MultiBlockBase { log("A3"); return false; } + + @Override + public boolean depleteInput(final FluidStack aLiquid) { + if (aLiquid == null) { + return false; + } + for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) { + tHatch.mRecipeMap = this.getRecipeMap(); + if (isValidMetaTileEntity(tHatch)) { + FluidStack tLiquid = tHatch.getFluid(); + if (tLiquid == null || !tLiquid.isFluidEqual(aLiquid) || tLiquid.amount < aLiquid.amount) { + continue; + } + tLiquid = tHatch.drain(aLiquid.amount, false); + if (tLiquid != null && tLiquid.amount >= aLiquid.amount) { + tLiquid = tHatch.drain(aLiquid.amount, true); + return tLiquid != null && tLiquid.amount >= aLiquid.amount; + } + continue; + } + } + return false; + } + + diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java index de5d731dd5..2c3bf29119 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java @@ -432,6 +432,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas mChargeHatches.clear(); mDischargeHatches.clear(); mControlCoreBus.clear(); + mAirIntakes.clear(); mMultiDynamoHatches.clear(); mMachine = aFormCheck; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java index ab5cbd84d2..9b6da487e8 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java @@ -5,23 +5,29 @@ import java.util.Collection; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.Recipe_GT; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.chemistry.RocketFuels; import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -30,264 +36,448 @@ import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_MultiBlockBase { - protected int fuelConsumption; - protected int fuelValue; - protected int fuelRemaining; - protected boolean boostEu; + protected int fuelConsumption; + protected int fuelValue; + protected int fuelRemaining; + protected int freeFuelTicks = 0; + protected boolean boostEu; public static String mLubricantName = "Carbon Dioxide"; public static String mCoolantName = "Liquid Hydrogen"; - + public static String mCasingName = "Turbodyne Casing"; public static String mIntakeHatchName = "Tungstensteel Turbine Casing"; public static String mGearboxName = "Inconel Reinforced Casing"; - - private final static int CASING_ID = TAE.getIndexFromPage(3, 11); - - public GregtechMetaTileEntity_LargeRocketEngine(final int aID, final String aName, final String aNameRegional) { - super(aID, aName, aNameRegional); - this.fuelConsumption = 0; - this.fuelValue = 0; - this.fuelRemaining = 0; - this.boostEu = false; - } - - public GregtechMetaTileEntity_LargeRocketEngine(final String aName) { - super(aName); - this.fuelConsumption = 0; - this.fuelValue = 0; - this.fuelRemaining = 0; - this.boostEu = false; - } - - @Override - public String[] getTooltip() { - return new String[] { - "Controller Block for the Large Combustion Engine", - "Supply Rocket Fuels and 1000L of "+mLubricantName+" per hour to run.", - "Supply 40L of "+mCoolantName+" per second to boost output (optional).", - "Default: Produces "+GT_Values.V[5]+"EU/t at 100% efficiency", - "Boosted: Produces "+(GT_Values.V[5]*3)+"EU/t at 150% efficiency", - "Size(WxHxD): 3x3x4, Controller (front centered)", - "3x3x4 of Stable "+mCasingName+" (hollow, Min 16!)", - "2x "+mGearboxName+" inside the Hollow Casing", - "8x "+mIntakeHatchName+" (around controller)", - ""+mIntakeHatchName+" must not be obstructed in front (only air blocks)", - "2x Input Hatch (Fuel/Lubricant) (one of the Casings next to a Gear Box)", - "1x Maintenance Hatch (one of the Casings next to a Gear Box)", - "1x Muffler Hatch (top middle back, next to the rear Gear Box)", - "1x Dynamo Hatch (back centered)", - }; - } - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[CASING_ID], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE) }; - } - return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[CASING_ID] }; - } - - @Override - public boolean isCorrectMachinePart(final ItemStack aStack) { - return this.getMaxEfficiency(aStack) > 0; - } - - @Override - public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "LargeDieselEngine.png"); - } - - @Override - public boolean checkRecipe(final ItemStack aStack) { - final ArrayList tFluids = this.getStoredFluids(); - final Collection tRecipeList = Recipe_GT.Gregtech_Recipe_Map.sRocketFuels.mRecipeList; - if (tFluids.size() > 0 && tRecipeList != null) { - for (final FluidStack hatchFluid1 : tFluids) { - for (final GT_Recipe aFuel : tRecipeList) { - final FluidStack tLiquid; - if ((tLiquid = GT_Utility.getFluidForFilledItem(aFuel.getRepresentativeInput(0), true)) != null && hatchFluid1.isFluidEqual(tLiquid)) { - final FluidStack fluidStack = tLiquid; - final int n = (int) (this.boostEu ? ((GT_Values.V[5]*2) / aFuel.mSpecialValue) : (GT_Values.V[5] / aFuel.mSpecialValue)); - fluidStack.amount = n; - this.fuelConsumption = n; - if (!this.depleteInput(tLiquid)) { - continue; - } - this.boostEu = this.depleteInput(FluidUtils.getFluidStack(RocketFuels.Liquid_Hydrogen, 2)); - if (tFluids.contains(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 2 : 1))) { - if (this.mRuntime % 72 == 0 || this.mRuntime == 0) { - this.depleteInput(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 2 : 1)); - } - this.fuelValue = aFuel.mSpecialValue; - this.fuelRemaining = hatchFluid1.amount; - this.mEUt = (int) ((this.mEfficiency < 2000) ? 0 : GT_Values.V[5]); - this.mProgresstime = 1; - this.mMaxProgresstime = 1; - this.mEfficiencyIncrease = 5; - return true; - } - return false; - } - } - } - } - this.mEUt = 0; - this.mEfficiency = 0; - return false; - } - - @Override - public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { - byte tSide = getBaseMetaTileEntity().getBackFacing(); - int tX = getBaseMetaTileEntity().getXCoord(); - int tY = getBaseMetaTileEntity().getYCoord(); - int tZ = getBaseMetaTileEntity().getZCoord(); - - if(getBaseMetaTileEntity().getBlockAtSideAndDistance(tSide, 1) != getGearboxBlock() && getBaseMetaTileEntity().getBlockAtSideAndDistance(tSide, 2) != getGearboxBlock()) { - return false; - } - if(getBaseMetaTileEntity().getMetaIDAtSideAndDistance(tSide, 1) != getGearboxMeta() && getBaseMetaTileEntity().getMetaIDAtSideAndDistance(tSide, 2) != getGearboxMeta()) { - return false; - } - for (byte i = -1; i < 2; i = (byte) (i + 1)) { - for (byte j = -1; j < 2; j = (byte) (j + 1)) { - if ((i != 0) || (j != 0)) { - for (byte k = 0; k < 4; k = (byte) (k + 1)) { - - final int fX = tX - (tSide == 5 ? 1 : tSide == 4 ? -1 : i), - fZ = tZ - (tSide == 2 ? -1 : tSide == 3 ? 1 : i), - aY = tY + j, - aX = tX + (tSide == 5 ? k : tSide == 4 ? -k : i), - aZ = tZ + (tSide == 2 ? -k : tSide == 3 ? k : i); - - final Block frontAir = getBaseMetaTileEntity().getBlock(fX, aY, fZ); - final String frontAirName = frontAir.getUnlocalizedName(); - if(!(getBaseMetaTileEntity().getAir(fX, aY, fZ) || frontAirName.equalsIgnoreCase("tile.air") || frontAirName.equalsIgnoreCase("tile.railcraft.residual.heat"))) { - return false; //Fail if vent blocks are obstructed - } - - if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2))) { - if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) { - // Do nothing - } else if (!addMufflerToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? 2 : tSide == 4 ? -2 : 0), tY + 1, tZ + (tSide == 3 ? 2 : tSide == 2 ? -2 : 0)), getCasingTextureIndex())) { - return false; //Fail if no muffler top middle back - } else if (!addToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) { - return false; - } - } else if (k == 0) { - if(!(getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getIntakeBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getIntakeMeta())) { - return false; - } - } else if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) { - // Do nothing - } else { - return false; - } - } - } - } - } - this.mDynamoHatches.clear(); - IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 3); - if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) { - if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Dynamo)) { - this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) tTileEntity.getMetaTileEntity()); - ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).updateTexture(getCasingTextureIndex()); - } else { - return false; - } - } - return true; - } - - public Block getCasingBlock() { - return ModBlocks.blockCasings4Misc; - } - - public byte getCasingMeta() { - return 11; - } - - public Block getIntakeBlock() { - return GregTech_API.sBlockCasings4; - } - - public byte getIntakeMeta() { - return 12; - } - - public Block getGearboxBlock() { - return ModBlocks.blockCasings3Misc; - } - - public byte getGearboxMeta() { - return 1; - } - - public byte getCasingTextureIndex() { - return (byte) CASING_ID; - } - - @Override - public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMetaTileEntity_LargeRocketEngine(this.mName); - } - - @Override - public void saveNBTData(final NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - } - - @Override - public void loadNBTData(final NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - } - - @Override - public int getDamageToComponent(final ItemStack aStack) { - return 1; - } - - @Override - public int getMaxEfficiency(final ItemStack aStack) { - return this.boostEu ? 30000 : 10000; - } - - @Override - public int getPollutionPerTick(final ItemStack aStack) { - return this.boostEu ? 150 : 75; - } - - @Override - public boolean explodesOnComponentBreak(final ItemStack aStack) { - return true; - } - - @Override - public String[] getExtraInfoData() { - return new String[] { - "Rocket Engine", - "Current Pollution: " + getPollutionPerTick(null), - "Current Output: " + this.mEUt * this.mEfficiency / 10000 + " EU/t", - "Fuel Consumption: " + this.fuelConsumption + "L/t", - "Fuel Value: " + this.fuelValue + " EU/L", - "Fuel Remaining: " + this.fuelRemaining + " Litres", - "Current Efficiency: " + this.mEfficiency / 100 + "%", - (this.getIdealStatus() == this.getRepairStatus()) ? "No Maintainance issues" : "Needs Maintainance" }; - } - - @Override - public boolean isGivingInformation() { - return true; - } + + private final static int CASING_ID = TAE.getIndexFromPage(3, 11); + + public GregtechMetaTileEntity_LargeRocketEngine(final int aID, final String aName, final String aNameRegional) { + super(aID, aName, aNameRegional); + this.fuelConsumption = 0; + this.fuelValue = 0; + this.fuelRemaining = 0; + this.boostEu = false; + } + + public GregtechMetaTileEntity_LargeRocketEngine(final String aName) { + super(aName); + this.fuelConsumption = 0; + this.fuelValue = 0; + this.fuelRemaining = 0; + this.boostEu = false; + } + + @Override + public String[] getTooltip() { + if (mCasingName.toLowerCase().contains(".name")) { + mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 11); + } + if (mIntakeHatchName.toLowerCase().contains(".name")) { + mIntakeHatchName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 11); + } + if (mGearboxName.toLowerCase().contains(".name")) { + mGearboxName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 1); + } + if (mLubricantName.toLowerCase().contains(".")) { + mLubricantName = FluidUtils.getFluidStack("carbondioxide", 1).getLocalizedName(); + } + if (mCoolantName.toLowerCase().contains(".")) { + mCoolantName = FluidUtils.getFluidStack("liquidhydrogen", 1).getLocalizedName(); + } + return new String[] { + "Controller Block for the Large Combustion Engine", + "Supply Rocket Fuels and 1000L of "+mLubricantName+" per hour to run", + "Supply 40L of "+mCoolantName+" per second to boost output (optional)", + "Consumes upto 5000L of Air per second", + "Default: Produces "+GT_Values.V[5]+"EU/t at 100% efficiency", + "Boosted: Produces "+(GT_Values.V[5]*3)+"EU/t at 150% efficiency", + "Size(WxHxD): 3x3x10, Controller (front centered)", + "3x3x10 of Stable "+mCasingName+" (hollow, Min 64!)", + "8x "+mGearboxName+" inside the Hollow Casing", + "1x Dynamo Hatch (Top Middle, Max 8)", + "8x Air Intake Hatch (one of the Casings next to a Gear Box, top row allowed)", + "2x Input Hatch (Rocket Fuel/Booster) (one of the Casings next to a Gear Box, top row not allowed)", + "1x Maintenance Hatch (one of the Casings next to a Gear Box)", + "1x Muffler Hatch (Back Centre)", + }; + } @Override - public boolean hasSlotInGUI() { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[CASING_ID], new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced) }; + } + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[CASING_ID] }; + } + + @Override + public boolean isCorrectMachinePart(final ItemStack aStack) { + return this.getMaxEfficiency(aStack) > 0; + } + + @Override + public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "LargeDieselEngine.png"); + } + + public int getAir() { + if (this.mAirIntakes.isEmpty() || this.mAirIntakes.size() <= 0) { + return 0; + } + else { + int totalAir = 0; + FluidStack airstack = FluidUtils.getFluidStack("air", 1); + for (GT_MetaTileEntity_Hatch_AirIntake u : this.mAirIntakes) { + if (u != null) { + FluidStack f = u.mFluid; + if (f.isFluidEqual(airstack)) { + totalAir += f.amount; + } + } + } + return totalAir; + } + } + + @Override + public boolean checkRecipe(final ItemStack aStack) { + final ArrayList tFluids = this.getStoredFluids(); + FluidStack air = FluidUtils.getFluidStack("air", 1); + + int aircount = getAir() ; + if (aircount < (boostEu ? 500 : 200)) { + Logger.INFO("Not Enough Air to Run "+aircount); + return false; + } + else { + boolean hasIntakeAir = this.depleteInput(FluidUtils.getFluidStack(air, boostEu ? 500 : 200)); + if (!hasIntakeAir) { + Logger.INFO("Could not consume Air to run "+aircount); + return false; + } + } + Logger.INFO("Running "+aircount); + + final Collection tRecipeList = Recipe_GT.Gregtech_Recipe_Map.sRocketFuels.mRecipeList; + if (tFluids.size() > 0 && tRecipeList != null) { + for (final FluidStack hatchFluid1 : tFluids) { + if (hatchFluid1.isFluidEqual(air)) { + continue; + } + for (final GT_Recipe aFuel : tRecipeList) { + final FluidStack tLiquid; + tLiquid = aFuel.mFluidInputs[0]; + if (hatchFluid1.isFluidEqual(tLiquid)) { + final FluidStack fluidStack = tLiquid; + Logger.INFO("Found valid thing"); + final int n = (int) (this.boostEu ? ((GT_Values.V[5]*2) / aFuel.mSpecialValue) : (GT_Values.V[5] / aFuel.mSpecialValue)); + fluidStack.amount = n; + this.fuelConsumption = n; + + if (!consumeFuel(aFuel)) { + continue; + } + + Logger.INFO("Consumed some input fuel"); + this.boostEu = consumeLOH(); + Logger.INFO("Did we consume LOH? "+boostEu); + + if (tFluids.contains(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 2 : 1)) || tFluids.contains(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 2 : 1)))) { + Logger.INFO("Found CO2"); + if (this.mRuntime % 72 == 0 || this.mRuntime == 0) { + if (!consumeCO2()) { + return false; + } + } + this.fuelValue = aFuel.mSpecialValue; + this.fuelRemaining = hatchFluid1.amount; + this.mEUt = (int) ((this.mEfficiency < 2000) ? 0 : GT_Values.V[5]); + this.mProgresstime = 1; + this.mMaxProgresstime = 1; + this.mEfficiencyIncrease = 5; + return true; + } + return false; + } + } + } + } + this.mEUt = 0; + this.mEfficiency = 0; return false; } + /** + * Consumes Fuel if required. Free Fuel Ticks are handled here. + * @param aFuel + * @return + */ + public boolean consumeFuel(GT_Recipe aFuel) { + if (freeFuelTicks > 0) { + freeFuelTicks--; + return true; + } + else { + freeFuelTicks = 0; + int value = aFuel.mSpecialValue * 3000; + value /= 1000; + FluidStack tLiquid = FluidUtils.getFluidStack(aFuel.mFluidInputs[0], value); + if (!this.depleteInput(tLiquid)) { + return false; + } + else { + freeFuelTicks = value; + return true; + } + } + } + + public boolean consumeCO2() { + if (this.depleteInput(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 2 : 1)) || this.depleteInput(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 2 : 1)))) { + Logger.INFO("consumed some CO2"); + return true; + } + else { + Logger.INFO("No CO2 to consume"); + return false; + } + } + + public boolean consumeLOH() { + return this.depleteInput(FluidUtils.getFluidStack(RocketFuels.Liquid_Hydrogen, 2)); + } + + @Override + public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { + byte tSide = getBaseMetaTileEntity().getBackFacing(); + int tX = getBaseMetaTileEntity().getXCoord(); + int tY = getBaseMetaTileEntity().getYCoord(); + int tZ = getBaseMetaTileEntity().getZCoord(); + final int MAX_LENGTH = 8; + for (int length=0;length 0) && (aLength <= MAX_LENGTH))) { + Logger.INFO("Checking for Hatches. "+aLength); + //Top Row + if (j == 1) { + if (addDynamoToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) { + // Do Nothing + } + else if (addAirIntakeToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) { + // Do Nothing + } + else if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) { + // Do nothing + } + else { + Logger.INFO("Top Row - "+aLength+" | Did not find casing or Dynamo"); + return false; + } + } + else { + IGregTechTileEntity aCheck = getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ); + if (aCheck != null) { + final IMetaTileEntity bCheck = aCheck.getMetaTileEntity(); + // Only allow Dynamos on Top + if (bCheck instanceof GT_MetaTileEntity_Hatch_Dynamo) { + Logger.INFO("Found dynamo in disallowed location | "+aX+", "+aY+", "+aZ+" | "+i+", "+j+", "+aLength); + return false; + } + } + if (addAirIntakeToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) { + // Do Nothing + } + else if (addInputToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) { + // Do Nothing + } + else if (addOutputToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) { + // Do Nothing + } + else if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) { + // Do nothing + } + else {Logger.INFO("Bad block."); + return false; + } + + } + Logger.INFO("Passed check. "+aLength); + + } else if (aLength == 0) { + Logger.INFO("Searching for Gearbox"); + if (addMaintenanceToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) { + // Do Nothing + } + else if(!(getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta())) { + Logger.INFO("Bad Missing Casing || Bad Meta"); + return false; + } + else { + Logger.INFO("Found "+mCasingName+"."); + } + } else if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) { + Logger.INFO("Found Casing."); + // Do nothing + } else { + Logger.INFO("Bad XXX"); + return false; + } + } + } + } + } + + this.mMufflerHatches.clear(); + IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), MAX_LENGTH+1); + if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) { + if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Muffler)) { + this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) tTileEntity.getMetaTileEntity()); + this.updateTexture(tTileEntity, getCasingTextureIndex()); + } + } + + if (this.mDynamoHatches.size() <= 0 || this.mDynamoHatches.isEmpty()) { + Logger.INFO("Wrong count for Dynamos"); + return false; + } + if (this.mMufflerHatches.size() != 1 || this.mMufflerHatches.isEmpty()) { + Logger.INFO("Wrong count for Mufflers"); + return false; + } + if (this.mAirIntakes.size() < 8 || this.mAirIntakes.isEmpty()) { + Logger.INFO("Wrong count for Air Intakes | "+this.mAirIntakes.size()); + return false; + } + if (this.mMaintenanceHatches.size() < 1 || this.mMaintenanceHatches.isEmpty()) { + Logger.INFO("Wrong count for Maint. Hatches"); + return false; + } + + + Logger.INFO("Formed Rocket Engine."); + return true; + } + + public Block getCasingBlock() { + return ModBlocks.blockCasings4Misc; + } + + public byte getCasingMeta() { + return 11; + } + + public Block getIntakeBlock() { + return GregTech_API.sBlockCasings4; + } + + public byte getIntakeMeta() { + return 12; + } + + public Block getGearboxBlock() { + return ModBlocks.blockCasings3Misc; + } + + public byte getGearboxMeta() { + return 1; + } + + public byte getCasingTextureIndex() { + return (byte) CASING_ID; + } + + @Override + public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_LargeRocketEngine(this.mName); + } + + @Override + public void saveNBTData(final NBTTagCompound aNBT) { + aNBT.setInteger("freeFuelTicks", freeFuelTicks); + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(final NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + freeFuelTicks = aNBT.getInteger("freeFuelTicks"); + } + + @Override + public int getDamageToComponent(final ItemStack aStack) { + return 1; + } + + @Override + public int getMaxEfficiency(final ItemStack aStack) { + return this.boostEu ? 30000 : 10000; + } + + @Override + public int getPollutionPerTick(final ItemStack aStack) { + return this.boostEu ? 150 : 75; + } + + @Override + public boolean explodesOnComponentBreak(final ItemStack aStack) { + return true; + } + + @Override + public String[] getExtraInfoData() { + return new String[] { + "Rocket Engine", + "Current Air: "+getAir(), + "Current Pollution: " + getPollutionPerTick(null), + "Current Output: " + this.mEUt * this.mEfficiency / 10000 + " EU/t", + "Fuel Consumption: " + this.fuelConsumption + "L/t", + "Fuel Value: " + this.fuelValue + " EU/L", + "Fuel Remaining: " + this.fuelRemaining + " Litres", + "Current Efficiency: " + this.mEfficiency / 100 + "%", + (this.getIdealStatus() == this.getRepairStatus()) ? "No Maintainance issues" : "Needs Maintainance" }; + } + + @Override + public boolean isGivingInformation() { + return true; + } + + @Override + public boolean hasSlotInGUI() { + return true; + } + @Override public String getCustomGUIResourceName() { return null; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java index 2c1507526d..b8dd8e4767 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java @@ -30,7 +30,7 @@ public class GregtechRocketFuelGenerator { private static void run1() { GregtechItemList.Controller_RocketEngine.set( - new GregtechMetaTileEntity_LargeRocketEngine(30410, "gtpp.multimachine.rocketengine", "Rocketdyne F-1A Engine").getStackForm(1L)); + new GregtechMetaTileEntity_LargeRocketEngine(996, "gtpp.multimachine.rocketengine", "Rocketdyne F-1A Engine").getStackForm(1L)); GT_ModHandler.addCraftingRecipe( GregtechItemList.Controller_RocketEngine.get(1L), diff --git a/src/resources/assets/gregtech/lang/en_US.lang b/src/resources/assets/gregtech/lang/en_US.lang index caf4f636fb..c388f9785e 100644 --- a/src/resources/assets/gregtech/lang/en_US.lang +++ b/src/resources/assets/gregtech/lang/en_US.lang @@ -20,18 +20,6 @@ GTPP.CC.machinetier=Control Core Tier GTPP.CC.discount=EU Discount GTPP.CC.parallel=Maximum Parallel Processing - - -//Some Generic Words -GTPP.info.eu=EU -GTPP.info.euInfo=EU Information -GTPP.info.inputLimit=Input Limit -GTPP.info.currentPower=Current Power -GTPP.info.hidden=Hidden - - - - //Tooltips for the Charger Packs GTPP.battpack.tooltip.1=Worn as a Belt within Baubles GTPP.battpack.tooltip.2=Drains @@ -53,6 +41,53 @@ GTPP.monsterkiller.tooltip.2=Drains GTPP.monsterkiller.tooltip.3=per each kill GTPP.monsterkiller.tooltip.4=Target Type: +//17/08/19 +GTPP.container.decaychest.name=Decayables + + + + + + + + + + + + +//NEI INFORMATION +GTPP.nei.info=Information +GTPP.nei.eutick=Eu/t +GTPP.nei.timetaken=Time Taken +GTPP.nei.output=Output +GTPP.nei.input=Input +GTPP.nei.result=Result +GTPP.nei.radioation=Radiation Level + +//Some Generic Words +GTPP.info.eu=EU +GTPP.info.euInfo=EU Information +GTPP.info.inputLimit=Input Limit +GTPP.info.currentPower=Current Power +GTPP.info.hidden=Hidden + +//Some Time Words +GTPP.time.ticks=Ticks +GTPP.time.seconds=Seconds +GTPP.time.minutes=Minutes +GTPP.time.hours=Hours +GTPP.time.days=Days +GTPP.time.weeks=Weeks +GTPP.time.months=Months + + + + + + + + + diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index 3aefd6dee2..bc4b170654 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -2968,4 +2968,5 @@ item.itemCellHydrogenCyanide.name=Cell of Hydrogen Cyanide item.itemCactusCharcoal.name=Cactus Charcoal item.itemCactusCoke.name=Cactus Coke item.itemSugarCharcoal.name=Sugar Charcoal -item.itemSugarCoke.name=Sugar Coke \ No newline at end of file +item.itemSugarCoke.name=Sugar Coke +item.LiquidHydrogen.name=Liquid Hydrogen Cell [LOH] \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/gui/nei/decayables.png b/src/resources/assets/miscutils/textures/gui/nei/decayables.png new file mode 100644 index 0000000000..d1827433a0 Binary files /dev/null and b/src/resources/assets/miscutils/textures/gui/nei/decayables.png differ diff --git a/src/resources/assets/miscutils/textures/gui/nei/widgets.png b/src/resources/assets/miscutils/textures/gui/nei/widgets.png new file mode 100644 index 0000000000..0dc26c43e4 Binary files /dev/null and b/src/resources/assets/miscutils/textures/gui/nei/widgets.png differ -- cgit From 5f455188ce11c975ced96d8364624af540dd276b Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sat, 24 Aug 2019 16:34:38 +0100 Subject: + Added some more generic language strings. - Removed maintenance requirement from Cyclotron. % More work on new Multiblock GUIs. $ Potentially fixed #507. --- src/Java/gtPlusPlus/core/util/math/MathUtils.java | 65 ++++ .../gregtech/api/gui/CONTAINER_MultiMachine.java | 269 +++++++++++++--- .../xmod/gregtech/api/gui/GUI_MultiMachine.java | 338 +++++++++++++++------ .../gregtech/api/gui/GUI_MultiMachine_Default.java | 68 +++++ .../base/GregtechMeta_MultiBlockBase.java | 106 +++++-- .../advanced/GregtechMetaTileEntity_Adv_EBF.java | 30 +- .../GregtechMetaTileEntity_Cyclotron.java | 16 +- src/resources/assets/gregtech/lang/en_US.lang | 6 +- src/resources/assets/gregtech/lang/zh_CN.lang | 2 +- 9 files changed, 713 insertions(+), 187 deletions(-) create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine_Default.java (limited to 'src/resources/assets/gregtech/lang') diff --git a/src/Java/gtPlusPlus/core/util/math/MathUtils.java b/src/Java/gtPlusPlus/core/util/math/MathUtils.java index bda722b47e..a9f7b901ef 100644 --- a/src/Java/gtPlusPlus/core/util/math/MathUtils.java +++ b/src/Java/gtPlusPlus/core/util/math/MathUtils.java @@ -692,6 +692,39 @@ public class MathUtils { public static int balance(int aInput, int aMin, int aMax) { return Math.max(Math.min(aInput, aMax), aMin); } + + /** + * Balances a number within a range. + * @param aInput - The number to balance + * @param aMin - The minimum bounds + * @param aMax - The maximum bounds + * @return - A Number which will be between the bounds, or a boundary value. + */ + public static Number balance(Number aInput, Number aMin, Number aMax) { + return max(min(aInput, aMax), aMin); + } + + /** + * Balances a number within a range. + * @param aInput - The number to balance + * @param aMin - The minimum bounds + * @param aMax - The maximum bounds + * @return - An Integer which will be between the bounds, or a boundary value. + */ + public static int balanceInt(Number aInput, Number aMin, Number aMax) { + return MathUtils.safeCast_LongToInt((long) balance(max(min(aInput, aMax), aMin), Integer.MIN_VALUE, Integer.MAX_VALUE)); + } + + /** + * Balances a number within a range. + * @param aInput - The number to balance + * @param aMin - The minimum bounds + * @param aMax - The maximum bounds + * @return - A Long which will be between the bounds, or a boundary value. + */ + public static long balanceLong(Number aInput, Number aMin, Number aMax) { + return (long) balance(max(min(aInput, aMax), aMin), Long.MIN_VALUE, Long.MAX_VALUE); + } public static int getValueWithinRange(int i, int aMin, int aMax) { int aAmount = Math.max(Math.min(i, aMax), aMin); @@ -703,5 +736,37 @@ public class MathUtils { int aRemainder = (int) (aLong - (aIntMaxInLong * Integer.MAX_VALUE)); return new Pair(aIntMaxInLong, aRemainder); } + + + + + /** + * Returns the smaller of two {@code Number}s. That is, + * the result the argument closer to the value of + * {@link Long#MIN_VALUE}. If the arguments have the same + * value, the result is that same value. + * + * @param a an argument. + * @param b another argument. + * @return the smaller of {@code a} and {@code b}. + */ + public static Number min(Number a, Number b) { + return (a.longValue() <= b.longValue()) ? a : b; + } + + /** + * Returns the greater of two {@code Number}s. That is, the + * result is the argument closer to the value of + * {@link Long#MAX_VALUE}. If the arguments have the same value, + * the result is that same value. + * + * @param a an argument. + * @param b another argument. + * @return the larger of {@code a} and {@code b}. + */ + public static Number max(Number a, Number b) { + return (a.longValue() >= b.longValue()) ? a : b; + } + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java index 5fccb51e54..d3e22875ae 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java @@ -1,12 +1,19 @@ package gtPlusPlus.xmod.gregtech.api.gui; import java.lang.reflect.Field; +import java.util.ArrayList; import java.util.List; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_ContainerMetaTile_Machine; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gtPlusPlus.api.objects.data.AutoMap; +import gregtech.api.util.GT_Recipe; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; @@ -20,6 +27,9 @@ public class CONTAINER_MultiMachine extends GT_ContainerMetaTile_Machine { public String[] mTileDescription; private String[] oTileDescription; + + private GregtechMeta_MultiBlockBase mMCTEI; + private boolean mControllerSet = false; public CONTAINER_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) { @@ -29,56 +39,245 @@ public class CONTAINER_MultiMachine extends GT_ContainerMetaTile_Machine { public CONTAINER_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) { super(aInventoryPlayer, aTileEntity, bindInventory); } + + public static void setControllerInstance(CONTAINER_MultiMachine aContainer, IGregTechTileEntity aTile) { + if (aTile == null) { + return; + } + final IMetaTileEntity aMetaTileEntity = aTile.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return; + } + if (aMetaTileEntity instanceof GregtechMeta_MultiBlockBase) { + aContainer.mMCTEI = (GregtechMeta_MultiBlockBase) aMetaTileEntity; + } + } + + public int aTotalTickTime = 0; + public int aMaxParallel = 0; + public int aPollutionTick = 0; + public int aMaxInputVoltage = 0; + public int aInputTier = 0; + public int aOutputTier = 0; + public int aRecipeDuration = 0; + public int aRecipeEU = 0; + public int aRecipeSpecial = 0; + public int aPollutionReduction = 0; + public int aStoredEnergy = 0; + public int aMaxEnergy = 0; + public int aEfficiency = 0; + private int oTotalTickTime = 0; + private int oMaxParallel = 0; + private int oPollutionTick = 0; + private int oMaxInputVoltage = 0; + private int oInputTier = 0; + private int oOutputTier = 0; + private int oRecipeDuration = 0; + private int oRecipeEU = 0; + private int oRecipeSpecial = 0; + private int oPollutionReduction = 0; + private int oStoredEnergy = 0; + private int oMaxEnergy = 0; + private int oEfficiency = 0; + + private static Field timer; + //private static Field crafters; @Override - public void detectAndSendChanges() { + public final void detectAndSendChanges() { super.detectAndSendChanges(); if (this.mTileEntity.isClientSide() || this.mTileEntity.getMetaTileEntity() == null) { return; } - - try { - this.mTileDescription = this.mTileEntity.getInfoData(); - - Field bTimer = ReflectionUtils.getField(getClass(), "mTimer"); - Field bCrafters = ReflectionUtils.getField(getClass(), "crafters"); - int time = bTimer.getInt(this); - List crafters = (List) bCrafters.get(this); - AutoMap aCrafting = new AutoMap(); - if (crafters != null && !crafters.isEmpty()) { + if (!mControllerSet) { + setControllerInstance(this, this.mTileEntity); + } + mControllerSet = (mMCTEI != null); + if (timer == null) { + timer = ReflectionUtils.getField(getClass(), "mTimer"); + } + if (crafters == null) { + //crafters = ReflectionUtils.getField(getClass(), "crafters"); + } + if (timer != null && crafters != null && mControllerSet) { + Logger.INFO("Trying to update clientside GUI data"); + try { + Logger.INFO("0"); + int aTimer = (int) ReflectionUtils.getFieldValue(timer, this); + + //List crafters1List = (List) crafters1; + List crafters2 = new ArrayList(); + Logger.INFO("1"); for (Object o : crafters) { - aCrafting.put((ICrafting) o); + if (o instanceof ICrafting) { + crafters2.add((ICrafting) o); + } } - } + Logger.INFO("2"); + if (!crafters2.isEmpty()) { + Logger.INFO("3"); + handleInitialFieldSetting(); - for (final ICrafting var3 : aCrafting) { - if (time % 500 == 10 || this.oTileDescription != this.mTileDescription) { - var3.sendProgressBarUpdate((Container)this, 64, 0); + try { + Logger.INFO("4"); + for (final ICrafting var3 : crafters2) { + handleCraftingEvent(aTimer, var3); + } + Logger.INFO("5"); + handleInternalFieldSetting(); + Logger.INFO("6"); + } catch (Throwable t) { + + } } + } catch (Throwable t) { + t.printStackTrace(); } + } + else { + Logger.INFO("Failed."); + } + } + + public void handleInitialFieldSetting() { + this.aTotalTickTime = MathUtils.balance((int) mMCTEI.getTotalRuntimeInTicks(), Integer.MIN_VALUE, Integer.MAX_VALUE); + this.aMaxParallel = mMCTEI.getMaxParallelRecipes(); + this.aPollutionTick = mMCTEI.getPollutionPerTick(null); + this.aMaxInputVoltage = MathUtils.balance((int) mMCTEI.getMaxInputVoltage(), Integer.MIN_VALUE, Integer.MAX_VALUE); + this.aInputTier = MathUtils.balance((int) mMCTEI.getInputTier(), Integer.MIN_VALUE, Integer.MAX_VALUE); + this.aOutputTier = MathUtils.balance((int) mMCTEI.getOutputTier(), Integer.MIN_VALUE, Integer.MAX_VALUE); + if (mMCTEI.mLastRecipe != null) { + GT_Recipe aRecipe = mMCTEI.mLastRecipe; + this.aRecipeDuration = MathUtils.balance(aRecipe.mDuration, Integer.MIN_VALUE, Integer.MAX_VALUE); + this.aRecipeEU = MathUtils.balance(aRecipe.mEUt, Integer.MIN_VALUE, Integer.MAX_VALUE); + this.aRecipeSpecial = MathUtils.balance(aRecipe.mSpecialValue, Integer.MIN_VALUE, Integer.MAX_VALUE); + } + this.aPollutionReduction = mMCTEI.getPollutionReductionForAllMufflers(); + + this.aStoredEnergy = MathUtils.balance((int) mMCTEI.getStoredEnergyInAllEnergyHatches(), Integer.MIN_VALUE, Integer.MAX_VALUE); + this.aMaxEnergy = MathUtils.balance((int) mMCTEI.getMaxEnergyStorageOfAllEnergyHatches(), Integer.MIN_VALUE, Integer.MAX_VALUE); + this.aEfficiency = MathUtils.balance(mMCTEI.mEfficiency, Integer.MIN_VALUE, Integer.MAX_VALUE); + } - this.oTileDescription = this.mTileDescription; + public void handleCraftingEvent(int aTimer, ICrafting aCrafter) { + int aID = 750; + if (aTimer % 500 == 10 || this.oTotalTickTime != this.aTotalTickTime) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aTotalTickTime); + } + if (aTimer % 500 == 10 || this.oMaxParallel != this.aMaxParallel) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aMaxParallel); + } + if (aTimer % 500 == 10 || this.oPollutionTick != this.aPollutionTick) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aPollutionTick); + } + if (aTimer % 500 == 10 || this.oMaxInputVoltage != this.aMaxInputVoltage) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aMaxInputVoltage); + } + if (aTimer % 500 == 10 || this.oInputTier != this.aInputTier) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aInputTier); + } + if (aTimer % 500 == 10 || this.oOutputTier != this.aOutputTier) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aOutputTier); + } + if (aTimer % 500 == 10 || this.oRecipeDuration != this.aRecipeDuration) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aRecipeDuration); } - catch (Throwable t) { + if (aTimer % 500 == 10 || this.oRecipeEU != this.aRecipeEU) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aRecipeEU); + } + if (aTimer % 500 == 10 || this.oRecipeSpecial != this.aRecipeSpecial) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aRecipeSpecial); + } + if (aTimer % 500 == 10 || this.oPollutionReduction != this.aPollutionReduction) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aPollutionReduction); + } + if (aTimer % 500 == 10 || this.oStoredEnergy != this.aStoredEnergy) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aStoredEnergy); + } + if (aTimer % 500 == 10 || this.oMaxEnergy != this.aMaxEnergy) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aMaxEnergy); + } + if (aTimer % 500 == 10 || this.oEfficiency != this.aEfficiency) { + aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aEfficiency); + } + } + + public void handleInternalFieldSetting() { + this.oTotalTickTime = this.aTotalTickTime; + this.oMaxParallel = this.aMaxParallel; + this.oPollutionTick = this.aPollutionTick; + this.oMaxInputVoltage = this.aMaxInputVoltage; + this.oInputTier = this.aInputTier; + this.oOutputTier = this.aOutputTier; + this.oRecipeDuration = this.aRecipeDuration; + this.oRecipeEU = this.aRecipeEU; + this.oRecipeSpecial = this.aRecipeSpecial; + this.oPollutionReduction = this.aPollutionReduction; + this.oStoredEnergy = this.aStoredEnergy; + this.oMaxEnergy = this.aMaxEnergy; + this.oEfficiency = this.aEfficiency; + } + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(final int par1, final int par2) { + super.updateProgressBar(par1, par2); + int shiftedSwitch = par1 - 750; + switch (shiftedSwitch) { + case 0: { + this.aTotalTickTime = par2; + break; + } + case 1: { + this.aMaxParallel = par2; + break; + } + case 2: { + this.aPollutionTick = par2; + break; + } + case 3: { + this.aMaxInputVoltage = par2; + break; + } + case 4: { + this.aInputTier = par2; + break; + } + case 5: { + this.aOutputTier = par2; + break; + } + case 6: { + this.aRecipeDuration = par2; + break; + } + case 7: { + this.aRecipeEU = par2; + break; + } + case 8: { + this.aRecipeSpecial = par2; + break; + } + case 9: { + this.aPollutionReduction = par2; + break; + } + case 10: { + this.aStoredEnergy = par2; + break; + } + case 11: { + this.aMaxEnergy = par2; + break; + } + case 12: { + this.aEfficiency = par2; + break; + } } } } - -/*@Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new Slot(mTileEntity, 1, 152, 5)); - } - - @Override - public int getSlotCount() { - return 1; - } - - @Override - public int getShiftClickSlotCount() { - return 0; - } -}*/ diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java index 8293d5b9f3..c78e7789b8 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java @@ -1,23 +1,26 @@ package gtPlusPlus.xmod.gregtech.api.gui; -import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.TimeUnit; +import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Tool_01; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! @@ -28,128 +31,261 @@ import net.minecraft.util.ResourceLocation; */ public class GUI_MultiMachine extends GT_GUIContainerMetaTile_Machine { - String mName = ""; + private final static Materials GOOD; + private final static Materials BAD; + private final String mName; + + private final static ConcurrentHashMap mToolStacks = new ConcurrentHashMap(); + + //net.minecraft.client.gui.inventory.GuiContainer.drawItemStack(ItemStack, int, int, String) + private final static Method mDrawItemStack; + + static { + GOOD = Materials.Uranium; + BAD = Materials.Plutonium; + + //net.minecraft.client.gui.inventory.GuiContainer.drawItemStack(ItemStack, int, int, String) + mDrawItemStack = ReflectionUtils.getMethod(GuiContainer.class, "drawItemStack", new Class[] {ItemStack.class, int.class, int.class, String.class}); + } public GUI_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aTextureFile) { super(new CONTAINER_MultiMachine_NoPlayerInventory(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile)); - this.mName = aName; + this.mName = aName != null ? aName : ""; } @Override - protected void drawGuiContainerForegroundLayer(final int par1, final int par2) { - fontRendererObj.drawString(this.mName+"!", 6, 7, 16448255); + protected void drawGuiContainerForegroundLayer(final int par1, final int par2) { if (this.mContainer != null) { + drawGuiInfoTextLayer(par1, par2); + drawGuiRepairStatusLayer(par1, par2); + } + } - boolean aWrench = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 1) != 0; - boolean aScrewdriver = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 2) != 0; - boolean aMallet = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 4) != 0; - boolean aHammer = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 8) != 0; - boolean aSoldering = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 16) != 0; - boolean aCrowbar = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 32) != 0; - - - - //net.minecraft.client.gui.inventory.GuiContainer.drawItemStack(ItemStack, int, int, String) - Method aDrawItemStack = ReflectionUtils.getMethod(GuiContainer.class, "drawItemStack", new Class[] {ItemStack.class, int.class, int.class, String.class}); - if (aDrawItemStack != null) { - - try { - - if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) { - this.fontRendererObj.drawString("Incomplete Structure.", 10, 16, 16448255); // Move down 8px - } - else { - Field aStringData = ReflectionUtils.getField(this.mContainer.getClass(), "oTileDescription"); - if (aStringData != null) { - String[] aData = (String[]) aStringData.get(this.mContainer); - int aIndex = 0; - this.fontRendererObj.drawString(""+aStringData.getType().getSimpleName(), 6, 16+(aIndex++*8), 16448255); // Move down 8px - if (aData != null && aData.length > 0) { - for (String s : aData) { - this.fontRendererObj.drawString(s, 6, 16+(aIndex++*8), 16448255); // Move down 8px - } - } - else { - this.fontRendererObj.drawString("Unable to get Info Data from Tile Entity | "+(aData != null), 6, 16+(aIndex++*8), 16448255); // Move down 8px - } - } - else { - this.fontRendererObj.drawString("Unable to get Info Data from Tile Entity | Bad", 6, 16, 16448255); // Move down 8px - - - } - - } - - - - - - - - //Migrate to static block - - Materials GOOD = Materials.Uranium; - Materials BAD = Materials.Plutonium; - - ItemStack aWrenchStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, (aWrench ? BAD : GOOD), Materials.Tungsten, null); - ItemStack aCrowbarStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, (aCrowbar ? BAD : GOOD), Materials.Tungsten, null); - ItemStack aHammerStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, (aHammer ? BAD : GOOD), Materials.Tungsten, null); - ItemStack aMalletStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOFTHAMMER, 1, (aMallet ? BAD : GOOD), Materials.Tungsten, null); - ItemStack aScrewdriverStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, (aScrewdriver ? BAD : GOOD), Materials.Tungsten, null); - ItemStack aSolderingStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, (aSoldering ? BAD : GOOD), Materials.Tungsten, null); - - ItemStack[] aToolStacks2 = new ItemStack[] { - aWrenchStack, - aCrowbarStack, - aHammerStack, - aMalletStack, - aScrewdriverStack, - aSolderingStack - }; - - int aIndex = 0; - for (aIndex = 0; aIndex < 6; aIndex++) { - - int x = 156; - int y = 112 - (18*3) + (aIndex * 18); - aDrawItemStack.invoke(this, new Object[] { - aToolStacks2[aIndex] != null ? aToolStacks2[aIndex] : ItemUtils.getErrorStack(1, "Bad Times"), - x, - y, - ""+(aIndex == 2 ? "H" : aIndex == 3 ? "M" : "") // Stacksize Overlay - }); - this.fontRendererObj.drawString("", 10, 64, 16448255); - } - - } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { - e.printStackTrace(); - } + + protected void drawGuiInfoTextLayer(final float par1, final int par2) { + + if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) { + this.fontRendererObj.drawString(mName, 6, 7, 16448255); // Move down 8px + this.fontRendererObj.drawString("Incomplete Structure.", 6, 15, 16448255); // Move down 8px + } + else { + int aTotalTickTime = ((CONTAINER_MultiMachine) this.mContainer).aTotalTickTime; + int aMaxParallel = ((CONTAINER_MultiMachine) this.mContainer).aMaxParallel; + int aPollutionTick = ((CONTAINER_MultiMachine) this.mContainer).aPollutionTick; + int aMaxInputVoltage = ((CONTAINER_MultiMachine) this.mContainer).aMaxInputVoltage; + int aInputTier = ((CONTAINER_MultiMachine) this.mContainer).aInputTier; + int aOutputTier = ((CONTAINER_MultiMachine) this.mContainer).aOutputTier; + int aRecipeDuration = ((CONTAINER_MultiMachine) this.mContainer).aRecipeDuration; + int aRecipeEU = ((CONTAINER_MultiMachine) this.mContainer).aRecipeEU; + int aRecipeSpecial = ((CONTAINER_MultiMachine) this.mContainer).aRecipeSpecial; + int aEfficiency = ((CONTAINER_MultiMachine) this.mContainer).aEfficiency; + + int aPollutionReduction = ((CONTAINER_MultiMachine) this.mContainer).aPollutionReduction; + + + long aStoredEnergy = ((CONTAINER_MultiMachine) this.mContainer).aStoredEnergy; + long aMaxEnergy = ((CONTAINER_MultiMachine) this.mContainer).aMaxEnergy; + + /* + * Logic Block + */ + + long seconds = (aTotalTickTime/20); + int weeks = (int) (TimeUnit.SECONDS.toDays(seconds) / 7); + int days = (int) (TimeUnit.SECONDS.toDays(seconds) - 7 * weeks); + long hours = TimeUnit.SECONDS.toHours(seconds) - TimeUnit.DAYS.toHours(days) - TimeUnit.DAYS.toHours(7*weeks); + long minutes = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60); + long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) *60); + + ArrayList mInfo = new ArrayList(); + + String EU = StatCollector.translateToLocal("GTPP.info.eu"); + + //GTPP.machines.tier + + mInfo.add(mName); + + if (aInputTier > 0) { + mInfo.add(StatCollector.translateToLocal("GTPP.machines.input")+" "+StatCollector.translateToLocal("GTPP.machines.tier")+": "+ EnumChatFormatting.GREEN +GT_Values.VOLTAGE_NAMES[aInputTier]); + } + if (aOutputTier > 0) { + mInfo.add(StatCollector.translateToLocal("GTPP.machines.output")+" "+StatCollector.translateToLocal("GTPP.machines.tier")+": "+ EnumChatFormatting.GREEN +GT_Values.VOLTAGE_NAMES[aOutputTier]); + } + + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.progress")+": "+ + EnumChatFormatting.GREEN + Integer.toString(((CONTAINER_MultiMachine) this.mContainer).mProgressTime/20) + EnumChatFormatting.RESET +" s / "+ + EnumChatFormatting.YELLOW + Integer.toString(((CONTAINER_MultiMachine) this.mContainer).mMaxProgressTime/20) + EnumChatFormatting.RESET +" s"); + + + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy")+": "+ + EnumChatFormatting.GREEN + Long.toString(aStoredEnergy) + EnumChatFormatting.RESET +" "+EU+" / "+ + EnumChatFormatting.YELLOW + Long.toString(aMaxEnergy) + EnumChatFormatting.RESET +" "+EU+""); + + if (aRecipeEU != 0 && aRecipeDuration > 0) { + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.usage")+": "+ + EnumChatFormatting.RED + Integer.toString(-aRecipeEU) + EnumChatFormatting.RESET + " "+EU+"/t"); + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.duration")+": "+ + EnumChatFormatting.RED + Integer.toString(aRecipeDuration) + EnumChatFormatting.RESET + " ticks"); + if (aRecipeSpecial > 0) { + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.specialvalue")+": "+ + EnumChatFormatting.RED + Integer.toString(aRecipeEU) + EnumChatFormatting.RESET + ""); + } + } + + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.mei")+": "+ + EnumChatFormatting.YELLOW+Long.toString(aMaxInputVoltage)+EnumChatFormatting.RESET+ " "+EU+"/t"+EnumChatFormatting.RESET); + + mInfo.add(StatCollector.translateToLocal(StatCollector.translateToLocal("GTPP.machines.tier")+": "+ + EnumChatFormatting.YELLOW+GT_Values.VN[GT_Utility.getTier(aMaxInputVoltage)]+ EnumChatFormatting.RESET)); + + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.efficiency")+": "+ EnumChatFormatting.YELLOW+Float.toString(aEfficiency / 100.0F)+EnumChatFormatting.RESET + " %"); + + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollution")+": "+ EnumChatFormatting.RED + (aPollutionTick*20)+ EnumChatFormatting.RESET+"/sec"); + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollutionreduced")+": "+ EnumChatFormatting.GREEN + aPollutionReduction + EnumChatFormatting.RESET+" %"); + + mInfo.add(StatCollector.translateToLocal("GTPP.CC.parallel")+": "+EnumChatFormatting.GREEN+(aMaxParallel)+EnumChatFormatting.RESET); + + mInfo.add("Total Time Since Built: "); + mInfo.add("" + EnumChatFormatting.DARK_GREEN + Integer.toString(weeks)+EnumChatFormatting.RESET+" Weeks,"); + mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Integer.toString(days) +EnumChatFormatting.RESET+ " Days,"); + mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Long.toString(hours) +EnumChatFormatting.RESET+ " Hours,"); + mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Long.toString(minutes) +EnumChatFormatting.RESET+ " Minutes,"); + mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Long.toString(second) +EnumChatFormatting.RESET+ " Seconds"); + + + + // Machine Name + //fontRendererObj.drawString(this.mName, 6, 7, 16448255); + + for (int i=0;i 10) { + mStartUpCheck = 10; + } + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java index d3f6fdb491..97ee87e4a2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java @@ -408,23 +408,25 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase } - private volatile int mGraceTimer = 100; + private volatile int mGraceTimer = 2; - @SuppressWarnings("unused") @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (this.mMaxProgresstime > 0 && this.mProgresstime != 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) { - if (aTick % 10 == 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) { - if (!this.depleteInput(FluidUtils.getFluidStack("pyrotheum", 5))) { - this.causeMaintenanceIssue(); - this.stopMachine(); - } - if (false) { // To be replaced with a config option or something - this.explodeMultiblock(); - } - } + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + //Try dry Pyrotheum after all other logic + if (this.mStartUpCheck < 0) { + if (this.mMaxProgresstime > 0 && this.mProgresstime != 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) { + if (aTick % 10 == 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) { + if (!this.depleteInput(FluidUtils.getFluidStack("pyrotheum", 5))) { + if (mGraceTimer-- == 0) { + this.causeMaintenanceIssue(); + this.stopMachine(); + } + } + } + } } - super.onPostTick(aBaseMetaTileEntity, aTick); + } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java index 91620eece5..ed6c913e6b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java @@ -6,7 +6,6 @@ import gregtech.GT_Mod; import gregtech.api.enums.Dyes; import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; -import gregtech.api.gui.GT_Container_MultiMachine; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -22,14 +21,11 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.Recipe_GT; -import gregtech.common.gui.GT_GUIContainer_FusionReactor; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.chemistry.IonParticles; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; -import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_Cyclotron; -import gtPlusPlus.xmod.gregtech.api.gui.GUI_Cyclotron; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; @@ -173,12 +169,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas return false; } } - mWrench = true; - mScrewdriver = true; - mSoftHammer = true; - mHardHammer = true; - mSolderingTool = true; - mCrowbar = true; + this.fixAllMaintenanceIssue(); log("Built Cyclotron."); turnCasingActive(true); return true; @@ -320,7 +311,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas /*if (CORE.DEVENV) { return this.checkRecipeGeneric(); }*/ - + this.fixAllMaintenanceIssue(); //log("Recipe Check."); ArrayList tItemList = getStoredInputs(); @@ -411,6 +402,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas //Time Counter this.mTotalRunTime++; + this.fixAllMaintenanceIssue(); onRunningTick(null); @@ -502,7 +494,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas stopMachine(); } } - doRandomMaintenanceDamage(); + //doRandomMaintenanceDamage(); aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8) | (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64)); aBaseMetaTileEntity.setActive(mMaxProgresstime > 0); diff --git a/src/resources/assets/gregtech/lang/en_US.lang b/src/resources/assets/gregtech/lang/en_US.lang index c388f9785e..9989bffcf0 100644 --- a/src/resources/assets/gregtech/lang/en_US.lang +++ b/src/resources/assets/gregtech/lang/en_US.lang @@ -4,15 +4,19 @@ GTPP.EBF.heat=Heat capacity GTPP.machines.tier=Tier +GTPP.machines.input=Input +GTPP.machines.output=Output GTPP.multiblock.pollutionreduced=Pollution reduced to GTPP.multiblock.pollution=Pollution GTPP.multiblock.energy=Stored Energy -GTPP.multiblock.Progress=Progress +GTPP.multiblock.progress=Progress GTPP.multiblock.efficiency=Efficiency GTPP.multiblock.problems=Problems GTPP.multiblock.mei=Max Energy Income GTPP.multiblock.usage=Probably uses +GTPP.multiblock.specialvalue=Special Value +GTPP.multiblock.duration=Duration diff --git a/src/resources/assets/gregtech/lang/zh_CN.lang b/src/resources/assets/gregtech/lang/zh_CN.lang index 750961610a..df43ca8590 100644 --- a/src/resources/assets/gregtech/lang/zh_CN.lang +++ b/src/resources/assets/gregtech/lang/zh_CN.lang @@ -8,7 +8,7 @@ GTPP.machines.tier=等级 GTPP.multiblock.pollutionreduced=减少污染至 GTPP.multiblock.pollution=污染 GTPP.multiblock.energy=能量存储 -GTPP.multiblock.Progress=进程 +GTPP.multiblock.progress=进程 GTPP.multiblock.efficiency=效率 GTPP.multiblock.problems=为每桶 GTPP.multiblock.mei=最大能量输入 -- cgit From 10d4c7d4b4fd651d64f17936a916785b36a43f92 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 8 Dec 2019 02:00:35 +0000 Subject: + Added an assembly recipe for tier 1 Round Robinators. + Added localization for Rotor Housing achievement. + Added the Algae Farm (WIP). - Removed Durability bar on Iridium Rotors. - Reverted 2A hatch fix on Multiblocks. % Adjusted all Robinator recipes, removing the fluid requirements. $ Fixed Robinators Crashing on Servers. $ Implemented new backend for all future non-GT tile entities. --- .../api/objects/minecraft/CubicObject.java | 62 +++++ .../api/objects/minecraft/SafeTexture.java | 64 +++++ .../core/block/base/BasicTileBlockWithTooltip.java | 309 +++++++++++++++++++++ .../core/block/machine/CircuitProgrammer.java | 111 ++++---- .../core/block/machine/Machine_RoundRobinator.java | 138 ++++----- .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 1 + .../item/base/itemblock/ItemBlockBasicTile.java | 33 ++- .../item/base/itemblock/ItemBlockBasicTooltip.java | 34 --- .../base/itemblock/ItemBlockRoundRobinator.java | 6 +- src/Java/gtPlusPlus/core/lib/CORE.java | 23 +- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 6 +- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 13 +- .../core/util/minecraft/ClientUtils.java | 18 ++ .../xmod/gregtech/api/enums/GregtechItemList.java | 3 + .../base/GregtechMeta_MultiBlockBase.java | 51 ++-- .../algae/GregtechMTE_AlgaePondBase.java | 128 +++++++++ .../gregtech/GregtechAlgaeContent.java | 24 ++ .../xmod/ic2/item/CustomKineticRotor.java | 274 ++++++++++++++++++ src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java | 68 ++--- .../gtPlusPlus/xmod/ic2/item/RotorIridium.java | 5 + src/resources/assets/gregtech/lang/en_US.lang | 4 +- .../RoundRobinator/RoundRobinator_Side_0.png | Bin 1448 -> 0 bytes .../RoundRobinator/RoundRobinator_Side_1.png | Bin 1444 -> 0 bytes .../RoundRobinator/RoundRobinator_Side_2.png | Bin 1446 -> 0 bytes .../RoundRobinator/RoundRobinator_Side_3.png | Bin 1446 -> 0 bytes .../RoundRobinator/RoundRobinator_Side_4.png | Bin 1443 -> 0 bytes .../RoundRobinator/RoundRobinator_Top_0.png | Bin 1405 -> 0 bytes .../RoundRobinator/RoundRobinator_Top_1.png | Bin 1403 -> 0 bytes .../RoundRobinator/RoundRobinator_Top_2.png | Bin 1403 -> 0 bytes .../RoundRobinator/RoundRobinator_Top_3.png | Bin 1402 -> 0 bytes .../RoundRobinator/RoundRobinator_Top_4.png | Bin 1400 -> 0 bytes .../blocks/TileEntities/RoundRobinator/Side_0.png | Bin 0 -> 1448 bytes .../blocks/TileEntities/RoundRobinator/Side_1.png | Bin 0 -> 1444 bytes .../blocks/TileEntities/RoundRobinator/Side_2.png | Bin 0 -> 1446 bytes .../blocks/TileEntities/RoundRobinator/Side_3.png | Bin 0 -> 1446 bytes .../blocks/TileEntities/RoundRobinator/Side_4.png | Bin 0 -> 1443 bytes .../blocks/TileEntities/RoundRobinator/Top_0.png | Bin 0 -> 1405 bytes .../blocks/TileEntities/RoundRobinator/Top_1.png | Bin 0 -> 1403 bytes .../blocks/TileEntities/RoundRobinator/Top_2.png | Bin 0 -> 1403 bytes .../blocks/TileEntities/RoundRobinator/Top_3.png | Bin 0 -> 1402 bytes .../blocks/TileEntities/RoundRobinator/Top_4.png | Bin 0 -> 1400 bytes 41 files changed, 1096 insertions(+), 279 deletions(-) create mode 100644 src/Java/gtPlusPlus/api/objects/minecraft/CubicObject.java create mode 100644 src/Java/gtPlusPlus/api/objects/minecraft/SafeTexture.java create mode 100644 src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java delete mode 100644 src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTooltip.java create mode 100644 src/Java/gtPlusPlus/core/util/minecraft/ClientUtils.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java create mode 100644 src/Java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png delete mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_0.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_1.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_2.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_3.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_4.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_0.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_1.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_2.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_3.png create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_4.png (limited to 'src/resources/assets/gregtech/lang') diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/CubicObject.java b/src/Java/gtPlusPlus/api/objects/minecraft/CubicObject.java new file mode 100644 index 0000000000..8c76513d09 --- /dev/null +++ b/src/Java/gtPlusPlus/api/objects/minecraft/CubicObject.java @@ -0,0 +1,62 @@ +package gtPlusPlus.api.objects.minecraft; + +import gtPlusPlus.api.objects.data.AutoMap; +import net.minecraftforge.common.util.ForgeDirection; + +public class CubicObject { + + public final T NORTH; + public final T SOUTH; + + public final T WEST; + public final T EAST; + + public final T UP; + public final T DOWN; + + public CubicObject(AutoMap aDataSet) { + this(aDataSet.get(0), aDataSet.get(1), aDataSet.get(2), aDataSet.get(3), aDataSet.get(4), aDataSet.get(5)); + } + + public CubicObject(T[] aDataSet) { + this(aDataSet[0], aDataSet[1], aDataSet[2], aDataSet[3], aDataSet[4], aDataSet[5]); + } + + public CubicObject(T aDOWN, T aUP, T aNORTH, T aSOUTH, T aWEST, T aEAST) { + DOWN = aDOWN; + UP = aUP; + NORTH = aNORTH; + SOUTH = aSOUTH; + WEST = aWEST; + EAST = aEAST; + } + + public T get(int aSide) { + return get(ForgeDirection.getOrientation(aSide)); + } + + public T get(ForgeDirection aSide) { + if (aSide == ForgeDirection.DOWN) { + return DOWN; + } + else if (aSide == ForgeDirection.UP) { + return UP; + } + else if (aSide == ForgeDirection.NORTH) { + return NORTH; + } + else if (aSide == ForgeDirection.SOUTH) { + return SOUTH; + } + else if (aSide == ForgeDirection.WEST) { + return WEST; + } + else if (aSide == ForgeDirection.EAST) { + return EAST; + } + else { + return null; + } + } + +} diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/SafeTexture.java b/src/Java/gtPlusPlus/api/objects/minecraft/SafeTexture.java new file mode 100644 index 0000000000..7c418b5a77 --- /dev/null +++ b/src/Java/gtPlusPlus/api/objects/minecraft/SafeTexture.java @@ -0,0 +1,64 @@ +package gtPlusPlus.api.objects.minecraft; + +import java.util.HashMap; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gtPlusPlus.core.util.Utils; +import net.minecraft.util.IIcon; + +/** + * A Server Side safe object that can hold {@link IIcon}s. + * @author Alkalus + * + */ +public class SafeTexture implements Runnable { + + @SideOnly(Side.CLIENT) + private static final HashMap mHashToIconCache = new HashMap(); + + @SideOnly(Side.CLIENT) + private static final HashMap mPathToHashCash = new HashMap(); + + private static final HashMap mTextureObjectCache = new HashMap(); + + private final int mHash; + + private final String mTextureName; + + private final static String getKey(String aTexPath) { + String aNameKey = Utils.sanitizeString(aTexPath); + aNameKey = aNameKey.replace('/', ' '); + aNameKey = aNameKey.toLowerCase(); + return aNameKey; + } + + public static SafeTexture register(String aTexturePath) { + String aNameKey = getKey(aTexturePath); + SafeTexture g = mTextureObjectCache.get(aNameKey); + if (g == null) { + g = new SafeTexture(aTexturePath); + mTextureObjectCache.put(aNameKey, g); + mPathToHashCash.put(aTexturePath, aTexturePath.hashCode()); + } + return g; + } + + private SafeTexture(String aTexturePath) { + mTextureName = aTexturePath; + mHash = getKey(aTexturePath).hashCode(); + GregTech_API.sGTBlockIconload.add(this); + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon() { + return mHashToIconCache.get(mHash); + } + + @Override + public void run() { + mHashToIconCache.put(getKey(mTextureName).hashCode(), GregTech_API.sBlockIcons.registerIcon(mTextureName)); + } + +} diff --git a/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java b/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java new file mode 100644 index 0000000000..098b670509 --- /dev/null +++ b/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java @@ -0,0 +1,309 @@ +package gtPlusPlus.core.block.base; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.interfaces.ITileTooltip; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.api.objects.minecraft.CubicObject; +import gtPlusPlus.api.objects.minecraft.SafeTexture; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.minecraft.InventoryUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BasicTileBlockWithTooltip extends BlockContainer implements ITileTooltip { + + /** + * Each mapped object holds the data for the six sides. + */ + @SideOnly(Side.CLIENT) + private AutoMap> mSidedTextureArray = new AutoMap>(); + + /** + * Holds the data for the six sides, each side holds an array of data for each respective meta. + */ + @SideOnly(Side.CLIENT) + private AutoMap> mSidedTexturePathArray = new AutoMap>(); + + /** + * Does this block have any meta at all? + * @return + */ + public final boolean hasMeta() { + return getMetaCount() > 0; + } + + /** + * The amount of meta this block has. + * @return + */ + public abstract int getMetaCount(); + + /** + * Does this {@link Block} require special {@link ItemBlock} handling? + * @return The {@link Class} that will be used for this {@link Block}. + */ + public Class getItemBlockClass() { + return ItemBlock.class; + } + + /** + * A lazy way to declare the unlocal name for the block, makes boilerplating easy. + * @return The internal name for this block. + */ + public abstract String getUnlocalBlockName(); + + /** + * Does this Block have {@link ITileTooltip} support? + * @return {@link boolean} that represents if this block supports {@link ITileTooltip} or not. + */ + public final boolean hasTooltip() { + return getTooltipID() >= -1; + } + + /** + * Lazy Boilerplating. + * @return Block Hardness. + */ + protected abstract float initBlockHardness(); + + /** + * Lazy Boilerplating. + * @return Block Resistance. + */ + protected abstract float initBlockResistance(); + + /** + * Lazy Boilerplating. + * @return The {@link CreativeTab} this Block is shown on. + */ + protected abstract CreativeTabs initCreativeTab(); + + /** + * The ID used by the {@link ITileTooltip} handler. Return -1 if you are not providing a custom {@link ItemBlock} in {@link #getItemBlockClass}(). + * @return + */ + @Override + public abstract int getTooltipID(); + + public BasicTileBlockWithTooltip(Material aBlockMat){ + super(aBlockMat); + //Use Abstract method values + this.setHardness(initBlockHardness()); + this.setResistance(initBlockResistance()); + this.setBlockName(getUnlocalBlockName()); + this.setCreativeTab(initCreativeTab()); + // Register the block last. + GameRegistry.registerBlock(this, getItemBlockClass(), getUnlocalBlockName()); + Logger.INFO("Registered "+getTileEntityName()+"."); + if (Utils.isClient()) { + // Handle Textures + handleTextures(); + } + } + + /** + * The name of the Tile Entity. + * @return + */ + protected abstract String getTileEntityName(); + + /** + * The String used for texture pathing. + * @return Sanitized {@link String}, containing no spaces or illegal characters. + */ + private final String getTileEntityNameForTexturePathing() { + return Utils.sanitizeString(getTileEntityName().replace(" ", "")); + } + + /** + * An array of CubicObjects, one for each meta, else just a single cell array. + * Expected to be null regularly, as the default texture handling should suffice. + * Handy if re-using textures or using a non-standard structure for them. FULL texture path must be used, + * inclusive of the MODID and a colon. + * @return + */ + public CubicObject[] getCustomTextureDirectoryObject(){ + return null; + } + + @Override + @SideOnly(Side.CLIENT) + public final IIcon getIcon(final int aSide, final int aMeta) { + return mSidedTextureArray.get(aMeta).get(aSide).getIcon(); + } + + @Override + public IIcon getIcon(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) { + return super.getIcon(aWorld, aX, aY, aZ, aSide); + } + + @SideOnly(Side.CLIENT) + private final void handleTextures() { + + Logger.INFO("[TeTexture] Building Texture Maps for "+getTileEntityName()+"."); + //Store them in forge order + //DOWN, UP, NORTH, SOUTH, WEST, EAST + + // Default Path Name, this will make us look inside 'miscutils\textures\blocks' + final String aPrefixTexPath = CORE.MODID + ":"; + // Default Path Name, this will make us look in the sub-directory for this Tile Entity. + final String aTexPathMid = "TileEntities"+CORE.SEPERATOR+getTileEntityNameForTexturePathing()+CORE.SEPERATOR; + // Construct a full path + String aTexPathBuilt = aPrefixTexPath + aTexPathMid; + // File Name Suffixes, without meta tags + String aStringBot; + String aStringTop; + String aStringBack; + String aStringFront; + String aStringLeft; + String aStringRight; + // Do we provide a matrix of custom data to be used for texture processing instead? + if (getCustomTextureDirectoryObject() != null) { + // Get custom provided texture data. + CubicObject[] aDataMap = getCustomTextureDirectoryObject(); + Logger.INFO("[TeTexture] Found custom texture data, using this instead. Size: "+aDataMap.length); + // Map each meta string data to the main map. + for (int i=0;i aMetaBlob = new CubicObject(aStringBot, aStringTop, aStringBack, aStringFront, aStringLeft, aStringRight); + mSidedTexturePathArray.put(aMetaBlob); + Logger.INFO("[TeTexture] Added Texture Path data to map for meta "+i); + } + } + Logger.INFO("[TeTexture] Map size for pathing: "+mSidedTexturePathArray.size()); + + // Iteration Index + int aIndex = 0; + + // Iterate each CubicObject, holding the six texture paths for each meta. + for (CubicObject aMetaBlob : mSidedTexturePathArray) { + // Make a Safe Texture for each side + SafeTexture aBottom = SafeTexture.register(aMetaBlob.DOWN); + SafeTexture aTop = SafeTexture.register(aMetaBlob.UP); + SafeTexture aBack = SafeTexture.register(aMetaBlob.NORTH); + SafeTexture aFont = SafeTexture.register(aMetaBlob.SOUTH); + SafeTexture aWest = SafeTexture.register(aMetaBlob.WEST); + SafeTexture aEast = SafeTexture.register(aMetaBlob.EAST); + // Store them in an Array + SafeTexture[] aInjectBlob = new SafeTexture[] { + aBottom, + aTop, + aBack, + aFont, + aWest, + aEast + }; + // Convenience Blob + CubicObject aMetaBlob2 = new CubicObject(aInjectBlob); + // Store this Blob into + mSidedTextureArray.put(aMetaBlob2); + Logger.INFO("[TeTexture] Added SafeTexture data to map for meta "+(aIndex++)); + } + Logger.INFO("[TeTexture] Map size for registration: "+mSidedTextureArray.size()); + + + } + + @Override + @SideOnly(Side.CLIENT) + public final void registerBlockIcons(final IIconRegister aRegisterer){ + this.blockIcon = aRegisterer.registerIcon(CORE.MODID + ":" + "net"); + } + + @Override + public abstract TileEntity createNewTileEntity(final World world, final int p_149915_2_); + + /** + * Called when {@link #breakBlock}() is called, but before {@link InventoryUtils#dropInventoryItems} and the super call. + */ + public void onBlockBreak() { + + } + + @Override + public final void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int number) { + onBlockBreak(); + InventoryUtils.dropInventoryItems(world, x, y, z, block); + super.breakBlock(world, x, y, z, block, number); + } + + @SuppressWarnings({"unchecked", "rawtypes"}) + @Override + public final void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) { + if (hasMeta()) { + for (int i=0;i[] getCustomTextureDirectoryObject() { + String[] aTexData = new String[] { + CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_G", + CORE.MODID + ":" + "metro/" + "TEXTURE_TECH_PANEL_B", + CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I", + CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I", + CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I", + CORE.MODID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I" + }; + CubicObject[] aTextureData = new CubicObject[] {new CubicObject(aTexData)}; + return aTextureData; + } + } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java b/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java index cd480dcffe..dc87b885b9 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_RoundRobinator.java @@ -1,85 +1,27 @@ package gtPlusPlus.core.block.machine; -import java.util.List; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.common.items.GT_MetaGenerated_Tool_01; -import gtPlusPlus.api.interfaces.ITileTooltip; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.api.objects.minecraft.CubicObject; +import gtPlusPlus.core.block.base.BasicTileBlockWithTooltip; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.item.base.itemblock.ItemBlockRoundRobinator; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; -import gtPlusPlus.core.util.minecraft.InventoryUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -public class Machine_RoundRobinator extends BlockContainer implements ITileTooltip -{ - @SideOnly(Side.CLIENT) - private IIcon[] textureTop = new IIcon[5]; - @SideOnly(Side.CLIENT) - private IIcon[] textureFront = new IIcon[5]; +public class Machine_RoundRobinator extends BasicTileBlockWithTooltip { + - /** - * Determines which tooltip is displayed within the itemblock. - */ - private final int mTooltipID = 7; - - @Override - public int getTooltipID() { - return this.mTooltipID; - } - - @SuppressWarnings("deprecation") public Machine_RoundRobinator(){ super(Material.iron); - this.setHardness(1f); - this.setResistance(1f); - this.setBlockName("blockRoundRobinator"); - this.setCreativeTab(AddToCreativeTab.tabMachines); - GameRegistry.registerBlock(this, ItemBlockRoundRobinator.class, "blockRoundRobinator"); - //LanguageRegistry.addName(this, "Round-Robinator"); - - } - - /** - * Gets the block's texture. Args: side, meta - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(final int aSide, final int aMeta) { - if (aSide < 2) { - return this.textureTop[aMeta]; - } - else { - return this.textureFront[aMeta]; - } - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister p_149651_1_){ - this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "RoundRobinator_Side"); - for (int i=0;i<5;i++) { - this.textureTop[i] = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/RoundRobinator/" + "RoundRobinator_Top_"+i); - this.textureFront[i] = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/RoundRobinator/" + "RoundRobinator_Side_"+i); - } } /** @@ -97,13 +39,11 @@ public class Machine_RoundRobinator extends BlockContainer implements ITileToolt // Check For Screwdriver try { final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName()); - final Item mHandItem = mHandStack.getItem(); - if (((mHandItem instanceof GT_MetaGenerated_Tool_01) - && ((mHandItem.getDamage(mHandStack) == 22) || (mHandItem.getDamage(mHandStack) == 150)))) { + if (ItemUtils.isToolScrewdriver(mHandStack)) { final TileEntityRoundRobinator tile = (TileEntityRoundRobinator) world.getTileEntity(x, y, z); if (tile != null) { mDidScrewDriver = tile.onScrewdriverRightClick((byte) side, player, x, y, z); - } + } } } catch (final Throwable t) {} @@ -122,52 +62,70 @@ public class Machine_RoundRobinator extends BlockContainer implements ITileToolt } @Override - public int getRenderBlockPass() { - return 0; + public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { + return new TileEntityRoundRobinator(); } @Override - public boolean isOpaqueCube() { - return false; + public int getMetaCount() { + return 5; } @Override - public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { - return new TileEntityRoundRobinator(); + public String getUnlocalBlockName() { + return "blockRoundRobinator"; } @Override - public void onBlockAdded(final World world, final int x, final int y, final int z) { - super.onBlockAdded(world, x, y, z); + protected float initBlockHardness() { + return 1; } @Override - public void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int number) { - InventoryUtils.dropInventoryItems(world, x, y, z, block); - super.breakBlock(world, x, y, z, block, number); + protected float initBlockResistance() { + return 1; } @Override - public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, final ItemStack stack) { - super.onBlockPlacedBy(world, x, y, z, entity, stack); + protected CreativeTabs initCreativeTab() { + return AddToCreativeTab.tabMachines; } @Override - public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) { - return false; + public int getTooltipID() { + return -1; } @Override - public void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) { - //super.getSubBlocks(aItem, p_149666_2_, aList); - for (int i=0;i<5;i++) { - aList.add(ItemUtils.simpleMetaStack(aItem, i, 1)); - } + protected String getTileEntityName() { + return "Round Robinator"; + } + + @Override + public Class getItemBlockClass() { + return ItemBlockRoundRobinator.class; } @Override - public IIcon getIcon(IBlockAccess aBlockAccess, int x, int y, int z, int aSide) { - return super.getIcon(aBlockAccess, x, y, z, aSide); + public CubicObject[] getCustomTextureDirectoryObject() { + AutoMap aTemp = new AutoMap(); + for (int i=0;i<5;i++) { + String[] aTexData = new String[] { + CORE.MODID + ":" + "TileEntities/RoundRobinator/Top_"+i, + CORE.MODID + ":" + "TileEntities/RoundRobinator/Top_"+i, + CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i, + CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i, + CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i, + CORE.MODID + ":" + "TileEntities/RoundRobinator/Side_"+i, + }; + aTemp.put(aTexData); + } + AutoMap> aTemp2 = new AutoMap>(); + for (String[] y : aTemp) { + aTemp2.put(new CubicObject(y)); + } + CubicObject[] aTextureData = new CubicObject[] {aTemp2.get(0), aTemp2.get(1), aTemp2.get(2), aTemp2.get(3), aTemp2.get(4)}; + return aTextureData; } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index 0b1078366a..ca62a524c1 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -136,6 +136,7 @@ public class COMPAT_HANDLER { GregtechLargeTurbinesAndHeatExchanger.run(); GregtechPowerBreakers.run(); GregtechFluidReactor.run(); + GregtechAlgaeContent.run(); //New Horizons Content NewHorizonsAccelerator.run(); diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java index 42890ddfa6..251230932c 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java @@ -26,28 +26,43 @@ public class ItemBlockBasicTile extends ItemBlock { list.add("Can also be placed beside upto 4 other fish traps"); list.add("Requires at least two faces touching water"); list.add("1/1000 chance to produce triple loot."); - } else if (this.mID == 1) { // Modularity + } + else if (this.mID == 1) { // Modularity list.add("Used to construct modular armour & bauble upgrades.."); - } else if (this.mID == 2) { // Trade + } + else if (this.mID == 2) { // Trade list.add("Allows for SMP trade-o-mat type trading."); - } else if (this.mID == 3) { // Project + } + else if (this.mID == 3) { // Project list.add("Scan any crafting recipe in this to mass fabricate them in the Autocrafter.."); - } else if (this.mID == 4) { // Circuit Table + } + else if (this.mID == 4) { // Circuit Table list.add("Easy Circuit Configuration"); list.add("Change default setting with a Screwdriver"); list.add("Default is used to select slot for auto-insertion"); - } else if (this.mID == 5) { // Decayables Chest + } + else if (this.mID == 5) { // Decayables Chest list.add("Chest which holds radioactive materials"); list.add("Items which decay will tick while inside"); list.add("Place with right click"); - } else if (this.mID == 6) { // Butterfly Killer + } + else if (this.mID == 6) { // Butterfly Killer list.add("Kills Forestry Butterflies, Bats and other pests"); list.add("Use either Formaldehyde or Hydrogen cyanide"); list.add("Be weary of your neighbours"); - } else if (this.mID == 7) { - } else { - list.add("Bad Tooltip ID - " + mID); + } + else if (this.mID == 7) { + } + else if (this.mID == 8){ + + } + else if (this.mID == 9){ + + } + + else { + list.add("Bad Tooltip ID - " + mID); } super.addInformation(stack, aPlayer, list, bool); } diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTooltip.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTooltip.java deleted file mode 100644 index 9badd384d8..0000000000 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTooltip.java +++ /dev/null @@ -1,34 +0,0 @@ -package gtPlusPlus.core.item.base.itemblock; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -import gtPlusPlus.api.interfaces.ITileTooltip; - -public class ItemBlockBasicTooltip extends ItemBlock{ - - protected final int mID; - - public ItemBlockBasicTooltip(final Block block) { - super(block); - this.mID = ((ITileTooltip) block).getTooltipID(); - } - - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - if (this.mID == 0){ //blockDarkWorldPortalFrame - list.add("Assembled in the same shape as the Nether Portal."); - } - else if (this.mID == 1){ //Modularity - list.add("Used to construct modular armour & bauble upgrades.."); - } - } - - -} diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java index f586695eb7..2d0fd00dd9 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockRoundRobinator.java @@ -16,8 +16,6 @@ public class ItemBlockRoundRobinator extends ItemBlockWithMetadata public ItemBlockRoundRobinator(final Block aBlock){ super(aBlock, aBlock); this.mBlock = aBlock; - this.setMaxDamage(4); - this.setHasSubtypes(true); } @@ -40,7 +38,7 @@ public class ItemBlockRoundRobinator extends ItemBlockWithMetadata else if (stack.getItemDamage() == 4) { list.add("1 Item per enabled side every tick"); } - list.add("Top and bottom do not pull, so you must push item in"); + list.add("Top and bottom do not pull, so you must push items in"); list.add("Sides can also be disabled with a screwdriver"); list.add("Shift+RMB with empty hand to view inventory contents"); super.addInformation(stack, aPlayer, list, bool); @@ -62,7 +60,7 @@ public class ItemBlockRoundRobinator extends ItemBlockWithMetadata @Override public int getMetadata(final int p_77647_1_) { - return super.getMetadata(p_77647_1_); + return p_77647_1_; } @Override diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java index 04f1861cfe..3330ad8c3f 100644 --- a/src/Java/gtPlusPlus/core/lib/CORE.java +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -5,10 +5,13 @@ import java.util.concurrent.ConcurrentHashMap; import com.mojang.authlib.GameProfile; +import cpw.mods.fml.common.FMLCommonHandler; import gregtech.api.GregTech_API; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.api.objects.random.XSTR; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.core.util.sys.GeoUtils; import gtPlusPlus.core.util.sys.NetworkUtils; import gtPlusPlus.preloader.CORE_Preloader; @@ -52,7 +55,7 @@ public class CORE { public static final String name = "GT++"; public static final String MODID = "miscutils"; - public static final String VERSION = "1.7.03.01"; + public static final String VERSION = "1.7.03.45"; public static String MASTER_VERSION = NetworkUtils.getContentFromURL("https://raw.githubusercontent.com/draknyte1/GTplusplus/master/Recommended.txt").toLowerCase(); public static String USER_COUNTRY = GeoUtils.determineUsersCountry(); public static boolean isModUpToDate = Utils.isModUpToDate(); @@ -76,7 +79,7 @@ public class CORE { public static int turbineCutoffBase = 75000; //GT++ Fake Player Profile - public static GameProfile gameProfile = new GameProfile(UUID.nameUUIDFromBytes("gtplusplus.core".getBytes()), "[GT++]"); + public static final GameProfile gameProfile = new GameProfile(UUID.nameUUIDFromBytes("gtplusplus.core".getBytes()), "[GT++]"); public static final WeakHashMap fakePlayerCache = new WeakHashMap(); //Tooltips; public static final String GT_Tooltip = "Added by: " + EnumChatFormatting.DARK_GREEN+"Alkalus "+EnumChatFormatting.GRAY+"- "+EnumChatFormatting.RED+"[GT++]"; @@ -88,6 +91,7 @@ public class CORE { //Because I want to be lazy. Beyond Reality Classic Var. public static boolean BRC = false; + public static final String SEPERATOR = "/"; /** @@ -286,7 +290,20 @@ public class CORE { } public static final void crash() { - System.exit(0); + Logger.ERROR("=========================================================="); + Logger.ERROR("[GT++ CRASH]"); + Logger.ERROR("=========================================================="); + Logger.ERROR("Oooops..."); + Logger.ERROR("This should only happy in a development environment or when something really bad happens."); + Logger.ERROR("=========================================================="); + Logger.ERROR("Called from: "+ReflectionUtils.getMethodName(0)); + Logger.ERROR(ReflectionUtils.getMethodName(1)); + Logger.ERROR(ReflectionUtils.getMethodName(2)); + Logger.ERROR(ReflectionUtils.getMethodName(3)); + Logger.ERROR(ReflectionUtils.getMethodName(4)); + Logger.ERROR(ReflectionUtils.getMethodName(5)); + Logger.ERROR(ReflectionUtils.getMethodName(6)); + FMLCommonHandler.instance().exitJava(0, true); } public static final void gc() { diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index ea7f5e4ef7..cac54cec4e 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -1584,10 +1584,10 @@ public class RECIPES_GREGTECH { // Supreme Pizza Gloves CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { - ItemUtils.getGregtechCircuit(17), - ItemUtils.getSimpleStack(ModItems.itemRope, 16), + ItemUtils.getGregtechCircuit(19), + ItemUtils.getSimpleStack(ModItems.itemRope, GTNH ? 32 : 16), ItemUtils.getItemStackOfAmountFromOreDict("gearGtSmallWroughtIron", GTNH ? 8 : 4), - ItemUtils.getItemStackOfAmountFromOreDict("wireFineTin", GTNH ? 32 : 16), + ItemUtils.getItemStackOfAmountFromOreDict("wireFineCopper", GTNH ? 32 : 16), ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(1), GTNH ? 2 : 1) }, FluidUtils.getFluidStack("molten.rubber", 2000), diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index c0a4a998e8..f5bd390aee 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -2331,6 +2331,17 @@ public class RECIPES_Machines { for (int i = 0; i < 5; i++) { if (i == 0) { + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedCircuit(17), + CI.getTieredMachineCasing(0), + ItemUtils.getSimpleStack(Blocks.hopper, 4), + CI.getTieredComponent(OrePrefixes.circuit, 0, 2) + }, + GT_Values.NF, //Input Fluid + aRobinators[i], + 45 * 10 * 1, + 8); continue; } int aTier = i+1; @@ -2345,7 +2356,7 @@ public class RECIPES_Machines { CORE.RA.addSixSlotAssemblingRecipe( aInputs, - CI.getAlternativeTieredFluid(aTier, (144 * 2 * i)), //Input Fluid + GT_Values.NF, //Input Fluid aRobinators[i], 45 * 10 * 1 * (i+1), MaterialUtils.getVoltageForTier(i)); diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ClientUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ClientUtils.java new file mode 100644 index 0000000000..806f83d830 --- /dev/null +++ b/src/Java/gtPlusPlus/core/util/minecraft/ClientUtils.java @@ -0,0 +1,18 @@ +package gtPlusPlus.core.util.minecraft; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; + +public class ClientUtils { + + static { + if (FMLCommonHandler.instance().getSide() == Side.SERVER) { + Logger.ERROR("Something tried to access the ClientUtils class from the Server Side."); + Logger.ERROR("Soft crashing to prevent data corruption."); + CORE.crash(); + } + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 3ea2851a85..3fc6d9d667 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -228,6 +228,9 @@ public enum GregtechItemList implements GregtechItemContainer { //Fish Pond Industrial_FishingPond, Casing_FishPond, + + //Algae + AlgaeFarm_Controller, //GT4 autoCrafter diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index e5d7f58dc6..ece8dfaa87 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -474,7 +474,7 @@ GT_MetaTileEntity_MultiBlockBase { public boolean canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes) { Logger.INFO("Determining if we have space to buffer outputs."); - + // Null recipe or a recipe with lots of outputs? // E.G. Gendustry custom comb with a billion centrifuge outputs? // Do it anyway. @@ -736,7 +736,7 @@ GT_MetaTileEntity_MultiBlockBase { // Check next fluid continue aFluidMatch; } - + } else { continue aFluidMatch; @@ -744,14 +744,14 @@ GT_MetaTileEntity_MultiBlockBase { } } } - + for (Triplet aFreeHatchCheck : aOutputHatches) { // Free Hatch if (aFreeHatchCheck.getValue_2() == null || aFreeHatchCheck.getValue_3() == 0 || aFreeHatchCheck.getValue_1().getFluid() == null) { aEmptyFluidHatches++; } } - + // We have Fluid Stacks we did not merge. Do we have space? if (aOutputFluids.size() > 0) { // Not enough space to add fluids. @@ -760,7 +760,7 @@ GT_MetaTileEntity_MultiBlockBase { return false; } } - + /* * End Fluid Management */ @@ -978,41 +978,22 @@ GT_MetaTileEntity_MultiBlockBase { ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { - // Based on the Processing Array. A bit overkill, but very flexible. - - + // Based on the Processing Array. A bit overkill, but very flexible. // Reset outputs and progress stats this.mEUt = 0; this.mMaxProgresstime = 0; this.mOutputItems = new ItemStack[]{}; this.mOutputFluids = new FluidStack[]{}; - - - - // Get input Voltage + long tVoltage = getMaxInputVoltage(); - - // Get total Amps available to this multiblock - long tAmpsIn = 0; - for (GT_MetaTileEntity_Hatch_Energy aHatch : this.mEnergyHatches) { - tAmpsIn += aHatch.maxAmperesIn(); - } - - // How much voltage can actually go in - long tEffectiveVoltage = tVoltage * tAmpsIn; - - byte tTierInputVoltage = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tEffectiveVoltage)); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); log("Running checkRecipeGeneric(0)"); - log("Amps: "+tAmpsIn); - log("Input Voltage: "+tVoltage+", Tier: "+tTierInputVoltage); - log("Effective Voltage: "+tEffectiveVoltage+", Effective Tier: "+tTier); GT_Recipe tRecipe = findRecipe( getBaseMetaTileEntity(), mLastRecipe, false, - gregtech.api.enums.GT_Values.V[tTierInputVoltage], aFluidInputs, aItemInputs); + gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); log("Running checkRecipeGeneric(1)"); // Remember last recipe - an optimization for findRecipe() @@ -1024,8 +1005,7 @@ GT_MetaTileEntity_MultiBlockBase { } if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) { - log("BAD RETURN - 2"); // TODO - Logger.INFO("No Output Space."); + log("BAD RETURN - 2"); return false; } @@ -1041,12 +1021,12 @@ GT_MetaTileEntity_MultiBlockBase { log("tVoltage: "+tVoltage); log("tRecipeEUt: "+tRecipeEUt); // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits - for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEffectiveVoltage - tRecipeEUt); parallelRecipes++) { + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) { if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { log("Broke at "+parallelRecipes+"."); break; } - log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+". Can use "+tEffectiveVoltage); + log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); tTotalEUt += tRecipeEUt; } @@ -1058,6 +1038,7 @@ GT_MetaTileEntity_MultiBlockBase { // -- Try not to fail after this point - inputs have already been consumed! -- + // Convert speed bonus to duration multiplier // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration. aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent); @@ -1071,10 +1052,10 @@ GT_MetaTileEntity_MultiBlockBase { // Overclock if (this.mEUt <= 16) { - this.mEUt = (this.mEUt * (1 << tTierInputVoltage - 1) * (1 << tTierInputVoltage - 1)); - this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTierInputVoltage - 1)); + this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1)); } else { - while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTierInputVoltage - 1)]) { + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { this.mEUt *= 4; this.mMaxProgresstime /= 2; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java new file mode 100644 index 0000000000..332c46dc3e --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java @@ -0,0 +1,128 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.algae; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + +public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase { + + private int mLevel = 0; + + public GregtechMTE_AlgaePondBase(final int aID, final String aName, final String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GregtechMTE_AlgaePondBase(final String aName) { + super(aName); + } + + @Override + public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GregtechMTE_AlgaePondBase(this.mName); + } + + @Override + public String getMachineType() { + return "Algae Pond"; + } + + @Override + public String[] getTooltip() { + return new String[]{ + "Grows Algae!", + "Controller Block for the Algae Farm", + "Size: 3x3x3 (Hollow)", + "Controller (front middle)", + "1x Input Hatch", + "1x Output Hatch", + "1x Input Bus", + "1x Output Bus" + }; + } + + @Override + public String getSound() { + return GregTech_API.sSoundList.get(Integer.valueOf(207)); + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.GTPP_INDEX(1)], new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced)}; + } + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.GTPP_INDEX(1)]}; + } + + @Override + public boolean hasSlotInGUI() { + return true; + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return null; + } + + @Override + public boolean isFacingValid(final byte aFacing) { + return aFacing > 1; + } + + @Override + public boolean checkRecipe(final ItemStack aStack) { + return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 0); + } + + @Override + public int getMaxParallelRecipes() { + return this.mLevel * 10; + } + + @Override + public int getEuDiscountForParallelism() { + return 0; + } + + @Override + public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { + final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + this.mLevel = 0; + return true; + } + + @Override + public int getMaxEfficiency(final ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(final ItemStack aStack) { + return 0; + } + + @Override + public int getAmountOfOutputs() { + return 1; + } + + @Override + public boolean explodesOnComponentBreak(final ItemStack aStack) { + return false; + } + + @Override + public String getCustomGUIResourceName() { + return null; + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java new file mode 100644 index 0000000000..57a726f7e8 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAlgaeContent.java @@ -0,0 +1,24 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.algae.GregtechMTE_AlgaePondBase; + +public class GregtechAlgaeContent { + + public static void run() { + if (LoadedMods.Gregtech) { + Logger.INFO("Gregtech5u Content | Registering Algae Content."); + run1(); + } + } + + private static void run1() { + // Industrial Centrifuge Multiblock + GregtechItemList.AlgaeFarm_Controller.set( + new GregtechMTE_AlgaePondBase(997, "algaefarm.controller.tier.single", "Algae Farm").getStackForm(1L)); + + } + +} diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java b/src/Java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java new file mode 100644 index 0000000000..e433396a1b --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/ic2/item/CustomKineticRotor.java @@ -0,0 +1,274 @@ +package gtPlusPlus.xmod.ic2.item; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.core.lib.LoadedMods; +import ic2.api.item.IKineticRotor; +import ic2.core.IC2; +import ic2.core.block.kineticgenerator.gui.GuiWaterKineticGenerator; +import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + +public class CustomKineticRotor extends Item implements IKineticRotor { + + private final int mTier; + + @SideOnly(Side.CLIENT) + private final IIcon[] mTextures = new IIcon[6]; + + private static final String[] mRegistrationNames = new String[] { + "itemwoodrotor", "itemironrotor", "itemsteelrotor", "itemwcarbonrotor" + }; + + private static final String[] mUnlocalNames = new String[] { + "itemEnergeticRotor", + "itemTungstenSteelRotor", + "itemVibrantRotor", + "itemIridiumRotor", + "itemMagnaliumRotor", + "itemUltimetRotor", + }; + private static final int[] mMaxDurability = new int[] { + 512000, 809600, 1600000, 3200000 + }; + private static final int[] mRadius = new int[] { + 9, 11, 13, 15 + }; + private static final float[] mEfficiency = new float[] { + 0.9f, 1.0f, 1.2f, 1.5f + }; + private static final int[] mMinWindStrength = new int[] { + 12, 14, 16, 18 + }; + private static final int[] mMaxWindStrength = new int[] { + 80, 120, 160, 320 + }; + + private static final ResourceLocation[] mResourceLocations = new ResourceLocation[] { + new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorEnergeticModel.png"), + new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorTungstenSteelModel.png"), + new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorVibrantModel.png"), + new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorIridiumModel.png"), + new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorMagnaliumModel.png"), + new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorUltimetModel.png"), + }; + + private final int maxWindStrength; + private final int minWindStrength; + private final int radius; + private final float efficiency; + private final ResourceLocation renderTexture; + + public CustomKineticRotor(int aTier) { + mTier = aTier; + this.setMaxStackSize(1); + // Handle Differences if EIO is not loaded + if (!LoadedMods.EnderIO && (aTier == 0 || aTier == 2)) { + this.renderTexture = mResourceLocations[(aTier == 0 ? 4 : 5)]; + this.setUnlocalizedName(mUnlocalNames[(aTier == 0 ? 4 : 5)]); + } + else { + this.renderTexture = mResourceLocations[aTier]; + this.setUnlocalizedName(mUnlocalNames[aTier]); + } + this.setMaxDamage(mMaxDurability[aTier]); + this.radius = mRadius[aTier]; + this.efficiency = mEfficiency[aTier]; + this.minWindStrength = mMinWindStrength[aTier]; + this.maxWindStrength = mMaxWindStrength[aTier]; + this.setNoRepair(); + this.setCreativeTab(IC2.tabIC2); + GameRegistry.registerItem(this, mRegistrationNames[aTier]); + } + + @Override + public void setDamage(final ItemStack stack, final int damage) { + if (mTier < 3) { + super.setDamage(stack, damage); + } + } + + @Override + public void addInformation(final ItemStack itemStack, final EntityPlayer player, final List info, final boolean b) { + + info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", new Object[]{this.minWindStrength, this.maxWindStrength})); + + GearboxType type = null; + if (Minecraft.getMinecraft().currentScreen != null && Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator) { + type = GearboxType.WATER; + } + else if (Minecraft.getMinecraft().currentScreen != null && Minecraft.getMinecraft().currentScreen instanceof GuiWindKineticGenerator) { + type = GearboxType.WIND; + } + + if (type != null) { + info.add(StatCollector.translateToLocal("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type))); + } + + } + + @Override + public int getDiameter(final ItemStack stack) + { + return this.radius; + } + + @Override + public ResourceLocation getRotorRenderTexture(final ItemStack stack) + { + return this.renderTexture; + } + + @Override + public float getEfficiency(final ItemStack stack) + { + return this.efficiency; + } + + @Override + public int getMinWindStrength(final ItemStack stack) + { + return this.minWindStrength; + } + + @Override + public int getMaxWindStrength(final ItemStack stack) + { + return this.maxWindStrength; + } + + @Override + public boolean isAcceptedType(final ItemStack stack, final IKineticRotor.GearboxType type){ + return (type == IKineticRotor.GearboxType.WIND) || (type == IKineticRotor.GearboxType.WATER); + } + + public String getUnlocalizedName() { + return "ic2." + super.getUnlocalizedName().substring(5); + } + + public String getUnlocalizedName(ItemStack itemStack) { + return this.getUnlocalizedName(); + } + + public String getItemStackDisplayName(ItemStack itemStack) { + return StatCollector.translateToLocal(this.getUnlocalizedName(itemStack)); + } + + @Override + public boolean showDurabilityBar(ItemStack stack) { + return mTier < 3; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int meta) { + if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) { + if (mTier == 0) { + return mTextures[4]; + } + else { + return mTextures[5]; + } + } + else { + return mTextures[mTier]; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconIndex(ItemStack aIndex) { + if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) { + if (mTier == 0) { + return mTextures[4]; + } + else { + return mTextures[5]; + } + } + else { + return mTextures[mTier]; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamageForRenderPass(int aDmg, int aPass) { + if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) { + if (mTier == 0) { + return mTextures[4]; + } + else { + return mTextures[5]; + } + } + else { + return mTextures[mTier]; + } + } + + @Override + protected String getIconString() { + return super.getIconString(); + } + + @Override + public int getDisplayDamage(ItemStack stack) { + return super.getDisplayDamage(stack); + } + + @Override + public double getDurabilityForDisplay(ItemStack stack) { + return super.getDurabilityForDisplay(stack); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { + if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) { + if (mTier == 0) { + return mTextures[4]; + } + else { + return mTextures[5]; + } + } + else { + return mTextures[mTier]; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(ItemStack stack, int pass) { + if (!LoadedMods.EnderIO && (mTier == 0 || mTier == 2)) { + if (mTier == 0) { + return mTextures[4]; + } + else { + return mTextures[5]; + } + } + else { + return mTextures[mTier]; + } + } + + @Override + public void registerIcons(IIconRegister iconRegister) { + int aIndex = 0; + for (String y : mUnlocalNames) { + mTextures[aIndex++] = iconRegister.registerIcon(IC2.textureDomain + ":" + "rotors/" + y); + } + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java index 64aa7f99bf..862ba38748 100644 --- a/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java +++ b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java @@ -1,13 +1,9 @@ package gtPlusPlus.xmod.ic2.item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.item.base.CoreItem; import gtPlusPlus.core.lib.LoadedMods; -import ic2.core.IC2; -import ic2.core.init.InternalName; +import net.minecraft.item.ItemStack; public class IC2_Items { @@ -29,45 +25,33 @@ public class IC2_Items { public static ItemStack blockRTG; public static ItemStack blockKineticGenerator; - public static void register(){ + private static final String[] mData1 = new String[] {"itemEnergeticRotorBlade", "itemMagnaliumRotorBlade"}; + private static final String[] mData2 = new String[] {"itemEnergeticShaft", "itemMagnaliumShaft"}; + private static final String[] mData3 = new String[] {"itemVibrantRotorBlade", "itemUltimetRotorBlade"}; + private static final String[] mData4 = new String[] {"itemVibrantShaft", "itemUltimetShaft"}; + - if(LoadedMods.EnderIO){ - //Tier 1 - rotor_Blade_Material_1 = new ItemStack (new CoreItem("itemEnergeticRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_1 = new ItemStack (new CoreItem("itemEnergeticShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_1 = new ItemStack (new RotorBase(InternalName.itemwoodrotor, 9, 512000, 0.9F, 12, 80, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorEnergeticModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemEnergeticRotor")); - //Tier 2 - rotor_Blade_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_2 = new ItemStack (new RotorBase(InternalName.itemironrotor, 11, 809600, 1.0F, 14, 120, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorTungstenSteelModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemTungstenSteelRotor")); - //Tier 3 - rotor_Blade_Material_3 = new ItemStack (new CoreItem("itemVibrantRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_3 = new ItemStack (new CoreItem("itemVibrantShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_3 = new ItemStack (new RotorBase(InternalName.itemsteelrotor, 13, 1600000, 1.2F, 16, 160, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorVibrantModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemVibrantRotor")); - //Tier 4 - rotor_Blade_Material_4 = new ItemStack (new CoreItem("itemIridiumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_4 = new ItemStack (new CoreItem("itemIridiumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_4 = new ItemStack (new RotorIridium(InternalName.itemwcarbonrotor, 15, 3200000, 1.5F, 18, 320, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorIridiumModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemIridiumRotor")); + public static void register(){ - } - else { - //Tier 1 - Magnalium - rotor_Blade_Material_1 = new ItemStack (new CoreItem("itemMagnaliumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_1 = new ItemStack (new CoreItem("itemMagnaliumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_1 = new ItemStack (new RotorBase(InternalName.itemwoodrotor, 9, 512000, 0.9F, 12, 80, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorMagnaliumModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemMagnaliumRotor")); - //Tier 2 - rotor_Blade_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_2 = new ItemStack (new RotorBase(InternalName.itemironrotor, 11, 809600, 1.0F, 14, 120, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorTungstenSteelModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemTungstenSteelRotor")); - //Tier 3 - Ultimet - rotor_Blade_Material_3 = new ItemStack (new CoreItem("itemUltimetRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_3 = new ItemStack (new CoreItem("itemUltimetShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_3 = new ItemStack (new RotorBase(InternalName.itemsteelrotor, 13, 1600000, 1.2F, 16, 160, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorUltimetModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemUltimetRotor")); - //Tier 4 - rotor_Blade_Material_4 = new ItemStack (new CoreItem("itemIridiumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - shaft_Material_4 = new ItemStack (new CoreItem("itemIridiumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); - rotor_Material_4 = new ItemStack (new RotorIridium(InternalName.itemwcarbonrotor, 15, 3200000, 1.5F, 18, 320, new ResourceLocation(IC2.textureDomain, "textures/items/rotors/rotorIridiumModel.png")).setCreativeTab(AddToCreativeTab.tabMachines).setUnlocalizedName("itemIridiumRotor")); - } + int aIndexEIO = (LoadedMods.EnderIO ? 0 : 1); + + // Rotor Blades + rotor_Blade_Material_1 = new ItemStack (new CoreItem(mData1[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + rotor_Blade_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + rotor_Blade_Material_3 = new ItemStack (new CoreItem(mData3[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + rotor_Blade_Material_4 = new ItemStack (new CoreItem("itemIridiumRotorBlade", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + + // Rotor Shafts + shaft_Material_1 = new ItemStack (new CoreItem(mData2[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + shaft_Material_2 = new ItemStack (new CoreItem("itemTungstenSteelShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + shaft_Material_3 = new ItemStack (new CoreItem(mData4[aIndexEIO], AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + shaft_Material_4 = new ItemStack (new CoreItem("itemIridiumShaft", AddToCreativeTab.tabMachines, 16, "A part for an advanced Kinetic Rotor")); + + // Rotors + rotor_Material_1 = new ItemStack (new CustomKineticRotor(0)); + rotor_Material_2 = new ItemStack (new CustomKineticRotor(1)); + rotor_Material_3 = new ItemStack (new CustomKineticRotor(2)); + rotor_Material_4 = new ItemStack (new CustomKineticRotor(3)); } } diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java b/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java index aca1c6a310..b9dffbd371 100644 --- a/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java +++ b/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java @@ -118,5 +118,10 @@ public class RotorIridium extends RotorBase{ this.setCustomDamage(stack, this.getCustomDamage(stack) + damage); return true; } + + @Override + public boolean showDurabilityBar(ItemStack stack) { + return false; + } } diff --git a/src/resources/assets/gregtech/lang/en_US.lang b/src/resources/assets/gregtech/lang/en_US.lang index 9989bffcf0..e2120fdf7b 100644 --- a/src/resources/assets/gregtech/lang/en_US.lang +++ b/src/resources/assets/gregtech/lang/en_US.lang @@ -212,7 +212,9 @@ achievement.decay.technetium99.desc=Cyclotron Product - +//24/11/19 +achievement.gt.blockmachines.hatch.turbine.input.tier.00=Turbine Housing +achievement.gt.blockmachines.hatch.turbine.input.tier.00.desc=[AL] Pickup this item to see the recipe in NEI diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png deleted file mode 100644 index cbf604f2b3..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_0.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png deleted file mode 100644 index 3b7ac3d50e..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_1.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png deleted file mode 100644 index a5a5e2c559..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_2.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png deleted file mode 100644 index b68c900ddd..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_3.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png deleted file mode 100644 index df182aeaa5..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Side_4.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png deleted file mode 100644 index 85bc3f16cd..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_0.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png deleted file mode 100644 index f82185ebdb..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_1.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png deleted file mode 100644 index 345476e03c..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_2.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png deleted file mode 100644 index 971164eb3e..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_3.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png deleted file mode 100644 index 5b5bac3ad2..0000000000 Binary files a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/RoundRobinator_Top_4.png and /dev/null differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_0.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_0.png new file mode 100644 index 0000000000..cbf604f2b3 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_0.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_1.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_1.png new file mode 100644 index 0000000000..3b7ac3d50e Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_1.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_2.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_2.png new file mode 100644 index 0000000000..a5a5e2c559 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_2.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_3.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_3.png new file mode 100644 index 0000000000..b68c900ddd Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_3.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_4.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_4.png new file mode 100644 index 0000000000..df182aeaa5 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Side_4.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_0.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_0.png new file mode 100644 index 0000000000..85bc3f16cd Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_0.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_1.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_1.png new file mode 100644 index 0000000000..f82185ebdb Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_1.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_2.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_2.png new file mode 100644 index 0000000000..345476e03c Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_2.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_3.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_3.png new file mode 100644 index 0000000000..971164eb3e Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_3.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_4.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_4.png new file mode 100644 index 0000000000..5b5bac3ad2 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/RoundRobinator/Top_4.png differ -- cgit