From beacf52a7db51c15b9deeee490482c3c5b6d88b0 Mon Sep 17 00:00:00 2001 From: Technus Date: Tue, 22 Aug 2017 10:57:55 +0200 Subject: Revert "remove unused code" This reverts commit ca0c96cff22641b72da222d1fb72ca33c9b00ede. --- src/main/java/com/github/technus/tectech/auxiliary/TecTechConfig.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/auxiliary/TecTechConfig.java b/src/main/java/com/github/technus/tectech/auxiliary/TecTechConfig.java index 001e198d64..9344ec286b 100644 --- a/src/main/java/com/github/technus/tectech/auxiliary/TecTechConfig.java +++ b/src/main/java/com/github/technus/tectech/auxiliary/TecTechConfig.java @@ -22,6 +22,7 @@ public class TecTechConfig extends ConfigManager { @Override protected void PreInit() { ModAdminErrorLogs_Enabled = false; + //DEBUG_MODE = false; BOOM_ENABLE = true; NERF_FUSION = false; ENABLE_TURRET_EXPLOSIONS = true; @@ -33,6 +34,8 @@ public class TecTechConfig extends ConfigManager { protected void Init() { ModAdminErrorLogs_Enabled = _mainConfig.getBoolean("AdminErrorLog", "Modules", ModAdminErrorLogs_Enabled, "If set to true, every op/admin will receive all errors occoured during the startup phase as ingame message on join"); + //DEBUG_MODE = _mainConfig.getBoolean("DebugPrint", "Debug", DEBUG_MODE, + // "Enables logging"); BOOM_ENABLE = _mainConfig.getBoolean("BoomEnable", "Features", BOOM_ENABLE, "Set to false to disable explosions on everything bad that you can do"); NERF_FUSION = _mainConfig.getBoolean("NerfFusion", "Features", NERF_FUSION, -- cgit From 3ef9c4aa807231fdac85f2a455803028b870822e Mon Sep 17 00:00:00 2001 From: Technus Date: Tue, 22 Aug 2017 11:31:03 +0200 Subject: Small refactor --- .../java/com/github/technus/tectech/TecTech.java | 10 +++++-- src/main/java/com/github/technus/tectech/Util.java | 16 +++++----- .../technus/tectech/auxiliary/TecTechConfig.java | 19 +++++++----- .../classes/cElementalDefinition.java | 4 +-- .../classes/cElementalPrimitive.java | 6 ++-- .../definitions/dAtomDefinition.java | 34 +++++++++++----------- .../definitions/dHadronDefinition.java | 14 ++++----- .../definitions/dComplexAspectDefinition.java | 8 ++--- .../github/technus/tectech/recipe/TT_recipe.java | 5 ++-- .../tectech/thing/item/DebugContainer_EM.java | 4 +-- .../tectech/thing/item/DefinitionContainer_EM.java | 8 ++--- ...GT_MetaTileEntity_Hatch_ElementalContainer.java | 11 +++++-- .../hatch/GT_MetaTileEntity_Hatch_Rack.java | 5 ++-- .../multi/GT_MetaTileEntity_EM_computer.java | 8 ++--- .../multi/GT_MetaTileEntity_EM_infuser.java | 8 ++--- .../multi/GT_MetaTileEntity_EM_quantizer.java | 10 +++---- .../multi/GT_MetaTileEntity_MultiblockBase_EM.java | 14 ++++----- .../GT_MetaTileEntity_DebugStructureWriter.java | 6 ++-- .../blocks/turretheads/TurretHeadEM.java | 3 +- 19 files changed, 102 insertions(+), 91 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index 9be7c008d7..6893663af2 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -25,6 +25,8 @@ import net.minecraftforge.fluids.FluidStack; import java.util.HashMap; +import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; + @Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION, dependencies = "required-after:Forge@[10.13.4.1614,);" + "required-after:YAMCore@[0.5.70,);" + "required-after:gregtech;" + "after:CoFHCore;" + "after:Thaumcraft;" + "after:dreamcraft;" + "after:miscutils;") public class TecTech { @@ -108,13 +110,15 @@ public class TecTech { for (Materials m : Materials.values()) { FluidStack p = m.getPlasma(1); if (p != null) { - if (TecTechConfig.DEBUG_MODE) TecTech.Logger.info("Found Plasma of " + m.mName); + if (DEBUG_MODE) + TecTech.Logger.info("Found Plasma of " + m.mName); if (m.mElement != null && (m.mElement.mProtons >= Materials.Iron.mElement.mProtons || -m.mElement.mProtons >= Materials.Iron.mElement.mProtons || m.mElement.mNeutrons >= Materials.Iron.mElement.mNeutrons || -m.mElement.mNeutrons >= Materials.Iron.mElement.mNeutrons)) { - if (TecTechConfig.DEBUG_MODE) TecTech.Logger.info("Attempting to bind " + m.mName); + if (DEBUG_MODE) + TecTech.Logger.info("Attempting to bind " + m.mName); if (m.getMolten(1) != null) binds.put(p.getFluid(), m.getMolten(1).getFluid()); else if (m.getGas(1) != null) binds.put(p.getFluid(), m.getGas(1).getFluid()); else if (m.getFluid(1) != null) binds.put(p.getFluid(), m.getFluid(1).getFluid()); @@ -125,7 +129,7 @@ public class TecTech { for (GT_Recipe r : GT_Recipe.GT_Recipe_Map.sFusionRecipes.mRecipeList) { Fluid f = binds.get(r.mFluidOutputs[0].getFluid()); if (f != null) { - if (TecTechConfig.DEBUG_MODE) + if (DEBUG_MODE) TecTech.Logger.info("Nerfing Recipe " + r.mFluidOutputs[0].getUnlocalizedName()); r.mFluidOutputs[0] = new FluidStack(f, r.mFluidInputs[0].amount); } diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index 27f1c8377b..d1a45ec657 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -1,6 +1,5 @@ package com.github.technus.tectech; -import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.thing.casing.TT_Container_Casings; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; @@ -23,6 +22,7 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; +import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; import static gregtech.api.enums.GT_Values.E; /** @@ -138,12 +138,12 @@ public class Util { pointer = block - '0'; //countable air -> net.minecraft.block.BlockAir if (world.getBlock(x, y, z) != blockType[pointer]) { - if (TecTechConfig.DEBUG_MODE) + if (DEBUG_MODE) TecTech.Logger.info("Struct-block-error " + x + " " + y + " " + z + " / " + a + " " + b + " " + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + " " + blockType[pointer].getUnlocalizedName()); return false; } if (world.getBlockMetadata(x, y, z) != blockMeta[pointer]) { - if (TecTechConfig.DEBUG_MODE) + if (DEBUG_MODE) TecTech.Logger.info("Struct-meta-id-error " + x + " " + y + " " + z + " / " + a + " " + b + " " + c + " / " + world.getBlockMetadata(x, y, z) + " " + blockMeta[pointer]); return false; } @@ -262,12 +262,12 @@ public class Util { if ((pointer = block - '0') >= 0) { //countable air -> net.minecraft.block.BlockAir if (world.getBlock(x, y, z) != blockType[pointer]) { - if (TecTechConfig.DEBUG_MODE) + if (DEBUG_MODE) TecTech.Logger.info("Struct-block-error " + x + " " + y + " " + z + " / " + a + " " + b + " " + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + " " + blockType[pointer].getUnlocalizedName()); return false; } if (world.getBlockMetadata(x, y, z) != blockMeta[pointer]) { - if (TecTechConfig.DEBUG_MODE) + if (DEBUG_MODE) TecTech.Logger.info("Struct-meta-id-error " + x + " " + y + " " + z + " / " + a + " " + b + " " + c + " / " + world.getBlockMetadata(x, y, z) + " " + blockMeta[pointer]); return false; } @@ -276,18 +276,18 @@ public class Util { try { if (igt == null || !(boolean) adder.invoke(imt, addingMethods[pointer], igt, casingTextures[pointer])) { if (world.getBlock(x, y, z) != blockTypeFallback[pointer]) { - if (TecTechConfig.DEBUG_MODE) + if (DEBUG_MODE) TecTech.Logger.info("Fallback-struct-block-error " + x + " " + y + " " + z + " / " + a + " " + b + " " + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + " " + blockTypeFallback[pointer].getUnlocalizedName()); return false; } if (world.getBlockMetadata(x, y, z) != blockMetaFallback[pointer]) { - if (TecTechConfig.DEBUG_MODE) + if (DEBUG_MODE) TecTech.Logger.info("Fallback-Struct-meta-id-error " + x + " " + y + " " + z + " / " + a + " " + b + " " + c + " / " + world.getBlockMetadata(x, y, z) + " " + blockMetaFallback[pointer]); return false; } } } catch (InvocationTargetException | IllegalAccessException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); return false; } } diff --git a/src/main/java/com/github/technus/tectech/auxiliary/TecTechConfig.java b/src/main/java/com/github/technus/tectech/auxiliary/TecTechConfig.java index 9344ec286b..87a2cdc54b 100644 --- a/src/main/java/com/github/technus/tectech/auxiliary/TecTechConfig.java +++ b/src/main/java/com/github/technus/tectech/auxiliary/TecTechConfig.java @@ -12,8 +12,9 @@ public class TecTechConfig extends ConfigManager { public boolean ModAdminErrorLogs_Enabled; //final static to allow compiler to remove the debug code when this is false - public static final boolean DEBUG_MODE = true; + public static boolean DEBUG_MODE = false; public boolean BOOM_ENABLE; + public boolean EASY_SCAN; public boolean NERF_FUSION; public boolean ENABLE_TURRET_EXPLOSIONS; public float TURRET_DAMAGE_FACTOR; @@ -22,24 +23,26 @@ public class TecTechConfig extends ConfigManager { @Override protected void PreInit() { ModAdminErrorLogs_Enabled = false; - //DEBUG_MODE = false; + EASY_SCAN = false; BOOM_ENABLE = true; NERF_FUSION = false; ENABLE_TURRET_EXPLOSIONS = true; - TURRET_DAMAGE_FACTOR=10; - TURRET_EXPLOSION_FACTOR=1; + TURRET_DAMAGE_FACTOR = 10; + TURRET_EXPLOSION_FACTOR = 1; } @Override protected void Init() { ModAdminErrorLogs_Enabled = _mainConfig.getBoolean("AdminErrorLog", "Modules", ModAdminErrorLogs_Enabled, - "If set to true, every op/admin will receive all errors occoured during the startup phase as ingame message on join"); - //DEBUG_MODE = _mainConfig.getBoolean("DebugPrint", "Debug", DEBUG_MODE, - // "Enables logging"); + "If set to true, every op/admin will receive all errors occurred during the startup phase as in game message on join"); + DEBUG_MODE = _mainConfig.getBoolean("DebugMode", "Debug", DEBUG_MODE, + "Enables logging and other purely debug features"); + EASY_SCAN = _mainConfig.getBoolean("EasyScan", "Features", EASY_SCAN, + "Enables tricorder to scan EM i/o hatches directly, too CHEEKY"); BOOM_ENABLE = _mainConfig.getBoolean("BoomEnable", "Features", BOOM_ENABLE, "Set to false to disable explosions on everything bad that you can do"); NERF_FUSION = _mainConfig.getBoolean("NerfFusion", "Features", NERF_FUSION, - "Set to true to enable removal of plasmas heavier than Fe"); + "Set to true to enable removal of plasmas heavier than Fe and other weird ones"); ENABLE_TURRET_EXPLOSIONS = _mainConfig.getBoolean("TurretBoomEnable", "Features", ENABLE_TURRET_EXPLOSIONS, "Set to false to disable explosions caused by EM turrets"); TURRET_DAMAGE_FACTOR = _mainConfig.getFloat("TurretDamageFactor", "Features", TURRET_DAMAGE_FACTOR, 0, Short.MAX_VALUE, diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinition.java index 6e27486466..ce12ad5c3d 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinition.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalDefinition.java @@ -1,6 +1,5 @@ package com.github.technus.tectech.elementalMatter.classes; -import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.elementalMatter.interfaces.iElementalDefinition; import com.github.technus.tectech.elementalMatter.interfaces.iHasElementalDefinition; import net.minecraft.nbt.NBTTagCompound; @@ -10,6 +9,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; +import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.elementalMatter.definitions.cPrimitiveDefinition.nbtE__; /** @@ -37,7 +37,7 @@ public abstract class cElementalDefinition implements iElementalDefinition { try { return (iElementalDefinition) nbtCreationBind.get(nbt.getByte("t")).invoke(null, nbt); } catch (Exception e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); return nbtE__; } } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalPrimitive.java b/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalPrimitive.java index 6545a82cbc..4f878901ea 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalPrimitive.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/classes/cElementalPrimitive.java @@ -1,7 +1,6 @@ package com.github.technus.tectech.elementalMatter.classes; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.elementalMatter.interfaces.iElementalDefinition; import net.minecraft.client.Minecraft; import net.minecraft.crash.CrashReport; @@ -10,6 +9,7 @@ import net.minecraft.nbt.NBTTagCompound; import java.util.HashMap; import java.util.Map; +import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.elementalMatter.definitions.cPrimitiveDefinition.null__; /** @@ -164,9 +164,9 @@ public abstract class cElementalPrimitive extends cElementalDefinition { try { cElementalDefinition.addCreatorFromNBT(nbtType, cElementalPrimitive.class.getMethod("fromNBT", NBTTagCompound.class),(byte)-128); } catch (Exception e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } - if(TecTechConfig.DEBUG_MODE) + if(DEBUG_MODE) TecTech.Logger.info("Registered Elemental Matter Class: Primitive "+nbtType+" "+(-128)); } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dAtomDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dAtomDefinition.java index 5108c409cd..7350beea8e 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dAtomDefinition.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dAtomDefinition.java @@ -1,7 +1,6 @@ package com.github.technus.tectech.elementalMatter.definitions; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.elementalMatter.classes.*; import com.github.technus.tectech.elementalMatter.interfaces.iElementalDefinition; import com.github.technus.tectech.gtppAddon.GtppAtomLoader; @@ -14,6 +13,7 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.*; +import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.elementalMatter.definitions.eBosonDefinition.boson_Y__; import static com.github.technus.tectech.elementalMatter.definitions.eBosonDefinition.deadEnd; import static gregtech.api.enums.OrePrefixes.dust; @@ -256,7 +256,7 @@ public final class dAtomDefinition extends cElementalDefinition { if (type != 1) return (negative ? "~? " : "? ") + nomenclature.Name[element]; return negative ? "~" + nomenclature.Name[element] : nomenclature.Name[element]; } catch (Exception e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); return (negative ? "Element: ~" : "Element: ") + element; } } @@ -268,12 +268,12 @@ public final class dAtomDefinition extends cElementalDefinition { try { return (negative ? "~" : "") + nomenclature.Symbol[element] + " N:" + neutralCount + " I:" + (neutralCount+element) + " C: " + getCharge(); } catch (Exception e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); try { int s100 = element / 100, s1 = (element / 10) % 10, s10 = (element) % 10; return (negative ? "~" : "") + nomenclature.SymbolIUPAC[10 + s100] + nomenclature.SymbolIUPAC[s10] + nomenclature.SymbolIUPAC[s1] + " N:" + neutralCount + " I:" + (neutralCount+element) + " C: " + getCharge(); } catch (Exception E) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); return (negative ? "~" : "") + "? N:" + neutralCount + " I:" + (neutralCount+element) + " C: " + getCharge(); } } @@ -316,7 +316,7 @@ public final class dAtomDefinition extends cElementalDefinition { deadEnd }; } catch (Exception e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } } return getNaturalDecayInstant(); @@ -332,7 +332,7 @@ public final class dAtomDefinition extends cElementalDefinition { deadEnd }; } catch (Exception e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } } return getNaturalDecayInstant(); @@ -349,7 +349,7 @@ public final class dAtomDefinition extends cElementalDefinition { deadEnd }; } catch (Exception e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } } return getNaturalDecayInstant(); @@ -366,7 +366,7 @@ public final class dAtomDefinition extends cElementalDefinition { deadEnd }; } catch (Exception e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } } return getNaturalDecayInstant(); @@ -392,7 +392,7 @@ public final class dAtomDefinition extends cElementalDefinition { decaysInto.add(new cElementalDefinitionStack(new dAtomDefinition(newAtom.toArray(new cElementalDefinitionStack[newAtom.size()])), 1)); return new cElementalDecay[]{new cElementalDecay(0.95F, decaysInto.toArray(new cElementalDefinitionStack[decaysInto.size()])), eBosonDefinition.deadEnd}; } catch (tElementalException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); for (cElementalDefinitionStack things : newAtom) { decaysInto.add(things); } @@ -426,7 +426,7 @@ public final class dAtomDefinition extends cElementalDefinition { try { return new dAtomDefinition(false, antiElements); } catch (tElementalException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); return null; } } @@ -483,7 +483,7 @@ public final class dAtomDefinition extends cElementalDefinition { try { return new dAtomDefinition(stacks); } catch (tElementalException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); return null; } } @@ -535,7 +535,7 @@ public final class dAtomDefinition extends cElementalDefinition { new cElementalDefinitionStack(dHadronDefinition.hadron_p, key), new cElementalDefinitionStack(dHadronDefinition.hadron_n, stableIsotopes.get(key).first()), new cElementalDefinitionStack(eLeptonDefinition.lepton_e, key))); - if (TecTechConfig.DEBUG_MODE) + if (DEBUG_MODE) TecTech.Logger.info("Added Stable Atom:" + key + " " + stableIsotopes.get(key).first() + " " + stableAtoms.get(key).getMass()); } for (int key : mostStableUnstableIsotopes.keySet()) { @@ -543,7 +543,7 @@ public final class dAtomDefinition extends cElementalDefinition { new cElementalDefinitionStack(dHadronDefinition.hadron_p, key), new cElementalDefinitionStack(dHadronDefinition.hadron_n, mostStableUnstableIsotopes.get(key).lastEntry().getValue()), new cElementalDefinitionStack(eLeptonDefinition.lepton_e, key))); - if (TecTechConfig.DEBUG_MODE) + if (DEBUG_MODE) TecTech.Logger.info("Added Unstable Atom:" + key + " " + mostStableUnstableIsotopes.get(key).lastEntry().getValue() + " " + unstableAtoms.get(key).getMass()); } alpha = new cElementalDefinitionStack( @@ -552,15 +552,15 @@ public final class dAtomDefinition extends cElementalDefinition { new cElementalDefinitionStack(dHadronDefinition.hadron_n, 2)) , 1); } catch (Exception e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } try { cElementalDefinition.addCreatorFromNBT(nbtType, dAtomDefinition.class.getMethod("fromNBT", NBTTagCompound.class),(byte)64); } catch (Exception e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } - if(TecTechConfig.DEBUG_MODE) + if(DEBUG_MODE) TecTech.Logger.info("Registered Elemental Matter Class: Atom "+nbtType+" "+64); } @@ -727,7 +727,7 @@ public final class dAtomDefinition extends cElementalDefinition { ); transformation.addOredict(new cElementalDefinitionStack(temp, 144),OrePrefixes.dust, Materials.Plutonium241,1); } catch (tElementalException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } if(Loader.isModLoaded("miscutils")) new GtppAtomLoader().run(); diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dHadronDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dHadronDefinition.java index 5665288bbb..db94932cd1 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dHadronDefinition.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/dHadronDefinition.java @@ -1,13 +1,13 @@ package com.github.technus.tectech.elementalMatter.definitions; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.elementalMatter.classes.*; import com.github.technus.tectech.elementalMatter.interfaces.iElementalDefinition; import net.minecraft.nbt.NBTTagCompound; import java.util.ArrayList; +import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.elementalMatter.definitions.eBosonDefinition.boson_Y__; /** @@ -216,7 +216,7 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi new cElementalDecay(0.001F, new dHadronDefinition(false, contentOfBaryon), Particles[0], Particles[1], boson_Y__), eBosonDefinition.deadEnd}; //decay into quarks } catch (tElementalException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); return new cElementalDecay[]{eBosonDefinition.deadEnd}; } } @@ -252,7 +252,7 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi try { return new dHadronDefinition(false, antiElements); } catch (tElementalException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); return null; } } @@ -303,7 +303,7 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi try { return new dHadronDefinition(stacks); } catch (tElementalException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); return null; } } @@ -321,7 +321,7 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi hadron_n = new dHadronDefinition(new cElementalDefinitionStackMap(eQuarkDefinition.quark_u.getStackForm(1), eQuarkDefinition.quark_d.getStackForm(2))); hadron_n_ = (dHadronDefinition) (hadron_n.getAnti()); } catch (tElementalException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); protonMass = -1; neutronMass = -1; } @@ -333,9 +333,9 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi try { cElementalDefinition.addCreatorFromNBT(nbtType, dHadronDefinition.class.getMethod("fromNBT", NBTTagCompound.class),(byte)-64); } catch (Exception e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } - if(TecTechConfig.DEBUG_MODE) + if(DEBUG_MODE) TecTech.Logger.info("Registered Elemental Matter Class: Hadron "+nbtType+" "+(-64)); } diff --git a/src/main/java/com/github/technus/tectech/magicAddon/definitions/dComplexAspectDefinition.java b/src/main/java/com/github/technus/tectech/magicAddon/definitions/dComplexAspectDefinition.java index 3ca018928a..0060ae261b 100644 --- a/src/main/java/com/github/technus/tectech/magicAddon/definitions/dComplexAspectDefinition.java +++ b/src/main/java/com/github/technus/tectech/magicAddon/definitions/dComplexAspectDefinition.java @@ -1,12 +1,12 @@ package com.github.technus.tectech.magicAddon.definitions; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.elementalMatter.classes.*; import com.github.technus.tectech.elementalMatter.definitions.eBosonDefinition; import com.github.technus.tectech.elementalMatter.interfaces.iElementalDefinition; import net.minecraft.nbt.NBTTagCompound; +import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.elementalMatter.classes.cElementalDecay.noDecay; import static com.github.technus.tectech.magicAddon.definitions.AspectDefinitionCompat.aspectDefinitionCompat; @@ -113,7 +113,7 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme try { return new dComplexAspectDefinition(stacks); } catch (tElementalException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); return null; } } @@ -191,9 +191,9 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme try { cElementalDefinition.addCreatorFromNBT(nbtType, dComplexAspectDefinition.class.getMethod("fromNBT", NBTTagCompound.class),(byte)-96); } catch (Exception e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } - if(TecTechConfig.DEBUG_MODE) + if(DEBUG_MODE) TecTech.Logger.info("Registered Elemental Matter Class: ComplexAspect "+nbtType+" "+(-96)); } diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java index 2b9f917418..aa1d85f109 100644 --- a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java +++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java @@ -1,6 +1,5 @@ package com.github.technus.tectech.recipe; -import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.elementalMatter.classes.cElementalDefinition; import com.github.technus.tectech.elementalMatter.classes.cElementalDefinitionStackMap; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStackMap; @@ -14,6 +13,8 @@ import java.util.Collection; import java.util.HashMap; import java.util.HashSet; +import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; + public class TT_recipe extends GT_Recipe { public static final String E_RECIPE_ID = "eRecipeID"; public final cElementalDefinitionStackMap input[],output[], eCatalyst[]; @@ -219,7 +220,7 @@ public class TT_recipe extends GT_Recipe { try { return mRecipeMap.get(cElementalDefinition.fromNBT(dataHandler.stackTagCompound.getCompoundTag(E_RECIPE_ID))); }catch (Exception e){ - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); return null; } } diff --git a/src/main/java/com/github/technus/tectech/thing/item/DebugContainer_EM.java b/src/main/java/com/github/technus/tectech/thing/item/DebugContainer_EM.java index 332f028684..835a606897 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/DebugContainer_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/item/DebugContainer_EM.java @@ -1,7 +1,6 @@ package com.github.technus.tectech.thing.item; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStackMap; import com.github.technus.tectech.elementalMatter.classes.tElementalException; import com.github.technus.tectech.elementalMatter.interfaces.iElementalInstanceContainer; @@ -22,6 +21,7 @@ import java.util.Collections; import java.util.List; import static com.github.technus.tectech.auxiliary.Reference.MODID; +import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; /** * Created by Tec on 15.03.2017. @@ -50,7 +50,7 @@ public class DebugContainer_EM extends Item { try { content.putUnifyAll(cElementalInstanceStackMap.fromNBT(tNBT.getCompoundTag("content"))); } catch (tElementalException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); return true; } ((iElementalInstanceContainer) metaTE).purgeOverflow(); diff --git a/src/main/java/com/github/technus/tectech/thing/item/DefinitionContainer_EM.java b/src/main/java/com/github/technus/tectech/thing/item/DefinitionContainer_EM.java index 99535b8e23..7d666a3218 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/DefinitionContainer_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/item/DefinitionContainer_EM.java @@ -1,7 +1,6 @@ package com.github.technus.tectech.thing.item; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.elementalMatter.classes.cElementalDefinitionStackMap; import com.github.technus.tectech.elementalMatter.classes.tElementalException; import cpw.mods.fml.common.registry.GameRegistry; @@ -15,6 +14,7 @@ import java.util.Collections; import java.util.List; import static com.github.technus.tectech.auxiliary.Reference.MODID; +import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; /** * Created by Tec on 15.03.2017. @@ -40,7 +40,7 @@ public class DefinitionContainer_EM extends Item { try { oldMap=cElementalDefinitionStackMap.fromNBT(tNBT.getCompoundTag("content")); } catch (tElementalException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } } tNBT.setTag("info", definitions.getInfoNBT()); @@ -58,7 +58,7 @@ public class DefinitionContainer_EM extends Item { try { return cElementalDefinitionStackMap.fromNBT(tNBT.getCompoundTag("content")); } catch (tElementalException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } } return null; @@ -74,7 +74,7 @@ public class DefinitionContainer_EM extends Item { try { oldMap=cElementalDefinitionStackMap.fromNBT(tNBT.getCompoundTag("content")); } catch (tElementalException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } } tNBT.removeTag("info"); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java index a054961b72..4bbd7b957e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java @@ -212,7 +212,7 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta @Override public String[] getInfoData() { - if(DEBUG_MODE) { + if(TecTech.ModConfig.EASY_SCAN) { if (id > 0) { if (content == null || content.size() == 0) return new String[]{"ID: " + EnumChatFormatting.AQUA + id, "No Stacks"}; @@ -227,7 +227,14 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta if (content == null || content.size() == 0) return new String[]{"No Stacks"}; return content.getElementalInfo(); } else { - return new String[0]; + if(id>0){ + if (content == null || content.size() == 0) + return new String[]{"ID: " + EnumChatFormatting.AQUA + id, "No Stacks"}; + return new String[]{"ID: " + EnumChatFormatting.AQUA + id, "Contains EM"}; + } + if (content == null || content.size() == 0) + return new String[]{"No Stacks"}; + return new String[]{"Contains EM"}; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java index 40d11f5f05..ec703ac61e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java @@ -2,7 +2,6 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Rack; import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Rack; import cpw.mods.fml.common.Loader; @@ -27,6 +26,7 @@ import java.util.Map; import static com.github.technus.tectech.CommonValues.multiCheckAt; import static com.github.technus.tectech.Util.getUniqueIdentifier; +import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; /** * Created by Tec on 03.04.2017. @@ -307,7 +307,8 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { this.maxHeat = maxHeat; this.subZero = subZero; componentBinds.put(unlocalizedName, this); - if (TecTechConfig.DEBUG_MODE) TecTech.Logger.info("Component registered: " + unlocalizedName); + if (DEBUG_MODE) + TecTech.Logger.info("Component registered: " + unlocalizedName); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java index bb39b661e9..b234d2912a 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java @@ -4,12 +4,11 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.Util; import com.github.technus.tectech.Vec3pos; -import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.dataFramework.QuantumDataPacket; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Rack; -import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -24,10 +23,11 @@ import net.minecraft.util.EnumChatFormatting; import java.util.ArrayList; import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.V; +import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; -import static com.github.technus.tectech.Util.V; /** * Created by danie_000 on 17.12.2016. @@ -272,7 +272,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB try { adderMethodMap.put("addRackToMachineList", GT_MetaTileEntity_EM_computer.class.getMethod("addRackToMachineList", IGregTechTileEntity.class, int.class)); } catch (NoSuchMethodException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java index 48d32a47df..bab172f231 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -3,7 +3,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import cofh.api.energy.IEnergyContainerItem; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -15,6 +14,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static gregtech.api.GregTech_API.mEUtoRF; @@ -147,8 +147,7 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa if (this.getEUVar() < 0) this.setEUVar(0); return remove; } catch (Exception e) { - if (TecTechConfig.DEBUG_MODE) - e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } return 0; } @@ -163,8 +162,7 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa if (this.getEUVar() < 0) this.setEUVar(0); return RF; } catch (Exception e) { - if (TecTechConfig.DEBUG_MODE) - e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } return 0; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java index 87a706f132..46bd48a794 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java @@ -2,7 +2,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.elementalMatter.classes.*; import com.github.technus.tectech.elementalMatter.interfaces.iHasElementalDefinition; import com.github.technus.tectech.thing.block.QuantumGlassBlock; @@ -16,13 +15,12 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; -import static com.github.technus.tectech.Util.StructureBuilder; -import static com.github.technus.tectech.Util.isInputEqual; +import static com.github.technus.tectech.Util.*; +import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.elementalMatter.definitions.dAtomDefinition.refMass; import static com.github.technus.tectech.elementalMatter.definitions.dAtomDefinition.refUnstableMass; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; -import static com.github.technus.tectech.Util.V; /** * Created by danie_000 on 17.12.2016. @@ -101,7 +99,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock //ORE DICT quantization int[] oreIDs = OreDictionary.getOreIDs(is); for (int ID : oreIDs) { - if (TecTechConfig.DEBUG_MODE) + if (DEBUG_MODE) TecTech.Logger.info("Quantifier-Ore-recipe " + is.getItem().getUnlocalizedName() + "." + is.getItemDamage() + " " + OreDictionary.getOreName(ID)); aOredictQuantizationInfo aOQI = bTransformationInfo.oredictQuantization.get(ID); if (aOQI == null) continue; @@ -114,7 +112,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock } } else { //Do ITEM STACK quantization - if (TecTechConfig.DEBUG_MODE) + if (DEBUG_MODE) TecTech.Logger.info("Quantifier-Item-recipe " + is.getItem().getUnlocalizedName() + "." + is.getItemDamage()); iHasElementalDefinition into = aIQI.output(); if (into != null && isInputEqual(true, false, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java index 518a1c7a0a..bd79ad38ad 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java @@ -3,7 +3,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.Util; -import com.github.technus.tectech.auxiliary.TecTechConfig; +import com.github.technus.tectech.Vec3pos; import com.github.technus.tectech.elementalMatter.classes.cElementalDefinitionStack; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStack; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStackMap; @@ -11,7 +11,6 @@ import com.github.technus.tectech.elementalMatter.classes.tElementalException; import com.github.technus.tectech.thing.metaTileEntity.hatch.*; import com.github.technus.tectech.thing.metaTileEntity.multi.gui.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.gui.GT_GUIContainer_MultiMachineEM; -import com.github.technus.tectech.Vec3pos; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -41,6 +40,7 @@ import java.util.Map; import static com.github.technus.tectech.CommonValues.*; import static com.github.technus.tectech.Util.*; +import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; /** @@ -336,7 +336,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt outputEM[i] = cElementalInstanceStackMap.fromNBT( aNBT.getCompoundTag("outputEM").getCompoundTag(Integer.toString(i))); } catch (tElementalException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); outputEM[i] = new cElementalInstanceStackMap(); } } else outputEM = new cElementalInstanceStackMap[0]; @@ -802,7 +802,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (euVar > getEUVar() || EU > maxEUinputMax || (euVar - 1) / maxEUinputMin + 1 > eMaxAmpereFlow) {// euVar==0? --> (euVar - 1) / maxEUinputMin + 1 = 1! - if (TecTechConfig.DEBUG_MODE) { + if (DEBUG_MODE) { TecTech.Logger.debug("L1 " + euVar + " " + getEUVar() + " " + (euVar > getEUVar())); TecTech.Logger.debug("L2 " + EU + " " + maxEUinputMax + " " + (EU > maxEUinputMax)); TecTech.Logger.debug("L3 " + euVar + " " + eMaxAmpereFlow); @@ -1502,7 +1502,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt return; } } catch (Exception e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } } @@ -1530,7 +1530,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt adderMethodMap.put("addDataConnectorToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addDataConnectorToMachineList", IGregTechTileEntity.class, int.class)); adderMethod = GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addThing", String.class, IGregTechTileEntity.class, int.class); } catch (NoSuchMethodException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } } @@ -1539,7 +1539,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt try { return (boolean) adderMethodMap.get(methodName).invoke(this, igt, casing); } catch (InvocationTargetException | IllegalAccessException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) e.printStackTrace(); } return false; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java index ecd17d7581..4ea525acd2 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java @@ -2,7 +2,6 @@ package com.github.technus.tectech.thing.metaTileEntity.single; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.auxiliary.TecTechConfig; import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_DebugStructureWriter; import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_DebugStructureWriter; import cpw.mods.fml.relauncher.Side; @@ -21,6 +20,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import static com.github.technus.tectech.Util.StructureWriter; +import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; /** * Created by Tec on 23.03.2017. @@ -104,7 +104,7 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isAllowedToWork()) { result = StructureWriter(this.getBaseMetaTileEntity(), numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5], false); - if (TecTechConfig.DEBUG_MODE) + if (DEBUG_MODE) for (String s : result) TecTech.Logger.info(s); aBaseMetaTileEntity.disableWorking(); @@ -114,7 +114,7 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { result = StructureWriter(this.getBaseMetaTileEntity(), numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5], true); - if (TecTechConfig.DEBUG_MODE) + if (DEBUG_MODE) for (String s : result) TecTech.Logger.info(s); } diff --git a/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadEM.java b/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadEM.java index b19b1f3560..90318ef390 100644 --- a/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadEM.java +++ b/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadEM.java @@ -1,7 +1,6 @@ package openmodularturrets.blocks.turretheads; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.auxiliary.Reference; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; @@ -27,7 +26,7 @@ public class TurretHeadEM extends Block implements ITileEntityProvider { this.setStepSound(Block.soundTypeMetal); this.setBlockBounds(0.2F, 0.0F, 0.2F, 0.8F, 1F, 0.8F); this.setBlockName("turretHeadEM"); - this.setBlockTextureName(Reference.MODID+":turretHeadEM"); + //this.setBlockTextureName(Reference.MODID+":turretHeadEM"); } @Override -- cgit From 7502e2c13b9f44c9f0ff7b4d935d5f4df0be0bdf Mon Sep 17 00:00:00 2001 From: Technus Date: Tue, 22 Aug 2017 11:41:42 +0200 Subject: More refactor --- .../github/technus/tectech/loader/MainLoader.java | 4 +- .../technus/tectech/loader/ThingsLoader.java | 4 +- .../thing/item/ConstructableTriggerItem.java | 158 +++++++++++++++++++++ .../thing/item/ConstructibleTriggerItem.java | 158 --------------------- .../hatch/gui/GT_Container_Param.java | 2 +- .../hatch/gui/GT_Container_Uncertainty.java | 2 +- .../hatch/gui/GT_GUIContainer_Param.java | 2 +- .../hatch/gui/GT_GUIContainer_UncertaintyAdv.java | 2 +- .../multi/gui/GT_GUIContainer_MultiMachineEM.java | 6 +- .../pipe/GT_MetaTileEntity_Pipe_Data.java | 6 +- .../GT_MetaTileEntity_DebugStructureWriter.java | 11 +- 11 files changed, 176 insertions(+), 179 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/item/ConstructibleTriggerItem.java (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/loader/MainLoader.java b/src/main/java/com/github/technus/tectech/loader/MainLoader.java index ad1517adb2..9a1e1be66c 100644 --- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java @@ -8,7 +8,7 @@ import com.github.technus.tectech.magicAddon.definitions.AspectDefinitionCompatE import com.github.technus.tectech.thing.CustomItemList; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.casing.TT_Container_Casings; -import com.github.technus.tectech.thing.item.ConstructibleTriggerItem; +import com.github.technus.tectech.thing.item.ConstructableTriggerItem; import com.github.technus.tectech.thing.item.DebugContainer_EM; import com.github.technus.tectech.thing.item.ParametrizerMemoryCard; import cpw.mods.fml.common.ProgressManager; @@ -118,7 +118,7 @@ public final class MainLoader {//TODO add checks for - is mod loaded dreamcraft TT_Container_Casings.sBlockCasingsTT.setCreativeTab(mainTab); TT_Container_Casings.sHintCasingsTT.setCreativeTab(mainTab); DebugContainer_EM.INSTANCE.setCreativeTab(mainTab); - ConstructibleTriggerItem.INSTANCE.setCreativeTab(mainTab); + ConstructableTriggerItem.INSTANCE.setCreativeTab(mainTab); ParametrizerMemoryCard.INSTANCE.setCreativeTab(mainTab); } diff --git a/src/main/java/com/github/technus/tectech/loader/ThingsLoader.java b/src/main/java/com/github/technus/tectech/loader/ThingsLoader.java index a92a5a663d..7411bc9335 100644 --- a/src/main/java/com/github/technus/tectech/loader/ThingsLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/ThingsLoader.java @@ -6,7 +6,7 @@ import com.github.technus.tectech.thing.block.QuantumStuffBlock; import com.github.technus.tectech.thing.casing.GT_Block_CasingsTT; import com.github.technus.tectech.thing.casing.GT_Block_HintTT; import com.github.technus.tectech.thing.casing.TT_Container_Casings; -import com.github.technus.tectech.thing.item.ConstructibleTriggerItem; +import com.github.technus.tectech.thing.item.ConstructableTriggerItem; import com.github.technus.tectech.thing.item.DebugContainer_EM; import com.github.technus.tectech.thing.item.DefinitionContainer_EM; import com.github.technus.tectech.thing.item.ParametrizerMemoryCard; @@ -37,7 +37,7 @@ public class ThingsLoader implements Runnable { TecTech.Logger.info("TurretBaseEM registered"); } - ConstructibleTriggerItem.run(); + ConstructableTriggerItem.run(); ParametrizerMemoryCard.run(); TecTech.Logger.info("Useful item registered"); diff --git a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java new file mode 100644 index 0000000000..18e7962f41 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java @@ -0,0 +1,158 @@ +package com.github.technus.tectech.thing.item; + +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; +import net.minecraft.block.Block; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.util.FakePlayer; + +import java.util.HashMap; +import java.util.List; + +import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.auxiliary.Reference.MODID; +import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sHintCasingsTT; +import static gregtech.api.GregTech_API.sBlockCasings1; + +/** + * Created by Tec on 15.03.2017. + */ +public class ConstructableTriggerItem extends Item { + public static ConstructableTriggerItem INSTANCE; + + public static HashMap multiblockMap= new HashMap<>(); + + private ConstructableTriggerItem() { + super(); + setUnlocalizedName("em.debugBuilder"); + setTextureName(MODID + ":itemDebugBuilder"); + } + + @Override + public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if(tTileEntity==null || aPlayer instanceof FakePlayer) return aPlayer instanceof EntityPlayerMP; + if (aPlayer instanceof EntityPlayerMP) { + //struct gen + if (aPlayer.isSneaking() && aPlayer.capabilities.isCreativeMode) { + if (tTileEntity instanceof IGregTechTileEntity) { + IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); + if (metaTE instanceof IConstructable) { + ((IConstructable) metaTE).construct(aStack.stackSize, false); + } else if (multiblockMap.containsKey(metaTE.getClass().getCanonicalName())) { + multiblockMap.get(metaTE.getClass().getCanonicalName()).construct(aStack.stackSize, false, tTileEntity, ((IGregTechTileEntity) tTileEntity).getFrontFacing()); + } + } else if (tTileEntity instanceof IConstructable) { + ((IConstructable) tTileEntity).construct(aStack.stackSize, false); + } else if (multiblockMap.containsKey(tTileEntity.getClass().getCanonicalName())) { + multiblockMap.get(tTileEntity.getClass().getCanonicalName()).construct(aStack.stackSize, false, tTileEntity, aSide); + } + } + return true; + }else if (aPlayer instanceof EntityClientPlayerMP){//particles and text client side + if ((!aPlayer.isSneaking() || !aPlayer.capabilities.isCreativeMode)) { + if(tTileEntity instanceof IGregTechTileEntity) { + IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); + if (metaTE instanceof IConstructable) { + ((IConstructable) metaTE).construct(aStack.stackSize, true); + TecTech.proxy.printInchat(((IConstructable) metaTE).getStructureDescription(aStack.stackSize)); + return false; + } else if(multiblockMap.containsKey(metaTE.getClass().getCanonicalName())){ + multiblockMap.get(metaTE.getClass().getCanonicalName()).construct(aStack.stackSize,true,tTileEntity,((IGregTechTileEntity) tTileEntity).getFrontFacing()); + TecTech.proxy.printInchat(multiblockMap.get(metaTE.getClass().getCanonicalName()).getDescription(aStack.stackSize)); + return false; + } + } else if(tTileEntity instanceof IConstructable){ + ((IConstructable) tTileEntity).construct(aStack.stackSize,true); + TecTech.proxy.printInchat(((IConstructable) tTileEntity).getStructureDescription(aStack.stackSize)); + return false; + } else if(multiblockMap.containsKey(tTileEntity.getClass().getCanonicalName())){ + multiblockMap.get(tTileEntity.getClass().getCanonicalName()).construct(aStack.stackSize,true,tTileEntity, aSide); + TecTech.proxy.printInchat(multiblockMap.get(tTileEntity.getClass().getCanonicalName()).getDescription(aStack.stackSize)); + return false; + } + } else { + if(tTileEntity instanceof IGregTechTileEntity) { + IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); + if (metaTE instanceof IConstructable) { + TecTech.proxy.printInchat(((IConstructable) metaTE).getStructureDescription(aStack.stackSize)); + return false; + } else if(multiblockMap.containsKey(metaTE.getClass().getCanonicalName())){ + TecTech.proxy.printInchat(multiblockMap.get(metaTE.getClass().getCanonicalName()).getDescription(aStack.stackSize)); + return false; + } + } else if(tTileEntity instanceof IConstructable){ + TecTech.proxy.printInchat(((IConstructable) tTileEntity).getStructureDescription(aStack.stackSize)); + return false; + } else if(multiblockMap.containsKey(tTileEntity.getClass().getCanonicalName())){ + TecTech.proxy.printInchat(multiblockMap.get(tTileEntity.getClass().getCanonicalName()).getDescription(aStack.stackSize)); + return false; + } + } + } + return false; + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) { + aList.add(CommonValues.tecMark); + aList.add("Triggers Constructable Interface"); + aList.add(EnumChatFormatting.BLUE + "Shows multiblock construction details,"); + aList.add(EnumChatFormatting.BLUE + "just Use on a multiblock controller."); + aList.add(EnumChatFormatting.BLUE + "(Sneak Use in creative to build)"); + aList.add(EnumChatFormatting.BLUE + "Quantity affects tier/mode/type"); + } + + public static void run() { + INSTANCE = new ConstructableTriggerItem(); + GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName()); + + multiblockMap.put(GT_MetaTileEntity_ElectricBlastFurnace.class.getCanonicalName(), new MultiblockInfoContainer() { + //region Structure + private final String[][] shape = new String[][]{ + {"000","111","111"," . ",}, + {"0!0","1A1","1A1"," ",}, + {"000","111","111"," ",}, + }; + private final Block[] blockType = new Block[]{sBlockCasings1, sHintCasingsTT}; + private final byte[] blockMeta = new byte[]{11, 12}; + private final String[] desc=new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or Heat Proof Casing", + "2 - Muffler Hatch", + "General - Coil blocks" + }; + //endregion + + @Override + public void construct(int stackSize, boolean hintsOnly, TileEntity tileEntity, int aSide) { + StructureBuilder(shape, blockType, blockMeta, 1, 3, 0, tileEntity, aSide, hintsOnly); + } + + @Override + public String[] getDescription(int stackSize) { + return desc; + } + }); + } + + public abstract static class MultiblockInfoContainer { + public abstract void construct(int stackSize, boolean hintsOnly, TileEntity tileEntity, int aSide); + @SideOnly(Side.CLIENT) + public abstract String[] getDescription(int stackSize); + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/item/ConstructibleTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/ConstructibleTriggerItem.java deleted file mode 100644 index ceeeadbf5a..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/item/ConstructibleTriggerItem.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.github.technus.tectech.thing.item; - -import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.thing.metaTileEntity.IConstructable; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; -import net.minecraft.block.Block; -import net.minecraft.client.entity.EntityClientPlayerMP; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import net.minecraftforge.common.util.FakePlayer; - -import java.util.HashMap; -import java.util.List; - -import static com.github.technus.tectech.Util.StructureBuilder; -import static com.github.technus.tectech.auxiliary.Reference.MODID; -import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sHintCasingsTT; -import static gregtech.api.GregTech_API.sBlockCasings1; - -/** - * Created by Tec on 15.03.2017. - */ -public class ConstructibleTriggerItem extends Item { - public static ConstructibleTriggerItem INSTANCE; - - public static HashMap multiblockMap= new HashMap<>(); - - private ConstructibleTriggerItem() { - super(); - setUnlocalizedName("em.debugBuilder"); - setTextureName(MODID + ":itemDebugBuilder"); - } - - @Override - public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if(tTileEntity==null || aPlayer instanceof FakePlayer) return aPlayer instanceof EntityPlayerMP; - if (aPlayer instanceof EntityPlayerMP) { - //struct gen - if (aPlayer.isSneaking() && aPlayer.capabilities.isCreativeMode) { - if (tTileEntity instanceof IGregTechTileEntity) { - IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); - if (metaTE instanceof IConstructable) { - ((IConstructable) metaTE).construct(aStack.stackSize, false); - } else if (multiblockMap.containsKey(metaTE.getClass().getCanonicalName())) { - multiblockMap.get(metaTE.getClass().getCanonicalName()).construct(aStack.stackSize, false, tTileEntity, ((IGregTechTileEntity) tTileEntity).getFrontFacing()); - } - } else if (tTileEntity instanceof IConstructable) { - ((IConstructable) tTileEntity).construct(aStack.stackSize, false); - } else if (multiblockMap.containsKey(tTileEntity.getClass().getCanonicalName())) { - multiblockMap.get(tTileEntity.getClass().getCanonicalName()).construct(aStack.stackSize, false, tTileEntity, aSide); - } - } - return true; - }else if (aPlayer instanceof EntityClientPlayerMP){//particles and text client side - if ((!aPlayer.isSneaking() || !aPlayer.capabilities.isCreativeMode)) { - if(tTileEntity instanceof IGregTechTileEntity) { - IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); - if (metaTE instanceof IConstructable) { - ((IConstructable) metaTE).construct(aStack.stackSize, true); - TecTech.proxy.printInchat(((IConstructable) metaTE).getStructureDescription(aStack.stackSize)); - return false; - } else if(multiblockMap.containsKey(metaTE.getClass().getCanonicalName())){ - multiblockMap.get(metaTE.getClass().getCanonicalName()).construct(aStack.stackSize,true,tTileEntity,((IGregTechTileEntity) tTileEntity).getFrontFacing()); - TecTech.proxy.printInchat(multiblockMap.get(metaTE.getClass().getCanonicalName()).getDescription(aStack.stackSize)); - return false; - } - } else if(tTileEntity instanceof IConstructable){ - ((IConstructable) tTileEntity).construct(aStack.stackSize,true); - TecTech.proxy.printInchat(((IConstructable) tTileEntity).getStructureDescription(aStack.stackSize)); - return false; - } else if(multiblockMap.containsKey(tTileEntity.getClass().getCanonicalName())){ - multiblockMap.get(tTileEntity.getClass().getCanonicalName()).construct(aStack.stackSize,true,tTileEntity, aSide); - TecTech.proxy.printInchat(multiblockMap.get(tTileEntity.getClass().getCanonicalName()).getDescription(aStack.stackSize)); - return false; - } - } else { - if(tTileEntity instanceof IGregTechTileEntity) { - IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); - if (metaTE instanceof IConstructable) { - TecTech.proxy.printInchat(((IConstructable) metaTE).getStructureDescription(aStack.stackSize)); - return false; - } else if(multiblockMap.containsKey(metaTE.getClass().getCanonicalName())){ - TecTech.proxy.printInchat(multiblockMap.get(metaTE.getClass().getCanonicalName()).getDescription(aStack.stackSize)); - return false; - } - } else if(tTileEntity instanceof IConstructable){ - TecTech.proxy.printInchat(((IConstructable) tTileEntity).getStructureDescription(aStack.stackSize)); - return false; - } else if(multiblockMap.containsKey(tTileEntity.getClass().getCanonicalName())){ - TecTech.proxy.printInchat(multiblockMap.get(tTileEntity.getClass().getCanonicalName()).getDescription(aStack.stackSize)); - return false; - } - } - } - return false; - } - - @Override - public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) { - aList.add(CommonValues.tecMark); - aList.add("Triggers Constructable Interface"); - aList.add(EnumChatFormatting.BLUE + "Shows multiblock construction details,"); - aList.add(EnumChatFormatting.BLUE + "just Use on a multiblock controller."); - aList.add(EnumChatFormatting.BLUE + "(Sneak Use in creative to build)"); - aList.add(EnumChatFormatting.BLUE + "Quantity affects tier/mode/type"); - } - - public static void run() { - INSTANCE = new ConstructibleTriggerItem(); - GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName()); - - multiblockMap.put(GT_MetaTileEntity_ElectricBlastFurnace.class.getCanonicalName(), new MultiblockInfoContainer() { - //region Structure - private final String[][] shape = new String[][]{ - {"000","111","111"," . ",}, - {"0!0","1A1","1A1"," ",}, - {"000","111","111"," ",}, - }; - private final Block[] blockType = new Block[]{sBlockCasings1, sHintCasingsTT}; - private final byte[] blockMeta = new byte[]{11, 12}; - private final String[] desc=new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic Hatches or Heat Proof Casing", - "2 - Muffler Hatch", - "General - Coil blocks" - }; - //endregion - - @Override - public void construct(int stackSize, boolean hintsOnly, TileEntity tileEntity, int aSide) { - StructureBuilder(shape, blockType, blockMeta, 1, 3, 0, tileEntity, aSide, hintsOnly); - } - - @Override - public String[] getDescription(int stackSize) { - return desc; - } - }); - } - - public abstract static class MultiblockInfoContainer { - public abstract void construct(int stackSize, boolean hintsOnly, TileEntity tileEntity, int aSide); - @SideOnly(Side.CLIENT) - public abstract String[] getDescription(int stackSize); - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java index c384552c25..ef0b9ddfb1 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java @@ -14,7 +14,7 @@ import net.minecraft.item.ItemStack; import java.util.Iterator; -public final class GT_Container_Param extends GT_ContainerMetaTile_Machine { +public class GT_Container_Param extends GT_ContainerMetaTile_Machine { public int exponent = 0; public int value2 = 0; public int value1 = 0; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Uncertainty.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Uncertainty.java index 68b4f9268b..8db5fc1aa4 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Uncertainty.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Uncertainty.java @@ -14,7 +14,7 @@ import net.minecraft.item.ItemStack; import java.util.Iterator; -public final class GT_Container_Uncertainty extends GT_ContainerMetaTile_Machine { +public class GT_Container_Uncertainty extends GT_ContainerMetaTile_Machine { public short[] matrix = new short[]{500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500}; public byte selection = -1, mode = 0, status = -128; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java index c272e67fdc..d883cb3332 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java @@ -7,7 +7,7 @@ import net.minecraft.entity.player.InventoryPlayer; import static com.github.technus.tectech.TecTech.proxy; import static gregtech.api.enums.GT_Values.RES_PATH_GUI; -public final class GT_GUIContainer_Param extends GT_GUIContainerMetaTile_Machine { +public class GT_GUIContainer_Param extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_Param(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(new GT_Container_Param(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Parametrizer.png"); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_UncertaintyAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_UncertaintyAdv.java index eebf48debb..d6a0b14f34 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_UncertaintyAdv.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_UncertaintyAdv.java @@ -9,7 +9,7 @@ import static com.github.technus.tectech.TecTech.proxy; import static gregtech.api.enums.GT_Values.RES_PATH_GUI; import static org.lwjgl.opengl.GL11.*; -public final class GT_GUIContainer_UncertaintyAdv extends GT_GUIContainerMetaTile_Machine { +public class GT_GUIContainer_UncertaintyAdv extends GT_GUIContainerMetaTile_Machine { protected static final short sX = 52, sY = 33, bU = 0, rU = 70, fU = 192, V = 210, Vs = 216; public GT_GUIContainer_UncertaintyAdv(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/gui/GT_GUIContainer_MultiMachineEM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/gui/GT_GUIContainer_MultiMachineEM.java index 595d280c18..08f97832dd 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/gui/GT_GUIContainer_MultiMachineEM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/gui/GT_GUIContainer_MultiMachineEM.java @@ -28,11 +28,11 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 1) != 0) fontRendererObj.drawString("Pipe is loose.", 10, -10, 16448255); if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 2) != 0) - fontRendererObj.drawString("Screws are missing.", 10, -2, 16448255); + fontRendererObj.drawString("Screws are loose.", 10, -2, 16448255); if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 4) != 0) fontRendererObj.drawString("Something is stuck.", 10, 6, 16448255); if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 8) != 0) - fontRendererObj.drawString("Platings are dented.", 10, 14, 16448255); + fontRendererObj.drawString("Plating is dented.", 10, 14, 16448255); if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 16) != 0) fontRendererObj.drawString("Circuitry burned out.", 10, 22, 16448255); if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 32) != 0) @@ -46,7 +46,7 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach if (((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode == 0) { if (((GT_Container_MultiMachineEM) mContainer).mActive == 0) { - fontRendererObj.drawString("Hit with Soft Hammer", 10, -10, 16448255); + fontRendererObj.drawString("Soft Hammer or press Button", 10, -10, 16448255); fontRendererObj.drawString("to (re-)start the Machine", 10, -2, 16448255); fontRendererObj.drawString("if it doesn't start.", 10, 6, 16448255); } else { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java index c8ba4dbc1e..d495c7e9f2 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java @@ -32,7 +32,7 @@ import static gregtech.api.enums.Dyes.MACHINE_METAL; */ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements iConnectsToDataPipe { private static Textures.BlockIcons.CustomIcon EMpipe; - private static Textures.BlockIcons.CustomIcon EMcandy; + private static Textures.BlockIcons.CustomIcon EMbar; public byte connectionCount = 0; public GT_MetaTileEntity_Pipe_Data(int aID, String aName, String aNameRegional) { @@ -52,13 +52,13 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements iConn @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { EMpipe = new Textures.BlockIcons.CustomIcon("iconsets/EM_DATA"); - EMcandy = new Textures.BlockIcons.CustomIcon("iconsets/EM_BAR"); + EMbar = new Textures.BlockIcons.CustomIcon("iconsets/EM_BAR"); super.registerIcons(aBlockIconRegister); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { - return new ITexture[]{new GT_RenderedTexture(EMpipe), new GT_RenderedTexture(EMcandy, Dyes.getModulation(aColorIndex, MACHINE_METAL.getRGBA()))}; + return new ITexture[]{new GT_RenderedTexture(EMpipe), new GT_RenderedTexture(EMbar, Dyes.getModulation(aColorIndex, MACHINE_METAL.getRGBA()))}; } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java index 4ea525acd2..f300b3e432 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java @@ -20,7 +20,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import static com.github.technus.tectech.Util.StructureWriter; -import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; /** * Created by Tec on 23.03.2017. @@ -104,9 +103,8 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isAllowedToWork()) { result = StructureWriter(this.getBaseMetaTileEntity(), numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5], false); - if (DEBUG_MODE) - for (String s : result) - TecTech.Logger.info(s); + for (String s : result) + TecTech.Logger.info(s); aBaseMetaTileEntity.disableWorking(); } } @@ -114,9 +112,8 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { result = StructureWriter(this.getBaseMetaTileEntity(), numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5], true); - if (DEBUG_MODE) - for (String s : result) - TecTech.Logger.info(s); + for (String s : result) + TecTech.Logger.info(s); } @Override -- cgit From b51236f81822fbf0decbcbd55f43105dcc6d75a2 Mon Sep 17 00:00:00 2001 From: Technus Date: Tue, 22 Aug 2017 13:24:41 +0200 Subject: Change strings --- src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java index 6d7060b4fb..d1933f0ba4 100644 --- a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java +++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java @@ -25,7 +25,7 @@ public class TT_recipeAdder extends GT_RecipeAdder { } for(ItemStack tItem : aInputs){ if(tItem==null){ - TecTech.Logger.error("addAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); + TecTech.Logger.error("addResearchableAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); } } if(researchAmperage<=0) researchAmperage=1; @@ -56,7 +56,7 @@ public class TT_recipeAdder extends GT_RecipeAdder { } for(ItemStack tItem : aInputs){ if(tItem==null){ - TecTech.Logger.error("addEMmachineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); + TecTech.Logger.error("addResearchableEMmachineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); } } if(researchAmperage<=0) researchAmperage=1; @@ -97,7 +97,7 @@ public class TT_recipeAdder extends GT_RecipeAdder { } for(ItemStack tItem : aInputs){ if(tItem==null){ - TecTech.Logger.error("addEMmachineRecipe "+aResearchEM+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); + TecTech.Logger.error("addScannableEMmachineRecipe "+aResearchEM+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); } } if(researchAmperage<=0) researchAmperage=1; -- cgit From 6c64d190065bb4f57a3e18a174a2dc556b21f15d Mon Sep 17 00:00:00 2001 From: Technus Date: Wed, 23 Aug 2017 10:29:21 +0200 Subject: Refactor names --- .../GT_MetaTileEntity_EM_essentiaDequantizer.java | 8 +- .../GT_MetaTileEntity_EM_essentiaQuantizer.java | 8 +- .../multi/GT_MetaTileEntity_EM_annihilation.java | 4 +- .../multi/GT_MetaTileEntity_EM_bhg.java | 6 +- .../multi/GT_MetaTileEntity_EM_collider.java | 6 +- .../multi/GT_MetaTileEntity_EM_computer.java | 22 ++-- .../multi/GT_MetaTileEntity_EM_crafter.java | 4 +- .../multi/GT_MetaTileEntity_EM_decay.java | 10 +- .../multi/GT_MetaTileEntity_EM_dequantizer.java | 6 +- .../multi/GT_MetaTileEntity_EM_infuser.java | 8 +- .../multi/GT_MetaTileEntity_EM_junction.java | 12 +- .../multi/GT_MetaTileEntity_EM_machine.java | 2 +- .../multi/GT_MetaTileEntity_EM_quantizer.java | 8 +- .../multi/GT_MetaTileEntity_EM_research.java | 14 +-- .../multi/GT_MetaTileEntity_EM_scanner.java | 18 +-- .../multi/GT_MetaTileEntity_EM_stabilizer.java | 4 +- .../multi/GT_MetaTileEntity_EM_switch.java | 10 +- .../multi/GT_MetaTileEntity_EM_transformer.java | 6 +- .../multi/GT_MetaTileEntity_EM_wormhole.java | 4 +- .../multi/GT_MetaTileEntity_MultiblockBase_EM.java | 130 +++++++++++---------- .../multi/GT_MetaTileEntity_TM_microwave.java | 18 +-- 21 files changed, 158 insertions(+), 150 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java b/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java index 96a84b6603..00762221e4 100644 --- a/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java +++ b/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java @@ -68,8 +68,8 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ } @Override - public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return essentiaContainerCompat.check(this) && EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return essentiaContainerCompat.check(this) && structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); } @Override @@ -101,7 +101,7 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ } @Override - public boolean EM_checkRecipe(ItemStack itemStack) { + public boolean checkRecipe_EM(ItemStack itemStack) { container=essentiaContainerCompat.getContainer(this); if (eInputHatches.size() < 1 || container==null) { stopMachine(); @@ -112,7 +112,7 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ cElementalInstanceStack stack = inputHatchContainer.getFirst(); inputHatchContainer.removeAmount(false,new cElementalInstanceStack(stack.definition,1)); if(!essentiaContainerCompat.putElementalInstanceStack(container,stack)) - cleanInstanceStack(stack); + cleanStackEM_EM(stack); mMaxProgresstime = 20; mEfficiencyIncrease = 10000; eAmpereFlow=1; diff --git a/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java b/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java index 96d8056992..9e11841dfd 100644 --- a/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java +++ b/src/main/java/com/github/technus/tectech/magicAddon/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java @@ -68,8 +68,8 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu } @Override - public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return essentiaContainerCompat.check(this) && EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return essentiaContainerCompat.check(this) && structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); } @Override @@ -110,7 +110,7 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu } @Override - public boolean EM_checkRecipe(ItemStack itemStack) { + public boolean checkRecipe_EM(ItemStack itemStack) { container=essentiaContainerCompat.getContainer(this); cElementalInstanceStack newStack=essentiaContainerCompat.getFromContainer(container); if(newStack!=null){ @@ -133,7 +133,7 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu } @Override - public void EM_outputFunction() { + public void outputAfterRecipe_EM() { if (eOutputHatches.size() < 1) { stopMachine(); return; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java index 71f17d8fe0..ec6e4497cd 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java @@ -57,8 +57,8 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl } @Override - public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 5, 5, 0); + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 5, 5, 0); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java index 7c1fa2f0b5..fdeb73757e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java @@ -136,12 +136,12 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E } @Override - public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - if(EM_StructureCheckAdvanced(shape2, blockType2, blockMeta2, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 16, 16, 0)){ + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + if(structureCheck_EM(shape2, blockType2, blockMeta2, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 16, 16, 0)){ glassDome=true; return true; } - if(EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 16, 16, 0)){ + if(structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 16, 16, 0)){ glassDome=false; return true; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index 115cbc6381..1a34ec9977 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -128,7 +128,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } @Override - public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX*2; int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ*2; if (iGregTechTileEntity.getBlockOffset(xDir, 0, zDir) != TT_Container_Casings.sBlockCasingsTT) { @@ -148,10 +148,10 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB boolean test; switch (eTier) { case 1: - test = EM_StructureCheckAdvanced(shape, blockType, blockMeta1,addingMethods,casingTextures,blockTypeFallback,blockMetaFallback, 11, 1, 18); + test = structureCheck_EM(shape, blockType, blockMeta1,addingMethods,casingTextures,blockTypeFallback,blockMetaFallback, 11, 1, 18); break; case 2: - test = EM_StructureCheckAdvanced(shape, blockType, blockMeta2,addingMethods,casingTextures,blockTypeFallback,blockMetaFallback, 11, 1, 18); + test = structureCheck_EM(shape, blockType, blockMeta2,addingMethods,casingTextures,blockTypeFallback,blockMetaFallback, 11, 1, 18); break; default: eTier = 0; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java index b234d2912a..498ea9387d 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java @@ -79,7 +79,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override - public boolean EM_checkRecipe(ItemStack itemStack) { + public boolean checkRecipe_EM(ItemStack itemStack) { eAvailableData = 0; maxTemp = 0; short thingsActive = 0; @@ -116,12 +116,12 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override - protected long EM_getAvailableData() { + protected long getAvailableData_EM() { return eAvailableData; } @Override - public void EM_checkParams() { + public void checkParams_EM() { if (eParamsIn[0] <= 0) eParamsInStatus[0] = PARAM_TOO_LOW; else if (eParamsIn[0] < 1) @@ -157,7 +157,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override - public void EM_outputFunction() { + public void outputAfterRecipe_EM() { if (eOutputData.size() > 0) { final Vec3pos pos = new Vec3pos(getBaseMetaTileEntity()); QuantumDataPacket pack = new QuantumDataPacket(pos, eAvailableData); @@ -189,26 +189,26 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override - public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { for (GT_MetaTileEntity_Hatch_Rack rack : eRacks) if (isValidMetaTileEntity(rack)) rack.getBaseMetaTileEntity().setActive(false); eRacks.clear(); - if (!EM_StructureCheckAdvanced(front, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, 0)) + if (!structureCheck_EM(front, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, 0)) return false; - if (!EM_StructureCheckAdvanced(cap, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, -1)) + if (!structureCheck_EM(cap, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, -1)) return false; byte offset = -2, totalLen = 4; for (; offset > -16; ) { - if (!EM_StructureCheckAdvanced(slice, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, offset)) + if (!structureCheck_EM(slice, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, offset)) break; totalLen++; offset--; } if (totalLen > 16) return false; - if (!EM_StructureCheckAdvanced(cap, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, ++offset)) + if (!structureCheck_EM(cap, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, ++offset)) return false; - if (!EM_StructureCheckAdvanced(terminator, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, --offset)) + if (!structureCheck_EM(terminator, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, --offset)) return false; eCertainMode = (byte) Math.min(totalLen / 3, 5); for (GT_MetaTileEntity_Hatch_Rack rack : eRacks) @@ -238,7 +238,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override - protected void EM_extraExplosions() { + protected void extraExplosions_EM() { for (MetaTileEntity tTileEntity : eRacks) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java index 8f235b1af6..affcd442ee 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java @@ -58,8 +58,8 @@ public class GT_MetaTileEntity_EM_crafter extends GT_MetaTileEntity_MultiblockBa } @Override - public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0); + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java index c4eca167fe..679e0a280d 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java @@ -60,8 +60,8 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase } @Override - public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0); + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0); } @Override @@ -84,8 +84,8 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase } @Override - public boolean EM_checkRecipe(ItemStack itemStack) { - cElementalInstanceStackMap map= EM_getInputsClone(); + public boolean checkRecipe_EM(ItemStack itemStack) { + cElementalInstanceStackMap map= getInputsClone_EM(); if(map!=null && map.hasStacks() && map.getFirst().getLifeTime() eInputHatches.size()) continue; final int outIndex = (int) (eParamsIn[i + 10]) - 1; GT_MetaTileEntity_Hatch_InputElemental in = eInputHatches.get(inIndex); if (outIndex == -1) {//param==0 -> null the content - cleanHatchContent(in); + cleanHatchContentEM_EM(in); } else { if (outIndex < 0 || outIndex > eOutputHatches.size()) continue; GT_MetaTileEntity_Hatch_OutputElemental out = eOutputHatches.get(outIndex); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_machine.java index 0436bd303e..abe930c07f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_machine.java @@ -36,7 +36,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa } @Override - public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { return false; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java index 46bd48a794..303e23f5a7 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java @@ -61,8 +61,8 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock } @Override - public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); } @Override @@ -85,7 +85,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock } @Override - public boolean EM_checkRecipe(ItemStack itemStack) {//TODO implement by item quantization, implement instance quantization + public boolean checkRecipe_EM(ItemStack itemStack) {//TODO implement by item quantization, implement instance quantization if (GregTech_API.sPostloadFinished) { ItemStack[] inI = getStoredInputs().toArray(new ItemStack[0]); if (inI.length > 0) { @@ -161,7 +161,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock } @Override - public void EM_outputFunction() { + public void outputAfterRecipe_EM() { if (eOutputHatches.size() < 1) { stopMachine(); return; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java index de29a4f96e..d481d5fd24 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java @@ -85,13 +85,13 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } @Override - public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { for (GT_MetaTileEntity_Hatch_Holder rack : eHolders) if (isValidMetaTileEntity(rack)) rack.getBaseMetaTileEntity().setActive(false); eHolders.clear(); - if (!EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 3, 4)) + if (!structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 3, 4)) return false; for (GT_MetaTileEntity_Hatch_Holder rack : eHolders) @@ -131,7 +131,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } @Override - protected void EM_onFirstTick() { + protected void onFirstTick_EM() { if(getBaseMetaTileEntity().isClientSide()) return; if(computationRemaining>0) { aRecipe=null; @@ -175,7 +175,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } @Override - public boolean EM_checkRecipe(ItemStack itemStack) { + public boolean checkRecipe_EM(ItemStack itemStack) { tRecipe=null; aRecipe=null; if(!eHolders.isEmpty() && eHolders.get(0).mInventory[0]!=null) { @@ -263,7 +263,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } @Override - public void EM_outputFunction() { + public void outputAfterRecipe_EM() { if(!eHolders.isEmpty()) { if (tRecipe != null && ItemList.Tool_DataStick.isStackEqual(mInventory[1], false, true)){ eHolders.get(0).getBaseMetaTileEntity().setActive(false); @@ -315,7 +315,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } @Override - protected void EM_extraExplosions() { + protected void extraExplosions_EM() { for (MetaTileEntity tTileEntity : eHolders) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); } @@ -409,7 +409,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB (mEUt <= 0 ? "Probably uses: " : "Probably makes: ") + EnumChatFormatting.RED + Integer.toString(Math.abs(mEUt)) + EnumChatFormatting.RESET + " EU/t at " + EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A", - "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier()] + EnumChatFormatting.RESET + + "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + " Amp Rating: " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A", "Problems: " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " Efficiency: " + EnumChatFormatting.YELLOW + Float.toString(mEfficiency / 100.0F) + EnumChatFormatting.RESET + " %", diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java index 0ef6618372..e73a313619 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java @@ -82,8 +82,8 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa } @Override - public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - if (!EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0)) + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + if (!structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0)) return false; return eInputHatches.size() == 1 && eOutputHatches.size() == 1 && eOutputHatches.get(0).getBaseMetaTileEntity().getFrontFacing() == iGregTechTileEntity.getFrontFacing(); } @@ -139,7 +139,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa } @Override - protected void EM_onFirstTick() { + protected void onFirstTick_EM() { if(getBaseMetaTileEntity().isClientSide()) return; if(computationRemaining>0) { eRecipe=null; @@ -167,7 +167,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa } @Override - public boolean EM_checkRecipe(ItemStack itemStack) { + public boolean checkRecipe_EM(ItemStack itemStack) { eRecipe=null; if(!eInputHatches.isEmpty() && eInputHatches.get(0).getContainerHandler().hasStacks() && !eOutputHatches.isEmpty()) { cElementalInstanceStackMap researchEM = eInputHatches.get(0).getContainerHandler(); @@ -179,7 +179,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa scannerRecipe=eRecipe.scannerRecipe; machineType=GT_MetaTileEntity_EM_machine.machine; objectResearched=new cElementalDefinitionStack(stackEM.definition,1); - //cleanMass(objectResearched.getMass()); + //cleanMassEM_EM(objectResearched.getMass()); researchEM.remove(objectResearched.definition); break; } @@ -188,11 +188,11 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa scannerRecipe=eRecipe.scannerRecipe; machineType=GT_MetaTileEntity_EM_crafter.crafter; objectResearched=new cElementalDefinitionStack(stackEM.definition,1); - //cleanMass(objectResearched.getMass()); + //cleanMassEM_EM(objectResearched.getMass()); researchEM.remove(objectResearched.definition); break; } - cleanInstanceStack(stackEM); + cleanStackEM_EM(stackEM); researchEM.remove(stackEM.definition); } if(eRecipe!=null && scannerRecipe!=null){//make sure it werks @@ -231,7 +231,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa } @Override - public void EM_outputFunction() { + public void outputAfterRecipe_EM() { if (eRecipe != null && ItemList.Tool_DataOrb.isStackEqual(mInventory[1], false, true)){ mInventory[1].setStackDisplayName(GT_LanguageManager.getTranslation(eRecipe.mOutputs[0].getDisplayName()) + ' ' + machineType +" Construction Data"); @@ -275,7 +275,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa (mEUt <= 0 ? "Probably uses: " : "Probably makes: ") + EnumChatFormatting.RED + Integer.toString(Math.abs(mEUt)) + EnumChatFormatting.RESET + " EU/t at " + EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A", - "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier()] + EnumChatFormatting.RESET + + "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + " Amp Rating: " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A", "Problems: " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " Efficiency: " + EnumChatFormatting.YELLOW + Float.toString(mEfficiency / 100.0F) + EnumChatFormatting.RESET + " %", diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java index dd2b8b3ec5..6474a042c6 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java @@ -51,8 +51,8 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc } @Override - public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0); + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java index 95bc272172..b654fa6958 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java @@ -64,8 +64,8 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas } @Override - public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); } @Override @@ -79,7 +79,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas } @Override - public boolean EM_checkRecipe(ItemStack itemStack) { + public boolean checkRecipe_EM(ItemStack itemStack) { short thingsActive = 0; for (GT_MetaTileEntity_Hatch_InputData di : eInputData) if (di.q != null) @@ -99,7 +99,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas } @Override - public void EM_outputFunction() { + public void outputAfterRecipe_EM() { if (eOutputData.size() > 0) { float total = 0; for (int i = 0; i < 10; i++) {//each param pair @@ -139,7 +139,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas } @Override - public void EM_checkParams() { + public void checkParams_EM() { for (int i = 0; i < 10; i++) { if (eParamsIn[i] < 0) eParamsInStatus[i] = PARAM_TOO_LOW; else if (eParamsIn[i] == 0) eParamsInStatus[i] = PARAM_UNUSED; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java index b8a65b3328..8d8b758103 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java @@ -64,8 +64,8 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo } @Override - public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); } @Override @@ -96,7 +96,7 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo } @Override - public boolean EM_checkRecipe(ItemStack itemStack) { + public boolean checkRecipe_EM(ItemStack itemStack) { if (ePowerPass) { mEfficiencyIncrease = 10000; mMaxProgresstime = 20; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java index cc236828d5..023c4d6afd 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java @@ -84,8 +84,8 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB } @Override - public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 4, 4, 0); + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 4, 4, 0); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java index bd79ad38ad..9cce5dbc81 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java @@ -96,18 +96,18 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //if you want to add checks that run periodically when machine works then make onRunningTick better //if you want to add checks that run periodically when machine is built then use check params - public boolean EM_checkRecipe(ItemStack itemStack) { + public boolean checkRecipe_EM(ItemStack itemStack) { return false; } // My code handles AMPS, if you want overclocking just modify mEUt and mMaxProgressTime, leave amps as usual! // Set mEUt, Efficiencies, required computation, time, check input etc. - public void EM_checkParams() { + public void checkParams_EM() { } // update status of parameters in guis and "machine state" // Called before check recipe, before outputting, and every second the machine is active - public void EM_outputFunction() { + public void outputAfterRecipe_EM() { } // based on "machine state" do output, // this must move to outputEM to EM output hatches @@ -115,25 +115,23 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt // (Well it can be overflowed if machine didn't finished, soft-hammered/disabled/not enough EU) // Setting available data processing - protected void EM_extraHatchInitHook() { + protected void hatchInit_EM() { }//For extra types of hatches initiation, LOOK HOW IT IS CALLED! onPostTick - protected void EM_extraExplosions() { + protected void extraExplosions_EM() { }//For that extra hatches explosions, and maybe some MOORE EXPLOSIONS - @Deprecated - protected void EM_workJustGotEnabled(){}//usually check recipe is more useful, therefore this one is deprecated - protected void EM_workJustGotDisabled(){} + protected void workGotDisabled_EM(){} //callback on enable/disable work, they don't care if the multiblock is complete or not //(you can check that with looking at mMachine and other variables) //machine structure check - protected boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { return false; } //Get Available data, Override only on data producers should return mAvailableData that is set in check recipe - protected long EM_getAvailableData() { + protected long getAvailableData_EM() { long result = 0; final Vec3pos pos = new Vec3pos(getBaseMetaTileEntity()); for (GT_MetaTileEntity_Hatch_InputData in : eInputData) @@ -143,14 +141,23 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //Extra hook on cyclic updates (not really needed for machines smaller than 1 chunk) //BUT NEEDED WHEN - machine blocks are not touching each other ot they don't implement IMachineBlockUpdateable (ex. air) - protected boolean EM_cyclicUpdate() { + protected boolean cyclicUpdate_EM() { return mUpdate <= -1000;//set to false to disable cyclic update //default is once per 50s; mUpdate is decremented every tick } - protected void EM_onFirstTick(){} // callback on first tick + protected void onFirstTick_EM(){} // callback on first tick + + @Override + public int getPollutionPerTick(ItemStack itemStack) { + return 0; + } + + public int getPollutionPerTick_EM(ItemStack itemStack) { + return 0; + } - //Override but call supermethod at start! + //Override but usually call super method at start! @Override public void stopMachine() { mOutputItems = null; @@ -178,7 +185,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } outputEM = null; - hatchesStatusUpdate(); + hatchesStatusUpdate_EM(); }//On machine stop - now called when softhammered to offline state! - it does not cause a full stop like power failure //RATHER LEAVE ALONE Section @@ -378,13 +385,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt return 0L; } - @Override - public int getPollutionPerTick(ItemStack itemStack) { - return 0; - } - private boolean cyclicUpdate() { - if (EM_cyclicUpdate()) { + if (cyclicUpdate_EM()) { mUpdate = 0; return true; } @@ -393,24 +395,23 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public final boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return EM_checkMachine(iGregTechTileEntity, itemStack); + return checkMachine_EM(iGregTechTileEntity, itemStack); } @Override public final void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { super.onFirstTick(aBaseMetaTileEntity); previousTickValueForWorkEnabled=getBaseMetaTileEntity().isAllowedToWork();//Assign new value - EM_onFirstTick(); + onFirstTick_EM(); } + //CAREFUL!!! it calls most of the callbacks @Override - public final void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { if (mEfficiency < 0) mEfficiency = 0; - if (getBaseMetaTileEntity().hasWorkJustBeenEnabled()) EM_workJustGotEnabled(); - if (previousTickValueForWorkEnabled && !getBaseMetaTileEntity().isAllowedToWork()) - EM_workJustGotDisabled(); + if (previousTickValueForWorkEnabled && !getBaseMetaTileEntity().isAllowedToWork()) workGotDisabled_EM(); previousTickValueForWorkEnabled = getBaseMetaTileEntity().isAllowedToWork();//Assign new value if (--mUpdate == 0 || --mStartUpCheck == 0 || cyclicUpdate() || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) { @@ -516,14 +517,14 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt eMaxAmpereFlow = 0; this.setEUVar(0); } - EM_extraHatchInitHook(); + hatchInit_EM(); } if (mStartUpCheck < 0) {//E if (mMachine) {//S final byte Tick = (byte) (aTick % 20); if (multiPurge1At == Tick || multiPurge2At == Tick) - purgeAll(); + purgeAllOverflowEM_EM(); else if (multiCheckAt == Tick) for (GT_MetaTileEntity_Hatch_Maintenance tHatch : mMaintenanceHatches) { if (isValidMetaTileEntity(tHatch)) { @@ -584,17 +585,18 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (getRepairStatus() >= minRepairStatus) {//S if (multiCheckAt == Tick) - hatchesStatusUpdate(); + hatchesStatusUpdate_EM(); if (mMaxProgresstime > 0 && doRandomMaintenanceDamage()) {//Start if (onRunningTick(mInventory[1])) {//Compute EU - if (!polluteEnvironment(getPollutionPerTick(mInventory[1]))) stopMachine();//todo add em pollution + if (!polluteEnvironment(getPollutionPerTick(mInventory[1]))) stopMachine(); + if (!polluteEnvironment_EM(getPollutionPerTick_EM(mInventory[1]))) stopMachine(); if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime && recipeAt == Tick) {//progress increase and done - hatchesStatusUpdate(); + hatchesStatusUpdate_EM(); - EM_outputFunction(); - cleanOutputEM(); + outputAfterRecipe_EM(); + cleanOutputEM_EM(); if (mOutputItems != null) for (ItemStack tStack : mOutputItems) if (tStack != null) addOutput(tStack); @@ -687,11 +689,16 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } + public boolean polluteEnvironment_EM(int aPollutionLevel) { + return true; //TODO + } + @Deprecated public final int getAmountOfOutputs() { throw new NoSuchMethodError("Deprecated Do not use"); } + @Override protected void addFluidOutputs(FluidStack[] mOutputFluids) { int min=mOutputFluids.length>mOutputHatches.size()?mOutputHatches.size():mOutputFluids.length; for (int i = 0; i < min; ++i) { @@ -723,9 +730,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt return false; } if (this.mEUt > 0) { - this.EMaddEnergyOutput((long) mEUt * (long) mEfficiency / getMaxEfficiency(aStack), eAmpereFlow); + this.addEnergyOutput_EM((long) mEUt * (long) mEfficiency / getMaxEfficiency(aStack), eAmpereFlow); return true; - } else if (this.mEUt < 0 && !this.EMdrainEnergyInput((long) (-this.mEUt) * getMaxEfficiency(aStack) / (long) Math.max(1000, this.mEfficiency), eAmpereFlow)) { + } else if (this.mEUt < 0 && !this.drainEnergyInput_EM((long) (-this.mEUt) * getMaxEfficiency(aStack) / (long) Math.max(1000, this.mEfficiency), eAmpereFlow)) { stopMachine(); return false; } else return true; @@ -745,7 +752,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } //new method - public final boolean EMaddEnergyOutput(long EU, long Amperes) { + public final boolean addEnergyOutput_EM(long EU, long Amperes) { if (EU <= 0L || Amperes <= 0) return true; long euVar = EU * Amperes; long diff; @@ -796,7 +803,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } //new method - public final boolean EMdrainEnergyInput(long EU, long Amperes) { + public final boolean drainEnergyInput_EM(long EU, long Amperes) { if (EU <= 0L || Amperes <= 0) return true; long euVar = EU * Amperes; if (euVar > getEUVar() || @@ -816,7 +823,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } //new method - public final boolean EMoverclockAndPutValuesIn(long EU, int time) {//TODO rewise + public final boolean overclockAndPutValuesIn_EM(long EU, int time) {//TODO rewise if (EU == 0) { mEUt = 0; mMaxProgresstime = time; @@ -850,17 +857,17 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } //new Method - public final int getMaxEnergyInputTier() { + public final int getMaxEnergyInputTier_EM() { return Util.getTier(maxEUinputMax); } //new Method - public final int getMinEnergyInputTier() { + public final int getMinEnergyInputTier_EM() { return Util.getTier(maxEUinputMin); } //new Method - public final cElementalInstanceStackMap EM_getInputsClone(){ + public final cElementalInstanceStackMap getInputsClone_EM(){ cElementalInstanceStackMap in=new cElementalInstanceStackMap(); for(GT_MetaTileEntity_Hatch_ElementalContainer hatch:eInputHatches){ in.putUnifyAll(hatch.getContainerHandler()); @@ -869,7 +876,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } //new Method - public final cElementalInstanceStackMap EM_getOutputsClone(){ + public final cElementalInstanceStackMap getOutputsClone_EM(){ cElementalInstanceStackMap out=new cElementalInstanceStackMap(); for(GT_MetaTileEntity_Hatch_ElementalContainer hatch:eOutputHatches){ out.putUnifyAll(hatch.getContainerHandler()); @@ -885,10 +892,10 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public void updateSlots() { super.updateSlots(); - purgeAll(); + purgeAllOverflowEM_EM(); } - private void purgeAll() { + private void purgeAllOverflowEM_EM() { float mass = 0; for (GT_MetaTileEntity_Hatch_InputElemental tHatch : eInputHatches) { if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots(); @@ -912,7 +919,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } - public void cleanHatchContent(GT_MetaTileEntity_Hatch_ElementalContainer target) { + public void cleanHatchContentEM_EM(GT_MetaTileEntity_Hatch_ElementalContainer target) { if (target == null) return; float mass = target.getContainerHandler().getMass(); if (mass > 0) { @@ -924,12 +931,12 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } - public void cleanInstanceStack(cElementalInstanceStack target) { + public void cleanStackEM_EM(cElementalInstanceStack target) { if (target == null) return; - cleanMass(target.getMass()); + cleanMassEM_EM(target.getMass()); } - public void cleanMass(float mass) { + public void cleanMassEM_EM(float mass) { if (mass > 0) { if (eMufflerHatches.size() < 1) explodeMultiblock(); mass /= eMufflerHatches.size(); @@ -939,7 +946,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } - private void cleanOutputEM() { + private void cleanOutputEM_EM() { if (outputEM == null) return; float mass = 0; for (cElementalInstanceStackMap map : outputEM) @@ -960,11 +967,11 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public final boolean checkRecipe(ItemStack itemStack) {//do recipe checks, based on "machine content and state" - hatchesStatusUpdate(); - return EM_checkRecipe(itemStack); + hatchesStatusUpdate_EM(); + return checkRecipe_EM(itemStack); } - private void hatchesStatusUpdate() { + private void hatchesStatusUpdate_EM() { for (GT_MetaTileEntity_Hatch_Param param : eParamHatches) { final int paramID = param.param; if (paramID < 0) continue; @@ -973,9 +980,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt param.input1f = eParamsOut[paramID]; param.input2f = eParamsOut[paramID + 10]; } - EM_checkParams(); + checkParams_EM(); - eAvailableData = EM_getAvailableData(); + eAvailableData = getAvailableData_EM(); for (GT_MetaTileEntity_Hatch_Uncertainty uncertainty : eUncertainHatches) eCertainStatus = uncertainty.update(eCertainMode); @@ -1023,7 +1030,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt for (MetaTileEntity tTileEntity : eDynamoMulti) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]); for (MetaTileEntity tTileEntity : eInputData) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); for (MetaTileEntity tTileEntity : eOutputData) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); - EM_extraExplosions(); + extraExplosions_EM(); getBaseMetaTileEntity().doExplosion(V[15]); } @@ -1427,7 +1434,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt (mEUt <= 0 ? "Probably uses: " : "Probably makes: ") + EnumChatFormatting.RED + Integer.toString(Math.abs(mEUt)) + EnumChatFormatting.RESET + " EU/t at " + EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A", - "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier()] + EnumChatFormatting.RESET + + "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + " Amp Rating: " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A", "Problems: " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " Efficiency: " + EnumChatFormatting.YELLOW + Float.toString(mEfficiency / 100.0F) + EnumChatFormatting.RESET + " %", @@ -1437,7 +1444,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt }; } - @Override public boolean isGivingInformation() { return true; @@ -1445,15 +1451,17 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //can be used to check structures of multi-blocks larger than one chunk, but... //ALL THE HATCHES AND THE CONTROLLER SHOULD BE IN ONE CHUNK OR IN LOADED CHUNKS - public final boolean EM_StructureCheck( + @Deprecated + public final boolean structureCheck_EM( String[][] structure,//0-9 casing, +- air no air, a-z ignore Block[] blockType,//use numbers 0-9 for casing types byte[] blockMeta,//use numbers 0-9 for casing types int horizontalOffset, int verticalOffset, int depthOffset) { - return StructureChecker(structure, blockType, blockMeta, horizontalOffset, verticalOffset, depthOffset, getBaseMetaTileEntity(), !mMachine); + return StructureChecker(structure, blockType, blockMeta, + horizontalOffset, verticalOffset, depthOffset, getBaseMetaTileEntity(), !mMachine); } - public final boolean EM_StructureCheckAdvanced( + public final boolean structureCheck_EM( String[][] structure,//0-9 casing, +- air no air, a-z ignore Block[] blockType,//use numbers 0-9 for casing types byte[] blockMeta,//use numbers 0-9 for casing types @@ -1535,7 +1543,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } //CALLBACK - public final boolean addThing(String methodName, IGregTechTileEntity igt, int casing) { + public boolean addThing(String methodName, IGregTechTileEntity igt, int casing) { try { return (boolean) adderMethodMap.get(methodName).invoke(this, igt, casing); } catch (InvocationTargetException | IllegalAccessException e) { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java index c7816192c2..40a11e56b3 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java @@ -96,22 +96,22 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock } @Override - public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { if(flipped){//some optimization - if(EM_StructureCheckAdvanced(shapeFlipped, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 1, 0)){ + if(structureCheck_EM(shapeFlipped, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 1, 0)){ flipped=true; return true; } - if(EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0)){ + if(structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0)){ flipped=false; return true; } }else{ - if(EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0)){ + if(structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0)){ flipped=false; return true; } - if(EM_StructureCheckAdvanced(shapeFlipped, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 1, 0)){ + if(structureCheck_EM(shapeFlipped, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 1, 0)){ flipped=true; return true; } @@ -141,7 +141,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock } @Override - public boolean EM_checkRecipe(ItemStack itemStack) { + public boolean checkRecipe_EM(ItemStack itemStack) { hasBeenPausedThiscycle=false; if(powerSetting<=300 || eParamsInStatus[0] == PARAM_TOO_HIGH || timerSetting<=0 || timerSetting>3000) return false; if (timerValue <= 0) { @@ -155,7 +155,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock } @Override - public void EM_outputFunction() { + public void outputAfterRecipe_EM() { if(hasBeenPausedThiscycle) return;//skip timer and actions if paused timerValue--; IGregTechTileEntity mte=getBaseMetaTileEntity(); @@ -219,7 +219,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock } @Override - public void EM_checkParams() { + public void checkParams_EM() { if (eParamsIn[0] <= 300) eParamsInStatus[0] = PARAM_TOO_LOW; else if (eParamsIn[0] < 1000) @@ -255,7 +255,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock } @Override - protected void EM_workJustGotDisabled() { + protected void workGotDisabled_EM() { timerValue=0; } -- cgit From cdc349f8d7f95e469959ec20b5f9d3e78d418038 Mon Sep 17 00:00:00 2001 From: Technus Date: Wed, 23 Aug 2017 14:01:36 +0200 Subject: Minor commentary change --- .../multi/GT_MetaTileEntity_MultiblockBase_EM.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java index 9cce5dbc81..589752c176 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java @@ -121,7 +121,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt protected void extraExplosions_EM() { }//For that extra hatches explosions, and maybe some MOORE EXPLOSIONS - protected void workGotDisabled_EM(){} + protected void workGotDisabled_EM(){}//called at end of onPostTick //callback on enable/disable work, they don't care if the multiblock is complete or not //(you can check that with looking at mMachine and other variables) @@ -157,7 +157,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt return 0; } - //Override but usually call super method at start! + //Override if needed but usually call super method at start! + //On machine stop - NOT called when softhammered to offline state! - it SHOULD cause a full stop like power failure does + //Can be overriden to alter stopping behaviour, to do things on soft hammer scenario -> workGotDisabled_EM @Override public void stopMachine() { mOutputItems = null; @@ -186,7 +188,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt outputEM = null; hatchesStatusUpdate_EM(); - }//On machine stop - now called when softhammered to offline state! - it does not cause a full stop like power failure + } //RATHER LEAVE ALONE Section @@ -411,9 +413,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (aBaseMetaTileEntity.isServerSide()) { if (mEfficiency < 0) mEfficiency = 0; - if (previousTickValueForWorkEnabled && !getBaseMetaTileEntity().isAllowedToWork()) workGotDisabled_EM(); - previousTickValueForWorkEnabled = getBaseMetaTileEntity().isAllowedToWork();//Assign new value - if (--mUpdate == 0 || --mStartUpCheck == 0 || cyclicUpdate() || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) { mInputHatches.clear(); mInputBusses.clear(); @@ -681,6 +680,10 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt stopMachine(); } } + + if (previousTickValueForWorkEnabled && !getBaseMetaTileEntity().isAllowedToWork()) workGotDisabled_EM(); + previousTickValueForWorkEnabled = getBaseMetaTileEntity().isAllowedToWork();//Assign new value + aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & -512) | (mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8) | (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64) | ((eCertainStatus == 0) ? 0 : 128) | (eParameters ? 0 : 256)); aBaseMetaTileEntity.setActive(mMaxProgresstime > 0); boolean active = aBaseMetaTileEntity.isActive() && mPollution > 0; -- cgit