diff options
| author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2021-12-12 14:29:34 +0000 |
|---|---|---|
| committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2021-12-12 14:29:34 +0000 |
| commit | 8752df0b865c1a4104851da6ca100ad28952408d (patch) | |
| tree | a9fbd24dffbcc9adcab1d14b52487032b64286f2 /src/Java/gtPlusPlus/xmod/gregtech | |
| parent | 210f8cb4730b8472e0e86a53ed99616e7183b6a5 (diff) | |
| parent | 9cbfc7a1bacdbe908632e0fff9ec5ad7f119e563 (diff) | |
| download | GT5-Unofficial-8752df0b865c1a4104851da6ca100ad28952408d.tar.gz GT5-Unofficial-8752df0b865c1a4104851da6ca100ad28952408d.tar.bz2 GT5-Unofficial-8752df0b865c1a4104851da6ca100ad28952408d.zip | |
Merge branch 'master' of https://github.com/GTNewHorizons/GTplusplus into gtnh-milling
# Conflicts:
# build.properties
# src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java
# src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java
# src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java
# src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech')
46 files changed, 339 insertions, 361 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index f623fe7405..a375f77cda 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -8,6 +8,7 @@ import java.util.Collection; import java.util.List; import cpw.mods.fml.common.event.FMLLoadCompleteEvent; +import gregtech.api.GregTech_API; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -40,6 +41,7 @@ import gtPlusPlus.core.util.reflect.AddGregtechRecipe; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.everglades.gen.gt.WorldGen_GT; import gtPlusPlus.xmod.gregtech.api.enums.CustomOrePrefix; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.api.util.GTPP_Config; import gtPlusPlus.xmod.gregtech.api.world.GTPP_Worldgen; @@ -141,6 +143,18 @@ public class HANDLER_GT { //Register some custom recipe maps for any enabled multiblocks. //MultiblockRecipeMapHandler.run(); + + if (GregtechItemList.Circuit_BioRecipeSelector.hasBeenSet()) { + for (int i = 1; i <= 24; i++) { + GregTech_API.registerConfigurationCircuit(CI.getNumberedBioCircuit(i), 0); + } + } + + if (GregtechItemList.Circuit_T3RecipeSelector.hasBeenSet()) { + for (int i = 1; i <= 24; i++) { + GregTech_API.registerConfigurationCircuit(CI.getNumberedAdvancedCircuit(i), 3); + } + } } public static void onLoadComplete(FMLLoadCompleteEvent event) { 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 fd021f1487..4d79be29b1 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 @@ -2231,10 +2231,6 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En * Pollution Management */ - public int getPollutionPerTick(ItemStack arg0) { - return 0; - } - private static Method calculatePollutionReduction = null; public int calculatePollutionReductionForHatch(GT_MetaTileEntity_Hatch_Muffler i , int g) { if (calculatePollutionReduction != null) { 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 2e63e2476f..53b891ffb9 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 @@ -22,13 +22,18 @@ import net.minecraftforge.fluids.FluidStack; public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_BasicTank { private boolean useFuel = false; + protected int pollMin, pollMax; public GregtechRocketFuelGeneratorBase(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription, final ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures); + int pollMin = (int)(CORE.ConfigSwitches.baseMinPollutionPerSecondRocketFuelGenerator * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]); + int pollMax = (int)(CORE.ConfigSwitches.baseMaxPollutionPerSecondRocketFuelGenerator * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]); } public GregtechRocketFuelGeneratorBase(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); + int pollMin = (int)(CORE.ConfigSwitches.baseMinPollutionPerSecondRocketFuelGenerator * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]); + int pollMax = (int)(CORE.ConfigSwitches.baseMaxPollutionPerSecondRocketFuelGenerator * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]); } @Override @@ -56,21 +61,14 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ @Override - public String[] getDescription() { - if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - int pollMin = mTier == 4 ? 250 : (mTier == 5 ? 500 : 750); - int pollMax = mTier == 4 ? 2000 : (mTier == 5 ? 4000 : 6000); + public String[] getDescription() { String aPollution = "Causes between "+pollMin+" and "+pollMax+ " Pollution per second"; return new String[]{ this.mDescription, "Fuel Efficiency: " + this.getEfficiency() + "%", aPollution, CORE.GT_Tooltip}; - } - return new String[]{ - this.mDescription, - "Fuel Efficiency: " + this.getEfficiency() + "%", - CORE.GT_Tooltip}; + } } @@ -294,8 +292,10 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ } } - public abstract int getPollution(); - + public int getPollution() { + return MathUtils.randInt(pollMin, pollMax); + } + public abstract GT_Recipe_Map getRecipes(); public abstract int getEfficiency(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java index d1ce55d3f2..56dff1b1e3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java @@ -41,7 +41,7 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE } public GT_MetaTileEntity_Hatch_NbtConsumable(String aName, int aTier, int aInputSlots, String[] aDescription, boolean aAllowDuplicateTypes, ITexture[][][] aTextures) { - super(aName, aTier, aInputSlots*2, aDescription[0], aTextures); + super(aName, aTier, aInputSlots*2, aDescription, aTextures); mInputslotCount = getInputSlotCount(); mTotalSlotCount = getInputSlotCount()*2; mAllowDuplicateUsageTypes = aAllowDuplicateTypes; @@ -127,7 +127,7 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE if (i <= getSlotID_LastInput()) { fillStacksIntoFirstSlots(); } - } + } } // Only moves items in the first four slots @@ -141,7 +141,7 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE } } - private final void tryFillUsageSlots() { + public final void tryFillUsageSlots() { int aSlotSpace = (mInputslotCount - getContentUsageSlots().size()); if (aSlotSpace > 0) { Logger.INFO("We have empty usage slots. "+aSlotSpace); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java index c728c5d8e8..2ff2712952 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java @@ -15,6 +15,7 @@ import cpw.mods.fml.common.eventhandler.Event.Result; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; +import gregtech.api.enums.*; import net.minecraft.block.Block; import net.minecraft.block.BlockAir; import net.minecraft.block.IGrowable; @@ -28,8 +29,6 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.world.ChunkPosition; import net.minecraft.world.World; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaGenerated_Tool; @@ -54,12 +53,14 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.BonemealEvent; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; public class TreeFarmHelper { public static final FluidStack fertT1 = FluidUtils.getFluidStack("fluid.fertiliser", 3); public static final FluidStack fertT2 = FluidUtils.getFluidStack("fluid.un18fertiliser", 2); public static final FluidStack fertT3 = FluidUtils.getFluidStack("fluid.un32fertiliser", 1); + private static final int sawOreId = OreDictionary.getOreID(ToolDictNames.craftingToolSaw.name()); public static ITexture[][][] getTextureSet() { final ITexture[][][] rTextures = new ITexture[10][17][]; @@ -287,73 +288,26 @@ public class TreeFarmHelper { return SAWTOOL.NONE; } - public static boolean isCorrectPart(final ItemStack aStack) { + public static ToolType getPartType(final ItemStack aStack) { if (aStack != null){ //Utils.LOG_WARNING("Found "+aStack.getDisplayName()+" in the GUI slot."); - if (aStack.getItem() instanceof MetaGeneratedGregtechItems) { + if (aStack.getItem() == MetaGeneratedGregtechItems.INSTANCE) { int aDmg = aStack.getItemDamage(); if (aDmg >= 32120 && aDmg <= 32128) { - return true; - } - else if (aStack.getUnlocalizedName().toLowerCase().contains("mu-metaitem")) { - String[] aData = aStack.getUnlocalizedName().toLowerCase().split("//."); - if (aData != null && aData.length > 0) { - for (String s : aData) { - if (s.contains("32120")) { - return true; - } - else if (s.contains("32122")) { - return true; - } - else if (s.contains("32124")) { - return true; - } - else if (s.contains("32126")) { - return true; - } - else if (s.contains("32128")) { - return true; - } - else { - Logger.INFO("bad Tool in Slot 1"); - return false; - } - } - } + return ToolType.Unbreakable; } Logger.INFO("bad Tool in Slot 2 | "+aStack.getUnlocalizedName().toLowerCase() + " | "+aDmg); - return false; + return null; } - if ((aStack.getItem() instanceof GT_MetaGenerated_Item_02) || (aStack.getItem() instanceof GT_MetaGenerated_Tool)){ - if (OrePrefixes.craftingTool.contains(aStack)){ - if (aStack.getDisplayName().toLowerCase().contains("saw") || aStack.getDisplayName().toLowerCase().contains("gt.metatool.01")){ - if (aStack.getItemDamage() == 10){ - return true; - } - else if (aStack.getItemDamage() == 140 || aStack.getDisplayName().toLowerCase().contains("gt.metatool.01.140")){ - return true; - } - else if (aStack.getItemDamage() == 110 || aStack.getDisplayName().toLowerCase().contains("gt.metatool.01.110")){ - return true; - } - else if (aStack.getItemDamage() == 112 || aStack.getDisplayName().toLowerCase().contains("gt.metatool.01.112")){ - return true; - } - else if (aStack.getItemDamage() == 114 || aStack.getDisplayName().toLowerCase().contains("gt.metatool.01.114")){ - return true; - } - else { - Logger.INFO("bad Tool in Slot 3"); - return false; - } - } - } + if (aStack.getItem() instanceof GT_MetaGenerated_Tool) { + if (Arrays.stream(OreDictionary.getOreIDs(aStack)).anyMatch(i -> i == sawOreId)) + return ToolType.Breakable; } } Logger.INFO("bad Tool in Slot 4"); - return false; + return null; } public static boolean isHumusLoaded = false; @@ -716,7 +670,10 @@ public class TreeFarmHelper { } - + public enum ToolType { + Unbreakable, + Breakable + } /** diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java index b94ebf2918..bb40c9b379 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java @@ -35,14 +35,13 @@ public class TreeGenerator { } public AutoMap<ItemStack> generateOutput(int aTreeSize){ - AutoMap<ItemStack> aTemp = new AutoMap<ItemStack>(); AutoMap<ItemStack> aOutputMap = mTreeData.getOutputFromTree(); if (aOutputMap != null && aOutputMap.size() > 0) { Logger.WARNING("Valid tree data output"); return aOutputMap; } Logger.WARNING("Invalid tree data output"); - return aTemp; + return new AutoMap<ItemStack>(); } public static class FakeTreeInFakeWorldGenerator extends WorldGenAbstractTree diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java index ac7b444cb4..4173489be6 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java @@ -236,7 +236,7 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { @Override protected int getPollution() { - return 20 + (15 * tier); + return (int) (CORE.ConfigSwitches.basePollutionPerSecondBoiler*CORE.ConfigSwitches.pollutionReleasedByTierBoiler[this.tier]); } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java index 572abaa211..d1628bdb59 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java @@ -21,7 +21,6 @@ import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_BasicGenerator { - public static final int BASE_POLLUTION = 2; public int mEfficiency; /*public GT_MetaTileEntity_SemiFluidGenerator(int aID, String aName, String aNameRegional, int aTier) { @@ -42,7 +41,7 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi } public int getPollution() { - return (int) (2.0D * Math.pow(2.0D, this.mTier)); + return (int) (CORE.ConfigSwitches.basePollutionPerSecondSemiFluidGenerator * CORE.ConfigSwitches.pollutionReleasedByTierSemiFluidGenerator[this.mTier]); } @Override @@ -70,7 +69,7 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi public String[] getDescription() { return new String[]{ this.mDescription, - "Produces "+(this.getPollution()*20)+" pollution/sec", + "Produces "+(this.getPollution())+" pollution/sec", "Fuel Efficiency: "+this.getEfficiency() + "%", CORE.GT_Tooltip}; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java index 58221313f9..a392ae5a58 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java @@ -38,7 +38,7 @@ extends GT_MetaTileEntity_BasicGenerator @Override public String[] getDescription() { - String aPollution = "Causes between "+this.getPollution()+ " Pollution per second"; + String aPollution = "Causes "+this.getPollution()+ " Pollution per second"; return new String[]{ this.mDescription, "Generates power at " + this.getEfficiency() + "% Efficiency per tick", @@ -146,6 +146,6 @@ extends GT_MetaTileEntity_BasicGenerator } public int getPollution() { - return 100; + return (int) (CORE.ConfigSwitches.basePollutionPerSecondGeothermalGenerator * CORE.ConfigSwitches.pollutionReleasedByTierGeothermalGenerator[mTier]); } }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java index f9bf116362..c05c7ae3ff 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java @@ -12,6 +12,7 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GTPP_Recipe; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechRocketFuelGeneratorBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.Te |
