diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2017-07-10 00:22:21 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2017-07-10 00:22:21 +1000 |
commit | 99ebf8e09d19c949af4986fa20459c8f87c455ea (patch) | |
tree | fa76c2ff4d0acc8ec4f0dbbcdbd11c053d842c13 /src/Java | |
parent | 28a80cb3dc2392a8adb501a6f5d67319e4ce8e10 (diff) | |
download | GT5-Unofficial-99ebf8e09d19c949af4986fa20459c8f87c455ea.tar.gz GT5-Unofficial-99ebf8e09d19c949af4986fa20459c8f87c455ea.tar.bz2 GT5-Unofficial-99ebf8e09d19c949af4986fa20459c8f87c455ea.zip |
$ Fixed .09 features trying to work in .08.
+ Moved lots of things to reflection again.
Diffstat (limited to 'src/Java')
11 files changed, 33 insertions, 41 deletions
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java b/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java index 1ad37b1c56..fb14c50d04 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java @@ -6,6 +6,7 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.fluid.FluidUtils; import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.core.util.reflect.AddGregtechRecipe; import net.minecraft.item.ItemStack; public class CoalTar { @@ -114,7 +115,7 @@ public class CoalTar { public static void recipeCoalToCoalTar(){ //Pyrolyse //Lignite Coal - GT_Values.RA.addPyrolyseRecipe( + AddGregtechRecipe.PyrolyseOven( GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Lignite, 16L), //Input 1 GT_Values.NF, //Fluid Input 8, @@ -123,7 +124,7 @@ public class CoalTar { 150*20, 120); //Coal - GT_Values.RA.addPyrolyseRecipe( + AddGregtechRecipe.PyrolyseOven( GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 16L), //Input 1 GT_Values.NF, //Fluid Input 8, @@ -132,7 +133,7 @@ public class CoalTar { 120*20, 240); //Coal Coke - GT_Values.RA.addPyrolyseRecipe( + AddGregtechRecipe.PyrolyseOven( ItemUtils.getItemStack("Railcraft:fuel.coke", 16), //Input 1 GT_Values.NF, //Fluid Input 8, diff --git a/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java b/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java index 0c98751398..8ba355d57f 100644 --- a/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java +++ b/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java @@ -71,16 +71,4 @@ class LibProxy2 extends LibraryProxy { throw new RuntimeException(e); } } -} - -/*class Lib { // v1 - public static void addRecipe(ItemStack aInput, ItemStack aOutput) { - System.out.println("shit totally happened v1"); - } -} - -class Lib2 { // v2 - public static void addRecipe(ItemStack aInput, ItemStack aOutput, boolean hidden) { - System.out.println("shit totally happened v2"); - } -}*/
\ No newline at end of file +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/util/math/MathUtils.java b/src/Java/gtPlusPlus/core/util/math/MathUtils.java index 7ed15ec27b..a46bd8c61d 100644 --- a/src/Java/gtPlusPlus/core/util/math/MathUtils.java +++ b/src/Java/gtPlusPlus/core/util/math/MathUtils.java @@ -3,6 +3,7 @@ package gtPlusPlus.core.util.math; import java.util.Map; import java.util.Random; +import gregtech.api.enums.GT_Values; import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.objects.XSTR; @@ -96,7 +97,7 @@ public class MathUtils { } while (((bits-val)+(n-1)) < 0L); return val; } - + /** * Returns a psuedo-random number between min and max, inclusive. * The difference between min and max can be at most @@ -359,4 +360,12 @@ public class MathUtils { } } + public static int safeInt(long number, int margin){ + return number>Integer.MAX_VALUE-margin ? Integer.MAX_VALUE-margin :(int)number; + } + + public static int safeInt(long number){ + return number>GT_Values.V[GT_Values.V.length-1] ? safeInt(GT_Values.V[GT_Values.V.length-1],1) : number<Integer.MIN_VALUE ? Integer.MIN_VALUE : (int)number; + } + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java index 780bbae820..65733c440a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java @@ -168,7 +168,6 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool implements } } - @Override public void addAdditionalToolTips(final List aList, final ItemStack aStack, final EntityPlayer aPlayer) { final long tMaxDamage = getToolMaxDamage(aStack); final Materials tMaterial = getPrimaryMaterial(aStack); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechBaseMetaTileEntityLossless.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechBaseMetaTileEntityLossless.java index f2a538d778..3343750c09 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechBaseMetaTileEntityLossless.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechBaseMetaTileEntityLossless.java @@ -2089,7 +2089,6 @@ public class GregtechBaseMetaTileEntityLossless extends BaseTileEntity implement } - @Override public ITexture[] getTexture(final Block arg0, final byte aSide) { final ITexture rIcon = this.getCoverTexture(aSide); if (rIcon != null) { 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 b80352321c..681756cd67 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java @@ -135,8 +135,6 @@ extends GT_MetaTileEntity_BasicGenerator return GT_Recipe_Map.sHotFuels; } - - @Override public int getPollution() { return 100; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java index 3e321982cb..ba748e13d7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java @@ -11,11 +11,12 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; -import gregtech.common.GT_Pollution; import gregtech.common.items.GT_MetaGenerated_Tool_01; import gtPlusPlus.core.item.general.ItemAirFilter; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.PollutionUtils; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.gui.basic.CONTAINER_PollutionCleaner; import gtPlusPlus.xmod.gregtech.api.gui.basic.GUI_PollutionCleaner; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -53,13 +54,13 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi super(aName, aTier, 2, aDescription, aTextures, 2, 0, aGUIName, aNEIName); } - public GregtechMetaAtmosphericReconditioner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + /*public GregtechMetaAtmosphericReconditioner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 2, aDescription, aTextures, 2, 0, aGUIName, aNEIName); - } + }*/ @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GregtechMetaAtmosphericReconditioner(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + return new GregtechMetaAtmosphericReconditioner(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); } @Override @@ -184,7 +185,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi Utils.LOG_WARNING("mPollutionReduction[1]:"+mPollutionReduction); //I stole this code - mPollutionReduction = (GT_Utility.safeInt((long)mPollutionReduction*this.mBaseEff)/100000)*mAirSides; + mPollutionReduction = (MathUtils.safeInt((long)mPollutionReduction*this.mBaseEff)/100000)*mAirSides; //Utils.LOG_WARNING("mPollutionReduction[2]:"+mPollutionReduction); //mPollutionReduction = GT_Utility.safeInt((long)mPollutionReduction*this.mOptimalAirFlow/10000); //Utils.LOG_WARNING("mPollutionReduction[3]:"+mPollutionReduction); @@ -235,7 +236,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi } public int getCurrentChunkPollution(IGregTechTileEntity aBaseMetaTileEntity){ - int mCurrentChunkPollution = GT_Pollution.getPollution(aBaseMetaTileEntity); + int mCurrentChunkPollution = PollutionUtils.getPollution(aBaseMetaTileEntity); if (mCurrentChunkPollution > 0){ mHasPollution = true; } @@ -336,7 +337,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi public boolean removePollution(int toRemove){ int before = getCurrentChunkPollution(); - GT_Pollution.addPollution(this.getBaseMetaTileEntity(), -toRemove); + PollutionUtils.addPollution(this.getBaseMetaTileEntity(), -toRemove); int after = getCurrentChunkPollution(); return (after<before); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java index 62e9a6adcc..77f139ccd8 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java @@ -1,14 +1,13 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; -import gregtech.GT_Mod; 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_Utility; -import gregtech.common.GT_Pollution; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.PollutionUtils; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.player.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity; @@ -187,7 +186,7 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { public int pollutionMultiplier = 1; private void showPollution(final World worldIn, final EntityPlayer playerIn){ - if(!GT_Mod.gregtechproxy.mPollution){ + if(!PollutionUtils.mPollution()){ PlayerUtils.messagePlayer(playerIn, "This block is useless, Pollution is disabled."); } else { @@ -198,7 +197,7 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { } private boolean addPollution(){ - GT_Pollution.addPollution(getBaseMetaTileEntity(), 100000*pollutionMultiplier); + PollutionUtils.addPollution(getBaseMetaTileEntity(), 100000*pollutionMultiplier); return true; } @@ -217,7 +216,7 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { } public int getCurrentChunkPollution(IGregTechTileEntity aBaseMetaTileEntity){ - return GT_Pollution.getPollution(aBaseMetaTileEntity); + return PollutionUtils.getPollution(aBaseMetaTileEntity); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java index 61aacbf69f..4e6647060e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java @@ -1,14 +1,13 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; -import gregtech.GT_Mod; 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_Utility; -import gregtech.common.GT_Pollution; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.PollutionUtils; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.player.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity; @@ -173,7 +172,7 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { } private void showPollution(final World worldIn, final EntityPlayer playerIn){ - if(!GT_Mod.gregtechproxy.mPollution){ + if(!PollutionUtils.mPollution()){ PlayerUtils.messagePlayer(playerIn, "This block is useless, Pollution is disabled."); } else { @@ -197,7 +196,7 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { } public int getCurrentChunkPollution(IGregTechTileEntity aBaseMetaTileEntity){ - return GT_Pollution.getPollution(aBaseMetaTileEntity); + return PollutionUtils.getPollution(aBaseMetaTileEntity); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java index f744edb0db..dbc8fb4227 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java @@ -34,9 +34,9 @@ public class GregtechMetaTileEntity_BasicWasher extends GT_MetaTileEntity_BasicM super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } - public GregtechMetaTileEntity_BasicWasher(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + /*public GregtechMetaTileEntity_BasicWasher(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); - } + }*/ @Override public String[] getDescription() { @@ -45,7 +45,7 @@ public class GregtechMetaTileEntity_BasicWasher extends GT_MetaTileEntity_BasicM @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GregtechMetaTileEntity_BasicWasher(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + return new GregtechMetaTileEntity_BasicWasher(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java index 46bd28d318..490f3d7163 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java @@ -102,7 +102,6 @@ extends GT_Tool { return true; } - @Override public boolean isWrench(){ return true; } |