diff options
24 files changed, 266 insertions, 95 deletions
diff --git a/build.gradle b/build.gradle index 57551932fd..d91842f667 100644 --- a/build.gradle +++ b/build.gradle @@ -52,7 +52,7 @@ targetCompatibility = JavaVersion.VERSION_1_8 //Jar Info archivesBaseName = "GT-PlusPlus" -version = "1.7.02.09" +version = "1.7.02.24" minecraft.version = "1.7.10-10.13.4.1614-1.7.10" minecraft { diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java index f41d2019b6..99092aed71 100644 --- a/src/Java/gtPlusPlus/core/lib/CORE.java +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -51,7 +51,7 @@ public class CORE { public static final String name = "GT++"; public static final String MODID = "miscutils"; - public static final String VERSION = "1.7.02.09"; + public static final String VERSION = "1.7.02.24"; 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(); diff --git a/src/Java/gtPlusPlus/core/material/ELEMENT.java b/src/Java/gtPlusPlus/core/material/ELEMENT.java index 8ae2bff37b..888f030f56 100644 --- a/src/Java/gtPlusPlus/core/material/ELEMENT.java +++ b/src/Java/gtPlusPlus/core/material/ELEMENT.java @@ -165,23 +165,23 @@ public final class ELEMENT { if (a3 == null) { Logger.INFO("[Material] Fallback attempt to find Trinium failed, dumping materials."); for (Materials m : Materials.values()) { - Logger.INFO("[Material] Found "+m.mName); + Logger.INFO("[Material] Found "+MaterialUtils.getMaterialName(m)); } a4 = null; } else { - Logger.INFO("[Material] a3 Found "+a3.mName); + Logger.INFO("[Material] a3 Found "+MaterialUtils.getMaterialName(a3)); a4 = a3; } } else { - Logger.INFO("[Material] a2 Found "+a2.mName); + Logger.INFO("[Material] a2 Found "+MaterialUtils.getMaterialName(a2)); a4 = a2; } TRINIUM = MaterialUtils.generateMaterialFromGtENUM(a4); } else { - Logger.INFO("[Material] a1 Found "+a1.mName); + Logger.INFO("[Material] a1 Found "+MaterialUtils.getMaterialName(a1)); TRINIUM = MaterialUtils.generateMaterialFromGtENUM(a1); } diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index a2295a9da5..f28929a66a 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -10,6 +10,7 @@ import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.*; +import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.everglades.dimension.Dimension_Everglades; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import net.minecraft.init.Blocks; @@ -236,8 +237,8 @@ public class RECIPES_Machines { EV_MACHINE_BendingMachine= ItemList.Machine_IV_Bender.get(1); EV_MACHINE_Wiremill= ItemList.Machine_IV_Wiremill.get(1); HV_MACHINE_Macerator= ItemList.Machine_EV_Macerator.get(1); - EV_MACHINE_Macerator= ItemList.Machine_IV_Macerator.get(1); - EV_MACHINE_MassFabricator= ItemList.Machine_LuV_Massfab.get(1); + EV_MACHINE_Macerator= ItemList.Machine_IV_Macerator.get(1); + EV_MACHINE_MassFabricator= CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK ? ItemList.valueOf("Machine_LuV_Massfab").get(1, ItemList.Machine_IV_Massfab.get(1)) : ItemList.Machine_IV_Massfab.get(1); EV_MACHINE_Centrifuge= ItemList.Machine_IV_Centrifuge.get(1); EV_MACHINE_Cutter = ItemList.Machine_IV_Cutter.get(1); EV_MACHINE_Extruder = ItemList.Machine_IV_Extruder.get(1); @@ -861,9 +862,13 @@ public class RECIPES_Machines { GregtechItemList.Pollution_Detector.get(1)); //Air Intake Hatch + + ItemStack aTieredFluidRegulator = CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK ? ItemList.valueOf("FluidRegulator_IV").get(1, ItemList.Pump_IV.get(1)) : ItemList.Pump_IV.get(1); + + RecipeUtils.addShapedGregtechRecipe( CI.component_Plate[6], ItemList.Casing_Grate.get(1), CI.component_Plate[6], - CI.component_Plate[6], ItemList.FluidRegulator_IV.get(1), CI.component_Plate[6], + CI.component_Plate[6], aTieredFluidRegulator, CI.component_Plate[6], CI.getTieredCircuit(5), ItemList.Hatch_Input_IV.get(1), CI.getTieredCircuit(5), GregtechItemList.Hatch_Air_Intake.get(1)); @@ -1132,9 +1137,12 @@ public class RECIPES_Machines { } if (CORE.ConfigSwitches.enableMultiblock_LargeAutoCrafter){ + + ItemStack aCoreBlock = CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK ? ItemList.valueOf("Block_IridiumTungstensteel").get(1, ItemUtils.getItemStackOfAmountFromOreDict("blockOsmiridium", 1)) : ItemUtils.getItemStackOfAmountFromOreDict("blockOsmiridium", 1); + RecipeUtils.recipeBuilder( "plateTungstenSteel", CI.craftingToolHammer_Hard, "plateTungstenSteel", - "plateStellite", ItemList.Block_IridiumTungstensteel.get(1), "plateStellite", + "plateStellite", aCoreBlock, "plateStellite", "plateTungstenSteel", CI.craftingToolWrench, "plateTungstenSteel", GregtechItemList.Casing_Autocrafter.get(Casing_Amount)); @@ -1257,6 +1265,8 @@ public class RECIPES_Machines { cell1 = CI.conveyorModule_EV; cell2 = CI.electricMotor_IV; ItemStack casingAmazon = GregtechItemList.Casing_AmazonWarehouse.get(1); + ItemStack aTieredUnboxinator = CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK ? ItemList.valueOf("Machine_LuV_Unboxinator").get(1, ItemList.Machine_IV_Unboxinator.get(1)) : ItemList.Machine_IV_Unboxinator.get(1); + RecipeUtils.recipeBuilder( plate, ItemUtils.getItemStackOfAmountFromOreDict("cableGt12VanadiumGallium", 1), plate, @@ -1265,7 +1275,7 @@ public class RECIPES_Machines { GregtechItemList.Casing_AmazonWarehouse.get(Casing_Amount)); RecipeUtils.recipeBuilder( casingAmazon, CI.getTieredCircuit(7), casingAmazon, - CI.robotArm_LuV, ItemList.Machine_LuV_Unboxinator.get(1), CI.robotArm_LuV, + CI.robotArm_LuV, aTieredUnboxinator, CI.robotArm_LuV, CI.conveyorModule_LuV, GregtechItemList.Gregtech_Computer_Cube.get(1), CI.conveyorModule_LuV, GregtechItemList.Amazon_Warehouse_Controller.get(1)); diff --git a/src/Java/gtPlusPlus/core/util/minecraft/MiningUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/MiningUtils.java index 43c77282bb..e7ced98f5a 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/MiningUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/MiningUtils.java @@ -143,14 +143,22 @@ public class MiningUtils { } public static void iterateAllOreTypes() { - HashMap<String, Integer> M = new HashMap<String, Integer>(); + HashMap<String, Integer> M = new HashMap<String, Integer>(); + String aTextWorldGen = null; if (MiningUtils.findAndMapOreTypesFromGT()) { int mapKey = 0; for (AutoMap<GT_Worldgen_GT_Ore_Layer> g : MiningUtils.mOreMaps) { - for (GT_Worldgen_GT_Ore_Layer h : g) { + for (GT_Worldgen_GT_Ore_Layer h : g) { + + try { + aTextWorldGen = (String) ReflectionUtils.getField(GT_Worldgen_GT_Ore_Layer.class, "aTextWorldgen").get(h); + } catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) { + aTextWorldGen = h.mWorldGenName; + } + //if (M.containsKey(h.aTextWorldgen + h.mWorldGenName)) { - M.put(h.aTextWorldgen + h.mWorldGenName, mapKey); - Logger.INFO("Found Vein type: " + h.aTextWorldgen + h.mWorldGenName + " in map with key: "+mapKey); + M.put(aTextWorldGen + h.mWorldGenName, mapKey); + Logger.INFO("Found Vein type: " + aTextWorldGen + h.mWorldGenName + " in map with key: "+mapKey); //} } mapKey++; @@ -169,6 +177,8 @@ public class MiningUtils { public static boolean findAndMapOreTypesFromGT() { //Gets Moon ID + + boolean aEndAsteroids; try { if (Class.forName("micdoodle8.mods.galacticraft.core.util.ConfigManagerCore") != null && mMoonID == -99) { mMoonID = ReflectionUtils.getField(Class.forName("micdoodle8.mods.galacticraft.core.util.ConfigManagerCore"), "idDimensionMoon").getInt(null); @@ -200,16 +210,25 @@ public class MiningUtils { for (GT_Worldgen_GT_Ore_Layer x : GT_Worldgen_GT_Ore_Layer.sList) { if (x.mEnabled) { + + + try { + aEndAsteroids = ReflectionUtils.getField(GT_Worldgen_GT_Ore_Layer.class, "mEndAsteroid").getBoolean(x); + } + catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) { + aEndAsteroids = false; + } + if (x.mOverworld) { Ores_Overworld.put(x); } if (x.mNether) { Ores_Nether.put(x); } - if (x.mEnd || x.mEndAsteroid) { + if (x.mEnd || aEndAsteroids) { Ores_End.put(x); } - if (x.mOverworld || x.mNether || (x.mEnd || x.mEndAsteroid)) { + if (x.mOverworld || x.mNether || (x.mEnd || aEndAsteroids)) { continue; } /*if (x.mMoon) { diff --git a/src/Java/gtPlusPlus/preloader/asm/AsmConfig.java b/src/Java/gtPlusPlus/preloader/asm/AsmConfig.java index 81ebbd1309..fe77420803 100644 --- a/src/Java/gtPlusPlus/preloader/asm/AsmConfig.java +++ b/src/Java/gtPlusPlus/preloader/asm/AsmConfig.java @@ -70,13 +70,13 @@ public class AsmConfig { config.save(); } - System.out.println("[GT++ ASM] Chunk Debugging - Enabled: "+enableChunkDebugging); - System.out.println("[GT++ ASM] Gt Nbt Fix - Enabled: "+enableGtNbtFix); - System.out.println("[GT++ ASM] TiCon Fluid Lighting - Enabled: "+enableTiConFluidLighting); - System.out.println("[GT++ ASM] Gt Tooltip Fix - Enabled: "+enableGtTooltipFix); + FMLLog.log(Level.INFO, "[GT++ ASM] Chunk Debugging - Enabled: "+enableChunkDebugging, new Object[0]); + FMLLog.log(Level.INFO, "[GT++ ASM] Gt Nbt Fix - Enabled: "+enableGtNbtFix, new Object[0]); + FMLLog.log(Level.INFO, "[GT++ ASM] TiCon Fluid Lighting - Enabled: "+enableTiConFluidLighting, new Object[0]); + FMLLog.log(Level.INFO, "[GT++ ASM] Gt Tooltip Fix - Enabled: "+enableGtTooltipFix, new Object[0]); } catch (Exception var3) { - FMLLog.log(Level.ERROR, var3, "GT++ ASM has a problem loading it's config", new Object[0]); + FMLLog.log(Level.ERROR, var3, "GT++ ASM had a problem loading it's config", new Object[0]); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Multi_Basic_Slotted.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Multi_Basic_Slotted.java index 9d38295d4e..0756effa26 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Multi_Basic_Slotted.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Multi_Basic_Slotted.java @@ -7,7 +7,6 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Tool_01; -import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine; import gtPlusPlus.core.lib.CORE; import net.minecraft.entity.player.InventoryPlayer; @@ -63,14 +62,7 @@ public class GUI_Multi_Basic_Slotted extends GT_GUIContainerMetaTile_Machine { } ItemStack tItem; - if (this.mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_DrillerBase) { - tItem = this.mContainer.mTileEntity.getMetaTileEntity().getStackInSlot(1); - if (tItem == null - || !GT_Utility.areStacksEqual(tItem, GT_ModHandler.getIC2Item("miningPipe", 1L))) { - this.fontRendererObj.drawString(this.trans("143", "Missing Mining Pipe"), 10, - ((GT_Container_MultiMachine) this.mContainer).mActive == 0 ? 40 : 24, 16448255); - } - } else if (this.mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine) { + if (this.mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine) { tItem = this.mContainer.mTileEntity.getMetaTileEntity().getStackInSlot(1); if (tItem == null || tItem.getItem() != GT_MetaGenerated_Tool_01.INSTANCE || tItem.getItemDamage() < 170 || tItem.getItemDamage() > 177) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java index dd930e798c..eb1c3cc1f7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java @@ -37,7 +37,7 @@ public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_In public GT_MetaTileEntity_Hatch_Naquadah(final String aName, final String[] aDescription, final ITexture[][][] aTextures) { - super(aName, 6, aDescription, aTextures); + super(aName, 6, aDescription[0], aTextures); mFluidCapacity = 32000; initHatch(); } @@ -92,7 +92,7 @@ public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_In } public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return (MetaTileEntity) new GT_MetaTileEntity_Hatch_Naquadah(this.mName, this.mDescriptionArray, this.mTextures); + return (MetaTileEntity) new GT_MetaTileEntity_Hatch_Naquadah(this.mName, this.mDescription, this.mTextures); } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ThreadedBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ThreadedBuffer.java index 9642ff63ee..3e6d2f5d13 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ThreadedBuffer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ThreadedBuffer.java @@ -37,7 +37,7 @@ public abstract class GT_MetaTileEntity_ThreadedBuffer extends GT_MetaTileEntity public GT_MetaTileEntity_ThreadedBuffer(final int aID, final String aName, final String aNameRegional, final int aTier, final int aInvSlotCount, final String[] aDescription) { - super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); + super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription[0]); this.bOutput = false; this.bRedstoneIfFull = false; this.bInvert = false; @@ -59,7 +59,7 @@ public abstract class GT_MetaTileEntity_ThreadedBuffer extends GT_MetaTileEntity public GT_MetaTileEntity_ThreadedBuffer(final String aName, final int aTier, final int aInvSlotCount, final String[] aDescription, final ITexture[][][] aTextures) { - super(aName, aTier, aInvSlotCount, aDescription, aTextures); + super(aName, aTier, aInvSlotCount, aDescription[0], aTextures); this.bOutput = false; this.bRedstoneIfFull = false; this.bInvert = false; @@ -292,10 +292,9 @@ public abstract class GT_MetaTileEntity_ThreadedBuffer extends GT_MetaTileEntity this.mTargetStackSize = 64; } if (this.mTargetStackSize == 0) { - GT_Utility.sendChatToPlayer(aPlayer, this.trans("098", "Do not regulate Item Stack Size")); + GT_Utility.sendChatToPlayer(aPlayer, "Do not regulate Item Stack Size"); } else { - GT_Utility.sendChatToPlayer(aPlayer, - this.trans("099", "Regulate Item Stack Size to: ") + this.mTargetStackSize); + GT_Utility.sendChatToPlayer(aPlayer, "Regulate Item Stack Size to: " + this.mTargetStackSize); } } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java index 938febfea7..9eea6b4a28 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java @@ -15,38 +15,53 @@ import gregtech.api.objects.GT_RenderedTexture; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; +import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; public class GregtechMetaPipeEntityFluid extends GT_MetaPipeEntity_Fluid { + + + public static final boolean mGt6Pipe; + + static { + Boolean aGt6 = (Boolean) Meta_GT_Proxy.getFieldFromGregtechProxy(false, "gt6Pipe"); + if (aGt6 != null) { + mGt6Pipe = aGt6; + } + else { + mGt6Pipe = false; + } + } + public final GT_Materials mMaterial; - private boolean mCheckConnections; + private boolean mCheckConnections; + public GregtechMetaPipeEntityFluid(int aID, String aName, String aNameRegional, float aThickNess, GT_Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) { this(aID, aName, aNameRegional, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1); } + + public GregtechMetaPipeEntityFluid(final String aName, final float aThickNess, final GT_Materials aMaterial, final int aCapacity, final int aHeatResistance, final boolean aGasProof) { + this(aName, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1); + } public GregtechMetaPipeEntityFluid(int aID, String aName, String aNameRegional, float aThickNess, GT_Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) { super(aID, aName, aNameRegional, aThickNess, null, aCapacity, aHeatResistance, aGasProof); this.mLastReceivedFrom = 0; this.oLastReceivedFrom = 0; - this.mCheckConnections = !GT_Mod.gregtechproxy.gt6Pipe; - this.mDisableInput = 0; + this.mCheckConnections = !mGt6Pipe; this.mMaterial = aMaterial; - this.addInfo(aID); } - public GregtechMetaPipeEntityFluid(final String aName, final float aThickNess, final GT_Materials aMaterial, final int aCapacity, final int aHeatResistance, final boolean aGasProof) { - this(aName, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1); - } + public GregtechMetaPipeEntityFluid(String aName, float aThickNess, GT_Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) { - super(aName, aThickNess, null, aCapacity, aHeatResistance, aGasProof, aFluidTypes); + super(aName, aThickNess, null, aCapacity, aHeatResistance, aGasProof); this.mLastReceivedFrom = 0; this.oLastReceivedFrom = 0; - this.mCheckConnections = !GT_Mod.gregtechproxy.gt6Pipe; - this.mDisableInput = 0; + this.mCheckConnections = !mGt6Pipe; this.mMaterial = aMaterial; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java index c664936a0b..839fb3a14a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java @@ -35,7 +35,7 @@ public class GT_MetaTileEntity_Hatch_CustomFluidBase extends GT_MetaTileEntity_H } public GT_MetaTileEntity_Hatch_CustomFluidBase(Fluid aFluid, int aAmount, final String aName, final String[] aDescription, final ITexture[][][] aTextures) { - super(aName, 6, aDescription, aTextures); + super(aName, 6, aDescription[0], aTextures); this.mRecipeMap = null; this.mLockedFluid = aFluid; this.mFluidCapacity = aAmount; @@ -112,6 +112,6 @@ public class GT_MetaTileEntity_Hatch_CustomFluidBase extends GT_MetaTileEntity_H } public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return (MetaTileEntity) new GT_MetaTileEntity_Hatch_CustomFluidBase(this.mLockedFluid, this.mFluidCapacity, this.mName, this.mDescriptionArray, this.mTextures); + return (MetaTileEntity) new GT_MetaTileEntity_Hatch_CustomFluidBase(this.mLockedFluid, this.mFluidCapacity, this.mName, this.mDescription, this.mTextures); } }
\ 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 ba348f3aab..7c099f49ef 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 @@ -32,7 +32,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Outpu import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; @@ -43,6 +42,7 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.math.MathUtils; +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; @@ -62,6 +62,24 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_MultiBlockBase { + + + + static { + + Method a08 = findRecipe08 = ReflectionUtils.getMethod(GT_Recipe_Map.class, "findRecipe", IHasWorldObjectAndCoords.class, GT_Recipe.class, boolean.class, long.class, FluidStack[].class, ItemStack.class, ItemStack[].class); + Method a09 = findRecipe09 = ReflectionUtils.getMethod(GT_Recipe_Map.class, "findRecipe", IHasWorldObjectAndCoords.class, GT_Recipe.class, boolean.class, boolean.class, long.class, FluidStack[].class, ItemStack.class, ItemStack[].class); + Logger.INFO("Found .08 findRecipe method? "+(a08 != null)); + Logger.INFO("Found .09 findRecipe method? "+(a09 != null)); + + //gregtech.api.util.GT_Recipe.GT_Recipe_Map.findRecipe(IHasWorldObjectAndCoords, GT_Recipe, boolean, long, FluidStack[], ItemStack, ItemStack...) + + } + + //Find Recipe Methods + private static final Method findRecipe08; + private static final Method findRecipe09; + public GT_Recipe mLastRecipe; private boolean mInternalCircuit = false; protected long mTotalRunTime = 0; @@ -329,7 +347,7 @@ GT_MetaTileEntity_MultiBlockBase { //Control Core to control the Multiblocks behaviour. int aControlCoreTier = getControlCoreTier(); - + //If no core, return false; if (aControlCoreTier == 0) { return false; @@ -350,7 +368,7 @@ GT_MetaTileEntity_MultiBlockBase { if (tTier > aControlCoreTier) { return false; } - + GT_Recipe tRecipe = findRecipe( getBaseMetaTileEntity(), mLastRecipe, false, @@ -410,11 +428,11 @@ GT_MetaTileEntity_MultiBlockBase { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - + //Only Overclock as high as the control circuit. byte tTierOld = tTier; tTier = (byte) aControlCoreTier; - + // Overclock if (this.mEUt <= 16) { this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); @@ -713,7 +731,7 @@ GT_MetaTileEntity_MultiBlockBase { } return false; } - + public int getControlCoreTier() { if (mControlCoreBus.size() == 0) { return 0; @@ -1229,17 +1247,34 @@ GT_MetaTileEntity_MultiBlockBase { catch (Throwable t) { log("Invalid recipe lookup."); } + + if (mRecipeResult == null) { - return this.getRecipeMap().findRecipe(aTileEntity, aRecipe, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, aSpecialSlot, aInputs); + if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { + try { + return (GT_Recipe) findRecipe08.invoke(getRecipeMap(), aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { + return null; + } + } + else { + try { + return (GT_Recipe) findRecipe09.invoke(getRecipeMap(), aTileEntity, aRecipe, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, aSpecialSlot, aInputs); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { + return null; + } + } } else { return mRecipeResult; } - } + } + + /** diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java index bef16c0bf7..c1915fb14a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java @@ -14,7 +14,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gregtech.common.GT_Pollution; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java b/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java index 69c95bc1ff..1e7843b515 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java @@ -12,7 +12,7 @@ import gregtech.api.objects.MaterialStack; import gregtech.api.util.*; import gtPlusPlus.core.util.reflect.ReflectionUtils; - +import gtPlusPlus.xmod.gregtech.common.StaticFields59; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; @@ -100,7 +100,7 @@ public class GregtechOreDictUnificator { public static ItemStack get(OrePrefixes aPrefix, Object aMaterial, ItemStack aReplacement, long aAmount) { //if (Materials.mDefaultComponents.contains(aPrefix) && !aPrefix.mDynamicItems.contains((Materials)aMaterial)) aPrefix.mDynamicItems.add((Materials) aMaterial); - if (OrePrefixes.mPreventableComponents.contains(aPrefix) && aPrefix.mDisabledItems.contains(aMaterial)) return aReplacement; + if (StaticFields59.getOrePrefixesBooleanDisabledItems().contains(aPrefix) && StaticFields59.getOrePrefixesBooleanDisabledItems().contains(aMaterial)) return aReplacement; return get(aPrefix.get(aMaterial), aReplacement, aAmount, false, true); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java b/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java new file mode 100644 index 0000000000..15c6a519b1 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java @@ -0,0 +1,74 @@ +package gtPlusPlus.xmod.gregtech.common; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import net.minecraft.block.Block; + +public class StaticFields59 { + + public static final Field mGtBlockCasings5; + public static final Field mPreventableComponents; + public static final Field mDisabledItems; + public static final Method mCalculatePollutionReduction; + + //OrePrefixes + + static { + mGtBlockCasings5 = getField(GregTech_API.class, "sBlockCasings5"); + mPreventableComponents = getField(OrePrefixes.class, "mPreventableComponents"); + mDisabledItems = getField(OrePrefixes.class, "mDisabledItems"); + mCalculatePollutionReduction = getMethod(GT_MetaTileEntity_Hatch_Muffler.class, "calculatePollutionReduction", int.class); + } + + public static synchronized final Block getBlockCasings5() { + try { + return (Block) mGtBlockCasings5.get(GregTech_API.class); + } catch (IllegalArgumentException | IllegalAccessException e) { + return null; + } + } + + public static int calculatePollutionReducation(GT_MetaTileEntity_Hatch_Muffler h, int i) { + try { + return (int) mCalculatePollutionReduction.invoke(h, i); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { + return 0; + } + } + + public static Field getField(Class a, String b) { + try { + return ReflectionUtils.getField(a, b); + } catch (NoSuchFieldException e) { + return null; + } + } + + public static Method getMethod(Class a, String b, Class... params) { + return ReflectionUtils.getMethod(a, b, params); + } + + public static synchronized final Boolean getOrePrefixesBooleanDisabledItems() { + try { + return (Boolean) mDisabledItems.get(OrePrefixes.class); + } catch (IllegalArgumentException | IllegalAccessException e) { + return false; + } + } + + public static synchronized final Boolean geOrePrefixesBooleanPreventableComponents() { + try { + return (Boolean) mPreventableComponents.get(OrePrefixes.class); + } catch (IllegalArgumentException | IllegalAccessException e) { + return false; + } + } + + +} 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 47299366ed..8a80ca2fca 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 @@ -20,7 +20,7 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; - +import gtPlusPlus.xmod.gregtech.common.StaticFields59; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -208,13 +208,13 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { if ((i != 0) || (j != 0)) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != GregTech_API.sBlockCasings5) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != StaticFields59.getBlockCasings5()) { return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != tUsedMeta) { return false; } - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != GregTech_API.sBlockCasings5) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != StaticFields59.getBlockCasings5()) { return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) { @@ -284,7 +284,7 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase int pollutionReduction = 0; for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { if (isValidMetaTileEntity(tHatch)) { - pollutionReduction = 100 - tHatch.calculatePollutionReduction(100); + pollutionReduction = 100 - StaticFields59.calculatePollutionReducation(tHatch, 100); break; } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java index f2a6844053..59123a9a6d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced; +import java.lang.reflect.Method; + import gregtech.api.enums.Dyes; import gregtech.api.enums.GT_Values; import gregtech.api.enums.TAE; @@ -8,6 +10,7 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; @@ -16,6 +19,7 @@ import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_FusionCompu import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; @@ -24,6 +28,12 @@ import net.minecraftforge.common.util.ForgeDirection; public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_FusionComputer { + public static final Method mUpdateHatchTexture; + + static { + mUpdateHatchTexture = ReflectionUtils.getMethod(GT_MetaTileEntity_Hatch.class, "updateTexture", int.class); + } + public GregtechMetaTileEntity_Adv_Fusion_MK4(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 6); } @@ -126,21 +136,26 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_Fus } public boolean turnCasingActive(final boolean status) { + try { if (this.mEnergyHatches != null) { for (final GT_MetaTileEntity_Hatch_Energy hatch : this.mEnergyHatches) { - hatch.updateTexture(status ? TAE.getIndexFromPage(2, 14) : 53); + mUpdateHatchTexture.invoke(hatch, (status ? TAE.getIndexFromPage(2, 14) : 53)); } } if (this.mOutputHatches != null) { for (final GT_MetaTileEntity_Hatch_Output hatch2 : this.mOutputHatches) { - hatch2.updateTexture(status ? TAE.getIndexFromPage(2, 14) : 53); + mUpdateHatchTexture.invoke(hatch2, (status ? TAE.getIndexFromPage(2, 14) : 53)); } } if (this.mInputHatches != null) { for (final GT_MetaTileEntity_Hatch_Input hatch3 : this.mInputHatches) { - hatch3.updateTexture(status ? TAE.getIndexFromPage(2, 14) : 53); + mUpdateHatchTexture.invoke(hatch3, (status ? TAE.getIndexFromPage(2, 14) : 53)); } } + } + catch (Throwable t) { + return false; + } return true; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java index 8d1914859e..b93943960a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java @@ -195,7 +195,7 @@ extends GregtechMeta_MultiBlockBase 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 ? Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER)}; + new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)}; } return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.GTPP_INDEX(1)]}; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java index 918c827136..2019e26782 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java @@ -16,7 +16,10 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Naquadah; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_Fusion_MK4; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; + +import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import net.minecraft.block.Block; @@ -320,7 +323,13 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase { if (aMetaTileEntity == null) { return false; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Naquadah) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + + try { + GregtechMetaTileEntity_Adv_Fusion_MK4.mUpdateHatchTexture.invoke((GT_MetaTileEntity_Hatch) aMetaTileEntity, aBaseCasingIndex); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { + } + + //((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return this.mNaqHatches.add((GT_MetaTileEntity_Hatch_Naquadah) aMetaTileEntity); } else { return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java index c244831f6f..e3405f37b8 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java @@ -9,6 +9,7 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; @@ -88,7 +89,7 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu int tEU = 0; int totalFlow = 0; // Byproducts are based on actual flow int flow = 0; - int remainingFlow = GT_Utility.safeInt((long)(aOptFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. + int remainingFlow = MathUtils.safeInt((long)(aOptFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. this.realOptFlow = aOptFlow; storedFluid=0; @@ -118,9 +119,9 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu float efficiency = 1.0f - Math.abs((totalFlow - aOptFlow) / (float)aOptFlow); //if(totalFlow>aOptFlow){efficiency = 1.0f;} tEU *= efficiency; - tEU = Math.max(1, GT_Utility.safeInt((long)tEU * (long)aBaseEff / 10000L)); + tEU = Math.max(1, MathUtils.safeInt((long)tEU * (long)aBaseEff / 10000L)); } else { - tEU = GT_Utility.safeInt((long)tEU * (long)aBaseEff / 10000L); + tEU = MathUtils.safeInt((long)tEU * (long)aBaseEff / 10000L); } return tEU; @@ -130,7 +131,7 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aSide == getBaseMetaTileEntity().getFrontFacing()) { looseFit^=true; - GT_Utility.sendChatToPlayer(aPlayer, looseFit ? trans("500", "Fitting: Loose - More Flow") : trans("501", "Fitting: Tight - More Efficiency")); + GT_Utility.sendChatToPlayer(aPlayer, looseFit ? "Fitting: Loose - More Flow" : "Fitting: Tight - More Efficiency"); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java index 0d667575c5..7a0ba50b52 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java @@ -10,6 +10,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; @@ -98,7 +99,7 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb int tEU = 0; int totalFlow = 0; // Byproducts are based on actual flow int flow = 0; - int remainingFlow = GT_Utility.safeInt((long)(aOptFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. + int remainingFlow = MathUtils.safeInt((long)(aOptFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. this.realOptFlow = aOptFlow; storedFluid=0; @@ -126,9 +127,9 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb float efficiency = 1.0f - Math.abs((totalFlow - aOptFlow) / (float)aOptFlow); //if(totalFlow>aOptFlow){efficiency = 1.0f;} tEU *= efficiency; - tEU = Math.max(1, GT_Utility.safeInt((long)tEU * (long)aBaseEff / 20000L)); + tEU = Math.max(1, MathUtils.safeInt((long)tEU * (long)aBaseEff / 20000L)); } else { - tEU = GT_Utility.safeInt((long)tEU * (long)aBaseEff / 20000L); + tEU = MathUtils.safeInt((long)tEU * (long)aBaseEff / 20000L); } return tEU; @@ -138,7 +139,7 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aSide == getBaseMetaTileEntity().getFrontFacing()) { looseFit^=true; - GT_Utility.sendChatToPlayer(aPlayer, looseFit ? trans("500", "Fitting: Loose - More Flow") : trans("501", "Fitting: Tight - More Efficiency")); + GT_Utility.sendChatToPlayer(aPlayer, looseFit ? "Fitting: Loose - More Flow" : "Fitting: Tight - More Efficiency"); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java index 54f16e1944..27181a792e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java @@ -20,11 +20,13 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.sys.KeyboardUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.StaticFields59; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; import gtPlusPlus.xmod.gregtech.common.blocks.textures.turbine.LargeTurbineTextureHandler; import net.minecraft.block.Block; @@ -332,8 +334,8 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM if (baseEff == 0 || optFlow == 0 || counter >= 512 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled() || this.getBaseMetaTileEntity().hasInventoryBeenModified()) { counter = 0; - baseEff = GT_Utility.safeInt((long)((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); - optFlow = GT_Utility.safeInt((long)Math.max(Float.MIN_NORMAL, + baseEff = MathUtils.safeInt((long)((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); + optFlow = MathUtils.safeInt((long)Math.max(Float.MIN_NORMAL, ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier() * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed * 50)); @@ -354,7 +356,7 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM // Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the difference in power level (per tick) // This is how much the turbine can actually change during this tick - int maxChangeAllowed = Math.max(10, GT_Utility.safeInt((long)Math.abs(difference)/100)); + int maxChangeAllowed = Math.max(10, MathUtils.safeInt((long)Math.abs(difference)/100)); if (Math.abs(difference) > maxChangeAllowed) { // If this difference is too big, use the maximum allowed change int change = maxChangeAllowed * (difference > 0 ? 1 : -1); // Make the change positive or negative. @@ -406,7 +408,7 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM int mPollutionReduction=0; for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { if (isValidMetaTileEntity(tHatch)) { - mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction); + mPollutionReduction=Math.max(StaticFields59.calculatePollutionReducation(tHatch, 100),mPollutionReduction); } } @@ -420,7 +422,7 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM int tDura = 0; if (mInventory[1] != null && mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { - tDura = GT_Utility.safeInt((long)(100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1]))+1)); + tDura = MathUtils.safeInt((long)(100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1]))+1)); } long storedEnergy=0; @@ -438,14 +440,14 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM StatCollector.translateToLocal("GT5U.turbine.efficiency")+": "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.RESET+"%", /* 2 */ StatCollector.translateToLocal("GT5U.multiblock.energy")+": " + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ /* 3 */ EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", - StatCollector.translateToLocal("GT5U.turbine.flow")+": "+EnumChatFormatting.YELLOW+GT_Utility.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/t" + /* 4 */ + StatCollector.translateToLocal("GT5U.turbine.flow")+": "+EnumChatFormatting.YELLOW+MathUtils.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/t" + /* 4 */ EnumChatFormatting.YELLOW+" ("+(looseFit?StatCollector.translateToLocal("GT5U.turbine.loose"):StatCollector.translateToLocal("GT5U.turbine.tight"))+")", /* 5 */ StatCollector.translateToLocal("GT5U.turbine.fuel")+": "+EnumChatFormatting.GOLD+storedFluid+EnumChatFormatting.RESET+"L", /* 6 */ StatCollector.translateToLocal("GT5U.turbine.dmg")+": "+EnumChatFormatting.RED+Integer.toString(tDura)+EnumChatFormatting.RESET+"%", /* 7 */ StatCollector.translateToLocal("GT5U.multiblock.pollution")+": "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %" /* 8 */ }; if (!this.getClass().getName().contains("Steam")) - ret[4]=StatCollector.translateToLocal("GT5U.turbine.flow")+": "+EnumChatFormatting.YELLOW+GT_Utility.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/t"; + ret[4]=StatCollector.translateToLocal("GT5U.turbine.flow")+": "+EnumChatFormatting.YELLOW+MathUtils.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/t"; return ret; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java index 77ffd98531..5558d7551f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java @@ -66,24 +66,24 @@ public class GregtechConduits { } private static void run3() { - + if (Utils.getGregtechVersionAsInt() >= 50930) { try { Class<GT_MetaPipeEntity_Fluid> aPipeEntity = GT_MetaPipeEntity_Fluid.class; Constructor<GT_MetaPipeEntity_Fluid> constructor = aPipeEntity.getConstructor(int.class, String.class, String.class, float.class, Materials.class, int.class, int.class, boolean.class, int.class); if (constructor != null) { Logger.INFO("Generating Hexadecuple pipes."); - generateFluidMultiPipes(constructor, Materials.Copper, Materials.Copper.mName, "Copper", BasePipeHexadecupleID++, 60, 1000, true); - generateFluidMultiPipes(constructor, Materials.Bronze, Materials.Bronze.mName, "Bronze", BasePipeHexadecupleID++, 120, 2000, true); - generateFluidMultiPipes(constructor, Materials.Steel, Materials.Steel.mName, "Steel", BasePipeHexadecupleID++, 240, 2500, true); - generateFluidMultiPipes(constructor, Materials.StainlessSteel, Materials.StainlessSteel.mName, "StainlessSteel", BasePipeHexadecupleID++, 360, 3000, true); - generateFluidMultiPipes(constructor, Materials.Titanium, Materials.Titanium.mName, "Titanium", BasePipeHexadecupleID++, 480, 5000, true); - generateFluidMultiPipes(constructor, Materials.TungstenSteel, Materials.TungstenSteel.mName, "Bronze", BasePipeHexadecupleID++, 600, 7500, true); - generateFluidMultiPipes(constructor, Materials.Plastic, Materials.Plastic.mName, "Plastic", BasePipeHexadecupleID++, 360, 350, true); + generateFluidMultiPipes(constructor, Materials.Copper, MaterialUtils.getMaterialName(Materials.Copper), "Copper", BasePipeHexadecupleID++, 60, 1000, true); + generateFluidMultiPipes(constructor, Materials.Bronze, MaterialUtils.getMaterialName(Materials.Bronze), "Bronze", BasePipeHexadecupleID++, 120, 2000, true); + generateFluidMultiPipes(constructor, Materials.Steel, MaterialUtils.getMaterialName(Materials.Steel), "Steel", BasePipeHexadecupleID++, 240, 2500, true); + generateFluidMultiPipes(constructor, Materials.StainlessSteel, MaterialUtils.getMaterialName(Materials.StainlessSteel), "StainlessSteel", BasePipeHexadecupleID++, 360, 3000, true); + generateFluidMultiPipes(constructor, Materials.Titanium, MaterialUtils.getMaterialName(Materials.Titanium), "Titanium", BasePipeHexadecupleID++, 480, 5000, true); + generateFluidMultiPipes(constructor, Materials.TungstenSteel, MaterialUtils.getMaterialName(Materials.TungstenSteel), "Bronze", BasePipeHexadecupleID++, 600, 7500, true); + generateFluidMultiPipes(constructor, Materials.Plastic, MaterialUtils.getMaterialName(Materials.Plastic), "Plastic", BasePipeHexadecupleID++, 360, 350, true); Materials aPTFE = Materials.get("Polytetrafluoroethylene"); if (aPTFE != null) { - generateFluidMultiPipes(constructor, aPTFE, aPTFE.mName, "PTFE", BasePipeHexadecupleID++, 480, 600, true); + generateFluidMultiPipes(constructor, aPTFE, MaterialUtils.getMaterialName(aPTFE), "PTFE", BasePipeHexadecupleID++, 480, 600, true); } } else { diff --git a/src/resources/mcmod.info b/src/resources/mcmod.info index 6540db09f9..96494e2801 100644 --- a/src/resources/mcmod.info +++ b/src/resources/mcmod.info @@ -5,7 +5,7 @@ "description": "Adds over 100 new Multiblocks, Machines, etc to Gregtech.", "credits": "", "logoFile": "", - "version": "1.7.02.09", + "version": "1.7.02.24", "mcversion": "1.7.10", "url": "https://github.com/draknyte1/GTplusplus/wiki", "updateUrl": "https://github.com/draknyte1/GTplusplus/releases/latest", |