From 152a1e1f63851929e6efddd2098fdc775b8ff64f Mon Sep 17 00:00:00 2001 From: Tom Dickson Date: Wed, 24 Nov 2021 18:35:28 -0600 Subject: fix /GTNewHorizons/GT-New-Horizons-Modpack#6308 --- .../nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations') 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..b1bad97f0b 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 @@ -40,13 +40,6 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE mAllowDuplicateUsageTypes = aAllowDuplicateTypes; } - 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); - mInputslotCount = getInputSlotCount(); - mTotalSlotCount = getInputSlotCount()*2; - mAllowDuplicateUsageTypes = aAllowDuplicateTypes; - } - @Override public abstract ITexture[] getTexturesActive(ITexture aBaseTexture); -- cgit From 93067011c8289efbff8b9a223021b4e3107235f8 Mon Sep 17 00:00:00 2001 From: Tom Dickson Date: Wed, 24 Nov 2021 20:16:05 -0600 Subject: actually load in a new catalyst if available --- .../nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations') 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 b1bad97f0b..151b5a1735 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 @@ -120,7 +120,8 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE if (i <= getSlotID_LastInput()) { fillStacksIntoFirstSlots(); } - } + } + tryFillUsageSlots(); } // Only moves items in the first four slots -- cgit From 2b42cb27f84b23a38c154469575c108da29307b4 Mon Sep 17 00:00:00 2001 From: Tom Dickson Date: Thu, 25 Nov 2021 06:44:21 -0600 Subject: readd constructor --- .../nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations') 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 151b5a1735..7c857ac0bf 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 @@ -40,6 +40,13 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE mAllowDuplicateUsageTypes = aAllowDuplicateTypes; } + public GT_MetaTileEntity_Hatch_NbtConsumable(String aName, int aTier, int aInputSlots, String[] aDescription, boolean aAllowDuplicateTypes, ITexture[][][] aTextures) { + super(aName, aTier, aInputSlots*2, aDescription, aTextures); + mInputslotCount = getInputSlotCount(); + mTotalSlotCount = getInputSlotCount()*2; + mAllowDuplicateUsageTypes = aAllowDuplicateTypes; + } + @Override public abstract ITexture[] getTexturesActive(ITexture aBaseTexture); -- cgit From 0cf66de644598ef44ec662a46eeacb1dffbfd7a8 Mon Sep 17 00:00:00 2001 From: bombcar Date: Fri, 26 Nov 2021 08:32:53 -0600 Subject: turn tryfill public --- .../nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations') 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 7c857ac0bf..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 @@ -128,7 +128,6 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE fillStacksIntoFirstSlots(); } } - tryFillUsageSlots(); } // Only moves items in the first four slots @@ -142,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); -- cgit From f19ff7aa5c13c6e4d4e26e5d3f825f30d80c8f9d Mon Sep 17 00:00:00 2001 From: bombcar Date: Fri, 26 Nov 2021 08:57:46 -0600 Subject: Revert "turn tryfill public" This reverts commit 0cf66de644598ef44ec662a46eeacb1dffbfd7a8. --- .../nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations') 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 56dff1b1e3..7c857ac0bf 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 @@ -128,6 +128,7 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE fillStacksIntoFirstSlots(); } } + tryFillUsageSlots(); } // Only moves items in the first four slots @@ -141,7 +142,7 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE } } - public final void tryFillUsageSlots() { + private final void tryFillUsageSlots() { int aSlotSpace = (mInputslotCount - getContentUsageSlots().size()); if (aSlotSpace > 0) { Logger.INFO("We have empty usage slots. "+aSlotSpace); -- cgit From 8744c2c9664d157bb80895ca6d2956931401f1e2 Mon Sep 17 00:00:00 2001 From: bombcar Date: Fri, 26 Nov 2021 09:00:23 -0600 Subject: Revert "Revert "turn tryfill public"" This reverts commit f19ff7aa5c13c6e4d4e26e5d3f825f30d80c8f9d. --- .../nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations') 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 7c857ac0bf..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 @@ -128,7 +128,6 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE fillStacksIntoFirstSlots(); } } - tryFillUsageSlots(); } // Only moves items in the first four slots @@ -142,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); -- cgit From 648d073301c771e385f4b36049cc77b4fadc662c Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Mon, 29 Nov 2021 02:20:03 +0100 Subject: extracted pollution values to CORE.ConfigSwitches --- .../implementations/base/GregtechMeta_MultiBlockBase.java | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations') 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 3878583b60..0b8182c64a 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 @@ -2159,10 +2159,6 @@ public abstract class GregtechMeta_MultiBlockBase Date: Mon, 29 Nov 2021 12:31:58 +0100 Subject: added pollution config for single blocks --- .../generators/GregtechRocketFuelGeneratorBase.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations') 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 6e33529b66..885069693d 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 @@ -13,6 +13,7 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -22,13 +23,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,8 +62,7 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ @Override - public String[] getDescription() { - if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { + public String[] getDescription() { int pollMin = mTier == 4 ? 250 : (mTier == 5 ? 500 : 750); int pollMax = mTier == 4 ? 2000 : (mTier == 5 ? 4000 : 6000); String aPollution = "Causes between "+pollMin+" and "+pollMax+ " Pollution per second"; @@ -65,10 +70,6 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ this.mDescription, "Fuel Efficiency: " + this.getEfficiency() + "%", aPollution}; - } - return new String[]{ - this.mDescription, - "Fuel Efficiency: " + this.getEfficiency() + "%"}; } @@ -292,7 +293,9 @@ 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(); -- cgit