From b7c66bf2094dd2f03d92919c18fec9dfb04264e6 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 8 Sep 2018 00:39:04 +0200 Subject: Various fixes +Added GT-FML-Log +Added an Exception if a Nq reactor without recipe map is created +Added the ability to add ReinforcedGlass in the CleanroomWalls (https://github.com/GTNewHorizons/NewHorizons/issues/3584) +Added a config option for changing the ReinforcedGlass percentage +Renamed Materials2 -> GTNH_ExtraMaterials and fixed it --- src/main/java/gregtech/GT_Mod.java | 59 ++++++++++-------- .../gregtech/api/enums/GTNH_ExtraMaterials.java | 41 +++++++++++++ src/main/java/gregtech/api/enums/GT_Values.java | 5 ++ src/main/java/gregtech/api/enums/Materials2.java | 14 ----- .../api/metatileentity/BaseMetaPipeEntity.java | 4 +- .../api/metatileentity/BaseMetaTileEntity.java | 3 +- .../api/metatileentity/MetaPipeEntity.java | 2 +- .../java/gregtech/api/objects/GT_UO_Dimension.java | 4 +- .../java/gregtech/api/objects/GT_UO_Fluid.java | 2 +- src/main/java/gregtech/api/util/GT_ModHandler.java | 2 +- src/main/java/gregtech/api/util/GT_Utility.java | 3 +- src/main/java/gregtech/common/GT_Network.java | 6 +- src/main/java/gregtech/common/GT_Proxy.java | 6 +- src/main/java/gregtech/common/GT_RecipeAdder.java | 6 +- .../java/gregtech/common/GT_Worldgenerator.java | 2 +- .../gregtech/common/blocks/GT_Block_Machines.java | 5 +- .../gregtech/common/blocks/GT_TileEntity_Ores.java | 8 +-- .../common/covers/GT_Cover_Fluidfilter.java | 2 +- .../common/items/GT_IntegratedCircuit_Item.java | 6 +- .../gregtech/common/items/armor/ArmorData.java | 5 +- .../automation/GT_MetaTileEntity_ChestBuffer.java | 6 +- .../GT_MetaTileEntity_NaquadahReactor.java | 8 +-- .../machines/basic/GT_MetaTileEntity_Scanner.java | 1 - .../basic/GT_MetaTileEntity_Teleporter.java | 2 +- .../multi/GT_MetaTileEntity_AssemblyLine.java | 71 ++++++++++++++-------- .../multi/GT_MetaTileEntity_Cleanroom.java | 13 +++- .../GT_MetaTileEntity_LargeTurbine_Plasma.java | 2 +- .../storage/GT_MetaTileEntity_SuperChest.java | 6 +- .../materialprocessing/ProcessingConfig.java | 2 + .../gregtech/loaders/misc/GT_Achievements.java | 2 +- 30 files changed, 189 insertions(+), 109 deletions(-) create mode 100644 src/main/java/gregtech/api/enums/GTNH_ExtraMaterials.java delete mode 100644 src/main/java/gregtech/api/enums/Materials2.java (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 2a3dffc3ce..39b59997e0 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -57,6 +57,8 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import java.io.*; import java.util.*; @@ -111,6 +113,7 @@ public class GT_Mod implements IGT_Mod { public static GT_Achievements achievements; private final String aTextGeneral = "general"; private final String aTextIC2 = "ic2_"; + public static final Logger GT_FML_LOGGER = LogManager.getLogger("GregTech GTNH"); static { if ((509 != GregTech_API.VERSION) || (509 != GT_ModHandler.VERSION) || (509 != GT_OreDictUnificator.VERSION) || (509 != GT_Recipe.VERSION) || (509 != GT_Utility.VERSION) || (509 != GT_RecipeRegistrator.VERSION) || (509 != Element.VERSION) || (509 != Materials.VERSION) || (509 != OrePrefixes.VERSION)) { @@ -241,15 +244,19 @@ public class GT_Mod implements IGT_Mod { GT_Values.oreveinMaxPlacementAttempts = tMainConfig.get(aTextGeneral, "oreveinMaxPlacementAttempts_8",8).getInt(8); //GT_Values.oreveinMaxSize = tMainConfig.get(aTextGeneral, "oreveinMaxSize_64",64).getInt(64); GT_Values.ticksBetweenSounds = tMainConfig.get("machines", "TicksBetweenSounds", 30).getInt(30); + GT_Values.cleanroomGlass= (float) tMainConfig.get("machines","ReinforcedGlassPercentageForCleanroom",5D).getDouble(5D); GregTech_API.TICKS_FOR_LAG_AVERAGING = tMainConfig.get(aTextGeneral, "TicksForLagAveragingWithScanner", 25).getInt(25); GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING = tMainConfig.get(aTextGeneral, "MillisecondsPassedInGTTileEntityUntilLagWarning", 100).getInt(100); if (tMainConfig.get(aTextGeneral, "disable_STDOUT", false).getBoolean(false)) { + GT_FML_LOGGER.info("Disableing Console Messages."); + GT_FML_LOGGER.exit(); System.out.close(); - } - if (tMainConfig.get(aTextGeneral, "disable_STDERR", false).getBoolean(false)) { System.err.close(); } + /*if (tMainConfig.get(aTextGeneral, "disable_STDERR", false).getBoolean(false)) { + System.err.close(); + }*/ GregTech_API.sMachineExplosions = tMainConfig.get("machines", "machines_explosion_damage", true).getBoolean(false); GregTech_API.sMachineFlammable = tMainConfig.get("machines", "machines_flammable", true).getBoolean(false); GregTech_API.sMachineNonWrenchExplosions = tMainConfig.get("machines", "explosions_on_nonwrenching", true).getBoolean(false); @@ -406,7 +413,7 @@ public class GT_Mod implements IGT_Mod { EntityRegistry.registerModEntity(GT_Entity_Arrow.class, "GT_Entity_Arrow", 1, GT_Values.GT, 160, 1, true); EntityRegistry.registerModEntity(GT_Entity_Arrow_Potion.class, "GT_Entity_Arrow_Potion", 2, GT_Values.GT, 160, 1, true); - System.out.println("preReader"); + GT_FML_LOGGER.info("preReader"); List oreTags = new ArrayList(); if(Loader.isModLoaded("MineTweaker3")){ File globalDir = new File("scripts"); @@ -441,7 +448,7 @@ public class GT_Mod implements IGT_Mod { try{ hit = hit.substring(2); meta = Integer.parseInt(hit); - }catch(Exception e){System.out.println("parseError: "+hit);} + }catch(Exception e){GT_FML_LOGGER.info("parseError: "+hit);} if(meta>0&&meta<32000){ int prefix = meta/1000; int material = meta % 1000; @@ -454,7 +461,7 @@ public class GT_Mod implements IGT_Mod { if(GregTech_API.sGeneratedMaterials[material]!=null){ tag += GregTech_API.sGeneratedMaterials[material].mName; if(!oreTags.contains(tag)) oreTags.add(tag); - }else if(material>0){System.out.println("MaterialDisabled: "+material+" "+m.group(1));} + }else if(material>0){GT_FML_LOGGER.info("MaterialDisabled: "+material+" "+m.group(1));} } } } @@ -469,10 +476,10 @@ public class GT_Mod implements IGT_Mod { if(StringUtils.startsWithAny(test, preS)){ mMTTags.add(test); if(GT_Values.D1) - System.out.println("oretag: "+test); + GT_FML_LOGGER.info("oretag: "+test); }} - System.out.println("reenableMetaItems"); + GT_FML_LOGGER.info("reenableMetaItems"); for(String reEnable : mMTTags){ OrePrefixes tPrefix = OrePrefixes.getOrePrefix(reEnable); if(tPrefix!=null){ @@ -508,8 +515,8 @@ public class GT_Mod implements IGT_Mod { OrePrefixes.ring.mDisabledItems.remove(tName); OrePrefixes.ring.mGeneratedItems.add(tName); } - }else{System.out.println("noMaterial "+reEnable);} - }else{System.out.println("noPrefix "+reEnable);}} + }else{GT_FML_LOGGER.info("noMaterial "+reEnable);} + }else{GT_FML_LOGGER.info("noPrefix "+reEnable);}} new GT_Loader_OreProcessing().run(); new GT_Loader_OreDictionary().run(); @@ -723,9 +730,9 @@ public class GT_Mod implements IGT_Mod { Map aThermalCentrifugeRecipeList = GT_ModHandler.getThermalCentrifugeRecipeList(); GT_Log.out.println("GT_Mod: Activating OreDictionary Handler, this can take some time, as it scans the whole OreDictionary"); - FMLLog.info("If your Log stops here, you were too impatient. Wait a bit more next time, before killing Minecraft with the Task Manager.", new Object[0]); + GT_FML_LOGGER.info("If your Log stops here, you were too impatient. Wait a bit more next time, before killing Minecraft with the Task Manager.", new Object[0]); gregtechproxy.activateOreDictHandler(); - FMLLog.info("Congratulations, you have been waiting long enough. Have a Cake.", new Object[0]); + GT_FML_LOGGER.info("Congratulations, you have been waiting long enough. Have a Cake.", new Object[0]); GT_Log.out.println("GT_Mod: List of Lists of Tool Recipes: "+GT_ModHandler.sSingleNonBlockDamagableRecipeList_list.toString()); GT_Log.out.println("GT_Mod: Vanilla Recipe List -> Outputs null or stackSize <=0: " + GT_ModHandler.sVanillaRecipeList_warntOutput.toString()); GT_Log.out.println("GT_Mod: Single Non Block Damagable Recipe List -> Outputs null or stackSize <=0: " + GT_ModHandler.sSingleNonBlockDamagableRecipeList_warntOutput.toString()); @@ -1131,21 +1138,21 @@ public class GT_Mod implements IGT_Mod { } for (ItemStack tOutput : tStacks) { if (gregtechproxy.mRegisteredOres.contains(tOutput)) { - FMLLog.severe("GT-ERR-01: @ " + tOutput.getUnlocalizedName() + " " + tOutput.getDisplayName(), new Object[0]); - FMLLog.severe("A Recipe used an OreDict Item as Output directly, without copying it before!!! This is a typical CallByReference/CallByValue Error", new Object[0]); - FMLLog.severe("Said Item will be renamed to make the invalid Recipe visible, so that you can report it properly.", new Object[0]); - FMLLog.severe("Please check all Recipes outputting this Item, and report the Recipes to their Owner.", new Object[0]); - FMLLog.severe("The Owner of the ==>RECIPE<==, NOT the Owner of the Item, which has been mentioned above!!!", new Object[0]); - FMLLog.severe("And ONLY Recipes which are ==>OUTPUTTING<== the Item, sorry but I don't want failed Bug Reports.", new Object[0]); - FMLLog.severe("GregTech just reports this Error to you, so you can report it to the Mod causing the Problem.", new Object[0]); - FMLLog.severe("Even though I make that Bug visible, I can not and will not fix that for you, that's for the causing Mod to fix.", new Object[0]); - FMLLog.severe("And speaking of failed Reports:", new Object[0]); - FMLLog.severe("Both IC2 and GregTech CANNOT be the CAUSE of this Problem, so don't report it to either of them.", new Object[0]); - FMLLog.severe("I REPEAT, BOTH, IC2 and GregTech CANNOT be the source of THIS BUG. NO MATTER WHAT.", new Object[0]); - FMLLog.severe("Asking in the IC2 Forums, which Mod is causing that, won't help anyone, since it is not possible to determine, which Mod it is.", new Object[0]); - FMLLog.severe("If it would be possible, then I would have had added the Mod which is causing it to the Message already. But it is not possible.", new Object[0]); - FMLLog.severe("Sorry, but this Error is serious enough to justify this Wall-O-Text and the partially allcapsed Language.", new Object[0]); - FMLLog.severe("Also it is a Ban Reason on the IC2-Forums to post this seriously.", new Object[0]); + GT_FML_LOGGER.error("GT-ERR-01: @ " + tOutput.getUnlocalizedName() + " " + tOutput.getDisplayName(), new Object[0]); + GT_FML_LOGGER.error("A Recipe used an OreDict Item as Output directly, without copying it before!!! This is a typical CallByReference/CallByValue Error", new Object[0]); + GT_FML_LOGGER.error("Said Item will be renamed to make the invalid Recipe visible, so that you can report it properly.", new Object[0]); + GT_FML_LOGGER.error("Please check all Recipes outputting this Item, and report the Recipes to their Owner.", new Object[0]); + GT_FML_LOGGER.error("The Owner of the ==>RECIPE<==, NOT the Owner of the Item, which has been mentioned above!!!", new Object[0]); + GT_FML_LOGGER.error("And ONLY Recipes which are ==>OUTPUTTING<== the Item, sorry but I don't want failed Bug Reports.", new Object[0]); + GT_FML_LOGGER.error("GregTech just reports this Error to you, so you can report it to the Mod causing the Problem.", new Object[0]); + GT_FML_LOGGER.error("Even though I make that Bug visible, I can not and will not fix that for you, that's for the causing Mod to fix.", new Object[0]); + GT_FML_LOGGER.error("And speaking of failed Reports:", new Object[0]); + GT_FML_LOGGER.error("Both IC2 and GregTech CANNOT be the CAUSE of this Problem, so don't report it to either of them.", new Object[0]); + GT_FML_LOGGER.error("I REPEAT, BOTH, IC2 and GregTech CANNOT be the source of THIS BUG. NO MATTER WHAT.", new Object[0]); + GT_FML_LOGGER.error("Asking in the IC2 Forums, which Mod is causing that, won't help anyone, since it is not possible to determine, which Mod it is.", new Object[0]); + GT_FML_LOGGER.error("If it would be possible, then I would have had added the Mod which is causing it to the Message already. But it is not possible.", new Object[0]); + GT_FML_LOGGER.error("Sorry, but this Error is serious enough to justify this Wall-O-Text and the partially allcapsed Language.", new Object[0]); + GT_FML_LOGGER.error("Also it is a Ban Reason on the IC2-Forums to post this seriously.", new Object[0]); tOutput.setStackDisplayName("ERROR! PLEASE CHECK YOUR LOG FOR 'GT-ERR-01'!"); } else { GT_OreDictUnificator.setStack(tOutput); diff --git a/src/main/java/gregtech/api/enums/GTNH_ExtraMaterials.java b/src/main/java/gregtech/api/enums/GTNH_ExtraMaterials.java new file mode 100644 index 0000000000..a2c7ced80c --- /dev/null +++ b/src/main/java/gregtech/api/enums/GTNH_ExtraMaterials.java @@ -0,0 +1,41 @@ +package gregtech.api.enums; + +import gregtech.api.interfaces.IMaterialHandler; +import static gregtech.GT_Mod.GT_FML_LOGGER; + +public class GTNH_ExtraMaterials implements IMaterialHandler { + + public GTNH_ExtraMaterials(){ + GT_FML_LOGGER.info("Registering GTNH-Materials (post Java 64kb limit)"); + Materials.add(this); + } + + /** + * This Class is for adding new Materials since Java has a Limiation of 64kb per Method / Class header + */ + + public static Materials Signalum = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Signalum" , "Signalum" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL ); + public static Materials Lumium = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Lumium" , "Lumium" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL ); + public static Materials EnrichedCopper = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "EnrichedCopper" , "Enriched Copper" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL ); + public static Materials DiamondCopper = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "DiamondCopper" , "Diamond Copper" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL ); + public static Materials TarPitch = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "TarPitch" , "Tar Pitch" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL ); + + private static void initSubTags() { + SubTag.METAL.addTo(Signalum, Lumium, EnrichedCopper, DiamondCopper); + SubTag.NO_SMASHING.addTo(TarPitch); + } + + @Override + public void onMaterialsInit() { + initSubTags(); + } + + @Override + public void onComponentInit() { + } + + @Override + public void onComponentIteration(Materials aMaterial) { + + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/api/enums/GT_Values.java b/src/main/java/gregtech/api/enums/GT_Values.java index f36ea881d8..8fefe5b719 100644 --- a/src/main/java/gregtech/api/enums/GT_Values.java +++ b/src/main/java/gregtech/api/enums/GT_Values.java @@ -175,4 +175,9 @@ public class GT_Values { * This will prevent NEI from crashing but spams the Log. */ public static boolean allow_broken_recipemap = false; + + /** + * This will set the percentage how much ReinforcedGlass is Allowed in Cleanroom Walls. + */ + public static float cleanroomGlass = 5.0f; } diff --git a/src/main/java/gregtech/api/enums/Materials2.java b/src/main/java/gregtech/api/enums/Materials2.java deleted file mode 100644 index 1d343ff0f8..0000000000 --- a/src/main/java/gregtech/api/enums/Materials2.java +++ /dev/null @@ -1,14 +0,0 @@ -package gregtech.api.enums; - -public class Materials2 { - - public static Materials Signalum = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Signalum" , "Signalum" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL ); - public static Materials Lumium = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Lumium" , "Lumium" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL ); - public static Materials EnrichedCopper = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "EnrichedCopper" , "Enriched Copper" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL ); - public static Materials DiamondCopper = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "DiamondCopper" , "Diamond Copper" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL ); - public static Materials TarPitch = new Materials( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "TarPitch" , "Tar Pitch" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL ); - - private static void initSubTags() { - SubTag.METAL.addTo(Signalum, Lumium, EnrichedCopper, DiamondCopper); - } -} \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index 2a86b2bbf0..599d8879e4 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -1,12 +1,12 @@ package gregtech.api.metatileentity; +import static gregtech.GT_Mod.GT_FML_LOGGER; import static gregtech.api.enums.GT_Values.NW; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import cpw.mods.fml.common.FMLLog; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -303,7 +303,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE if (mTimeStatistics.length > 0) mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length] = (int) tTime; if (tTime > 0 && tTime > (GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING*1000000) && mTickTimer > 1000 && getMetaTileEntity().doTickProfilingMessageDuringThisTick() && mLagWarningCount++ < 10) - FMLLog.warning("WARNING: Possible Lag Source at [%s,%s,%s] in Dimension %s with %s ns caused by an instance of %s", xCoord, yCoord, zCoord, worldObj.provider.dimensionId, tTime, getMetaTileEntity().getClass()); + GT_FML_LOGGER.warn("WARNING: Possible Lag Source at [%s,%s,%s] in Dimension %s with %s ns caused by an instance of %s", xCoord, yCoord, zCoord, worldObj.provider.dimensionId, tTime, getMetaTileEntity().getClass()); } mWorkUpdate = mInventoryChanged = false; diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 43c479be70..5ffae94456 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -40,6 +40,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import static gregtech.GT_Mod.GT_FML_LOGGER; import static gregtech.api.enums.GT_Values.NW; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; @@ -577,7 +578,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE if (mTimeStatistics.length > 0) mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length] = (int) tTime; if (tTime > 0 && tTime > (GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING*1000000) && mTickTimer > 1000 && getMetaTileEntity().doTickProfilingMessageDuringThisTick() && mLagWarningCount++ < 10) - System.out.println("WARNING: Possible Lag Source at [" + xCoord + ", " + yCoord + ", " + zCoord + "] in Dimension " + worldObj.provider.dimensionId + " with " + tTime + "ns caused by an instance of " + getMetaTileEntity().getClass()); + GT_FML_LOGGER.warn("WARNING: Possible Lag Source at [" + xCoord + ", " + yCoord + ", " + zCoord + "] in Dimension " + worldObj.provider.dimensionId + " with " + tTime + "ns caused by an instance of " + getMetaTileEntity().getClass()); } mWorkUpdate = mInventoryChanged = mRunningThroughTick = false; diff --git a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java index df603de17b..fe0a996117 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java @@ -183,7 +183,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { if(isConnectedAtSide(aSide)){ tCovered = true; } - //System.out.println("Cover: "+mBaseMetaTileEntity.getCoverIDAtSide(aSide)); + //GT_FML_LOGGER.info("Cover: "+mBaseMetaTileEntity.getCoverIDAtSide(aSide)); //toDo: filter cover ids that actually protect against temperature (rubber/plastic maybe?, more like asbestos) return tCovered; } diff --git a/src/main/java/gregtech/api/objects/GT_UO_Dimension.java b/src/main/java/gregtech/api/objects/GT_UO_Dimension.java index cca5e22bf7..1c090eb9b5 100644 --- a/src/main/java/gregtech/api/objects/GT_UO_Dimension.java +++ b/src/main/java/gregtech/api/objects/GT_UO_Dimension.java @@ -20,7 +20,7 @@ public class GT_UO_Dimension { Dimension = aConfigCategory.get("Dimension").getString(); } maxChance = 0; - //System.out.println("GT UO "+aConfigCategory.getName()+" Dimension:"+Dimension); + //GT_FML_LOGGER.info("GT UO "+aConfigCategory.getName()+" Dimension:"+Dimension); for (int i = 0 ; i < aConfigCategory.getChildren().size(); i++) { GT_UO_Fluid fluid = new GT_UO_Fluid((ConfigCategory)aConfigCategory.getChildren().toArray()[i]); fFluids.put(fluid.Registry, fluid); @@ -33,7 +33,7 @@ public class GT_UO_Dimension { for (BiMap.Entry fl : fFluids.entrySet()) { int chance = fl.getValue().Chance*1000/maxChance; if (random<=chance) return fl.getValue(); - //System.out.println("GT UO "+fl.getValue().Registry+" Chance:"+chance+" Random:"+random); + //GT_FML_LOGGER.info("GT UO "+fl.getValue().Registry+" Chance:"+chance+" Random:"+random); random-=chance; } return null; diff --git a/src/main/java/gregtech/api/objects/GT_UO_Fluid.java b/src/main/java/gregtech/api/objects/GT_UO_Fluid.java index 5675f73b45..8a4b61065c 100644 --- a/src/main/java/gregtech/api/objects/GT_UO_Fluid.java +++ b/src/main/java/gregtech/api/objects/GT_UO_Fluid.java @@ -41,7 +41,7 @@ public class GT_UO_Fluid { aConfigCategory.get("DecreasePerOperationAmount").comment = "Decrease per operation (actual fluid gained works like (Litre)VeinData/5000)"; DecreasePerOperationAmount = aConfigCategory.get("DecreasePerOperationAmount").getInt(5); } - //System.out.println("GT UO "+aConfigCategory.getName()+" Fluid:"+Registry+" Max:"+MaxAmount+" Min:"+MinAmount+" Chance:"+Chance); + //GT_FML_LOGGER.info("GT UO "+aConfigCategory.getName()+" Fluid:"+Registry+" Max:"+MaxAmount+" Min:"+MinAmount+" Chance:"+Chance); } public Fluid getFluid(){ diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java index 6cfd539c68..8a1519234c 100644 --- a/src/main/java/gregtech/api/util/GT_ModHandler.java +++ b/src/main/java/gregtech/api/util/GT_ModHandler.java @@ -699,7 +699,7 @@ public class GT_ModHandler { break; } }catch(Exception e){System.err.println(e);} - //System.out.println("#####Processed IC2 " + aGTRecipeMap.mUnlocalizedName + " Recipe: In(" + tStack.getUnlocalizedName() + ") - Out(" + ((RecipeOutput) tRecipe.getValue()).items.get(0).getUnlocalizedName() + ")"); + //GT_FML_LOGGER.info("#####Processed IC2 " + aGTRecipeMap.mUnlocalizedName + " Recipe: In(" + tStack.getUnlocalizedName() + ") - Out(" + ((RecipeOutput) tRecipe.getValue()).items.get(0).getUnlocalizedName() + ")"); } if (aRemoveIC2Recipe) aRecipesToRemove.put(tStack, ((RecipeOutput) tRecipe.getValue()).items.get(0)); } diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 4a2fa78a62..824f952b85 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -77,6 +77,7 @@ import java.text.NumberFormat; import java.util.*; import java.util.Map.Entry; +import static gregtech.GT_Mod.GT_FML_LOGGER; import static gregtech.api.enums.GT_Values.*; import static gregtech.common.GT_Proxy.GTPOLLUTION; import static gregtech.common.GT_UndergroundOil.undergroundOilReadInformation; @@ -888,7 +889,7 @@ public class GT_Utility { ItemData tOreName = GT_OreDictUnificator.getAssociation(aInput); for (int i = 0; i < aOutput.length; i++) { if (aOutput[i] == null) { - System.out.println("EmptyIC2Output!" + aInput.getUnlocalizedName()); + GT_FML_LOGGER.info("EmptyIC2Output!" + aInput.getUnlocalizedName()); return false; } } diff --git a/src/main/java/gregtech/common/GT_Network.java b/src/main/java/gregtech/common/GT_Network.java index 2635f21f4b..1371b6485c 100644 --- a/src/main/java/gregtech/common/GT_Network.java +++ b/src/main/java/gregtech/common/GT_Network.java @@ -23,6 +23,8 @@ import net.minecraft.world.chunk.Chunk; import java.util.EnumMap; import java.util.List; +import static gregtech.GT_Mod.GT_FML_LOGGER; + @ChannelHandler.Sharable public class GT_Network extends MessageToMessageCodec @@ -48,10 +50,10 @@ public class GT_Network public void sendToPlayer(GT_Packet aPacket, EntityPlayerMP aPlayer) { if(aPacket==null){ - System.out.println("packet null");return; + GT_FML_LOGGER.info("packet null");return; } if(aPlayer==null){ - System.out.println("player null");return; + GT_FML_LOGGER.info("player null");return; } ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPlayer); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 880db79838..ddae83ff32 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -73,6 +73,8 @@ import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; +import static gregtech.GT_Mod.GT_FML_LOGGER; + import java.io.File; import java.text.DateFormat; import java.util.*; @@ -240,7 +242,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { GT_Utility.copyAmount(1L, new Object[]{aOre.mEvent.Ore})); } } else { -// System.out.println("Thingy Name: "+ aOre.mEvent.Name+ " !!!Unknown 'Thingy' detected!!! This Object seems to probably not follow a valid OreDictionary Convention, or I missed a Convention. Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me."); +// GT_FML_LOGGER.info("Thingy Name: "+ aOre.mEvent.Name+ " !!!Unknown 'Thingy' detected!!! This Object seems to probably not follow a valid OreDictionary Convention, or I missed a Convention. Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me."); } } @@ -1117,7 +1119,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { return; } } -// System.out.println("Material Name: "+aEvent.Name+ " !!!Unknown Material detected!!! Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me."); +// GT_FML_LOGGER.info("Material Name: "+aEvent.Name+ " !!!Unknown Material detected!!! Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me."); // GT_Log.ore.println(tModToName + " uses an unknown Material. Report this to GregTech."); return; } diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index 7bf34fbc97..730bd473d4 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -27,6 +27,8 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; +import static gregtech.GT_Mod.GT_FML_LOGGER; + public class GT_RecipeAdder implements IGT_RecipeAdder { @@ -1147,7 +1149,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } for(ItemStack tItem : aInputs){ if(tItem==null){ - System.out.println("addAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); + GT_FML_LOGGER.info("addAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); } } GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result", new Object[0])}, null, null, aResearchTime, 30, 0); @@ -1198,7 +1200,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } catch (Exception t) {} } } - System.out.println("addAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); + GT_FML_LOGGER.info("addAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); } GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result", new Object[0])}, null, null, aResearchTime, 30, 0); GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false,tInputs,new ItemStack[]{aOutput},new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0])},aFluidInputs,null,aDuration,aEUt,0,tAlts,true); diff --git a/src/main/java/gregtech/common/GT_Worldgenerator.java b/src/main/java/gregtech/common/GT_Worldgenerator.java index 9b48b15125..cac0ffe4c3 100644 --- a/src/main/java/gregtech/common/GT_Worldgenerator.java +++ b/src/main/java/gregtech/common/GT_Worldgenerator.java @@ -419,7 +419,7 @@ implements IWorldGenerator { } } } - //if(GT_Values.D1)System.out.println("do asteroid gen: "+this.mX+" "+this.mZ); + //if(GT_Values.D1)GT_FML_LOGGER.info("do asteroid gen: "+this.mX+" "+this.mZ); int tX = mX * 16 + aRandom.nextInt(16); int tY = 50 + aRandom.nextInt(200 - 50); int tZ = mZ * 16 + aRandom.nextInt(16); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java index 157a38962a..e1c11e05df 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java @@ -41,6 +41,7 @@ import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; import java.util.List; +import static gregtech.GT_Mod.GT_FML_LOGGER; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; public class GT_Block_Machines @@ -267,14 +268,14 @@ public class GT_Block_Machines e.printStackTrace(GT_Log.err); } GT_Log.out.println("GT_Mod: Starting Block Icon Load Phase"); - System.out.println("GT_Mod: Starting Block Icon Load Phase"); + GT_FML_LOGGER.info("GT_Mod: Starting Block Icon Load Phase"); try { for (Runnable tRunnable : GregTech_API.sGTBlockIconload) { tRunnable.run(); } } catch (Throwable e) {e.printStackTrace(GT_Log.err);} GT_Log.out.println("GT_Mod: Finished Block Icon Load Phase"); - System.out.println("GT_Mod: Finished Block Icon Load Phase"); + GT_FML_LOGGER.info("GT_Mod: Finished Block Icon Load Phase"); } } diff --git a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java index 0115d554c0..a76120150c 100644 --- a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java @@ -83,24 +83,24 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit if (GregTech_API.sBlockOresUb1 != null) { tOreBlock = GregTech_API.sBlockOresUb1; aMetaData += (BlockMeta * 1000); - //System.out.println("Block changed to UB1"); + //GT_FML_LOGGER.info("Block changed to UB1"); } } else if (BlockName.equals("tile.metamorphicStone")) { if (GregTech_API.sBlockOresUb2 != null) { tOreBlock = GregTech_API.sBlockOresUb2; aMetaData += (BlockMeta * 1000); - //System.out.println("Block changed to UB2"); + //GT_FML_LOGGER.info("Block changed to UB2"); } } else if (BlockName.equals("tile.sedimentaryStone")) { if (GregTech_API.sBlockOresUb3 != null) { tOreBlock = GregTech_API.sBlockOresUb3; aMetaData += (BlockMeta * 1000); - //System.out.println("Block changed to UB3"); + //GT_FML_LOGGER.info("Block changed to UB3"); } } else { return false; } - //System.out.println(tOreBlock); + //GT_FML_LOGGER.info(tOreBlock); aWorld.setBlock(aX, aY, aZ, tOreBlock, getHarvestData((short) aMetaData, ((GT_Block_Ores_Abstract) tOreBlock).getBaseBlockHarvestLevel(aMetaData % 16000 / 1000)), 0); TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if ((tTileEntity instanceof GT_TileEntity_Ores)) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java b/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java index b5ac8191f4..f9f3c64b7d 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java @@ -47,7 +47,7 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehavior { } public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - //System.out.println("rightclick"); + //GT_FML_LOGGER.info("rightclick"); if ( ((aX > 0.375D) && (aX < 0.625D)) || ((aSide > 3) && ((aY > 0.375D) && (aY < 0.625D))) || diff --git a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java index bb11224f13..10658125bf 100644 --- a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java +++ b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java @@ -18,6 +18,8 @@ import net.minecraft.item.ItemStack; import java.util.List; +import static gregtech.GT_Mod.GT_FML_LOGGER; + public class GT_IntegratedCircuit_Item extends GT_Generic_Item { private final static String aTextEmptyRow = " "; public GT_IntegratedCircuit_Item() { @@ -96,7 +98,7 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item { super.registerIcons(aIconRegister); if (GregTech_API.sPostloadFinished) { GT_Log.out.println("GT_Mod: Starting Item Icon Load Phase"); - System.out.println("GT_Mod: Starting Item Icon Load Phase"); + GT_FML_LOGGER.info("GT_Mod: Starting Item Icon Load Phase"); GregTech_API.sItemIcons = aIconRegister; try { for (Runnable tRunnable : GregTech_API.sGTItemIconload) { @@ -104,7 +106,7 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item { } } catch (Throwable e) {e.printStackTrace(GT_Log.err);} GT_Log.out.println("GT_Mod: Finished Item Icon Load Phase"); - System.out.println("GT_Mod: Finished Item Icon Load Phase"); + GT_FML_LOGGER.info("GT_Mod: Finished Item Icon Load Phase"); } } } diff --git a/src/main/java/gregtech/common/items/armor/ArmorData.java b/src/main/java/gregtech/common/items/armor/ArmorData.java index 52265a2b33..c8061db988 100644 --- a/src/main/java/gregtech/common/items/armor/ArmorData.java +++ b/src/main/java/gregtech/common/items/armor/ArmorData.java @@ -16,6 +16,8 @@ import java.text.DecimalFormatSymbols; import java.text.NumberFormat; import java.util.*; +import static gregtech.GT_Mod.GT_FML_LOGGER; + public class ArmorData { public int type; // 0 = helmet; 1 = chestplate; 2 = leggings; 3 = boots; @@ -385,7 +387,8 @@ public class ArmorData { public void change(Map aMap, StatType aType, float aChange){ float tChange = 0; - if(aMap==null)System.out.println("changeMapnull"); + if(aMap==null) + GT_FML_LOGGER.info("changeMapnull"); if(aMap.containsKey(aType)){ Object value = aMap.get(aType); tChange = value != null ? (float) aMap.get(aType) : 0.0f; diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java index e73631cd93..d11b1f2f81 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java @@ -101,7 +101,7 @@ public class GT_MetaTileEntity_ChestBuffer String displayName1 = o1.getDisplayName(); String displayName2 = o2.getDisplayName(); int result = displayName1.compareToIgnoreCase(displayName2); - //System.out.println("sorter: " + displayName1 + " " + displayName2 + " " + result); + //GT_FML_LOGGER.info("sorter: " + displayName1 + " " + displayName2 + " " + result); return result; } else { @@ -134,11 +134,11 @@ public class GT_MetaTileEntity_ChestBuffer sortStacks(); // Merge small stacks together for (int i = 0; i < this.mInventory.length-1;) { - //System.out.println( (this.mInventory[i] == null) ? "Slot empty " + i : "Slot " + i + " holds " + this.mInventory[i].getDisplayName()); + //GT_FML_LOGGER.info( (this.mInventory[i] == null) ? "Slot empty " + i : "Slot " + i + " holds " + this.mInventory[i].getDisplayName()); for (int j = i + 1; j < this.mInventory.length; j++) { if ((this.mInventory[j] != null) && ((GT_Utility.areStacksEqual(this.mInventory[i], this.mInventory[j])))) { GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), j, i, (byte) 64, (byte) 1, (byte) 64, (byte) 1); - //System.out.println( "Moving slot " + j + " into slot " + i ); + //GT_FML_LOGGER.info( "Moving slot " + j + " into slot " + i ); } else { i=j; diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java index aad3c4c474..769b87676c 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java @@ -17,6 +17,9 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe public GT_MetaTileEntity_NaquadahReactor(int aID, String aName, String[] aDescription, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, aDescription, new ITexture[0]); + if (aTier > 8 || aTier < 4) { + new Exception("Tier without Recipe Map!"); + } onConfigLoad(); } @@ -26,11 +29,6 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe onConfigLoad(); } - public GT_MetaTileEntity_NaquadahReactor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures); - onConfigLoad(); - } - public GT_MetaTileEntity_NaquadahReactor(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); onConfigLoad(); diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java index 4dcbc95786..8e244ff502 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java @@ -1,7 +1,6 @@ package gregtech.common.tileentities.machines.basic; import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.FMLLog; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IIndividual; import gregtech.GT_Mod; diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java index 7fdb9689a9..c9dbded8f9 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java @@ -309,7 +309,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { for (Object tObject : entities_in_box) { if (((tObject instanceof Entity)) && (!((Entity) tObject).isDead)) { Entity tEntity = (Entity) tObject; -// System.out.println("teleport"+(Math.pow(tDistance, 1.5))); +// GT_FML_LOGGER.info("teleport"+(Math.pow(tDistance, 1.5))); if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((long) (Math.pow(tDistance, 1.5) * weightCalculation(tEntity) * sFPowerMultiplyer), false)) { //if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg || mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))) { // mFluid.amount = mFluid.amount - ((int) Math.min(10, (Math.pow(tDistance, 1.5) * weightCalculation(tEntity) / 8192))); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java index 95c83dd7e9..20752dfad7 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java @@ -22,6 +22,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import static gregtech.GT_Mod.GT_FML_LOGGER; + public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_MultiBlockBase { @@ -77,22 +79,26 @@ public class GT_MetaTileEntity_AssemblyLine } public boolean checkRecipe(ItemStack aStack) { - if(GT_Values.D1)System.out.println("Start ALine recipe check"); + if(GT_Values.D1) + GT_FML_LOGGER.info("Start ALine recipe check"); ArrayList tDataStickList = getDataItems(2); if (tDataStickList.size() == 0) return false; - if(GT_Values.D1)System.out.println("Stick accepted, " + tDataStickList.size() + " Data Sticks found"); + if(GT_Values.D1) + GT_FML_LOGGER.info("Stick accepted, " + tDataStickList.size() + " Data Sticks found"); ItemStack tStack[] = new ItemStack[15]; FluidStack[] tFluids = new FluidStack[4]; boolean findRecipe = false; nextDS:for (ItemStack tDataStick : tDataStickList){ NBTTagCompound tTag = tDataStick.getTagCompound(); - if (tTag == null) continue; + if (tTag == null) + continue; for (int i = 0; i < 15; i++) { int count = tTag.getInteger("a"+i); - if (!tTag.hasKey("" + i) && count <= 0) continue; + if (!tTag.hasKey("" + i) && count <= 0) + continue; if (mInputBusses.get(i) == null) { - continue nextDS; + continue nextDS; } ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0); @@ -101,7 +107,8 @@ public class GT_MetaTileEntity_AssemblyLine for (int j = 0; j < count; j++) { tStack[i] = GT_Utility.loadItem(tTag, "a" + i + ":" + j); if (tStack[i] == null) continue; - if(GT_Values.D1)System.out.println("Item "+i+" : "+tStack[i].getUnlocalizedName()); + if(GT_Values.D1) + GT_FML_LOGGER.info("Item "+i+" : "+tStack[i].getUnlocalizedName()); if (GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) && tStack[i].stackSize <= stackInSlot.stackSize) { flag = false; break; @@ -114,66 +121,79 @@ public class GT_MetaTileEntity_AssemblyLine flag = false; continue; } - if(GT_Values.D1)System.out.println("Item "+i+" : "+tStack[i].getUnlocalizedName()); + if(GT_Values.D1) + GT_FML_LOGGER.info("Item "+i+" : "+tStack[i].getUnlocalizedName()); if (GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) && tStack[i].stackSize <= stackInSlot.stackSize) { flag = false; } } - if(GT_Values.D1) System.out.println(i + (flag ? " not accepted" : " accepted")); - if (flag) continue nextDS; + if(GT_Values.D1) + GT_FML_LOGGER.info(i + (flag ? " not accepted" : " accepted")); + if (flag) + continue nextDS; } - if(GT_Values.D1)System.out.println("All Items done, start fluid check"); + if(GT_Values.D1)GT_FML_LOGGER.info("All Items done, start fluid check"); for (int i = 0; i < 4; i++) { if (!tTag.hasKey("f" + i)) continue; tFluids[i] = GT_Utility.loadFluid(tTag, "f" + i); if (tFluids[i] == null) continue; - if(GT_Values.D1)System.out.println("Fluid "+i+" "+tFluids[i].getUnlocalizedName()); + if(GT_Values.D1) + GT_FML_LOGGER.info("Fluid "+i+" "+tFluids[i].getUnlocalizedName()); if (mInputHatches.get(i) == null) { continue nextDS; } FluidStack fluidInHatch = mInputHatches.get(i).mFluid; if (fluidInHatch == null || !GT_Utility.areFluidsEqual(fluidInHatch, tFluids[i], true) || fluidInHatch.amount < tFluids[i].amount) { - if(GT_Values.D1)System.out.println(i+" not accepted"); + if(GT_Values.D1) + GT_FML_LOGGER.info(i+" not accepted"); continue nextDS; } - if(GT_Values.D1)System.out.println(i+" accepted"); + if(GT_Values.D1) + GT_FML_LOGGER.info(i+" accepted"); } - if(GT_Values.D1)System.out.println("Input accepted, check other values"); - if (!tTag.hasKey("output")) continue; + if(GT_Values.D1) + GT_FML_LOGGER.info("Input accepted, check other values"); + if (!tTag.hasKey("output")) + continue; mOutputItems = new ItemStack[]{GT_Utility.loadItem(tTag, "output")}; if (mOutputItems[0] == null || !GT_Utility.isStackValid(mOutputItems[0])) continue; - if (!tTag.hasKey("time")) continue; + if (!tTag.hasKey("time")) + continue; mMaxProgresstime = tTag.getInteger("time"); - if (mMaxProgresstime <= 0) continue; + if (mMaxProgresstime <= 0) + continue; - if (!tTag.hasKey("eu")) continue; + if (!tTag.hasKey("eu")) + continue; mEUt = tTag.getInteger("eu"); - if(GT_Values.D1)System.out.println("Find avaiable recipe"); - findRecipe = true; + if(GT_Values.D1)GT_FML_LOGGER.info("Find avaiable recipe"); + findRecipe = true; break; } if (!findRecipe) return false; - if(GT_Values.D1)System.out.println("All checked start consuming inputs"); + if(GT_Values.D1)GT_FML_LOGGER.info("All checked start consuming inputs"); for (int i = 0; i < 15; i++) { - if (tStack[i] == null) continue; + if (tStack[i] == null) + continue; ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0); stackInSlot.stackSize -= tStack[i].stackSize; } for (int i = 0; i < 4; i++) { - if (tFluids[i] == null) continue; + if (tFluids[i] == null) + continue; mInputHatches.get(i).mFluid.amount -= tFluids[i].amount; if (mInputHatches.get(i).mFluid.amount <= 0) { mInputHatches.get(i).mFluid = null; } } - if(GT_Values.D1)System.out.println("Check overclock"); + if(GT_Values.D1)GT_FML_LOGGER.info("Check overclock"); byte tTier = (byte) Math.max(1, GT_Utility.getTier(getMaxInputVoltage())); this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); @@ -192,7 +212,8 @@ public class GT_MetaTileEntity_AssemblyLine } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); updateSlots(); - if(GT_Values.D1)System.out.println("Recipe sucessfull"); + if(GT_Values.D1) + GT_FML_LOGGER.info("Recipe sucessfull"); return true; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java index d3b61a59bf..b6495e5728 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java @@ -1,6 +1,8 @@ package gregtech.common.tileentities.machines.multi; import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; @@ -11,6 +13,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; @@ -19,7 +22,6 @@ import net.minecraft.item.ItemStack; import static gregtech.api.enums.GT_Values.debugCleanroom; public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBase { - private int mHeatingCapacity = 0; public GT_MetaTileEntity_Cleanroom(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -67,6 +69,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas int mDoorCount = 0; int mHullCount = 0; int mPlascreteCount = 0; + int mGlassCount = 0; boolean doorState = false; mUpdate = 100; @@ -138,6 +141,8 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas } } else if (tBlock == GregTech_API.sBlockReinforced && tMeta == 2) { mPlascreteCount++; + } else if (tBlock != null && tBlock.getUnlocalizedName().equals("blockAlloyGlass")){ + ++mGlassCount; } else { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); if ((!addMaintenanceToMachineList(tTileEntity, 82)) && (!addEnergyInputToMachineList(tTileEntity, 82))) { @@ -210,8 +215,10 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas byte t = (byte) Math.max(1, (byte)(15/(10000f / mEfficiency))); aBaseMetaTileEntity.setInternalOutputRedstoneSignal(i, t); } - - return mPlascreteCount>=20; + + float ratio = (((float)mPlascreteCount)/100f)* GT_Values.cleanroomGlass; + + return mPlascreteCount>=20 && mGlassCount < (int) Math.floor(ratio); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java index ed2c62ac1c..2485c21171 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java @@ -124,7 +124,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar if(totalFlow<=0)return 0; tEU = GT_Utility.safeInt((long)((fuelValue / 20D) * (double)totalFlow)); - //System.out.println(totalFlow+" : "+fuelValue+" : "+aOptFlow+" : "+actualOptimalFlow+" : "+tEU); + //GT_FML_LOGGER.info(totalFlow+" : "+fuelValue+" : "+aOptFlow+" : "+actualOptimalFlow+" : "+tEU); if (totalFlow != actualOptimalFlow) { double efficiency = 1.0D - Math.abs((totalFlow - actualOptimalFlow) / (float)actualOptimalFlow); diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java index 448d2443e5..5b4e5549c3 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java @@ -110,9 +110,9 @@ public class GT_MetaTileEntity_SuperChest extends GT_MetaTileEntity_TieredMachin public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { if (getBaseMetaTileEntity().isServerSide() && getBaseMetaTileEntity().isAllowedToWork()) { -// if(mInventory[0]!=null)System.out.println("input: "+mInventory[0].stackSize); -// System.out.println("store: "+mItemCount); -// if(mInventory[0]!=null)System.out.println("output: "+mInventory[2].stackSize); +// if(mInventory[0]!=null)GT_FML_LOGGER.info("input: "+mInventory[0].stackSize); +// GT_FML_LOGGER.info("store: "+mItemCount); +// if(mInventory[0]!=null)GT_FML_LOGGER.info("output: "+mInventory[2].stackSize); if ((getItemCount() <= 0)) { this.mItemStack = null; this.mItemCount = 0; diff --git a/src/main/java/gregtech/loaders/materialprocessing/ProcessingConfig.java b/src/main/java/gregtech/loaders/materialprocessing/ProcessingConfig.java index e8e8dea769..512a01f1ff 100644 --- a/src/main/java/gregtech/loaders/materialprocessing/ProcessingConfig.java +++ b/src/main/java/gregtech/loaders/materialprocessing/ProcessingConfig.java @@ -3,10 +3,12 @@ package gregtech.loaders.materialprocessing; import gregtech.api.GregTech_API; import gregtech.api.enums.Dyes; import gregtech.api.enums.Materials; +import gregtech.api.enums.GTNH_ExtraMaterials; import gregtech.api.enums.TextureSet; public class ProcessingConfig implements gregtech.api.interfaces.IMaterialHandler { public ProcessingConfig() { + new GTNH_ExtraMaterials(); Materials.add(this); } diff --git a/src/main/java/gregtech/loaders/misc/GT_Achievements.java b/src/main/java/gregtech/loaders/misc/GT_Achievements.java index fe9cde5f62..3e2751a430 100644 --- a/src/main/java/gregtech/loaders/misc/GT_Achievements.java +++ b/src/main/java/gregtech/loaders/misc/GT_Achievements.java @@ -566,7 +566,7 @@ public class GT_Achievements { // issueAchievement(player, "stepforward"); } } -// System.out.println(stack.getUnlocalizedName()); +// GT_FML_LOGGER.info(stack.getUnlocalizedName()); if (stack.getUnlocalizedName().startsWith("gt.metaitem.")) { if (stack.getUnlocalizedName().equals("gt.metaitem.02.32500")) { issueAchievement(player, "havestlead"); -- cgit From fde7ce4cf096684e3af0b88f9af0c062a2068981 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Sat, 8 Sep 2018 03:54:40 +0200 Subject: added tooltip for glass +cleaned up code a bit --- src/main/java/gregtech/GT_Mod.java | 4 +++- .../multi/GT_MetaTileEntity_Cleanroom.java | 23 +++++++++++----------- 2 files changed, 14 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 39b59997e0..2a778cf2df 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -153,7 +153,9 @@ public class GT_Mod implements IGT_Mod { for (Runnable tRunnable : GregTech_API.sBeforeGTPreload) { tRunnable.run(); } - } catch (Throwable e) {e.printStackTrace(GT_Log.err);} + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } File tFile = new File(new File(aEvent.getModConfigurationDirectory(), "GregTech"), "GregTech.cfg"); Configuration tMainConfig = new Configuration(tFile); tMainConfig.load(); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java index b6495e5728..46c9acd232 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java @@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines.multi; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; @@ -13,7 +12,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; @@ -33,7 +31,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Cleanroom(this.mName); + return new GT_MetaTileEntity_Cleanroom(mName); } @Override @@ -47,6 +45,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas "1x LV or 1x MV Energy Hatch, 1x Maintainance Hatch", "Up to 10 Machine Hull Item & Energy transfer through walls", "Remaining Blocks: Plascrete, 20 min", + GT_Values.cleanroomGlass+"% of the Plascrete can be Reinforced Glass (min 20 Plascrete still apply)", "Consumes 40 EU/t when first turned on and 4 EU/t once at 100% efficiency", "An energy hatch accepts up to 2A, so you can use 2A LV or 1A MV", "2 LV batteries + 1 LV generator or 1 MV generator", @@ -55,9 +54,9 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas @Override public boolean checkRecipe(ItemStack aStack) { - this.mEfficiencyIncrease = 100; - this.mMaxProgresstime = 100; - this.mEUt = -4; + mEfficiencyIncrease = 100; + mMaxProgresstime = 100; + mEUt = -4; return true; } @@ -71,7 +70,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas int mPlascreteCount = 0; int mGlassCount = 0; boolean doorState = false; - mUpdate = 100; + this.mUpdate = 100; if (debugCleanroom) { GT_Log.out.println( @@ -145,7 +144,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas ++mGlassCount; } else { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); - if ((!addMaintenanceToMachineList(tTileEntity, 82)) && (!addEnergyInputToMachineList(tTileEntity, 82))) { + if ((!this.addMaintenanceToMachineList(tTileEntity, 82)) && (!this.addEnergyInputToMachineList(tTileEntity, 82))) { if (tBlock instanceof ic2.core.block.BlockIC2Door) { if ((tMeta & 8) == 0) { doorState = (Math.abs(dX) > Math.abs(dZ) == ((tMeta & 1) != 0)) != ((tMeta & 4) != 0); @@ -186,7 +185,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas } } } - if (mMaintenanceHatches.size() != 1 || mEnergyHatches.size() != 1 || mDoorCount != 2 || mHullCount > 10) { + if (this.mMaintenanceHatches.size() != 1 || this.mEnergyHatches.size() != 1 || mDoorCount != 2 || mHullCount > 10) { return false; } for (int dX = -x + 1; dX <= x - 1; dX++) { @@ -209,10 +208,10 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas } if (doorState) { - mEfficiency = Math.max(0, mEfficiency - 200); + this.mEfficiency = Math.max(0, this.mEfficiency - 200); } for(byte i = 0 ; i<6 ; i++){ - byte t = (byte) Math.max(1, (byte)(15/(10000f / mEfficiency))); + byte t = (byte) Math.max(1, (byte)(15/(10000f / this.mEfficiency))); aBaseMetaTileEntity.setInternalOutputRedstoneSignal(i, t); } @@ -237,7 +236,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiblockDisplay.png"); + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "MultiblockDisplay.png"); } @Override -- cgit