diff options
Diffstat (limited to 'src/main/java')
113 files changed, 3357 insertions, 1788 deletions
diff --git a/src/main/java/com/github/technus/tectech/CommonValues.java b/src/main/java/com/github/technus/tectech/CommonValues.java index 0c49f98655..81c7dc3450 100644 --- a/src/main/java/com/github/technus/tectech/CommonValues.java +++ b/src/main/java/com/github/technus/tectech/CommonValues.java @@ -28,4 +28,6 @@ public final class CommonValues { // - in case some hatches are not in multiblock structure public static final byte MULTI_CHECK_AT = 12;// multiblock checks it's state public static final byte DISPERSE_AT = 14;// overflow hatches perform disperse + + private CommonValues() {} } diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index e82ab21895..21c8d6dd39 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -48,8 +48,9 @@ public class TecTech { public static final byte tectechTexturePage1=8; public static void AddLoginError(String pMessage) { - if (Module_AdminErrorLogs != null) + if (Module_AdminErrorLogs != null) { Module_AdminErrorLogs.AddErrorLogOnAdminJoin(pMessage); + } } @Mod.EventHandler @@ -59,7 +60,9 @@ public class TecTech { ModConfig = new TecTechConfig(PreEvent.getModConfigurationDirectory(), Reference.COLLECTIONNAME, Reference.MODID); - if (!ModConfig.LoadConfig()) Logger.error(Reference.MODID + " could not load its config file. Things are going to be weird!"); + if (!ModConfig.LoadConfig()) { + Logger.error(Reference.MODID + " could not load its config file. Things are going to be weird!"); + } if (ModConfig.ModAdminErrorLogs_Enabled) { Logger.debug("Module_AdminErrorLogs is enabled"); @@ -86,7 +89,9 @@ public class TecTech { @Mod.EventHandler public void PostLoad(FMLPostInitializationEvent PostEvent) { GTCustomLoader.postLoad(); - if (ModConfig.NERF_FUSION) FixBrokenFusionRecipes(); + if (ModConfig.NERF_FUSION) { + FixBrokenFusionRecipes(); + } fixBlocks(); } @@ -100,31 +105,39 @@ public class TecTech { private void FixBrokenFusionRecipes() { HashMap<Fluid, Fluid> binds = new HashMap<>(); - for (Materials m : Materials.values()) { - FluidStack p = m.getPlasma(1); + for (Materials material : Materials.values()) { + FluidStack p = material.getPlasma(1); if (p != null) { - if (DEBUG_MODE) - 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 (DEBUG_MODE) - 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()); - else binds.put(p.getFluid(), Materials.Iron.getMolten(1).getFluid()); + if (DEBUG_MODE) { + Logger.info("Found Plasma of " + material.mName); + } + if (material.mElement != null && + (material.mElement.mProtons >= Materials.Iron.mElement.mProtons || + -material.mElement.mProtons >= Materials.Iron.mElement.mProtons || + material.mElement.mNeutrons >= Materials.Iron.mElement.mNeutrons || + -material.mElement.mNeutrons >= Materials.Iron.mElement.mNeutrons)) { + if (DEBUG_MODE) { + Logger.info("Attempting to bind " + material.mName); + } + if (material.getMolten(1) != null) { + binds.put(p.getFluid(), material.getMolten(1).getFluid()); + } else if (material.getGas(1) != null) { + binds.put(p.getFluid(), material.getGas(1).getFluid()); + } else if (material.getFluid(1) != null) { + binds.put(p.getFluid(), material.getFluid(1).getFluid()); + } else { + binds.put(p.getFluid(), Materials.Iron.getMolten(1).getFluid()); + } } } } for (GT_Recipe r : GT_Recipe.GT_Recipe_Map.sFusionRecipes.mRecipeList) { - Fluid f = binds.get(r.mFluidOutputs[0].getFluid()); - if (f != null) { - if (DEBUG_MODE) + Fluid fluid = binds.get(r.mFluidOutputs[0].getFluid()); + if (fluid != null) { + if (DEBUG_MODE) { Logger.info("Nerfing Recipe " + r.mFluidOutputs[0].getUnlocalizedName()); - r.mFluidOutputs[0] = new FluidStack(f, r.mFluidInputs[0].amount); + } + r.mFluidOutputs[0] = new FluidStack(fluid, r.mFluidInputs[0].amount); } } } @@ -166,9 +179,10 @@ public class TecTech { modId = GameRegistry.findUniqueIdentifierFor(block).modId; if (modIDs.contains(modId)) {//Full Whitelisted Mods continue; - } else if (modId.equals("OpenBlocks")) { - if (GameRegistry.findUniqueIdentifierFor(block).name.equals("grave")) + } else if ("OpenBlocks".equals(modId)) { + if ("grave".equals(GameRegistry.findUniqueIdentifierFor(block).name)) { continue; + } } block.setResistance(6); } diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index ff058d044d..ff9e7f6cb8 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -30,16 +30,19 @@ import static gregtech.api.enums.GT_Values.E; /** * Created by Tec on 21.03.2017. */ -public class Util { +public final class Util { + private Util() {} + public static String intBitsToString(int number) { - StringBuilder result = new StringBuilder(); + StringBuilder result = new StringBuilder(16); for (int i = 31; i >= 0; i--) { int mask = 1 << i; result.append((number & mask) != 0 ? "1" : "0"); - if (i % 8 == 0) - result.append(" "); + if (i % 8 == 0) { + result.append(' '); + } } result.replace(result.length() - 1, result.length(), ""); @@ -47,14 +50,15 @@ public class Util { } public static String intBitsToShortString(int number) { - StringBuilder result = new StringBuilder(); + StringBuilder result = new StringBuilder(16); for (int i = 31; i >= 0; i--) { int mask = 1 << i; result.append((number & mask) != 0 ? ":" : "."); - if (i % 8 == 0) - result.append("|"); + if (i % 8 == 0) { + result.append('|'); + } } result.replace(result.length() - 1, result.length(), ""); @@ -70,7 +74,9 @@ public class Util { IGregTechTileEntity aBaseMetaTileEntity, boolean forceCheck) { World world = aBaseMetaTileEntity.getWorld(); - if (world.isRemote) return false; + if (world.isRemote) { + return false; + } //TE Rotation byte facing = aBaseMetaTileEntity.getFrontFacing(); @@ -94,12 +100,14 @@ public class Util { b -= block; break; } if (block > '@')//characters allow to skip check a-1 skip, b-2 skips etc. + { a += block - '@'; - else if (block < '+')//used to mark THINGS + } else if (block < '+')//used to mark THINGS + { a++; - else if (block=='.') + } else if (block=='.') { a++; - else { + } else { //get x y z from rotation switch (facing) {//translation case 4: @@ -138,34 +146,42 @@ public class Util { } //that must be here since in some cases other axis (b,c) controls y - if (y < 0 || y >= 256) return false; + if (y < 0 || y >= 256) { + return false; + } //Check block if (world.blockExists(x, y, z)) {//this actually checks if the chunk is loaded at this pos switch (block) { case '-'://must be air - if (world.getBlock(x, y, z).getMaterial() != Material.air) + if (world.getBlock(x, y, z).getMaterial() != Material.air) { return false; + } break; case '+'://must not be air - if (world.getBlock(x, y, z).getMaterial() == Material.air) + if (world.getBlock(x, y, z).getMaterial() == Material.air) { return false; + } break; default: //check for block (countable) pointer = block - '0'; //countable air -> net.minecraft.block.BlockAir if (world.getBlock(x, y, z) != blockType[pointer]) { - if (DEBUG_MODE) - TecTech.Logger.info("Struct-block-error " + x + " " + y + " " + z + " / " + a + " " + b + " " + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + " " + blockType[pointer].getUnlocalizedName()); + 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 (DEBUG_MODE) - TecTech.Logger.info("Struct-meta-id-error " + x + " " + y + " " + z + " / " + a + " " + b + " " + c + " / " + world.getBlockMetadata(x, y, z) + " " + blockMeta[pointer]); + 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; } } - } else if (forceCheck) return false; + } else if (forceCheck) { + return false; + } a++;//block in horizontal layer } } @@ -191,7 +207,9 @@ public class Util { IGregTechTileEntity aBaseMetaTileEntity, boolean forceCheck) { World world = aBaseMetaTileEntity.getWorld(); - if (world.isRemote) return false; + if (world.isRemote) { + return false; + } //TE Rotation byte facing = aBaseMetaTileEntity.getFrontFacing(); @@ -218,12 +236,13 @@ public class Util { b -= block; break; } else if (block > '@') //characters allow to skip check a-1 skip, b-2 skips etc. + { a += block - '@'; - //else if (block < '+')//used to mark THINGS + }//else if (block < '+')//used to mark THINGS // a++; - else if (block=='.') + else if (block=='.') { a++; - else { + } else { //get x y z from rotation switch (facing) {//translation case 4: @@ -262,30 +281,36 @@ public class Util { } //that must be here since in some cases other axis (b,c) controls y - if (y < 0 || y >= 256) return false; + if (y < 0 || y >= 256) { + return false; + } //Check block if (world.blockExists(x, y, z)) {//this actually checks if the chunk is loaded at this pos switch (block) { case '-'://must be air - if (world.getBlock(x, y, z).getMaterial() != Material.air) + if (world.getBlock(x, y, z).getMaterial() != Material.air) { return false; + } break; case '+'://must not be air - if (world.getBlock(x, y, z).getMaterial() == Material.air) + if (world.getBlock(x, y, z).getMaterial() == Material.air) { return false; + } break; default://check for block (countable) if ((pointer = block - '0') >= 0) { //countable air -> net.minecraft.block.BlockAir if (world.getBlock(x, y, z) != blockType[pointer]) { - if (DEBUG_MODE) - TecTech.Logger.info("Struct-block-error " + x + " " + y + " " + z + " / " + a + " " + b + " " + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + " " + blockType[pointer].getUnlocalizedName()); + 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 (DEBUG_MODE) - TecTech.Logger.info("Struct-meta-id-error " + x + " " + y + " " + z + " / " + a + " " + b + " " + c + " / " + world.getBlockMetadata(x, y, z) + " " + blockMeta[pointer]); + 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; } } else if ((pointer = block - ' ') >= 0) { @@ -293,23 +318,29 @@ 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 (DEBUG_MODE) - TecTech.Logger.info("Fallback-struct-block-error " + x + " " + y + " " + z + " / " + a + " " + b + " " + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + " " + blockTypeFallback[pointer].getUnlocalizedName()); + 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 (DEBUG_MODE) - TecTech.Logger.info("Fallback-Struct-meta-id-error " + x + " " + y + " " + z + " / " + a + " " + b + " " + c + " / " + world.getBlockMetadata(x, y, z) + " " + blockMetaFallback[pointer]); + 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 (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } return false; } } } - } else if (forceCheck) return false; + } else if (forceCheck) { + return false; + } a++;//block in horizontal layer } } @@ -337,9 +368,13 @@ public class Util { byte[] blockMeta,//use numbers 0-9 for casing types int horizontalOffset, int verticalOffset, int depthOffset, TileEntity tileEntity, int facing, boolean hintsOnly) { - if(!tileEntity.hasWorldObj()) return false; + if(!tileEntity.hasWorldObj()) { + return false; + } World world = tileEntity.getWorldObj(); - if (!world.isRemote && hintsOnly) return false; + if (!world.isRemote && hintsOnly) { + return false; + } //TE Rotation @@ -362,12 +397,14 @@ public class Util { b -= block; break; } if (block > '@')//characters allow to skip check a-1 skip, b-2 skips etc. + { a += block - '@'; - //else if (block < '+')//used to mark THINGS + }//else if (block < '+')//used to mark THINGS // a++; else if (block=='.')// this TE + { a++; - else { + } else { //get x y z from rotation switch (facing) {//translation case 4: @@ -406,7 +443,9 @@ public class Util { } //that must be here since in some cases other axis (b,c) controls y - if (y < 0 || y >= 256) return false; + if (y < 0 || y >= 256) { + return false; + } //Check block if (world.blockExists(x, y, z)) {//this actually checks if the chunk is loaded @@ -420,15 +459,18 @@ public class Util { break; default: //check for block if ((pointer = block - '0') >= 0) { - if(world.getBlock(x,y,z)!=blockType[pointer] || world.getBlockMetadata(x,y,z)!=blockMeta[pointer]) - TecTech.proxy.hint_particle(world,x, y, z, blockType[pointer], blockMeta[pointer]); + if(world.getBlock(x,y,z)!=blockType[pointer] || world.getBlockMetadata(x,y,z)!=blockMeta[pointer]) { + TecTech.proxy.hint_particle(world, x, y, z, blockType[pointer], blockMeta[pointer]); + } } else if ((pointer = block - ' ') >= 0) { - switch(pointer){ - case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: - TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, pointer); break; - default:TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 12); + if(pointer>=0 && pointer<12) { + TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, pointer); + } else { + TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, 12); } - } else TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 15); + } else { + TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, 15); + } } }else{ switch (block) { @@ -441,13 +483,15 @@ public class Util { default: //check for block if ((pointer = block - '0') >= 0) { world.setBlock(x, y, z, blockType[pointer], blockMeta[pointer], 2); - } else if ((pointer = block - ' ') >= 0) { + } else if (block - ' ' < 0) { + world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 15, 2); + } //else { //switch(pointer){ // case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: // world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, pointer, 2); break; // default:world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 12, 2); //} - } else world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 15,2); + //} } } } @@ -467,7 +511,9 @@ public class Util { //TE Rotation byte facing = aBaseMetaTileEntity.getFrontFacing(); World world = aBaseMetaTileEntity.getWorld(); - if (world.isRemote) return new String[]{"Not at Client m8"}; + if (world.isRemote) { + return new String[]{"Not at Client m8"}; + } ItemStack[] array = new ItemStack[10]; @@ -525,7 +571,9 @@ public class Util { } //that must be here since in some cases other axis (b,c) controls y - if (y < 0 || y >= 256) return new String[]{"Invalid position"}; + if (y < 0 || y >= 256) { + return new String[]{"Invalid position"}; + } //Check block Block block = world.getBlock(x, y, z); @@ -544,7 +592,9 @@ public class Util { break; } } - if (err) return new String[]{"Too much different blocks"}; + if (err) { + return new String[]{"Too much different blocks"}; + } } a++;//block in horizontal layer @@ -556,8 +606,8 @@ public class Util { List<String> output = new ArrayList<>(); - output.add("Offsets: " + horizontalOffset + " " + verticalOffset + " " + depthOffset); - output.add("Sizes: " + horizontalSize + " " + verticalSize + " " + depthSize); + output.add("Offsets: " + horizontalOffset + ' ' + verticalOffset + ' ' + depthOffset); + output.add("Sizes: " + horizontalSize + ' ' + verticalSize + ' ' + depthSize); output.add(""); output.add("ID[]: Name[]"); @@ -572,7 +622,7 @@ public class Util { output.add(""); for (int i = 0; i < array.length; i++) { if (array[i] != null) { - output.add(i + ": " + array[i].getItem().getUnlocalizedName() + " " + array[i].getItemDamage()); + output.add(i + ": " + array[i].getItem().getUnlocalizedName() + ' ' + array[i].getItemDamage()); } } output.add(""); @@ -582,10 +632,10 @@ public class Util { c = -depthOffset; for (int cz = 0; cz < depthSize; cz++) {//front to back b = verticalOffset; - String addMe = "{"; + StringBuilder addMe = new StringBuilder().append('{'); for (int by = 0; by < verticalSize; by++) {//top to bottom a = -horizontalOffset; - String line = ""; + StringBuilder line = new StringBuilder(); for (int az = 0; az < horizontalSize; az++) {//left to right //get x y z from rotation switch (facing) {//translation @@ -629,11 +679,11 @@ public class Util { int meta = world.getBlockMetadata(x, y, z); if (a == 0 && b == 0 && c == 0) { - line += '.'; + line.append('.'); } else if (block.getMaterial() == Material.air) { - line += '-'; + line.append('-'); } else if (block.hasTileEntity(meta)) { - line += '*'; + line.append('*'); } else { ItemStack stack = new ItemStack(block, 1, meta); String str = "?";//OH YEAH NPEs @@ -643,73 +693,81 @@ public class Util { break; } } - line += str; + line.append(str); } a++;//block in horizontal layer } if (ignoreAir) { - String l = ""; + StringBuilder builder = new StringBuilder(); char temp = '@'; - for (char ch : line.toCharArray()) { + for (char ch : line.toString().toCharArray()){ if (ch == '-') { temp += 1; if (temp == '~') { - l += '~'; + builder.append('~'); temp = '@'; } } else { if (temp > '@') { - l += temp; + builder.append(temp); temp = '@'; } - l += ch; + builder.append(ch); } } - while (l.length() > 0 && l.toCharArray()[l.length() - 1] == '~') - l = l.substring(0, l.length() - 1); - if (l.length() == 0) - l = "E,"; - else { - l = "\"" + l + "\","; + while (builder.length()>0 && builder.charAt(builder.length() - 1) == '~') { + builder.deleteCharAt(builder.length() - 1); + } + if (builder.length()==0) { + builder.append("E,"); + } else { + builder.insert(0,'"'); + builder.append('"').append(','); } - addMe += l; + addMe.append(builder); } else { - if (line.length() == 0) - line = "E,"; - else { - line = "\"" + line + "\","; + if (line.length()==0) { + line.append("E,"); + } else { + line.insert(0,'"'); + line.append('"').append(','); } - addMe += line; + addMe.append(line); } b--;//horizontal layer } //region less verbose - addMe=(addMe + "},").replaceAll("(E,)+(?=})",E/*Remove Empty strings at end*/); - Matcher m = matchE_.matcher(addMe); - while (m.find()) { - byte lenEE = (byte)(m.group(1).length()>>1); - addMe=addMe.replaceFirst("E,(E,)+","\"\\\\u00"+String.format("%02X", lenEE-1)+"\","); - //addMe=addMe.replaceFirst("E,(E,)+\"","\"\\\\u00"+String.format("%02X", lenEE)); + addMe.append('}').append(','); + String builtStr=addMe.toString().replaceAll("(E,)+(?=})",E/*Remove Empty strings at end*/); + Matcher matcher = matchE_.matcher(builtStr); + while (matcher.find()) { + byte lenEE = (byte)(matcher.group(1).length()>>1); + builtStr=builtStr.replaceFirst("E,(E,)+","\"\\\\u00"+String.format("%02X", lenEE-1)+"\","); + //builtStr=builtStr.replaceFirst("E,(E,)+\"","\"\\\\u00"+String.format("%02X", lenEE)); } //endregion - output.add(addMe); + output.add(builtStr); c++;//depth } output.add("}"); - return output.toArray(new String[0]); + return output.toArray(new String[output.size()]); } private static final Pattern matchE_ = Pattern.compile("(E,(E,)+)"); public static boolean isInputEqual(boolean aDecreaseStacksizeBySuccess, boolean aDontCheckStackSizes, FluidStack[] requiredFluidInputs, ItemStack[] requiredInputs, FluidStack[] givenFluidInputs, ItemStack... givenInputs) { - if (!GregTech_API.sPostloadFinished) return false; - if (requiredFluidInputs.length > 0 && givenFluidInputs == null) return false; + if (!GregTech_API.sPostloadFinished) { + return false; + } + if (requiredFluidInputs.length > 0 && givenFluidInputs == null) { + return false; + } int amt; - for (FluidStack tFluid : requiredFluidInputs) + for (FluidStack tFluid : requiredFluidInputs) { if (tFluid != null) { boolean temp = true; amt = tFluid.amount; - for (FluidStack aFluid : givenFluidInputs) + for (FluidStack aFluid : givenFluidInputs) { if (aFluid != null && aFluid.isFluidEqual(tFluid)) { if (aDontCheckStackSizes) { temp = false; @@ -721,10 +779,16 @@ public class Util { break; } } - if (temp) return false; + } + if (temp) { + return false; + } } + } - if (requiredInputs.length > 0 && givenInputs == null) return false; + if (requiredInputs.length > 0 && givenInputs == null) { + return false; + } for (ItemStack tStack : requiredInputs) { if (tStack != null) { amt = tStack.stackSize; @@ -742,7 +806,9 @@ public class Util { } } } - if (temp) return false; + if (temp) { + return false; + } } } @@ -798,7 +864,7 @@ public class Util { } public static String getUniqueIdentifier(ItemStack is) { - return GameRegistry.findUniqueIdentifierFor(is.getItem()).modId + ":" + is.getUnlocalizedName(); + return GameRegistry.findUniqueIdentifierFor(is.getItem()).modId + ':' + is.getUnlocalizedName(); } @@ -806,16 +872,16 @@ public class Util { public static final long[] V = new long[]{8L, 32L, 128L, 512L, 2048L, 8192L, 32768L, 131072L, 524288L, 2097152L, 8388608L, 33554432L, 134217728L, 536870912L, 1073741824L, Integer.MAX_VALUE-7}; public static byte getTier(long l) { - byte i = -1; + byte b = -1; do { - ++i; - if (i >= V.length) { - return i; + ++b; + if (b >= V.length) { + return b; } - } while(l > V[i]); + } while(l > V[b]); - return i; + return b; } public static String[] splitButDifferent(String string,String delimiter){ @@ -832,8 +898,9 @@ public class Util { public static String[] infoFromNBT(NBTTagCompound nbt) { String[] strings = new String[nbt.getInteger("i")]; - for (int i = 0; i < strings.length; i++) + for (int i = 0; i < strings.length; i++) { strings[i] = nbt.getString(Integer.toString(i)); + } return strings; } diff --git a/src/main/java/com/github/technus/tectech/Vec3pos.java b/src/main/java/com/github/technus/tectech/Vec3pos.java index 30509d3f02..eb694813da 100644 --- a/src/main/java/com/github/technus/tectech/Vec3pos.java +++ b/src/main/java/com/github/technus/tectech/Vec3pos.java @@ -24,9 +24,13 @@ public class Vec3pos implements Comparable<Vec3pos> { @Override public int compareTo(Vec3pos o) { int tmp=y-o.y; - if (tmp!=0) return tmp; + if (tmp!=0) { + return tmp; + } tmp=x-o.x; - if (tmp!=0) return tmp; + if (tmp!=0) { + return tmp; + } return z-o.z; } diff --git a/src/main/java/com/github/technus/tectech/XSTR.java b/src/main/java/com/github/technus/tectech/XSTR.java index af048bb19b..f5ff457fe1 100644 --- a/src/main/java/com/github/technus/tectech/XSTR.java +++ b/src/main/java/com/github/technus/tectech/XSTR.java @@ -1,23 +1,23 @@ package com.github.technus.tectech; -/** - * A subclass of java.util.random that implements the Xorshift random number - * generator - * <p> - * - it is 30% faster than the generator from Java's library - it produces - * random sequences of higher quality than java.util.Random - this class also - * provides a clone() function - * <p> - * Usage: XSRandom rand = new XSRandom(); //Instantiation x = rand.nextInt(); - * //pull a random number - * <p> - * To use the class in legacy code, you may also instantiate an XSRandom object - * and assign it to a java.util.Random object: java.util.Random rand = new - * XSRandom(); - * <p> - * for an explanation of the algorithm, see - * http://demesos.blogspot.com/2011/09/pseudo-random-number-generators.html - * - * @author Wilfried Elmenreich University of Klagenfurt/Lakeside Labs +/* + A subclass of java.util.random that implements the Xorshift random number + generator + <p> + - it is 30% faster than the generator from Java's library - it produces + random sequences of higher quality than java.util.Random - this class also + provides a clone() function + <p> + Usage: XSRandom rand = new XSRandom(); //Instantiation x = rand.nextInt(); + //pull a random number + <p> + To use the class in legacy code, you may also instantiate an XSRandom object + and assign it to a java.util.Random object: java.util.Random rand = new + XSRandom(); + <p> + for an explanation of the algorithm, see + http://demesos.blogspot.com/2011/09/pseudo-random-number-generators.html + + @author Wilfried Elmenreich University of Klagenfurt/Lakeside Labs * http://www.elmenreich.tk * <p> * This code is released under the GNU Lesser General Public License Version 3 @@ -46,8 +46,9 @@ public class XSTR extends Random { public static final XSTR XSTR_INSTANCE=new XSTR(){ @Override public synchronized void setSeed(long seed) { - if(!Thread.currentThread().getStackTrace()[2].getClassName().equals(Random.class.getName())) + if(!Thread.currentThread().getStackTrace()[2].getClassName().equals(Random.class.getName())) { throw new NoSuchMethodError("This is meant to be shared!, leave seed state alone!"); + } } }; @@ -68,7 +69,7 @@ public class XSTR extends Random { private static long seedUniquifier() { // L'Ecuyer, "Tables of Linear Congruential Generators of // Different Sizes and Good Lattice Structure", 1999 - for (; ; ) { + while (true) { long current = seedUniquifier.get(); long next = current * 181783497276652981L; if (seedUniquifier.compareAndSet(current, next)) { @@ -131,8 +132,8 @@ public class XSTR extends Random { * 30% faster and better quality than the built-in java.util.random see also * see http://www.javamex.com/tutorials/random_numbers/xorshift.shtml * - * @param nbits - * @return + * @param nbits will shift nbits bits + * @return next seed */ @Override public int next(int nbits) { @@ -155,13 +156,13 @@ public class XSTR extends Random { haveNextNextGaussian = false; return nextNextGaussian; } else { - double v1, v2, s; + double v1, v2, vs; do { v1 = 2 * nextDouble() - 1; // between -1 and 1 v2 = 2 * nextDouble() - 1; // between -1 and 1 - s = v1 * v1 + v2 * v2; - } while (s >= 1 || s == 0); - double multiplier = StrictMath.sqrt(-2 * StrictMath.log(s) / s); + vs = v1 * v1 + v2 * v2; + } while (vs >= 1 || vs == 0); + double multiplier = StrictMath.sqrt(-2 * StrictMath.log(vs) / vs); nextNextGaussian = v2 * multiplier; haveNextNextGaussian = true; return v1 * multiplier; @@ -268,10 +269,10 @@ public class XSTR extends Random { @Override public void nextBytes(byte[] bytes_arr) { - for (int iba = 0, lenba = bytes_arr.length; iba < lenba; ) - for (int rndba = nextInt(), - nba = Math.min(lenba - iba, Integer.SIZE / Byte.SIZE); - nba-- > 0; rndba >>= Byte.SIZE) + for (int iba = 0, lenba = bytes_arr.length; iba < lenba; ) { + for (int rndba = nextInt(), nba = Math.min(lenba - iba, Integer.SIZE / Byte.SIZE); nba-- > 0; rndba >>= Byte.SIZE) { bytes_arr[iba++] = (byte) rndba; + } + } } }
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/auxiliary/Reference.java b/src/main/java/com/github/technus/tectech/auxiliary/Reference.java index cc5202636a..828974af05 100644 --- a/src/main/java/com/github/technus/tectech/auxiliary/Reference.java +++ b/src/main/java/com/github/technus/tectech/auxiliary/Reference.java @@ -9,4 +9,6 @@ public final class Reference { public static final String SERVERSIDE = "com.github.technus.tectech.proxy.CommonProxy"; public static final String COFHCORE = "CoFHCore"; public static final String THAUMCRAFT = "Thaumcraft"; + + private Reference() {} } diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index 78eb0746c3..8360d9edf7 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -18,11 +18,9 @@ import net.minecraftforge.fluids.FluidStack; public class DreamCraftRecipeLoader implements Runnable { @Override public void run() { - Object[] o = new Object[0]; - //Quantum Glass GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Containment.get(1, o), + CustomItemList.eM_Containment.get(1), GT_ModHandler.getIC2Item("reinforcedGlass", 1L) }, Materials.Trinium.getMolten(576), new ItemStack(QuantumGlassBlock.INSTANCE, 1), 200, 500000); @@ -35,9 +33,9 @@ public class DreamCraftRecipeLoader implements Runnable { //Data GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - ItemList.Circuit_Parts_GlassFiber.get(8, o), + ItemList.Circuit_Parts_GlassFiber.get(8), GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silver, 8) - }, Materials.Polytetrafluoroethylene.getMolten(144), CustomItemList.DATApipe.get(1, o), 200, 30720, true); + }, Materials.Polytetrafluoroethylene.getMolten(144), CustomItemList.DATApipe.get(1), 200, 30720, true); //endregion @@ -52,42 +50,42 @@ public class DreamCraftRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Cobalt, 16), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Copper, 16), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NiobiumTitanium, 2) - }, Materials.TungstenSteel.getMolten(576), CustomItemList.eM_Power.get(1, o), 100, 30720); + }, Materials.TungstenSteel.getMolten(576), CustomItemList.eM_Power.get(1), 100, 30720); //Computer Casing GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Power.get(1, o), + CustomItemList.eM_Power.get(1), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StainlessSteel, 8), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 1), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NiobiumTitanium, 2) - }, Materials.Aluminium.getMolten(1296), CustomItemList.eM_Computer_Casing.get(1, o), 200, 122880); + }, Materials.Aluminium.getMolten(1296), CustomItemList.eM_Computer_Casing.get(1), 200, 122880); //Computer Vent Casing GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.StainlessSteel, 1), - ItemList.Electric_Motor_IV.get(2, o), + ItemList.Electric_Motor_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.StainlessSteel, 2), GT_OreDictUnificator.get(OrePrefixes.pipeTiny, Materials.StainlessSteel, 16), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Copper, 16), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 1) - }, Materials.SolderingAlloy.getMolten(1296), CustomItemList.eM_Computer_Vent.get(1, o), 100, 1920); + }, Materials.SolderingAlloy.getMolten(1296), CustomItemList.eM_Computer_Vent.get(1), 100, 1920); //Advanced Computer Casing GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Computer_Casing.get(1, o), + CustomItemList.eM_Computer_Casing.get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 1), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Cobalt, 64), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Electrum, 64), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Superconductor, 4) - }, Materials.Iridium.getMolten(1296), CustomItemList.eM_Computer_Bus.get(1, o), 200, 122880, true); + }, Materials.Iridium.getMolten(1296), CustomItemList.eM_Computer_Bus.get(1), 200, 122880, true); //Molecular Casing GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Power.get(1, o), + CustomItemList.eM_Power.get(1), GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Osmiridium, 6), GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Trinium, 12), GT_OreDictUnificator.get(OrePrefixes.screw, Materials.TungstenSteel, 24), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.TungstenSteel, 24), - ItemList.Field_Generator_IV.get(1, o) - }, Materials.Osmium.getMolten(1296), CustomItemList.eM_Containment.get(1, o), 800, 500000); + ItemList.Field_Generator_IV.get(1) + }, Materials.Osmium.getMolten(1296), CustomItemList.eM_Containment.get(1), 800, 500000); //Hollow Casing TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.eM_Containment.get(1), @@ -126,73 +124,73 @@ public class DreamCraftRecipeLoader implements Runnable { //region hatches //Dynamo Hatches UV-UIV - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_UV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, Materials.Silver.getMolten(1000), CustomItemList.eM_dynamomulti4_UV.get(1, o), 100, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_MAX_UV.get(1, o), CustomItemList.eM_dynamomulti4_UV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, Materials.Electrum.getMolten(1000), CustomItemList.eM_dynamomulti16_UV.get(1, o), 200, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UHV_UV.get(1, o), CustomItemList.eM_dynamomulti16_UV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, Materials.Tungsten.getMolten(1000), CustomItemList.eM_dynamomulti64_UV.get(1, o), 400, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, Materials.Silver.getMolten(1000), CustomItemList.eM_dynamomulti4_UV.get(1), 100, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_MAX_UV.get(1), CustomItemList.eM_dynamomulti4_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, Materials.Electrum.getMolten(1000), CustomItemList.eM_dynamomulti16_UV.get(1), 200, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UHV_UV.get(1), CustomItemList.eM_dynamomulti16_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, Materials.Tungsten.getMolten(1000), CustomItemList.eM_dynamomulti64_UV.get(1), 400, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_MAX.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, Materials.Silver.getMolten(2000), CustomItemList.eM_dynamomulti4_UHV.get(1, o), 100, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UEV_UHV.get(1, o), CustomItemList.eM_dynamomulti4_UHV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2000), CustomItemList.eM_dynamomulti16_UHV.get(1, o), 200, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UEV_UHV.get(1, o), CustomItemList.eM_dynamomulti16_UHV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2000), CustomItemList.eM_dynamomulti64_UHV.get(1, o), 400, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, Materials.Silver.getMolten(2000), CustomItemList.eM_dynamomulti4_UHV.get(1), 100, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UEV_UHV.get(1), CustomItemList.eM_dynamomulti4_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2000), CustomItemList.eM_dynamomulti16_UHV.get(1), 200, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UEV_UHV.get(1), CustomItemList.eM_dynamomulti16_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2000), CustomItemList.eM_dynamomulti64_UHV.get(1), 400, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Dynamo_UEV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bedrockium, 2)}, Materials.Silver.getMolten(4000), CustomItemList.eM_dynamomulti4_UEV.get(1, o), 100, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UIV_UEV.get(1, o), CustomItemList.eM_dynamomulti4_UEV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bedrockium, 4)}, Materials.Electrum.getMolten(4000), CustomItemList.eM_dynamomulti16_UEV.get(1, o), 200, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UIV_UEV.get(1, o), CustomItemList.eM_dynamomulti16_UEV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bedrockium, 6)}, Materials.Tungsten.getMolten(4000), CustomItemList.eM_dynamomulti64_UEV.get(1, o), 400, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Dynamo_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bedrockium, 2)}, Materials.Silver.getMolten(4000), CustomItemList.eM_dynamomulti4_UEV.get(1), 100, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UIV_UEV.get(1), CustomItemList.eM_dynamomulti4_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bedrockium, 4)}, Materials.Electrum.getMolten(4000), CustomItemList.eM_dynamomulti16_UEV.get(1), 200, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UIV_UEV.get(1), CustomItemList.eM_dynamomulti16_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bedrockium, 6)}, Materials.Tungsten.getMolten(4000), CustomItemList.eM_dynamomulti64_UEV.get(1), 400, 2000000); - //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Dynamo_UIV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 2)}, Materials.Silver.getMolten(8000), CustomItemList.eM_dynamomulti4_UIV.get(1, o), 100, 8000000); - //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UMV_UIV.get(1, o), CustomItemList.eM_dynamomulti4_UIV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 4)}, Materials.Electrum.getMolten(8000), CustomItemList.eM_dynamomulti16_UIV.get(1, o), 200, 8000000); - //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UMV_UIV.get(1, o), CustomItemList.eM_dynamomulti16_UIV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 6)}, Materials.Tungsten.getMolten(8000), CustomItemList.eM_dynamomulti64_UIV.get(1, o), 400, 8000000); + //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Dynamo_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 2)}, Materials.Silver.getMolten(8000), CustomItemList.eM_dynamomulti4_UIV.get(1), 100, 8000000); + //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UMV_UIV.get(1), CustomItemList.eM_dynamomulti4_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 4)}, Materials.Electrum.getMolten(8000), CustomItemList.eM_dynamomulti16_UIV.get(1), 200, 8000000); + //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UMV_UIV.get(1), CustomItemList.eM_dynamomulti16_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 6)}, Materials.Tungsten.getMolten(8000), CustomItemList.eM_dynamomulti64_UIV.get(1), 400, 8000000); //Energy Hatches UV-UIV - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_UV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, Materials.Silver.getMolten(1000), CustomItemList.eM_energymulti4_UV.get(1, o), 100, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_MAX_UV.get(1, o), CustomItemList.eM_energymulti4_UV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, Materials.Electrum.getMolten(1000), CustomItemList.eM_energymulti16_UV.get(1, o), 200, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UHV_UV.get(1, o), CustomItemList.eM_energymulti16_UV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, Materials.Tungsten.getMolten(1000), CustomItemList.eM_energymulti64_UV.get(1, o), 400, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, Materials.Silver.getMolten(1000), CustomItemList.eM_energymulti4_UV.get(1), 100, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_MAX_UV.get(1), CustomItemList.eM_energymulti4_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, Materials.Electrum.getMolten(1000), CustomItemList.eM_energymulti16_UV.get(1), 200, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UHV_UV.get(1), CustomItemList.eM_energymulti16_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, Materials.Tungsten.getMolten(1000), CustomItemList.eM_energymulti64_UV.get(1), 400, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_MAX.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, Materials.Silver.getMolten(2000), CustomItemList.eM_energymulti4_UHV.get(1, o), 100, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UEV_UHV.get(1, o), CustomItemList.eM_energymulti4_UHV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2000), CustomItemList.eM_energymulti16_UHV.get(1, o), 200, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UEV_UHV.get(1, o), CustomItemList.eM_energymulti16_UHV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2000), CustomItemList.eM_energymulti64_UHV.get(1, o), 400, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, Materials.Silver.getMolten(2000), CustomItemList.eM_energymulti4_UHV.get(1), 100, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UEV_UHV.get(1), CustomItemList.eM_energymulti4_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2000), CustomItemList.eM_energymulti16_UHV.get(1), 200, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UEV_UHV.get(1), CustomItemList.eM_energymulti16_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2000), CustomItemList.eM_energymulti64_UHV.get(1), 400, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Energy_UEV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bedrockium, 2)}, Materials.Silver.getMolten(4000), CustomItemList.eM_energymulti4_UEV.get(1, o), 100, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UIV_UEV.get(1, o), CustomItemList.eM_energymulti4_UEV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bedrockium, 4)}, Materials.Electrum.getMolten(4000), CustomItemList.eM_energymulti16_UEV.get(1, o), 200, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UIV_UEV.get(1, o), CustomItemList.eM_energymulti16_UEV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bedrockium, 6)}, Materials.Tungsten.getMolten(4000), CustomItemList.eM_energymulti64_UEV.get(1, o), 400, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Energy_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bedrockium, 2)}, Materials.Silver.getMolten(4000), CustomItemList.eM_energymulti4_UEV.get(1), 100, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UIV_UEV.get(1), CustomItemList.eM_energymulti4_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bedrockium, 4)}, Materials.Electrum.getMolten(4000), CustomItemList.eM_energymulti16_UEV.get(1), 200, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UIV_UEV.get(1), CustomItemList.eM_energymulti16_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bedrockium, 6)}, Materials.Tungsten.getMolten(4000), CustomItemList.eM_energymulti64_UEV.get(1), 400, 2000000); - //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Energy_UIV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 2)}, Materials.Silver.getMolten(8000), CustomItemList.eM_energymulti4_UIV.get(1, o), 100, 8000000); - //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UMV_UIV.get(1, o), CustomItemList.eM_energymulti4_UIV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 4)}, Materials.Electrum.getMolten(8000), CustomItemList.eM_energymulti16_UIV.get(1, o), 200, 8000000); - //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UMV_UIV.get(1, o), CustomItemList.eM_energymulti16_UIV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 6)}, Materials.Tungsten.getMolten(8000), CustomItemList.eM_energymulti64_UIV.get(1, o), 400, 8000000); + //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Energy_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 2)}, Materials.Silver.getMolten(8000), CustomItemList.eM_energymulti4_UIV.get(1), 100, 8000000); + //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UMV_UIV.get(1), CustomItemList.eM_energymulti4_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 4)}, Materials.Electrum.getMolten(8000), CustomItemList.eM_energymulti16_UIV.get(1), 200, 8000000); + //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UMV_UIV.get(1), CustomItemList.eM_energymulti16_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 6)}, Materials.Tungsten.getMolten(8000), CustomItemList.eM_energymulti64_UIV.get(1), 400, 8000000); //Data Input GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Computer_Casing.get(1, o), - ItemList.Hatch_Input_Bus_LuV.get(1, o), - ItemList.Circuit_Crystalcomputer.get(1, o), - CustomItemList.DATApipe.get(2, o) - }, Materials.Iridium.getMolten(1296), CustomItemList.dataIn_Hatch.get(1, o), 200, 122880, true); + CustomItemList.eM_Computer_Casing.get(1), + ItemList.Hatch_Input_Bus_LuV.get(1), + ItemList.Circuit_Crystalcomputer.get(1), + CustomItemList.DATApipe.get(2) + }, Materials.Iridium.getMolten(1296), CustomItemList.dataIn_Hatch.get(1), 200, 122880, true); //Data Output GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Computer_Casing.get(1, o), - ItemList.Hatch_Output_Bus_LuV.get(1, o), - ItemList.Circuit_Crystalcomputer.get(1, o), - CustomItemList.DATApipe.get(2, o) - }, Materials.Iridium.getMolten(1296), CustomItemList.dataOut_Hatch.get(1, o), 200, 122880, true); + CustomItemList.eM_Computer_Casing.get(1), + ItemList.Hatch_Output_Bus_LuV.get(1), + ItemList.Circuit_Crystalcomputer.get(1), + CustomItemList.DATApipe.get(2) + }, Materials.Iridium.getMolten(1296), CustomItemList.dataOut_Hatch.get(1), 200, 122880, true); //Rack GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Computer_Bus.get(1, o), - ItemList.Hatch_Input_Bus_ZPM.get(1, o), - ItemList.Circuit_Crystalcomputer.get(2, o), - CustomItemList.DATApipe.get(4, o) - }, Materials.Iridium.getMolten(1296), CustomItemList.rack_Hatch.get(1, o), 800, 122880, true); + CustomItemList.eM_Computer_Bus.get(1), + ItemList.Hatch_Input_Bus_ZPM.get(1), + ItemList.Circuit_Crystalcomputer.get(2), + CustomItemList.DATApipe.get(4) + }, Materials.Iridium.getMolten(1296), CustomItemList.rack_Hatch.get(1), 800, 122880, true); //Object Holder GT_Values.RA.addAssemblylineRecipe(ItemList.Hatch_Input_Bus_ZPM.get(1), 10000, new ItemStack[]{ ItemList.Hatch_Input_Bus_ZPM.get(1), - CustomItemList.eM_Computer_Bus.get(1, o), + CustomItemList.eM_Computer_Bus.get(1), ItemList.Emitter_ZPM.get(8), ItemList.Robot_Arm_ZPM.get(1), ItemList.Electric_Motor_ZPM.get(2), ItemList.Circuit_Crystalmainframe.get(1), GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Naquadah, 2), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Naquadah, 16), - CustomItemList.DATApipe.get(2, o), + CustomItemList.DATApipe.get(2), }, new FluidStack[]{ Materials.UUMatter.getFluid(500), Materials.Iridium.getMolten(1000), @@ -201,42 +199,42 @@ public class DreamCraftRecipeLoader implements Runnable { //Parameterizer GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Computer_Casing.get(1, o), - ItemList.Circuit_Masterquantumcomputer.get(1, o), - CustomItemList.DATApipe.get(4, o), - ItemList.Cover_Screen.get(1, o ), + CustomItemList.eM_Computer_Casing.get(1), + ItemList.Circuit_Masterquantumcomputer.get(1), + CustomItemList.DATApipe.get(4), + ItemList.Cover_Screen.get(1 ), new ItemStack(Blocks.stone_button, 16), - }, Materials.Iridium.getMolten(2592), CustomItemList.Parametrizer_Hatch.get(1, o), 800, 122880); + }, Materials.Iridium.getMolten(2592), CustomItemList.Parametrizer_Hatch.get(1), 800, 122880); //Uncertainty GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Computer_Casing.get(1, o), - ItemList.Circuit_Ultimatecrystalcomputer.get(1, o), - CustomItemList.DATApipe.get(16, o), - ItemList.Cover_Screen.get(1, o ), + CustomItemList.eM_Computer_Casing.get(1), + ItemList.Circuit_Ultimatecrystalcomputer.get(1), + CustomItemList.DATApipe.get(16), + ItemList.Cover_Screen.get(1 ), new ItemStack(Blocks.stone_button, 16), - }, Materials.Iridium.getMolten(2592), CustomItemList.Uncertainty_Hatch.get(1, o), 1200, 122880, true); + }, Materials.Iridium.getMolten(2592), CustomItemList.Uncertainty_Hatch.get(1), 1200, 122880, true); //Elemental Input GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Containment.get(1, o), - ItemList.Hatch_Input_UV.get(1, o), + CustomItemList.eM_Containment.get(1), + ItemList.Hatch_Input_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Naquadah, 2), - ItemList.Sensor_UV.get(1, o) - }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_in_UV.get(1, o), 800, 500000, true); + ItemList.Sensor_UV.get(1) + }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_in_UV.get(1), 800, 500000, true); //Elemental Output GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Containment.get(1, o), - ItemList.Hatch_Output_UV.get(1, o), + CustomItemList.eM_Containment.get(1), + ItemList.Hatch_Output_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Naquadah, 2), - ItemList.Emitter_UV.get(1, o) - }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_out_UV.get(1, o), 800, 500000, true); + ItemList.Emitter_UV.get(1) + }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_out_UV.get(1), 800, 500000, true); //Overflow GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Containment.get(1, o), - ItemList.Hatch_Muffler_UV.get(1, o), + CustomItemList.eM_Containment.get(1), + ItemList.Hatch_Muffler_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Naquadah, 1), - ItemList.Field_Generator_UV.get(1, o) - }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_muffler_UV.get(1, o), 800, 500000, true); + ItemList.Field_Generator_UV.get(1) + }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_muffler_UV.get(1), 800, 500000, true); //endregion @@ -245,38 +243,38 @@ public class DreamCraftRecipeLoader implements Runnable { //Microwave Grinder GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - ItemList.Machine_HV_Microwave.get(1,o), + ItemList.Machine_HV_Microwave.get(1), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StainlessSteel, 4), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 4), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 16), - ItemList.Upgrade_Overclocker.get(4, o), - }, Materials.Copper.getMolten(576), CustomItemList.Machine_Multi_Microwave.get(1, o), 800, 480); + ItemList.Upgrade_Overclocker.get(4), + }, Materials.Copper.getMolten(576), CustomItemList.Machine_Multi_Microwave.get(1), 800, 480); //Active Transformer GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - com.dreammaster.gthandler.CustomItemList.WetTransformer_ZPM_LuV.get(1, o), - com.dreammaster.gthandler.CustomItemList.HighEnergyFlowCircuit.get(1, o), + com.dreammaster.gthandler.CustomItemList.WetTransformer_ZPM_LuV.get(1), + com.dreammaster.gthandler.CustomItemList.HighEnergyFlowCircuit.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 16), - ItemList.Circuit_Chip_UHPIC.get(2, o), - }, Materials.TungstenSteel.getMolten(576), CustomItemList.Machine_Multi_Transformer.get(1, o), 400, 30720); + ItemList.Circuit_Chip_UHPIC.get(2), + }, Materials.TungstenSteel.getMolten(576), CustomItemList.Machine_Multi_Transformer.get(1), 400, 30720); //Network Switch GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.Machine_Multi_Transformer.get(1, o), - ItemList.Circuit_Ultimatecrystalcomputer.get(1, o), + CustomItemList.Machine_Multi_Transformer.get(1), + ItemList.Circuit_Ultimatecrystalcomputer.get(1), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Cobalt, 64), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Copper, 64), - CustomItemList.DATApipe.get(4, o), - }, Materials.Iridium.getMolten(1296), CustomItemList.Machine_Multi_Switch.get(1, o), 800, 122880); + CustomItemList.DATApipe.get(4), + }, Materials.Iridium.getMolten(1296), CustomItemList.Machine_Multi_Switch.get(1), 800, 122880); //Quantum Computer GT_Values.RA.addAssemblylineRecipe(ItemList.Tool_DataOrb.get(1), 20000, new ItemStack[]{ CustomItemList.Machine_Multi_Switch.get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 2), ItemList.Tool_DataOrb.get(1), - ItemList.Cover_Screen.get(1, o), + ItemList.Cover_Screen.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Superconductor, 8), - CustomItemList.DATApipe.get(8, o), + CustomItemList.DATApipe.get(8), }, new FluidStack[]{ Materials.UUMatter.getFluid(1000), Materials.Iridium.getMolten(1296), @@ -293,7 +291,7 @@ public class DreamCraftRecipeLoader implements Runnable { ItemList.Electric_Motor_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Naquadah, 4), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Naquadah, 32), - CustomItemList.DATApipe.get(16, o), + CustomItemList.DATApipe.get(16), }, new FluidStack[]{ Materials.UUMatter.getFluid(1000), Materials.Iridium.getMolten(1296), diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/EssentiaCompatEnabled.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/EssentiaCompatEnabled.java index 30e310756d..15efa593eb 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/EssentiaCompatEnabled.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/EssentiaCompatEnabled.java @@ -25,7 +25,7 @@ public class EssentiaCompatEnabled extends EssentiaCompat { @Override public boolean check(GT_MetaTileEntity_MultiblockBase_EM meta) { TileEntity tile =meta.getBaseMetaTileEntity().getTileEntityAtSide(meta.getBaseMetaTileEntity().getBackFacing()); - return tile!=null && tile instanceof TileEssentiaReservoir || tile instanceof TileJarFillable; + return tile instanceof TileEssentiaReservoir || tile instanceof TileJarFillable; } @Override @@ -36,7 +36,9 @@ public class EssentiaCompatEnabled extends EssentiaCompat { @Override public boolean putElementalInstanceStack(TileEntity container,cElementalInstanceStack stack){ - if(container==null || container.isInvalid())return false; + if(container==null || container.isInvalid()) { + return false; + } if(container instanceof IAspectContainer && stack.definition instanceof iElementalAspect){ Aspect aspect=(Aspect) ((iElementalAspect) stack.definition).materializeIntoAspect(); if(aspect!=null){ @@ -49,7 +51,9 @@ public class EssentiaCompatEnabled extends EssentiaCompat { @Override public cElementalInstanceStack getFromContainer(TileEntity container){ - if(container==null || container.isInvalid())return null; + if(container==null || container.isInvalid()) { + return null; + } if(container instanceof IAspectContainer){ AspectList aspects=((IAspectContainer) container).getAspects(); if(aspects!=null){ diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/AspectDefinitionCompatEnabled.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/AspectDefinitionCompatEnabled.java index 6b46d47257..9038e4fe26 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/AspectDefinitionCompatEnabled.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/AspectDefinitionCompatEnabled.java @@ -30,8 +30,8 @@ public final class AspectDefinitionCompatEnabled extends AspectDefinitionCompat AspectDefinitionCompat.aspectToDef.put("perditio",magic_entropy); ArrayList<Aspect> list=Aspect.getCompoundAspects(); - Aspect[] array=list.toArray(new Aspect[0]); - while (list.size()>0) { + Aspect[] array= list.toArray(new Aspect[list.size()]); + while (!list.isEmpty()) { for (Aspect aspect : array) { if (list.contains(aspect)) { Aspect[] content = aspect.getComponents(); diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java index 2afaf0e3f8..e513240dac 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java @@ -55,7 +55,9 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme } private dComplexAspectDefinition(boolean check, cElementalDefinitionStackMap aspects) throws tElementalException { - if (check && !canTheyBeTogether(aspects)) throw new tElementalException("Hadron Definition error"); + if (check && !canTheyBeTogether(aspects)) { + throw new tElementalException("Hadron Definition error"); + } aspectStacks = aspects; float mass=0; for(cElementalDefinitionStack stack:aspects.values()){ @@ -69,8 +71,9 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme private static boolean canTheyBeTogether(cElementalDefinitionStackMap stacks) { long amount = 0; for (cElementalDefinitionStack aspects : stacks.values()) { - if (!(aspects.definition instanceof dComplexAspectDefinition) && !(aspects.definition instanceof ePrimalAspectDefinition)) + if (!(aspects.definition instanceof dComplexAspectDefinition) && !(aspects.definition instanceof ePrimalAspectDefinition)) { return false; + } amount += aspects.amount; } return amount==2; @@ -89,21 +92,21 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme @Override public String getSymbol() { - String symbol = ""; + StringBuilder symbol = new StringBuilder(8); for (cElementalDefinitionStack aspect : aspectStacks.values()) { if (aspect.definition instanceof ePrimalAspectDefinition) { for (int i = 0; i < aspect.amount; i++) { - symbol += aspect.definition.getSymbol(); + symbol.append(aspect.definition.getSymbol()); } } else { - symbol+="("; + symbol.append('('); for (int i = 0; i < aspect.amount; i++) { - symbol += aspect.definition.getSymbol(); + symbol.append(aspect.definition.getSymbol()); } - symbol+=")"; + symbol.append(')'); } } - return symbol; + return symbol.toString(); } @Override @@ -112,19 +115,23 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme nbt.setByte("t", nbtType); cElementalDefinitionStack[] quarkStacksValues = aspectStacks.values(); nbt.setInteger("i", quarkStacksValues.length); - for (int i = 0; i < quarkStacksValues.length; i++) + for (int i = 0; i < quarkStacksValues.length; i++) { nbt.setTag(Integer.toString(i), quarkStacksValues[i].toNBT()); + } return nbt; } public static iElementalDefinition fromNBT(NBTTagCompound nbt) { cElementalDefinitionStack[] stacks = new cElementalDefinitionStack[nbt.getInteger("i")]; - for (int i = 0; i < stacks.length; i++) + for (int i = 0; i < stacks.length; i++) { stacks[i] = cElementalDefinitionStack.fromNBT(nbt.getCompoundTag(Integer.toString(i))); + } try { return new dComplexAspectDefinition(stacks); } catch (tElementalException e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } return null; } } @@ -218,10 +225,13 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme try { cElementalDefinition.addCreatorFromNBT(nbtType, dComplexAspectDefinition.class.getMethod("fromNBT", NBTTagCompound.class),(byte)-96); } catch (Exception e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } + } + if(DEBUG_MODE) { + TecTech.Logger.info("Registered Elemental Matter Class: ComplexAspect " + nbtType + ' ' + -96); } - if(DEBUG_MODE) - TecTech.Logger.info("Registered Elemental Matter Class: ComplexAspect "+nbtType+" "+ -96); } @Override @@ -236,18 +246,22 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme @Override public void addScanResults(ArrayList<String> lines, int capabilities, long energyLevel) { - if(Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) - lines.add("CLASS = "+ nbtType +" "+getClassType()); + if(Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) { + lines.add("CLASS = " + nbtType + ' ' + getClassType()); + } if(Util.areBitsSet(SCAN_GET_NOMENCLATURE|SCAN_GET_CHARGE|SCAN_GET_MASS, capabilities)) { lines.add("NAME = "+getName()); //lines.add("SYMBOL = "+getSymbol()); } - if(Util.areBitsSet(SCAN_GET_CHARGE,capabilities)) - lines.add("CHARGE = "+getCharge()/3f+" e"); - if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) - lines.add(getColor()<0?"COLORLESS":"CARRIES COLOR"); - if(Util.areBitsSet(SCAN_GET_MASS,capabilities)) - lines.add("MASS = "+getMass()+" eV/c\u00b2"); + if(Util.areBitsSet(SCAN_GET_CHARGE,capabilities)) { + lines.add("CHARGE = " + getCharge() / 3f + " e"); + } + if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) { + lines.add(getColor() < 0 ? "COLORLESS" : "CARRIES COLOR"); + } + if(Util.areBitsSet(SCAN_GET_MASS,capabilities)) { + lines.add("MASS = " + getMass() + " eV/c\u00b2"); + } if(Util.areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)){ lines.add("LIFE TIME = "+getRawTimeSpan(energyLevel)+ " s"); lines.add(" "+"At current energy level"); diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java index 19a02fc1aa..ad67367172 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java @@ -85,12 +85,9 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ iGregTechTileEntity.getZCoord()+zDir, TT_Container_Casings.sHintCasingsTT,12); } else{ - if(iGregTechTileEntity.getBlockOffset(xDir,0,zDir).getMaterial() == Material.air) - iGregTechTileEntity.getWorld().setBlock( - iGregTechTileEntity.getXCoord()+xDir, - iGregTechTileEntity.getYCoord()+yDir, - iGregTechTileEntity.getZCoord()+zDir, - TT_Container_Casings.sHintCasingsTT,12,2); + if(iGregTechTileEntity.getBlockOffset(xDir,0,zDir).getMaterial() == Material.air) { + iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2); + } } StructureBuilder(shape, blockType, blockMeta,1, 1, 0, iGregTechTileEntity,hintsOnly); } @@ -111,8 +108,9 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ if(inputHatchContainer.hasStacks()){ cElementalInstanceStack stack = inputHatchContainer.getFirst(); inputHatchContainer.removeAmount(false,new cElementalInstanceStack(stack.definition,1)); - if(!essentiaContainerCompat.putElementalInstanceStack(container,stack)) + if(!essentiaContainerCompat.putElementalInstanceStack(container,stack)) { cleanStackEM_EM(stack); + } mMaxProgresstime = 20; mEfficiencyIncrease = 10000; eAmpereFlow=1; diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java index c2a4d13f78..acc386fb66 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java @@ -85,12 +85,9 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu iGregTechTileEntity.getZCoord()+zDir, TT_Container_Casings.sHintCasingsTT,12); } else{ - if(iGregTechTileEntity.getBlockOffset(xDir,0,zDir).getMaterial() == Material.air) - iGregTechTileEntity.getWorld().setBlock( - iGregTechTileEntity.getXCoord()+xDir, - iGregTechTileEntity.getYCoord()+yDir, - iGregTechTileEntity.getZCoord()+zDir, - TT_Container_Casings.sHintCasingsTT,12,2); + if(iGregTechTileEntity.getBlockOffset(xDir,0,zDir).getMaterial() == Material.air) { + iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2); + } } StructureBuilder(shape, blockType, blockMeta,1, 1, 0, iGregTechTileEntity,hintsOnly); } diff --git a/src/main/java/com/github/technus/tectech/dataFramework/QuantumDataPacket.java b/src/main/java/com/github/technus/tectech/dataFramework/QuantumDataPacket.java index 8f40dfb09d..56733d0b1d 100644 --- a/src/main/java/com/github/technus/tectech/dataFramework/QuantumDataPacket.java +++ b/src/main/java/com/github/technus/tectech/dataFramework/QuantumDataPacket.java @@ -70,7 +70,9 @@ public class QuantumDataPacket { } public long computationIfNotContained(Vec3pos pos) { - if (trace.contains(pos)) return 0; + if (trace.contains(pos)) { + return 0; + } return computation; } } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalDecay.java b/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalDecay.java index 842d0cde5b..609f92b1a1 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalDecay.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalDecay.java @@ -50,11 +50,17 @@ public final class cElementalDecay { public cElementalInstanceStackMap getResults(float lifeMult, long age, long energy, long amountDecaying) { cElementalInstanceStackMap decayResult = new cElementalInstanceStackMap(); - if (outputStacks == null) return decayResult;//This is to prevent null pointer exceptions. + if (outputStacks == null) { + return decayResult;//This is to prevent null pointer exceptions. + } //Deny decay code is in instance! long qtty = 0; - for (cElementalDefinitionStack stack : outputStacks.values()) qtty += stack.amount; - if (qtty <= 0) return decayResult; + for (cElementalDefinitionStack stack : outputStacks.values()) { + qtty += stack.amount; + } + if (qtty <= 0) { + return decayResult; + } //energy /= qtty; //lifeMult /= (float) qtty; for (cElementalDefinitionStack stack : outputStacks.values()) { diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalDefinitionStackMap.java b/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalDefinitionStackMap.java index c4dfb93bab..e6ba0e6be8 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalDefinitionStackMap.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalDefinitionStackMap.java @@ -38,7 +38,7 @@ public final class cElementalDefinitionStackMap/*IMMUTABLE*/ extends cElementalS //IMMUTABLE DON'T NEED IT @Override - public final cElementalDefinitionStackMap clone() { + public cElementalDefinitionStackMap clone() { return this; } @@ -56,8 +56,9 @@ public final class cElementalDefinitionStackMap/*IMMUTABLE*/ extends cElementalS cElementalDefinitionStack[] defStacks = new cElementalDefinitionStack[nbt.getInteger("i")]; for (int i = 0; i < defStacks.length; i++) { defStacks[i] = cElementalDefinitionStack.fromNBT(nbt.getCompoundTag(Integer.toString(i))); - if (defStacks[i].definition.equals(nbtE__)) + if (defStacks[i].definition.equals(nbtE__)) { throw new tElementalException("Something went Wrong"); + } } return new cElementalDefinitionStackMap(defStacks); } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalInstanceStackMap.java b/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalInstanceStackMap.java index f5ac7b7778..fc24a05588 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalInstanceStackMap.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalInstanceStackMap.java @@ -8,8 +8,9 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import java.util.ArrayList; -import java.util.Iterator; +import java.util.Collection; import java.util.Map; +import java.util.Set; import java.util.TreeMap; import static com.github.technus.tectech.elementalMatter.definitions.primitive.cPrimitiveDefinition.nbtE__; @@ -33,8 +34,9 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn map = new TreeMap<>(); if (clone) { cElementalInstanceStack[] stacks=new cElementalInstanceStack[in.length]; - for(int i=0;i<stacks.length;i++) - stacks[i]=in[i].clone(); + for(int i=0;i<stacks.length;i++) { + stacks[i] = in[i].clone(); + } putUnifyAll(stacks); } else { putUnifyAll(in); @@ -50,8 +52,9 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn private cElementalInstanceStackMap(boolean clone, TreeMap<iElementalDefinition, cElementalInstanceStack> in) { if (clone) { map = new TreeMap<>(); - for(cElementalInstanceStack stack:in.values()) + for(cElementalInstanceStack stack:in.values()) { putUnify(stack.clone()); + } } else { map = in; } @@ -66,11 +69,11 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn } @Override - public final cElementalInstanceStackMap clone() { + public cElementalInstanceStackMap clone() { return new cElementalInstanceStackMap(map); } - public final cElementalStackMap toDefinitionMapForComparison() { + public cElementalMutableDefinitionStackMap toDefinitionMapForComparison() { cElementalDefinitionStack[] list = new cElementalDefinitionStack[map.size()]; int i = 0; for (cElementalInstanceStack stack : map.values()) { @@ -79,15 +82,17 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn return new cElementalMutableDefinitionStackMap(list); } - @Deprecated - public final cElementalStackMap toDefinitionMap(boolean mutable) { - TreeMap<iElementalDefinition, cElementalDefinitionStack> newMap = new TreeMap<>(); - for (cElementalInstanceStack stack : map.values()) { - newMap.put(stack.definition, new cElementalDefinitionStack(stack.definition, stack.amount)); - } - if (mutable) return new cElementalMutableDefinitionStackMap(newMap); - return new cElementalDefinitionStackMap(newMap); - } + //@Deprecated + //public cElementalStackMap toDefinitionMap(boolean mutable) { + // TreeMap<iElementalDefinition, cElementalDefinitionStack> newMap = new TreeMap<>(); + // for (cElementalInstanceStack stack : map.values()) { + // newMap.put(stack.definition, new cElementalDefinitionStack(stack.definition, stack.amount)); + // } + // if (mutable) { + // return new cElementalMutableDefinitionStackMap(newMap); + // } + // return new cElementalDefinitionStackMap(newMap); + //} @Deprecated public Map<iElementalDefinition, cElementalInstanceStack> getRawMap() { @@ -109,24 +114,27 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn } public void removeAll(iElementalDefinition... definitions) { - for (iElementalDefinition def : definitions) + for (iElementalDefinition def : definitions) { map.remove(def); + } } @Deprecated private void removeAll(iHasElementalDefinition... hasElementalDefinition) { - for (iHasElementalDefinition has : hasElementalDefinition) + for (iHasElementalDefinition has : hasElementalDefinition) { map.remove(has.getDefinition()); + } } //Remove amounts public boolean removeAmount(boolean testOnly, cElementalInstanceStack instance) { cElementalInstanceStack target = map.get(instance.definition); - if (target == null) + if (target == null) { return false; - if (testOnly) + } + if (testOnly) { return target.amount >= instance.amount; - else { + } else { long diff = target.amount - instance.amount; if (diff > 0) { target.amount = diff; @@ -141,11 +149,12 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn public boolean removeAmount(boolean testOnly, iHasElementalDefinition stack) { cElementalInstanceStack target = map.get(stack.getDefinition()); - if (target == null) + if (target == null) { return false; - if (testOnly) + } + if (testOnly) { return target.amount >= stack.getAmount(); - else { + } else { long diff = target.amount - stack.getAmount(); if (diff > 0) { target.amount = diff; @@ -165,29 +174,38 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn public boolean removeAllAmounts(boolean testOnly, cElementalInstanceStack... instances) { boolean test = true; - for (cElementalInstanceStack stack : instances) + for (cElementalInstanceStack stack : instances) { test &= removeAmount(true, stack); - if (testOnly || !test) return test; - for (cElementalInstanceStack stack : instances) + } + if (testOnly || !test) { + return test; + } + for (cElementalInstanceStack stack : instances) { removeAmount(false, stack); + } return true; } public boolean removeAllAmounts(boolean testOnly, iHasElementalDefinition... stacks) { boolean test = true; - for (iHasElementalDefinition stack : stacks) + for (iHasElementalDefinition stack : stacks) { test &= removeAmount(true, stack); - if (testOnly || !test) return test; - for (iHasElementalDefinition stack : stacks) + } + if (testOnly || !test) { + return test; + } + for (iHasElementalDefinition stack : stacks) { removeAmount(false, stack); + } return true; } @Deprecated public boolean removeAllAmounts(boolean testOnly, iElementalDefinition... definitions) { cElementalDefinitionStack[] stacks = new cElementalDefinitionStack[definitions.length]; - for (int i = 0; i < stacks.length; i++) + for (int i = 0; i < stacks.length; i++) { stacks[i] = new cElementalDefinitionStack(definitions[i], 1); + } return removeAllAmounts(testOnly, stacks); } @@ -196,7 +214,9 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn for (Map.Entry<iElementalDefinition, cElementalDefinitionStack> entry : container.map.entrySet()) { test &= removeAmount(true, entry.getValue()); } - if (testOnly || !test) return test; + if (testOnly || !test) { + return test; + } for (Map.Entry<iElementalDefinition, cElementalDefinitionStack> entry : container.map.entrySet()) { removeAmount(false, entry.getValue()); } @@ -208,7 +228,9 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn for (Map.Entry<iElementalDefinition, cElementalInstanceStack> entry : container.map.entrySet()) { test &= removeAmount(true, entry.getValue()); } - if (testOnly || !test) return test; + if (testOnly || !test) { + return test; + } for (Map.Entry<iElementalDefinition, cElementalInstanceStack> entry : container.map.entrySet()) { test &= removeAmount(false, entry.getValue()); } @@ -227,11 +249,12 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn } } - for (cElementalInstanceStack instance : values()) + for (cElementalInstanceStack instance : values()) { if (instance.amount > stackCapacity) { massRemoved += instance.definition.getMass() * (instance.amount - stackCapacity); instance.amount = stackCapacity; } + } return massRemoved; } @@ -241,8 +264,9 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn } public void putReplaceAll(cElementalInstanceStack... instances) { - for (cElementalInstanceStack instance : instances) + for (cElementalInstanceStack instance : instances) { map.put(instance.definition, instance); + } } private void putReplaceAll(Map<iElementalDefinition, cElementalInstanceStack> inTreeUnsafe) { @@ -256,18 +280,22 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn //Put unify public cElementalInstanceStack putUnify(cElementalInstanceStack instance) { cElementalInstanceStack stack=map.get(instance.definition); - if(stack==null) return map.put(instance.definition,instance); + if(stack==null) { + return map.put(instance.definition, instance); + } return map.put(instance.definition, stack.unifyIntoThis(instance)); } public void putUnifyAll(cElementalInstanceStack... instances) { - for (cElementalInstanceStack instance : instances) + for (cElementalInstanceStack instance : instances) { putUnify(instance); + } } private void putUnifyAll(Map<iElementalDefinition, cElementalInstanceStack> inTreeUnsafe) { - for (cElementalInstanceStack in : inTreeUnsafe.values()) + for (cElementalInstanceStack in : inTreeUnsafe.values()) { putUnify(in); + } } public void putUnifyAll(cElementalInstanceStackMap containerUnsafe) { @@ -288,7 +316,8 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn } public cElementalInstanceStack get(int i){ - return map.values().toArray(new cElementalInstanceStack[0])[i]; + Collection<cElementalInstanceStack> var = map.values(); + return var.toArray(new cElementalInstanceStack[var.size()])[i]; } public String[] getElementalInfo() { @@ -313,11 +342,13 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn } public cElementalInstanceStack[] values() { - return map.values().toArray(new cElementalInstanceStack[0]); + Collection<cElementalInstanceStack> var = map.values(); + return var.toArray(new cElementalInstanceStack[var.size()]); } public iElementalDefinition[] keys() { - return map.keySet().toArray(new iElementalDefinition[0]); + Set<iElementalDefinition> var = map.keySet(); + return var.toArray(new iElementalDefinition[var.size()]); } public float getMass() { @@ -342,7 +373,7 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn } public boolean hasStacks() { - return map.size() > 0; + return !map.isEmpty(); } //Tick Content @@ -370,8 +401,9 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn NBTTagCompound nbt = new NBTTagCompound(); String[] info = getElementalInfo(); nbt.setInteger("i", info.length); - for (int i = 0; i < info.length; i++) + for (int i = 0; i < info.length; i++) { nbt.setString(Integer.toString(i), info[i]); + } return nbt; } @@ -379,8 +411,9 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn NBTTagCompound nbt = new NBTTagCompound(); ArrayList<String> info = getScanInfo(capabilities); nbt.setInteger("i", info.size()); - for (int i = 0; i < info.size(); i++) + for (int i = 0; i < info.size(); i++) { nbt.setString(Integer.toString(i), info.get(i)); + } return nbt; } @@ -388,8 +421,9 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn NBTTagCompound nbt = new NBTTagCompound(); nbt.setInteger("i", map.size()); int i = 0; - for (cElementalInstanceStack instance : map.values()) + for (cElementalInstanceStack instance : map.values()) { nbt.setTag(Integer.toString(i++), instance.toNBT()); + } return nbt; } @@ -397,8 +431,9 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn cElementalInstanceStack[] instances = new cElementalInstanceStack[nbt.getInteger("i")]; for (int i = 0; i < instances.length; i++) { instances[i] = cElementalInstanceStack.fromNBT(nbt.getCompoundTag(Integer.toString(i))); - if (instances[i].definition.equals(nbtE__)) + if (instances[i].definition.equals(nbtE__)) { throw new tElementalException("Something went Wrong"); + } } return new cElementalInstanceStackMap(false, instances); } @@ -413,29 +448,35 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn @Override public int compareTo(cElementalInstanceStackMap o) { int sizeDiff = map.size() - o.map.size(); - if (sizeDiff != 0) return sizeDiff; + if (sizeDiff != 0) { + return sizeDiff; + } cElementalInstanceStack[] ofThis = values(), ofThat = o.values(); for (int i = 0; i < ofThat.length; i++) { int result = ofThis[i].compareTo(ofThat[i]); - if (result != 0) return result; + if (result != 0) { + return result; + } } return 0; } @Override public boolean equals(Object obj) { - if (obj instanceof cElementalInstanceStackMap) + if (obj instanceof cElementalInstanceStackMap) { return compareTo((cElementalInstanceStackMap) obj) == 0; - if (obj instanceof cElementalStackMap) + } + if (obj instanceof cElementalStackMap) { return toDefinitionMapForComparison().compareTo((cElementalStackMap) obj) == 0; + } return false; } @Override public int hashCode() {//Hash only definitions to compare contents not amounts or data int hash = -(map.size() << 4); - for (cElementalInstanceStack s : map.values()) { - hash += s.definition.hashCode(); + for (cElementalInstanceStack stack : map.values()) { + hash += stack.definition.hashCode(); } return hash; } @@ -457,7 +498,9 @@ public final class cElementalInstanceStackMap implements Comparable<cElementalIn public void cleanUp(){ for(Map.Entry<iElementalDefinition, cElementalInstanceStack> entry:map.entrySet()){ - if(entry.getValue().amount<=0) map.remove(entry.getKey()); + if(entry.getValue().amount<=0) { + map.remove(entry.getKey()); + } } } } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalMutableDefinitionStackMap.java b/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalMutableDefinitionStackMap.java index d85d522d3a..9f7e14a154 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalMutableDefinitionStackMap.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalMutableDefinitionStackMap.java @@ -6,7 +6,6 @@ import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstance import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition; import net.minecraft.nbt.NBTTagCompound; -import java.util.Iterator; import java.util.Map; import java.util.TreeMap; @@ -80,24 +79,27 @@ public final class cElementalMutableDefinitionStackMap extends cElementalStackMa } public void removeAll(iElementalDefinition... definitions) { - for (iElementalDefinition def : definitions) + for (iElementalDefinition def : definitions) { map.remove(def); + } } @Deprecated public void removeAll(iHasElementalDefinition... hasElementalDefinition) { - for (iHasElementalDefinition has : hasElementalDefinition) + for (iHasElementalDefinition has : hasElementalDefinition) { map.remove(has.getDefinition()); + } } //Remove amounts public boolean removeAmount(boolean testOnly, cElementalInstanceStack instance) { cElementalDefinitionStack target = map.get(instance.definition); - if (target == null) + if (target == null) { return false; - if (testOnly) + } + if (testOnly) { return target.amount >= instance.amount; - else { + } else { long diff = target.amount - instance.amount; if (diff > 0) { map.put(target.definition, new cElementalDefinitionStack(target.definition, diff)); @@ -112,11 +114,12 @@ public final class cElementalMutableDefinitionStackMap extends cElementalStackMa public boolean removeAmount(boolean testOnly, iHasElementalDefinition stack) { cElementalDefinitionStack target = map.get(stack.getDefinition()); - if (target == null) + if (target == null) { return false; - if (testOnly) + } + if (testOnly) { return target.amount >= stack.getAmount(); - else { + } else { long diff = target.amount - stack.getAmount(); if (diff > 0) { map.put(target.definition, new cElementalDefinitionStack(target.definition, diff)); @@ -136,29 +139,38 @@ public final class cElementalMutableDefinitionStackMap extends cElementalStackMa public boolean removeAllAmounts(boolean testOnly, cElementalInstanceStack... instances) { boolean test = true; - for (cElementalInstanceStack stack : instances) + for (cElementalInstanceStack stack : instances) { test &= removeAmount(true, stack); - if (testOnly || !test) return test; - for (cElementalInstanceStack stack : instances) + } + if (testOnly || !test) { + return test; + } + for (cElementalInstanceStack stack : instances) { removeAmount(false, stack); + } return true; } public boolean removeAllAmounts(boolean testOnly, iHasElementalDefinition... stacks) { boolean test = true; - for (iHasElementalDefinition stack : stacks) + for (iHasElementalDefinition stack : stacks) { test &= removeAmount(true, stack); - if (testOnly || !test) return test; - for (iHasElementalDefinition stack : stacks) + } + if (testOnly || !test) { + return test; + } + for (iHasElementalDefinition stack : stacks) { removeAmount(false, stack); + } return true; } @Deprecated public boolean removeAllAmounts(boolean testOnly, iElementalDefinition... definitions) { cElementalDefinitionStack[] stacks = new cElementalDefinitionStack[definitions.length]; - for (int i = 0; i < stacks.length; i++) + for (int i = 0; i < stacks.length; i++) { stacks[i] = new cElementalDefinitionStack(definitions[i], 1); + } return removeAllAmounts(testOnly, stacks); } @@ -167,7 +179,9 @@ public final class cElementalMutableDefinitionStackMap extends cElementalStackMa for (Map.Entry<iElementalDefinition, cElementalDefinitionStack> entry : container.map.entrySet()) { test &= removeAmount(true, entry.getValue()); } - if (testOnly || !test) return test; + if (testOnly || !test) { + return test; + } for (Map.Entry<iElementalDefinition, cElementalDefinitionStack> entry : container.map.entrySet()) { removeAmount(false, entry.getValue()); } @@ -179,7 +193,9 @@ public final class cElementalMutableDefinitionStackMap extends cElementalStackMa for (Map.Entry<iElementalDefinition, cElementalInstanceStack> entry : container.map.entrySet()) { test &= removeAmount(true, entry.getValue()); } - if (testOnly || !test) return test; + if (testOnly || !test) { + return test; + } for (Map.Entry<iElementalDefinition, cElementalInstanceStack> entry : container.map.entrySet()) { test &= removeAmount(false, entry.getValue()); } @@ -192,8 +208,9 @@ public final class cElementalMutableDefinitionStackMap extends cElementalStackMa } public void putReplaceAll(cElementalDefinitionStack... defStacks) { - for (cElementalDefinitionStack defStack : defStacks) + for (cElementalDefinitionStack defStack : defStacks) { map.put(defStack.definition, defStack); + } } public void putReplaceAll(cElementalStackMap inContainerUnsafe) { @@ -203,7 +220,9 @@ public final class cElementalMutableDefinitionStackMap extends cElementalStackMa //Put unify public cElementalDefinitionStack putUnify(cElementalDefinitionStack def) { cElementalDefinitionStack stack=map.get(def.definition); - if(stack==null) return map.put(def.definition,def); + if(stack==null) { + return map.put(def.definition, def); + } return map.put(def.definition, stack.addAmountIntoNewInstance(def.amount)); } @@ -213,39 +232,46 @@ public final class cElementalMutableDefinitionStackMap extends cElementalStackMa } public void putUnifyAll(cElementalDefinitionStack... defs) { - for (cElementalDefinitionStack def : defs) + for (cElementalDefinitionStack def : defs) { putUnify(def); + } } @Deprecated public void putUnifyAll(iElementalDefinition... defs) { - for (iElementalDefinition def : defs) + for (iElementalDefinition def : defs) { putUnify(def); + } } private void putUnifyAll(Map<iElementalDefinition, cElementalDefinitionStack> inTreeUnsafe) { - for (cElementalDefinitionStack in : inTreeUnsafe.values()) + for (cElementalDefinitionStack in : inTreeUnsafe.values()) { putUnify(in); + } } public void putUnifyAll(cElementalStackMap containerUnsafe) { - for (cElementalDefinitionStack in : containerUnsafe.map.values()) + for (cElementalDefinitionStack in : containerUnsafe.map.values()) { putUnify(in); + } } public static cElementalMutableDefinitionStackMap fromNBT(NBTTagCompound nbt) throws tElementalException { cElementalDefinitionStack[] defStacks = new cElementalDefinitionStack[nbt.getInteger("i")]; for (int i = 0; i < defStacks.length; i++) { defStacks[i] = cElementalDefinitionStack.fromNBT(nbt.getCompoundTag(Integer.toString(i))); - if (defStacks[i].definition.equals(nbtE__)) + if (defStacks[i].definition.equals(nbtE__)) { throw new tElementalException("Something went Wrong"); + } } return new cElementalMutableDefinitionStackMap(defStacks); } public void cleanUp(){ for(Map.Entry<iElementalDefinition, cElementalDefinitionStack> entry:map.entrySet()){ - if(entry.getValue().amount<=0) map.remove(entry.getKey()); + if(entry.getValue().amount<=0) { + map.remove(entry.getKey()); + } } } } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalStackMap.java b/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalStackMap.java index fc2d210946..585e47b767 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalStackMap.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/core/cElementalStackMap.java @@ -5,6 +5,8 @@ import com.github.technus.tectech.elementalMatter.core.templates.iElementalDefin import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; +import java.util.Collection; +import java.util.Set; import java.util.TreeMap; /** @@ -45,11 +47,13 @@ abstract class cElementalStackMap implements Comparable<cElementalStackMap> { } public final cElementalDefinitionStack[] values() { - return map.values().toArray(new cElementalDefinitionStack[0]); + Collection<cElementalDefinitionStack> var = map.values(); + return var.toArray(new cElementalDefinitionStack[var.size()]); } public final iElementalDefinition[] keys() { - return map.keySet().toArray(new iElementalDefinition[0]); + Set<iElementalDefinition> var = map.keySet(); + return var.toArray(new iElementalDefinition[var.size()]); } //Tests @@ -66,7 +70,7 @@ abstract class cElementalStackMap implements Comparable<cElementalStackMap> { } public final boolean hasStacks() { - return map.size() > 0; + return !map.isEmpty(); } //NBT @@ -74,8 +78,9 @@ abstract class cElementalStackMap implements Comparable<cElementalStackMap> { NBTTagCompound nbt = new NBTTagCompound(); String[] info = getElementalInfo(); nbt.setInteger("i", info.length); - for (int i = 0; i < info.length; i++) + for (int i = 0; i < info.length; i++) { nbt.setString(Integer.toString(i), info[i]); + } return nbt; } @@ -83,37 +88,44 @@ abstract class cElementalStackMap implements Comparable<cElementalStackMap> { NBTTagCompound nbt = new NBTTagCompound(); nbt.setInteger("i", map.size()); int i = 0; - for (cElementalDefinitionStack defStack : map.values()) + for (cElementalDefinitionStack defStack : map.values()) { nbt.setTag(Integer.toString(i++), defStack.toNBT()); + } return nbt; } @Override public final int compareTo(cElementalStackMap o) {//this actually compares rest int sizeDiff = map.size() - o.map.size(); - if (sizeDiff != 0) return sizeDiff; + if (sizeDiff != 0) { + return sizeDiff; + } cElementalDefinitionStack[] ofThis = values(), ofO = o.values(); for (int i = 0; i < ofO.length; i++) { int result = ofThis[i].compareTo(ofO[i]); - if (result != 0) return result; + if (result != 0) { + return result; + } } return 0; } @Override public boolean equals(Object obj) { - if (obj instanceof cElementalStackMap) + if (obj instanceof cElementalStackMap) { return compareTo((cElementalStackMap) obj) == 0; - if (obj instanceof cElementalInstanceStackMap) + } + if (obj instanceof cElementalInstanceStackMap) { return compareTo(((cElementalInstanceStackMap) obj).toDefinitionMapForComparison()) == 0; + } return false; } @Override public final int hashCode() {//Hash only definitions to compare contents not amounts or data int hash = -(map.size() << 4); - for (cElementalDefinitionStack s : map.values()) { - hash += s.definition.hashCode(); + for (cElementalDefinitionStack stack : map.values()) { + hash += stack.definition.hashCode(); } return hash; } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/rElementalRecipe.java b/src/main/java/com/github/technus/tectech/elementalMatter/core/rElementalRecipe.java index c193e91e0b..29fea2fa4c 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/rElementalRecipe.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/core/rElementalRecipe.java @@ -35,13 +35,23 @@ public class rElementalRecipe implements Comparable<rElementalRecipe> { @Override public int compareTo(rElementalRecipe o) { int compare = inEM.compareTo(o.inEM); - return compare != 0 ? compare : (int) ID - o.ID; + if(compare!=0) { + return compare; + } + if(ID>o.ID) { + return 1; + } + if(ID<o.ID) { + return -1; + } + return 0; } @Override public boolean equals(Object obj) { - if (obj instanceof rElementalRecipe) + if (obj instanceof rElementalRecipe) { return compareTo((rElementalRecipe) obj) == 0; + } return false; } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/rElementalRecipeMap.java b/src/main/java/com/github/technus/tectech/elementalMatter/core/rElementalRecipeMap.java index 41aff17327..9a8ad52252 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/rElementalRecipeMap.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/core/rElementalRecipeMap.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.elementalMatter.core; import java.util.HashMap; +import java.util.Map; /** * Created by Tec on 02.03.2017. @@ -24,8 +25,9 @@ public class rElementalRecipeMap {//TODO FIX } public void putAll(rElementalRecipe... contents) { - for (rElementalRecipe recipe : contents) + for (rElementalRecipe recipe : contents) { put(recipe); + } } public rElementalRecipe remove(cElementalStackMap map, short id) { @@ -51,16 +53,20 @@ public class rElementalRecipeMap {//TODO FIX //Return a recipeShortMap when the content of input matches the recipe input - does not ignore amounts but ignores instance data! @Deprecated public HashMap<Short, rElementalRecipe> findMatch(cElementalMutableDefinitionStackMap in, boolean testOnlyTruePreferred) { - for (cElementalDefinitionStackMap requirement : recipes.keySet()) - if (in.removeAllAmounts(testOnlyTruePreferred, requirement)) - return recipes.get(requirement); + for (Map.Entry<cElementalDefinitionStackMap, HashMap<Short, rElementalRecipe>> cElementalDefinitionStackMapHashMapEntry : recipes.entrySet()) { + if (in.removeAllAmounts(testOnlyTruePreferred, cElementalDefinitionStackMapHashMapEntry.getKey())) { + return cElementalDefinitionStackMapHashMapEntry.getValue(); + } + } return null; } public HashMap<Short, rElementalRecipe> findMatch(cElementalInstanceStackMap in, boolean testOnly) { - for (cElementalDefinitionStackMap requirement : recipes.keySet()) - if (in.removeAllAmounts(testOnly, requirement)) - return recipes.get(requirement); + for (Map.Entry<cElementalDefinitionStackMap, HashMap<Short, rElementalRecipe>> cElementalDefinitionStackMapHashMapEntry : recipes.entrySet()) { + if (in.removeAllAmounts(testOnly, cElementalDefinitionStackMapHashMapEntry.getKey())) { + return cElementalDefinitionStackMapHashMapEntry.getValue(); + } + } return null; } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalDefinitionStack.java b/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalDefinitionStack.java index bd35a31192..4e74650786 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalDefinitionStack.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalDefinitionStack.java @@ -19,7 +19,7 @@ public final class cElementalDefinitionStack implements iHasElementalDefinition } @Override - public final cElementalDefinitionStack clone() { + public cElementalDefinitionStack clone() { return this;//IMMUTABLE } @@ -57,16 +57,21 @@ public final class cElementalDefinitionStack implements iHasElementalDefinition } public cElementalDefinitionStack addAmountIntoNewInstance(long amount) { - if(amount==0) return this; + if(amount==0) { + return this; + } return new cElementalDefinitionStack(definition, amount + this.amount); } public cElementalDefinitionStack addAmountIntoNewInstance(cElementalDefinitionStack... other) { - if (other == null || other.length == 0) return this; - long i = 0; - for (cElementalDefinitionStack stack : other) - i += stack.amount; - return addAmountIntoNewInstance(i); + if (other == null || other.length == 0) { + return this; + } + long l = 0; + for (cElementalDefinitionStack stack : other) { + l += stack.amount; + } + return addAmountIntoNewInstance(l); } @Override @@ -76,10 +81,12 @@ public final class cElementalDefinitionStack implements iHasElementalDefinition @Override public boolean equals(Object obj) { - if (obj instanceof iElementalDefinition) + if (obj instanceof iElementalDefinition) { return definition.compareTo((iElementalDefinition) obj) == 0; - if (obj instanceof iHasElementalDefinition) + } + if (obj instanceof iHasElementalDefinition) { return definition.compareTo(((iHasElementalDefinition) obj).getDefinition()) == 0; + } return false; } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalInstanceStack.java b/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalInstanceStack.java index bd401094be..4193153d57 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalInstanceStack.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalInstanceStack.java @@ -42,9 +42,9 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { public cElementalInstanceStack(iElementalDefinition defSafe, long amount, float lifeTimeMult, long age, long energy) { definition = defSafe == null ? null__ : defSafe; - byte color = definition.getColor(); - if (color < 0 || color > 2) {//transforms colorable??? into proper color - this.color = color; + byte bColor = definition.getColor(); + if (bColor < 0 || bColor > 2) {//transforms colorable??? into proper color + this.color = bColor; } else { this.color = (byte) TecTech.Rnd.nextInt(3); } @@ -67,7 +67,7 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { } @Override - public final cElementalInstanceStack clone() { + public cElementalInstanceStack clone() { return new cElementalInstanceStack(this); } @@ -119,12 +119,16 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { } public byte setColor(byte color) {//does not allow changing magic element - if (this.color < 0 || this.color > 2 || color < 0 || color >= 3) return this.color; + if (this.color < 0 || this.color > 2 || color < 0 || color >= 3) { + return this.color; + } return this.color = color; } public byte nextColor() {//does not allow changing magic element - if (color < 0 || color > 2) return color; + if (color < 0 || color > 2) { + return color; + } return color = (byte) TecTech.Rnd.nextInt(3); } @@ -134,9 +138,13 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { public float setLifeTimeMultipleOfBaseValue(float mult) { if(mult<=0) //since infinity*0=nan + { throw new IllegalArgumentException("mult must be >0"); + } lifeTimeMult = mult; - if (definition.getRawTimeSpan(energy) <= 0) return lifeTime; + if (definition.getRawTimeSpan(energy) <= 0) { + return lifeTime; + } lifeTime = definition.getRawTimeSpan(energy) * lifeTimeMult; return lifeTime; } @@ -155,8 +163,11 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { public cElementalInstanceStackMap decay(float lifeTimeMult, long apparentAge, long postEnergize) { long newEnergyLevel=postEnergize+ energy; - if(newEnergyLevel>0) newEnergyLevel-=1; - else if(newEnergyLevel<0) newEnergyLevel+=1; + if(newEnergyLevel>0) { + newEnergyLevel -= 1; + } else if(newEnergyLevel<0) { + newEnergyLevel += 1; + } if (energy > 0 && !definition.usesSpecialEnergeticDecayHandling()) { setLifeTimeMultipleOfBaseValue(getLifeTimeMult()); return decayCompute(definition.getEnergyInducedDecay(energy), lifeTimeMult, -1, newEnergyLevel); @@ -179,8 +190,11 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { double decayInverseRatio=Math.pow(2d,1d/* 1 second *//(double)lifeTime); double newAmount=(double)amount/decayInverseRatio; long amountRemaining= (long)Math.floor(newAmount) +(TecTech.Rnd.nextDouble()<=newAmount-Math.floor(newAmount)?1:0); - if(amountRemaining==amount) return null;//nothing decayed - else if(amountRemaining<=0) return decayCompute(decays,lifeTimeMult,newProductsAge,energy); + if(amountRemaining==amount) { + return null;//nothing decayed + } else if(amountRemaining<=0) { + return decayCompute(decays, lifeTimeMult, newProductsAge, energy); + } //split to non decaying and decaying part long amount=this.amount; this.amount-=amountRemaining; @@ -193,22 +207,23 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { //Use to get direct decay output providing correct decay array public cElementalInstanceStackMap decayCompute(cElementalDecay[] decays, float lifeTimeMult, long newProductsAge, long energy) { - if (decays == null) return null;//Can not decay so it wont - else if (decays.length == 0) + if (decays == null) { + return null;//Can not decay so it wont + } else if (decays.length == 0) { return new cElementalInstanceStackMap();//provide non null 0 length array for annihilation - else if (decays.length == 1) {//only one type of decay :D, doesn't need dead end + } else if (decays.length == 1) {//only one type of decay :D, doesn't need dead end cElementalInstanceStackMap products=decays[0].getResults(lifeTimeMult, newProductsAge, energy, amount); if(newProductsAge<0){ - for(cElementalInstanceStack s:products.values()){ - if(s.definition.equals(definition)){ - s.age= age; - s.energy=this.energy; + for(cElementalInstanceStack stack:products.values()){ + if(stack.definition.equals(definition)){ + stack.age= age; + stack.energy=this.energy; } } }else{ - for(cElementalInstanceStack s:products.values()){ - if(s.definition.equals(definition)){ - s.energy=this.energy; + for(cElementalInstanceStack stack:products.values()){ + if(stack.definition.equals(definition)){ + stack.energy=this.energy; } } } @@ -262,21 +277,22 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { } for (int i = 0; i < differentDecays; i++) { - if (qttyOfDecay[i] > 0) + if (qttyOfDecay[i] > 0) { output.putUnifyAll(decays[i].getResults(lifeTimeMult, newProductsAge, energy, qttyOfDecay[i])); + } } if(newProductsAge<0){ - for(cElementalInstanceStack s:output.values()){ - if(s.definition.equals(definition)){ - s.age= age; - s.energy=this.energy; + for(cElementalInstanceStack stack:output.values()){ + if(stack.definition.equals(definition)){ + stack.age= age; + stack.energy=this.energy; } } }else{ - for(cElementalInstanceStack s:output.values()){ - if(s.definition.equals(definition)){ - s.energy=this.energy; + for(cElementalInstanceStack stack:output.values()){ + if(stack.definition.equals(definition)){ + stack.energy=this.energy; } } } @@ -285,7 +301,9 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { } public cElementalInstanceStack unifyIntoThis(cElementalInstanceStack... instances) { - if (instances == null) return this; + if (instances == null) { + return this; + } //returns with the definition from the first object passed long energy = this.energy * amount; float lifeTimeMul = lifeTimeMult; @@ -299,7 +317,9 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { } } - if (amount != 0) energy /= Math.abs(amount); + if (amount != 0) { + energy /= Math.abs(amount); + } this.energy = energy; setLifeTimeMultipleOfBaseValue(lifeTimeMul); @@ -308,22 +328,28 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { public void addScanResults(ArrayList<String> lines, int[] detailsOnDepthLevels){ int capabilities=detailsOnDepthLevels[0]; - if(Util.areBitsSet(SCAN_GET_DEPTH_LEVEL,capabilities)) - lines.add("DEPTH = "+0); + if(Util.areBitsSet(SCAN_GET_DEPTH_LEVEL,capabilities)) { + lines.add("DEPTH = " + 0); + } definition.addScanResults(lines,capabilities,energy); if(Util.areBitsSet(SCAN_GET_TIMESPAN_MULT,capabilities)) { lines.add("TIME SPAN MULTIPLIER = " + lifeTimeMult); - if(Util.areBitsSet(SCAN_GET_TIMESPAN_INFO,capabilities)) - lines.add("TIME SPAN MULTIPLIED = "+lifeTime+" s"); + if(Util.areBitsSet(SCAN_GET_TIMESPAN_INFO,capabilities)) { + lines.add("TIME SPAN MULTIPLIED = " + lifeTime + " s"); + } + } + if(Util.areBitsSet(SCAN_GET_AGE,capabilities)) { + lines.add("AGE = " + age + " s"); + } + if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) { + lines.add("COLOR = " + color + " RGB or CMY"); + } + if(Util.areBitsSet(SCAN_GET_ENERGY_LEVEL,capabilities)) { + lines.add("E. LEVEL = " + energy); + } + if(Util.areBitsSet(SCAN_GET_AMOUNT,capabilities)) { + lines.add("AMOUNT = " + amount); } - if(Util.areBitsSet(SCAN_GET_AGE,capabilities)) - lines.add("AGE = " + age+" s"); - if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) - lines.add("COLOR = "+color+" RGB or CMY"); - if(Util.areBitsSet(SCAN_GET_ENERGY_LEVEL,capabilities)) - lines.add("E. LEVEL = "+energy); - if(Util.areBitsSet(SCAN_GET_AMOUNT,capabilities)) - lines.add("AMOUNT = "+amount); scanContents(lines,definition.getSubParticles(),1,detailsOnDepthLevels); } @@ -332,11 +358,13 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { int deeper=depth+1; for(cElementalDefinitionStack definitionStack:definitions.values()) { lines.add("");//def separator - if(Util.areBitsSet(SCAN_GET_DEPTH_LEVEL,detailsOnDepthLevels[depth])) + if(Util.areBitsSet(SCAN_GET_DEPTH_LEVEL,detailsOnDepthLevels[depth])) { lines.add("DEPTH = " + depth); + } definition.addScanResults(lines,detailsOnDepthLevels[depth],energy); - if(Util.areBitsSet(SCAN_GET_AMOUNT,detailsOnDepthLevels[depth])) - lines.add("AMOUNT = "+definitionStack.amount); + if(Util.areBitsSet(SCAN_GET_AMOUNT,detailsOnDepthLevels[depth])) { + lines.add("AMOUNT = " + definitionStack.amount); + } scanContents(lines,definitionStack.definition.getSubParticles(),deeper,detailsOnDepthLevels); } } @@ -372,10 +400,12 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { @Override public boolean equals(Object obj) { - if (obj instanceof iElementalDefinition) + if (obj instanceof iElementalDefinition) { return definition.compareTo((iElementalDefinition) obj) == 0; - if (obj instanceof iHasElementalDefinition) + } + if (obj instanceof iHasElementalDefinition) { return definition.compareTo(((iHasElementalDefinition) obj).getDefinition()) == 0; + } return false; } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalDefinition.java index fedc90da99..ac53948dbb 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalDefinition.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalDefinition.java @@ -2,6 +2,7 @@ package com.github.technus.tectech.elementalMatter.core.templates; import com.github.technus.tectech.elementalMatter.core.stacks.iHasElementalDefinition; import com.github.technus.tectech.elementalMatter.core.stacks.cElementalDefinitionStack; +import com.sun.istack.internal.NotNull; import net.minecraft.nbt.NBTTagCompound; import java.lang.reflect.Method; @@ -24,8 +25,12 @@ public abstract class cElementalDefinition extends iElementalDefinition { private static final HashSet<Byte> classSet = new HashSet<>(); protected static void addCreatorFromNBT(byte shortcutNBT, Method constructorFromNBT,byte classID) { - if(nbtCreationBind.put(shortcutNBT, constructorFromNBT)!=null) throw new Error("Duplicate NBT shortcut! "+shortcutNBT); - if(!classSet.add(classID)) throw new Error("Duplicate Class ID! "+classID); + if(nbtCreationBind.put(shortcutNBT, constructorFromNBT)!=null) { + throw new Error("Duplicate NBT shortcut! " + shortcutNBT); + } + if(!classSet.add(classID)) { + throw new Error("Duplicate Class ID! " + classID); + } } @Override @@ -37,7 +42,9 @@ public abstract class cElementalDefinition extends iElementalDefinition { try { return (iElementalDefinition) nbtCreationBind.get(nbt.getByte("t")).invoke(null, nbt); } catch (Exception e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } return nbtE__; } } @@ -45,7 +52,9 @@ public abstract class cElementalDefinition extends iElementalDefinition { @Override public int compareTo(iElementalDefinition o) { int classCompare = compareClassID(o); - if (classCompare != 0) return classCompare; + if (classCompare != 0) { + return classCompare; + } //only of the internal def stacks!!! //that allows neat check if the same thing and @@ -56,20 +65,33 @@ public abstract class cElementalDefinition extends iElementalDefinition { //use only for nested operations! private static int compareInnerContentsWithAmounts(cElementalDefinitionStack[] tc, cElementalDefinitionStack[] sc) { if (tc == null) { - if (sc == null) return 0; - else return -1; + if (sc == null) { + return 0; + } else { + return -1; + } + } + if (sc == null) { + return 1; } - if (sc == null) return 1; int lenDiff = tc.length - sc.length; - if (lenDiff != 0) return lenDiff; + if (lenDiff != 0) { + return lenDiff; + } for (int i = 0; i < tc.length; i++) { int cn = tc[i].definition.compareTo(sc[i].definition); - if (cn != 0) return cn; - - if (tc[i].amount > sc[i].amount) return 1; - if (tc[i].amount < sc[i].amount) return -1; + if (cn != 0) { + return cn; + } + + if (tc[i].amount > sc[i].amount) { + return 1; + } + if (tc[i].amount < sc[i].amount) { + return -1; + } } return 0; } @@ -81,19 +103,23 @@ public abstract class cElementalDefinition extends iElementalDefinition { @Override public final boolean equals(Object obj) { - if(this==obj)return true; - if (obj instanceof iElementalDefinition) + if(this==obj) { + return true; + } + if (obj instanceof iElementalDefinition) { return compareTo((iElementalDefinition) obj) == 0; - if (obj instanceof iHasElementalDefinition) + } + if (obj instanceof iHasElementalDefinition) { return compareTo(((iHasElementalDefinition) obj).getDefinition()) == 0; + } return false; } @Override public int hashCode() {//Internal amounts should be also hashed int hash = -(getSubParticles().size() << 4); - for (cElementalDefinitionStack s : getSubParticles().values()) { - hash += ((s.amount & 0x1) == 0 ? -s.amount : s.amount) + s.definition.hashCode(); + for (cElementalDefinitionStack stack : getSubParticles().values()) { + hash += ((stack.amount & 0x1) == 0 ? -stack.amount : stack.amount) + stack.definition.hashCode(); } return hash; } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalPrimitive.java b/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalPrimitive.java index 7e6e5ed3ac..b6a877a024 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalPrimitive.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalPrimitive.java @@ -60,8 +60,9 @@ public abstract class cElementalPrimitive extends cElementalDefinition { this.charge = (byte) charge; this.color = (byte) color; this.ID = ID; - if (bindsBO.put(ID, this) != null) + if (bindsBO.put(ID, this) != null) { Minecraft.getMinecraft().crashed(new CrashReport("Primitive definition", new tElementalException("Duplicate ID"))); + } } // @@ -105,13 +106,17 @@ public abstract class cElementalPrimitive extends cElementalDefinition { @Override public cElementalDecay[] getNaturalDecayInstant() { - if (naturalDecayInstant < 0) return elementalDecays; + if (naturalDecayInstant < 0) { + return elementalDecays; + } return new cElementalDecay[]{elementalDecays[naturalDecayInstant]}; } @Override public cElementalDecay[] getEnergyInducedDecay(long energyLevel) { - if (energeticDecayInstant < 0) return elementalDecays; + if (energeticDecayInstant < 0) { + return elementalDecays; + } return new cElementalDecay[]{elementalDecays[energeticDecayInstant]}; } @@ -180,18 +185,22 @@ public abstract class cElementalPrimitive extends cElementalDefinition { @Override public void addScanResults(ArrayList<String> lines, int capabilities, long energyLevel) { - if(Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) - lines.add("CLASS = "+ nbtType +" "+getClassType()); + if(Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) { + lines.add("CLASS = " + nbtType + ' ' + getClassType()); + } if(Util.areBitsSet(SCAN_GET_NOMENCLATURE|SCAN_GET_CHARGE|SCAN_GET_MASS|SCAN_GET_TIMESPAN_INFO, capabilities)) { lines.add("NAME = "+getName()); lines.add("SYMBOL = "+getSymbol()); } - if(Util.areBitsSet(SCAN_GET_CHARGE,capabilities)) - lines.add("CHARGE = "+getCharge()/3f+" e"); - if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) - lines.add(getColor()<0?"COLORLESS":"CARRIES COLOR"); - if(Util.areBitsSet(SCAN_GET_MASS,capabilities)) - lines.add("MASS = "+getMass()+" eV/c\u00b2"); + if(Util.areBitsSet(SCAN_GET_CHARGE,capabilities)) { + lines.add("CHARGE = " + getCharge() / 3f + " e"); + } + if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) { + lines.add(getColor() < 0 ? "COLORLESS" : "CARRIES COLOR"); + } + if(Util.areBitsSet(SCAN_GET_MASS,capabilities)) { + lines.add("MASS = " + getMass() + " eV/c\u00b2"); + } if(Util.areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)){ lines.add((isTimeSpanHalfLife()?"HALF LIFE = ":"LIFE TIME = ")+getRawTimeSpan(energyLevel)+ " s"); lines.add(" "+"At current energy level"); @@ -202,18 +211,25 @@ public abstract class cElementalPrimitive extends cElementalDefinition { try { cElementalDefinition.addCreatorFromNBT(nbtType, cElementalPrimitive.class.getMethod("fromNBT", NBTTagCompound.class),(byte)-128); } catch (Exception e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } + } + if(DEBUG_MODE) { + TecTech.Logger.info("Registered Elemental Matter Class: Primitive " + nbtType + ' ' + -128); } - if(DEBUG_MODE) - TecTech.Logger.info("Registered Elemental Matter Class: Primitive "+nbtType+" "+ -128); } @Override public final int compareTo(iElementalDefinition o) { if (getClassType() == o.getClassType()) { int oID = ((cElementalPrimitive) o).ID; - if (ID > oID) return 1; - if (ID < oID) return -1; + if (ID > oID) { + return 1; + } + if (ID < oID) { + return -1; + } return 0; } return compareClassID(o); diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/aItemQuantizationInfo.java b/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/aItemQuantizationInfo.java index ebb75f8d16..cc240e1246 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/aItemQuantizationInfo.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/aItemQuantizationInfo.java @@ -40,23 +40,29 @@ public class aItemQuantizationInfo implements iExchangeInfo { @Override public int hashCode() { - return (GameRegistry.findUniqueIdentifierFor(in.getItem())+":"+in.getUnlocalizedName()+":"+in.getItemDamage()).hashCode(); + return (GameRegistry.findUniqueIdentifierFor(in.getItem())+":"+in.getUnlocalizedName()+ ':' +in.getItemDamage()).hashCode(); } @Override public boolean equals(Object obj) { if(obj instanceof aItemQuantizationInfo){ //alias - ItemStack b=((aItemQuantizationInfo) obj).in; - if(!in.getUnlocalizedName().equals(((aItemQuantizationInfo) obj).in.getUnlocalizedName())) return false; + ItemStack stack=((aItemQuantizationInfo) obj).in; + if(!in.getUnlocalizedName().equals(((aItemQuantizationInfo) obj).in.getUnlocalizedName())) { + return false; + } if(!GameRegistry.findUniqueIdentifierFor(in.getItem()).equals( - GameRegistry.findUniqueIdentifierFor(((aItemQuantizationInfo) obj).in.getItem()))) return false; + GameRegistry.findUniqueIdentifierFor(((aItemQuantizationInfo) obj).in.getItem()))) { + return false; + } - if(in.getItemDamage() != OreDictionary.WILDCARD_VALUE && b.getItemDamage() != OreDictionary.WILDCARD_VALUE) { - if (in.getItemDamage() != b.getItemDamage()) return false; + if(in.getItemDamage() != OreDictionary.WILDCARD_VALUE && stack.getItemDamage() != OreDictionary.WILDCARD_VALUE) { + if (in.getItemDamage() != stack.getItemDamage()) { + return false; + } } - return skipNBT || ItemStack.areItemStackTagsEqual(in, b); + return skipNBT || ItemStack.areItemStackTagsEqual(in, stack); } return false; } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/bTransformationInfo.java b/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/bTransformationInfo.java index 6867319543..0584a7566c 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/bTransformationInfo.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/core/transformations/bTransformationInfo.java @@ -31,9 +31,15 @@ public class bTransformationInfo { } public bTransformationInfo(int fluidCap,int itemCap, int oreCap){ - if(fluidCap>0)fluidDequantization=new HashMap<>(fluidCap); - if(itemCap>0)itemDequantization=new HashMap<>(itemCap); - if(oreCap>0)oredictDequantization=new HashMap<>(oreCap); + if(fluidCap>0) { + fluidDequantization = new HashMap<>(fluidCap); + } + if(itemCap>0) { + itemDequantization = new HashMap<>(itemCap); + } + if(oreCap>0) { + oredictDequantization = new HashMap<>(oreCap); + } } public void addFluid(iHasElementalDefinition em, FluidStack fluidStack){ diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/atom/dAtomDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/atom/dAtomDefinition.java index 8262069433..179d9016e0 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/atom/dAtomDefinition.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/atom/dAtomDefinition.java @@ -104,7 +104,9 @@ public final class dAtomDefinition extends cElementalDefinition { } private dAtomDefinition(boolean check, cElementalDefinitionStackMap things) throws tElementalException { - if (check && !canTheyBeTogether(things)) throw new tElementalException("Atom Definition error"); + if (check && !canTheyBeTogether(things)) { + throw new tElementalException("Atom Definition error"); + } elementalStacks = things; float mass = 0; @@ -117,16 +119,22 @@ public final class dAtomDefinition extends cElementalDefinition { iElementalDefinition def = stack.definition; int amount = (int)stack.amount; mass += stack.getMass(); - if (def.getType() < 0) containsAnti = true; + if (def.getType() < 0) { + containsAnti = true; + } type = Math.max(type, Math.abs(def.getType())); if (def instanceof eLeptonDefinition) { cLeptons += stack.getCharge(); } else { cNucleus += stack.getCharge(); - if (def.getCharge() == 3) element += amount; - else if (def.getCharge() == -3) element -= amount; - else if (def.getCharge() == 0) neutralCount += amount; + if (def.getCharge() == 3) { + element += amount; + } else if (def.getCharge() == -3) { + element -= amount; + } else if (def.getCharge() == 0) { + neutralCount += amount; + } } } this.type = containsAnti ? (byte) -type : (byte) type; @@ -146,15 +154,18 @@ public final class dAtomDefinition extends cElementalDefinition { xstr.setSeed((element + 1L) * (neutralCount + 100L)); iaea =iaeaNuclide.get(element,neutralCount); if(iaea!=null){ - if(Float.isNaN(iaea.mass)) this.mass=mass; - else this.mass=iaea.mass; + if(Float.isNaN(iaea.mass)) { + this.mass = mass; + } else { + this.mass = iaea.mass; + } if(Float.isNaN(iaea.halfTime)) { Float overriddenLifeTime= lifetimeOverrides.get(this); float rawLifeTimeTemp; - if(overriddenLifeTime!=null) + if(overriddenLifeTime!=null) { rawLifeTimeTemp = overriddenLifeTime; - else { + } else { rawLifeTimeTemp = calculateLifeTime(izoDiff, izoDiffAbs, element, neutralCount, containsAnti); } rawLifeTime =rawLifeTimeTemp> iElementalDefinition.STABLE_RAW_LIFE_TIME ? iElementalDefinition.STABLE_RAW_LIFE_TIME :rawLifeTimeTemp; @@ -167,9 +178,9 @@ public final class dAtomDefinition extends cElementalDefinition { Float overriddenLifeTime= lifetimeOverrides.get(this); float rawLifeTimeTemp; - if(overriddenLifeTime!=null) + if(overriddenLifeTime!=null) { rawLifeTimeTemp = overriddenLifeTime; - else { + } else { rawLifeTimeTemp = calculateLifeTime(izoDiff, izoDiffAbs, element, neutralCount, containsAnti); } rawLifeTime =rawLifeTimeTemp> iElementalDefinition.STABLE_RAW_LIFE_TIME ? iElementalDefinition.STABLE_RAW_LIFE_TIME :rawLifeTimeTemp; @@ -178,8 +189,11 @@ public final class dAtomDefinition extends cElementalDefinition { } if(iaea==null || iaea.energeticStatesArray[0].energy!=0) { - if (izoDiff == 0) decayMode = 0; - else decayMode = izoDiff > 0 ? (byte) Math.min(2, 1 + izoDiffAbs / 4) : (byte) -Math.min(2, 1 + izoDiffAbs / 4); + if (izoDiff == 0) { + decayMode = 0; + } else { + decayMode = izoDiff > 0 ? (byte) Math.min(2, 1 + izoDiffAbs / 4) : (byte) -Math.min(2, 1 + izoDiffAbs / 4); + } }else{ decayMode = izoDiff > 0 ? (byte) (Math.min(2, 1 + izoDiffAbs / 4)+ BYTE_OFFSET) : (byte) (-Math.min(2, 1 + izoDiffAbs / 4) + BYTE_OFFSET); } @@ -228,15 +242,27 @@ public final class dAtomDefinition extends cElementalDefinition { unstabilityEXP = Math.min(element / 2.4f, 6 + ((element + 1) % 2) * 3e6F / elementPow4) + (float) -izoDiff * elementPow4 / 1e8F - Math.abs(izoDiff - 1 + element / 60F) * (3f - element / 12.5f + element * element / 1500f); } else if (element < 180) { unstabilityEXP = Math.min((element - 85) * 2, 16 + ((isotope + 1) % 2) * 2.5F - (element - 85) / 3F) - Math.abs(izoDiff) * (3f - element / 13f + element * element / 1600f); - } else return -1; - if ((isotope == 127 || isotope == 128) && element < 120 && element > 83) unstabilityEXP -= 1.8f; - if (element > 83 && element < 93 && isotope % 2 == 0 && izoDiff == 3) unstabilityEXP += 6; - if (element > 93 && element < 103 && isotope % 2 == 0 && izoDiff == 4) unstabilityEXP += 6; + } else { + return -1; + } + if ((isotope == 127 || isotope == 128) && element < 120 && element > 83) { + unstabilityEXP -= 1.8f; + } + if (element > 83 && element < 93 && isotope % 2 == 0 && izoDiff == 3) { + unstabilityEXP += 6; + } + if (element > 93 && element < 103 && isotope % 2 == 0 && izoDiff == 4) { + unstabilityEXP += 6; + } rawLifeTime = (containsAnti ? 1e-8f : 1f) * (float) Math.pow(10F, unstabilityEXP) * (1f + xstr.nextFloat() * 9f); } - if (rawLifeTime < 8e-15) return 1e-35f; - if (rawLifeTime > 8e28) return 8e30f; + if (rawLifeTime < 8e-15) { + return 1e-35f; + } + if (rawLifeTime > 8e28) { + return 8e30f; + } return rawLifeTime; } @@ -245,9 +271,13 @@ public final class dAtomDefinition extends cElementalDefinition { long qty=0; for (cElementalDefinitionStack stack : stacks.values()) { if (stack.definition instanceof dHadronDefinition) { - if (((dHadronDefinition) stack.definition).amount != 3) return false; + if (((dHadronDefinition) stack.definition).amount != 3) { + return false; + } nuclei = true; - } else if (!(stack.definition instanceof eLeptonDefinition)) return false; + } else if (!(stack.definition instanceof eLeptonDefinition)) { + return false; + } qty+=stack.amount; } return nuclei && qty<ATOM_COMPLEXITY_LIMIT; @@ -282,7 +312,9 @@ public final class dAtomDefinition extends cElementalDefinition { @Override public float getRawTimeSpan(long currentEnergy) { - if(currentEnergy<=0) return rawLifeTime; + if(currentEnergy<=0) { + return rawLifeTime; + } if(iaeaDefinitionExistsAndHasEnergyLevels){ if(currentEnergy>=iaea.energeticStatesArray.length){ return iaea.energeticStatesArray[iaea.energeticStatesArray.length-1].Thalf/(currentEnergy-iaea.energeticStatesArray.length+1); @@ -307,10 +339,14 @@ public final class dAtomDefinition extends cElementalDefinition { int element = Math.abs(this.element); boolean negative = element < 0; try { - if (type != 1) return (negative ? "~? " : "? ") + nomenclature.Name[element]; - return negative ? "~" + nomenclature.Name[-element] : nomenclature.Name[element]; + if (type != 1) { + return (negative ? "~? " : "? ") + nomenclature.Name[element]; + } + return negative ? '~' + nomenclature.Name[-element] : nomenclature.Name[element]; } catch (Exception e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } return (negative ? "Element: ~" : "Element: ") + element; } } @@ -322,12 +358,16 @@ public final class dAtomDefinition extends cElementalDefinition { try { return (negative ? "~" : "") + nomenclature.Symbol[element] + " N:" + neutralCount + " I:" + (neutralCount+element) + " C: " + getCharge(); } catch (Exception e) { - if (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 (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } return (negative ? "~" : "") + "? N:" + neutralCount + " I:" + (neutralCount+element) + " C: " + getCharge(); } } @@ -348,54 +388,66 @@ public final class dAtomDefinition extends cElementalDefinition { if (type == 1) { switch (decayMode) { case -2: - if(TecTech.Rnd.nextBoolean() && ElectronCapture(decaysList)) + if(TecTech.Rnd.nextBoolean() && ElectronCapture(decaysList)) { return decaysList.toArray(new cElementalDecay[decaysList.size()]); - else if(PbetaDecay(decaysList)) + } else if(PbetaDecay(decaysList)) { return decaysList.toArray(new cElementalDecay[decaysList.size()]); + } break; case -1: - if(Emmision(decaysList, dHadronDefinition.hadron_p1)) + if(Emmision(decaysList, dHadronDefinition.hadron_p1)) { return decaysList.toArray(new cElementalDecay[decaysList.size()]); + } break; case 0: - if(alphaDecay(decaysList)) + if(alphaDecay(decaysList)) { return decaysList.toArray(new cElementalDecay[decaysList.size()]); + } break; case 1: - if(Emmision(decaysList, dHadronDefinition.hadron_n1)) + if(Emmision(decaysList, dHadronDefinition.hadron_n1)) { return decaysList.toArray(new cElementalDecay[decaysList.size()]); + } break; case 2: - if(MbetaDecay(decaysList)) + if(MbetaDecay(decaysList)) { return decaysList.toArray(new cElementalDecay[decaysList.size()]); + } break; default: if(decayMode>8){ - if(iaeaDecay(decaysList,0)) + if(iaeaDecay(decaysList,0)) { return decaysList.toArray(new cElementalDecay[decaysList.size()]); + } return getDecayArray(decaysList,decayMode- BYTE_OFFSET,false); } } return cElementalDecay.noDecay; }else if(type ==-1){ dAtomDefinition anti=getAnti(); - if(anti!=null) return anti.getDecayArray(decaysList,decayMode,false); + if(anti!=null) { + return anti.getDecayArray(decaysList, decayMode, false); + } } return getNaturalDecayInstant(); } private boolean iaeaDecay(ArrayList<cElementalDecay> decaysList,long energy){ iaeaNuclide.energeticState state; - if(energy>iaea.energeticStatesArray.length) state = iaea.energeticStatesArray[iaea.energeticStatesArray.length-1]; - else if(energy<=0) state = iaea.energeticStatesArray[0]; - else state=iaea.energeticStatesArray[(int)energy]; + if(energy>iaea.energeticStatesArray.length) { + state = iaea.energeticStatesArray[iaea.energeticStatesArray.length - 1]; + } else if(energy<=0) { + state = iaea.energeticStatesArray[0]; + } else { + state = iaea.energeticStatesArray[(int) energy]; + } for (int i=0;i<state.decaymodes.length;i++){ if(!getDecayFromIaea(decaysList,state.decaymodes[i],energy)) { decaysList.clear(); return false; } } - return decaysList.size()>0; + return !decaysList.isEmpty(); } private boolean getDecayFromIaea(ArrayList<cElementalDecay> decaysList, iaeaNuclide.iaeaDecay decay, long energy){ @@ -437,7 +489,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -449,7 +503,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -461,7 +517,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -473,7 +531,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -487,7 +547,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -501,7 +563,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -515,7 +579,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -529,7 +595,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -542,7 +610,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -555,7 +625,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -569,7 +641,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -583,7 +657,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -598,7 +674,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -613,7 +691,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -627,7 +707,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -642,7 +724,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -657,7 +741,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -671,7 +757,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -684,7 +772,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -698,7 +788,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -712,7 +804,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -726,7 +820,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -738,7 +834,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -750,7 +848,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -762,7 +862,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -774,21 +876,30 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; - case "SF": - if(Fission(decaysList,withThis,newStuff,decay.chance,false)) return true; + case "SF": { + if (Fission(decaysList, withThis, newStuff, decay.chance, false)) { + return true; + } + } break; case "B-F": { if (withThis.removeAllAmounts(false, dHadronDefinition.hadron_n1)){ withThis.putUnify(dHadronDefinition.hadron_p1); newStuff.putReplace(eLeptonDefinition.lepton_e1); newStuff.putReplace(eNeutrinoDefinition.lepton_Ve_1); try{ - if(Fission(decaysList,withThis,newStuff,decay.chance,false)) return true; + if(Fission(decaysList,withThis,newStuff,decay.chance,false)) { + return true; + } }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -797,9 +908,13 @@ public final class dAtomDefinition extends cElementalDefinition { withThis.putUnify(dHadronDefinition.hadron_n1); newStuff.putReplace(eNeutrinoDefinition.lepton_Ve1); try{ - if(Fission(decaysList,withThis,newStuff,decay.chance,false)) return true; + if(Fission(decaysList,withThis,newStuff,decay.chance,false)) { + return true; + } }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -809,9 +924,13 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eLeptonDefinition.lepton_e_1); newStuff.putReplace(eNeutrinoDefinition.lepton_Ve2); try{ - if(Fission(decaysList,withThis,newStuff,decay.chance,false)) return true; + if(Fission(decaysList,withThis,newStuff,decay.chance,false)) { + return true; + } }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -821,9 +940,13 @@ public final class dAtomDefinition extends cElementalDefinition { newStuff.putReplace(eNeutrinoDefinition.lepton_Ve1); newStuff.putReplace(eNeutrinoDefinition.lepton_Ve_1); try{ - if(Fission(decaysList,withThis,newStuff,decay.chance,false)) return true; + if(Fission(decaysList,withThis,newStuff,decay.chance,false)) { + return true; + } }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; @@ -832,7 +955,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance, this, boson_Y__)); return true; }else{ - if(DEBUG_MODE) TecTech.Logger.info("Tried to emit Gamma from ground state"); + if(DEBUG_MODE) { + TecTech.Logger.info("Tried to emit Gamma from ground state"); + } decaysList.add(new cElementalDecay(decay.chance, this)); return true; } @@ -848,16 +973,20 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(decay.chance,newStuff.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; }catch (Exception e){ - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } } } break; case "DEAD_END": decaysList.add(deadEnd); return true; - default: throw new Error("Unsupported decay mode: " + decay.decayName + " "+ neutralCount+" "+element); + default: throw new Error("Unsupported decay mode: " + decay.decayName + ' ' + neutralCount+ ' ' +element); + } + if(DEBUG_MODE) { + TecTech.Logger.info("Failed to decay " + element + ' ' + neutralCount + ' ' + decay.decayName); } - if(DEBUG_MODE) TecTech.Logger.info("Failed to decay "+element+" "+neutralCount+" "+decay.decayName); return false; } @@ -868,7 +997,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay((float) 1, new cElementalDefinitionStack(new dAtomDefinition(tree.toImmutable_unsafeMightLeaveExposedElementalTree()), 1), emit)); return true; } catch (Exception e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } } } return false; @@ -881,7 +1012,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay((float) 1, new cElementalDefinitionStack(new dAtomDefinition(tree.toImmutable_unsafeMightLeaveExposedElementalTree()), 1), alpha)); return true; } catch (Exception e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } } } return false; @@ -895,7 +1028,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay((float) 1, new cElementalDefinitionStack(new dAtomDefinition(tree.toImmutable_unsafeMightLeaveExposedElementalTree()), 1), eLeptonDefinition.lepton_e1, eNeutrinoDefinition.lepton_Ve_1)); return true; } catch (Exception e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } } } return false; @@ -909,7 +1044,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay((float) 1, new cElementalDefinitionStack(new dAtomDefinition(tree.toImmutable_unsafeMightLeaveExposedElementalTree()), 1), eLeptonDefinition.lepton_e_1, eNeutrinoDefinition.lepton_Ve1)); return true; } catch (Exception e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } } } return false; @@ -923,7 +1060,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay((float) 1, new cElementalDefinitionStack(new dAtomDefinition(tree.toImmutable_unsafeMightLeaveExposedElementalTree()), 1), eNeutrinoDefinition.lepton_Ve1)); return true; } catch (Exception e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } } } return false; @@ -935,8 +1074,9 @@ public final class dAtomDefinition extends cElementalDefinition { for(cElementalDefinitionStack stack: fissile.values()){ if(spontaneousCheck && stack.definition instanceof dHadronDefinition && - (stack.amount<=80 || stack.amount<90 && XSTR_INSTANCE.nextInt(10)<stack.amount-80)) + (stack.amount<=80 || stack.amount<90 && XSTR_INSTANCE.nextInt(10)<stack.amount-80)) { return false; + } if(stack.definition.getCharge()==0){ //if(stack.definition instanceof dHadronDefinition){ double neutrals=stack.amount*liquidDrop[2]; @@ -945,8 +1085,9 @@ public final class dAtomDefinition extends cElementalDefinition { particles.putUnify(new cElementalDefinitionStack(stack.definition, neutrals_cnt)); int heavy_cnt=(int)Math.ceil(stack.amount*liquidDrop[1]); - while(heavy_cnt+neutrals_cnt>stack.amount) + while(heavy_cnt+neutrals_cnt>stack.amount) { heavy_cnt--; + } fissile.removeAmount(false,new cElementalDefinitionStack(stack.definition,heavy_cnt+neutrals_cnt)); heavy.putReplace(new cElementalDefinitionStack(stack.definition, heavy_cnt)); //}else{ @@ -955,8 +1096,9 @@ public final class dAtomDefinition extends cElementalDefinition { //} }else{ int heavy_cnt=(int)Math.ceil(stack.amount*liquidDrop[0]); - if(heavy_cnt%2==1 && XSTR_INSTANCE.nextFloat()>0.05f) + if(heavy_cnt%2==1 && XSTR_INSTANCE.nextFloat()>0.05f) { heavy_cnt--; + } cElementalDefinitionStack new_stack=new cElementalDefinitionStack(stack.definition, heavy_cnt); fissile.removeAmount(false,new_stack); heavy.putReplace(new_stack); @@ -969,7 +1111,9 @@ public final class dAtomDefinition extends cElementalDefinition { decaysList.add(new cElementalDecay(probability, particles.toImmutable_unsafeMightLeaveExposedElementalTree())); return true; } catch (Exception e) { - if(DEBUG_MODE) e.printStackTrace(); + if(DEBUG_MODE) { + e.printStackTrace(); + } } return false; } @@ -979,28 +1123,34 @@ public final class dAtomDefinition extends cElementalDefinition { out[0] = XSTR_INSTANCE.nextGaussian(); - if (out[0] < 1 && out[0] >= -1) - if (XSTR_INSTANCE.nextBoolean()) + if (out[0] < 1 && out[0] >= -1) { + if (XSTR_INSTANCE.nextBoolean()) { out[0] = XSTR_INSTANCE.nextDouble() * 2d - 1d; + } + } - if (asymmetric && out[0] > XSTR_INSTANCE.nextDouble() && XSTR_INSTANCE.nextInt(4) == 0) + if (asymmetric && out[0] > XSTR_INSTANCE.nextDouble() && XSTR_INSTANCE.nextInt(4) == 0) { out[0] = -out[0]; + } //scale to splitting ratio out[0] = out[0] * 0.05d + .6d; - if (out[0] < 0 || out[0] > 1) + if (out[0] < 0 || out[0] > 1) { return liquidDropFunction(asymmetric); - if (out[0] < .5d) + } + if (out[0] < .5d) { out[0] = 1d - out[0]; + } //extra neutrals out[2] = 0.012d + XSTR_INSTANCE.nextDouble() * 0.01d; - if (asymmetric) + if (asymmetric) { out[1] = out[0]; - else + } else { out[1] = out[0] - out[2] * .5d; + } return out; } @@ -1031,14 +1181,24 @@ public final class dAtomDefinition extends cElementalDefinition { } if(currentEnergyLevel<=0){ - if(newEnergyLevel<=0) return iElementalDefinition.DEFAULT_ENERGY_REQUIREMENT *(newEnergyLevel-currentEnergyLevel); - else result+= iElementalDefinition.DEFAULT_ENERGY_REQUIREMENT * -currentEnergyLevel; - }else result-=iaea.energeticStatesArray[(int)Math.min(iaea.energeticStatesArray.length-1,currentEnergyLevel)].energy; + if(newEnergyLevel<=0) { + return iElementalDefinition.DEFAULT_ENERGY_REQUIREMENT * (newEnergyLevel - currentEnergyLevel); + } else { + result += iElementalDefinition.DEFAULT_ENERGY_REQUIREMENT * -currentEnergyLevel; + } + }else { + result -= iaea.energeticStatesArray[(int) Math.min(iaea.energeticStatesArray.length - 1, currentEnergyLevel)].energy; + } if(newEnergyLevel>=iaea.energeticStatesArray.length){ - if(currentEnergyLevel>=iaea.energeticStatesArray.length) return iElementalDefinition.DEFAULT_ENERGY_REQUIREMENT *(newEnergyLevel-currentEnergyLevel); - else result+= iElementalDefinition.DEFAULT_ENERGY_REQUIREMENT *(newEnergyLevel-iaea.energeticStatesArray.length+1); + if(currentEnergyLevel>=iaea.energeticStatesArray.length) { + return iElementalDefinition.DEFAULT_ENERGY_REQUIREMENT * (newEnergyLevel - currentEnergyLevel); + } else { + result += iElementalDefinition.DEFAULT_ENERGY_REQUIREMENT * (newEnergyLevel - iaea.energeticStatesArray.length + 1); + } result+=iaea.energeticStatesArray[iaea.energeticStatesArray.length-1].energy; - }else result+=iaea.energeticStatesArray[(int)Math.max(0,newEnergyLevel)].energy; + }else { + result += iaea.energeticStatesArray[(int) Math.max(0, newEnergyLevel)].energy; + } return backwards?-result:result; } @@ -1084,12 +1244,15 @@ public final class dAtomDefinition extends cElementalDefinition { @Override public dAtomDefinition getAnti() { cElementalMutableDefinitionStackMap anti = new cElementalMutableDefinitionStackMap(); - for (cElementalDefinitionStack stack : elementalStacks.values()) + for (cElementalDefinitionStack stack : elementalStacks.values()) { anti.putReplace(new cElementalDefinitionStack(stack.definition.getAnti(), stack.amount)); + } try { return new dAtomDefinition(anti.toImmutable_unsafeMightLeaveExposedElementalTree()); } catch (tElementalException e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } return null; } } @@ -1110,7 +1273,6 @@ public final class dAtomDefinition extends cElementalDefinition { } private static final class nomenclature { - private nomenclature(){} private static final String[] Symbol = new String[]{"Nt", "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne", "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca", "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn", "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr", "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn", "Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr", "Nd", "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb", "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hg", "Tl", "Pb", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th", "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm", "Md", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt", "Ds", "Rg", "Cn", "Nh", "Fl", "Mc", "Lv", "Ts", "Og"}; private static final String[] Name = new String[]{"Neutronium", "Hydrogen", "Helium", "Lithium", "Beryllium", "Boron", "Carbon", "Nitrogen", "Oxygen", "Fluorine", "Neon", "Sodium", "Magnesium", "Aluminium", "Silicon", "Phosphorus", "Sulfur", "Chlorine", "Argon", "Potassium", "Calcium", "Scandium", "Titanium", "Vanadium", "Chromium", "Manganese", "Iron", "Cobalt", "Nickel", "Copper", "Zinc", "Gallium", "Germanium", "Arsenic", "Selenium", "Bromine", "Krypton", "Rubidium", "Strontium", "Yttrium", "Zirconium", "Niobium", "Molybdenum", "Technetium", "Ruthenium", "Rhodium", "Palladium", "Silver", "Cadmium", "Indium", "Tin", "Antimony", "Tellurium", "Iodine", "Xenon", "Caesium", "Barium", "Lanthanum", "Cerium", "Praseodymium", "Neodymium", "Promethium", "Samarium", "Europium", "Gadolinium", "Terbium", "Dysprosium", "Holmium", "Erbium", "Thulium", "Ytterbium", "Lutetium", "Hafnium", "Tantalum", "Tungsten", "Rhenium", "Osmium", "Iridium", "Platinum", "Gold", "Mercury", "Thallium", "Lead", "Bismuth", "Polonium", "Astatine", "Radon", "Francium", "Radium", "Actinium", "Thorium", "Protactinium", "Uranium", "Neptunium", "Plutonium", "Americium", "Curium", "Berkelium", "Californium", "Einsteinium", "Fermium", "Mendelevium", "Nobelium", "Lawrencium", "Rutherfordium", "Dubnium", "Seaborgium", "Bohrium", "Hassium", "Meitnerium", "Darmstadtium", "Roentgenium", "Copernicium", "Nihonium", "Flerovium", "Moscovium", "Livermorium", "Tennessine", "Oganesson"}; private static final String[] SymbolIUPAC = new String[]{"n", "u", "b", "t", "q", "p", "h", "s", "o", "e", "N", "U", "B", "T", "Q", "P", "H", "S", "O", "E"}; @@ -1122,25 +1284,31 @@ public final class dAtomDefinition extends cElementalDefinition { nbt.setByte("t", nbtType); cElementalDefinitionStack[] elementalStacksValues = elementalStacks.values(); nbt.setInteger("i", elementalStacksValues.length); - for (int i = 0; i < elementalStacksValues.length; i++) + for (int i = 0; i < elementalStacksValues.length; i++) { nbt.setTag(Integer.toString(i), elementalStacksValues[i].toNBT()); + } return nbt; } public static iElementalDefinition fromNBT(NBTTagCompound nbt) { cElementalDefinitionStack[] stacks = new cElementalDefinitionStack[nbt.getInteger("i")]; - for (int i = 0; i < stacks.length; i++) + for (int i = 0; i < stacks.length; i++) { stacks[i] = cElementalDefinitionStack.fromNBT(nbt.getCompoundTag(Integer.toString(i))); + } try { return new dAtomDefinition(stacks); } catch (tElementalException e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } return null; } } public static void run() { - for (Runnable r : overrides) r.run(); + for (Runnable r : overrides) { + r.run(); + } for(Map.Entry<dAtomDefinition,Float> entry:lifetimeOverrides.entrySet()){ try { @@ -1152,6 +1320,7 @@ public final class dAtomDefinition extends cElementalDefinition { //populate stable isotopes for (int element = 1; element < 83; element++)//Up to Bismuth exclusive + { for (int isotope = 0; isotope < 130; isotope++) { xstr.setSeed((long) (element + 1) * (isotope + 100)); //stability curve @@ -1159,16 +1328,19 @@ public final class dAtomDefinition extends cElementalDefinition { int izoDiff = isotope - StableIsotope; int izoDiffAbs = Math.abs(izoDiff); float rawLifeTime = calculateLifeTime(izoDiff, izoDiffAbs, element, isotope, false); - iaeaNuclide nuclide=iaeaNuclide.get(element,isotope); - if (rawLifeTime>= STABLE_RAW_LIFE_TIME || nuclide!=null && nuclide.halfTime >=STABLE_RAW_LIFE_TIME) { + iaeaNuclide nuclide = iaeaNuclide.get(element, isotope); + if (rawLifeTime >= STABLE_RAW_LIFE_TIME || nuclide != null && nuclide.halfTime >= STABLE_RAW_LIFE_TIME) { TreeSet<Integer> isotopes = stableIsotopes.get(element); - if (isotopes == null) stableIsotopes.put(element, isotopes = new TreeSet<>()); + if (isotopes == null) { + stableIsotopes.put(element, isotopes = new TreeSet<>()); + } isotopes.add(isotope); } } + } //populate unstable isotopes - for (int element = 83; element < 150; element++) + for (int element = 83; element < 150; element++) { for (int isotope = 100; isotope < 180; isotope++) { xstr.setSeed((long) (element + 1) * (isotope + 100)); //stability curve @@ -1177,26 +1349,31 @@ public final class dAtomDefinition extends cElementalDefinition { int izoDiffAbs = Math.abs(izoDiff); float rawLifeTime = calculateLifeTime(izoDiff, izoDiffAbs, element, isotope, false); TreeMap<Float, Integer> isotopes = mostStableUnstableIsotopes.get(element); - if (isotopes == null) mostStableUnstableIsotopes.put(element, isotopes = new TreeMap<>()); + if (isotopes == null) { + mostStableUnstableIsotopes.put(element, isotopes = new TreeMap<>()); + } isotopes.put(rawLifeTime, isotope); } + } try { - for (int key : stableIsotopes.keySet()) { - stableAtoms.put(key, new dAtomDefinition( - new cElementalDefinitionStack(dHadronDefinition.hadron_p, key), - new cElementalDefinitionStack(dHadronDefinition.hadron_n, stableIsotopes.get(key).first()), - new cElementalDefinitionStack(eLeptonDefinition.lepton_e, key))); - if (DEBUG_MODE) - TecTech.Logger.info("Added Stable Atom:" + key + " " + stableIsotopes.get(key).first() + " " + stableAtoms.get(key).getMass()); + for (Map.Entry<Integer, TreeSet<Integer>> integerTreeSetEntry : stableIsotopes.entrySet()) { + stableAtoms.put(integerTreeSetEntry.getKey(), new dAtomDefinition( + new cElementalDefinitionStack(dHadronDefinition.hadron_p, integerTreeSetEntry.getKey()), + new cElementalDefinitionStack(dHadronDefinition.hadron_n, integerTreeSetEntry.getValue().first()), + new cElementalDefinitionStack(eLeptonDefinition.lepton_e, integerTreeSetEntry.getKey()))); + if (DEBUG_MODE) { + TecTech.Logger.info("Added Stable Atom:" + integerTreeSetEntry.getKey() + ' ' + integerTreeSetEntry.getValue().first() + ' ' + stableAtoms.get(integerTreeSetEntry.getKey()).getMass()); + } } - for (int key : mostStableUnstableIsotopes.keySet()) { - unstableAtoms.put(key, new dAtomDefinition( - new cElementalDefinitionStack(dHadronDefinition.hadron_p, key), - new cElementalDefinitionStack(dHadronDefinition.hadron_n, mostStableUnstableIsotopes.get(key).lastEntry().getValue()), - new cElementalDefinitionStack(eLeptonDefinition.lepton_e, key))); - if (DEBUG_MODE) - TecTech.Logger.info("Added Unstable Atom:" + key + " " + mostStableUnstableIsotopes.get(key).lastEntry().getValue() + " " + unstableAtoms.get(key).getMass()); + for (Map.Entry<Integer, TreeMap<Float, Integer>> integerTreeMapEntry : mostStableUnstableIsotopes.entrySet()) { + unstableAtoms.put(integerTreeMapEntry.getKey(), new dAtomDefinition( + new cElementalDefinitionStack(dHadronDefinition.hadron_p, integerTreeMapEntry.getKey()), + new cElementalDefinitionStack(dHadronDefinition.hadron_n, integerTreeMapEntry.getValue().lastEntry().getValue()), + new cElementalDefinitionStack(eLeptonDefinition.lepton_e, integerTreeMapEntry.getKey()))); + if (DEBUG_MODE) { + TecTech.Logger.info("Added Unstable Atom:" + integerTreeMapEntry.getKey() + ' ' + integerTreeMapEntry.getValue().lastEntry().getValue() + ' ' + unstableAtoms.get(integerTreeMapEntry.getKey()).getMass()); + } } deuterium=new dAtomDefinition( dHadronDefinition.hadron_p1, @@ -1230,16 +1407,21 @@ public final class dAtomDefinition extends cElementalDefinition { new cElementalDefinitionStack(dHadronDefinition.hadron_n, 20), new cElementalDefinitionStack(eLeptonDefinition.lepton_e, 14)).getStackForm(1); } catch (Exception e) { - if (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 (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } + } + if(DEBUG_MODE) { + TecTech.Logger.info("Registered Elemental Matter Class: Atom " + nbtType + ' ' + 64); } - if(DEBUG_MODE) - TecTech.Logger.info("Registered Elemental Matter Class: Atom "+nbtType+" "+64); } public static void setTransformation(){ @@ -1382,10 +1564,14 @@ public final class dAtomDefinition extends cElementalDefinition { ); transformation.addOredict(new cElementalDefinitionStack(temp, 144), dust, Materials.Plutonium241,1); } catch (tElementalException e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } } - if(Loader.isModLoaded("miscutils")) new GtppAtomLoader().run(); + if(Loader.isModLoaded("miscutils")) { + new GtppAtomLoader().run(); + } } public static dAtomDefinition getFirstStableIsotope(int element) { @@ -1408,18 +1594,22 @@ public final class dAtomDefinition extends cElementalDefinition { @Override public void addScanResults(ArrayList<String> lines, int capabilities, long energyLevel) { - if(Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) - lines.add("CLASS = "+ nbtType +" "+getClassType()); + if(Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) { + lines.add("CLASS = " + nbtType + ' ' + getClassType()); + } if(Util.areBitsSet(SCAN_GET_NOMENCLATURE|SCAN_GET_CHARGE|SCAN_GET_MASS|SCAN_GET_TIMESPAN_INFO, capabilities)) { lines.add("NAME = "+getName()); lines.add("SYMBOL = "+getSymbol()); } - if(Util.areBitsSet(SCAN_GET_CHARGE,capabilities)) - lines.add("CHARGE = "+getCharge()/3f+" e"); - if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) - lines.add(getColor()<0?"COLORLESS":"CARRIES COLOR"); - if(Util.areBitsSet(SCAN_GET_MASS,capabilities)) - lines.add("MASS = "+getMass()+" eV/c\u00b2"); + if(Util.areBitsSet(SCAN_GET_CHARGE,capabilities)) { + lines.add("CHARGE = " + getCharge() / 3f + " e"); + } + if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) { + lines.add(getColor() < 0 ? "COLORLESS" : "CARRIES COLOR"); + } + if(Util.areBitsSet(SCAN_GET_MASS,capabilities)) { + lines.add("MASS = " + getMass() + " eV/c\u00b2"); + } if(iaeaDefinitionExistsAndHasEnergyLevels && Util.areBitsSet(SCAN_GET_ENERGY_STATES,capabilities)){ for(int i=1;i<iaea.energeticStatesArray.length;i++){ lines.add("ENERGY LEVEL "+i+" = "+iaea.energeticStatesArray[i].energy+" eV"); diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/atom/iaeaNuclide.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/atom/iaeaNuclide.java index 1feb8253e3..49cb89b53c 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/atom/iaeaNuclide.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/atom/iaeaNuclide.java @@ -29,15 +29,17 @@ public final class iaeaNuclide { ArrayList<String[]> blockOfData=new ArrayList<>(4); while((line=reader.readLine())!=null) { String[] split= Util.splitButDifferent(line,","); - if(split.length!=19) throw new Error("Invalid count ("+split.length+") of separators in IAEA nuclides database " + line); - if(split[1].length()>0 && blockOfData.size()>0) { - new iaeaNuclide(blockOfData.toArray(new String[0][])); + if(split.length!=19) { + throw new Error("Invalid count (" + split.length + ") of separators in IAEA nuclides database " + line); + } + if(!split[1].isEmpty() && !blockOfData.isEmpty()) { + new iaeaNuclide(blockOfData.toArray(new String[blockOfData.size()][])); blockOfData.clear(); } blockOfData.add(split); } - if(blockOfData.size()>0) { - new iaeaNuclide(blockOfData.toArray(new String[0][])); + if(!blockOfData.isEmpty()) { + new iaeaNuclide(blockOfData.toArray(new String[blockOfData.size()][])); blockOfData.clear(); } reader.close(); @@ -50,7 +52,9 @@ public final class iaeaNuclide { BufferedReader reader = new BufferedReader(new InputStreamReader(iaeaNuclide.class.getResourceAsStream("nuclidesTable.csv"))); while((line=reader.readLine())!=null) { String[] split= Util.splitButDifferent(line,","); - if(split.length!=47) throw new Error("Invalid count ("+split.length+") of separators in IAEA nuvlidesTable database " + line); + if(split.length!=47) { + throw new Error("Invalid count (" + split.length + ") of separators in IAEA nuvlidesTable database " + line); + } get(Integer.parseInt(split[0]),Integer.parseInt(split[1])).getMoreData(split); } reader.close(); @@ -63,7 +67,9 @@ public final class iaeaNuclide { BufferedReader reader = new BufferedReader(new InputStreamReader(iaeaNuclide.class.getResourceAsStream("energyLevels.csv"))); while((line=reader.readLine())!=null) { String[] split= Util.splitButDifferent(line,","); - if(split.length!=27) throw new Error("Invalid count ("+split.length+") of separators in IAEA energyLevels database " + line); + if(split.length!=27) { + throw new Error("Invalid count (" + split.length + ") of separators in IAEA energyLevels database " + line); + } new energeticState(split); } reader.close(); @@ -72,8 +78,9 @@ public final class iaeaNuclide { e.printStackTrace(); } - for(iaeaNuclide nuclide:NUCLIDES.values()) + for(iaeaNuclide nuclide:NUCLIDES.values()) { nuclide.makeArrayOfEnergyStates(); + } } public static iaeaNuclide get(int protons, int neutrons){ @@ -99,7 +106,9 @@ public final class iaeaNuclide { //System.out.println("Mass =\t" + Mass+"\t"+(N+Z)+"\t"+N+"\t"+Z+"\t"+(Mass/(N+Z))); mass = (float)(Mass* MICRO_AMU_TO_EV_DIV_C_C); } - else mass=Float.NaN; + else { + mass = Float.NaN; + } discovery=(short)doubleOrNaN(rows[0][18],"discovery"); @@ -122,26 +131,31 @@ public final class iaeaNuclide { private static final energeticState[] empty=new energeticState[0]; private void makeArrayOfEnergyStates(){ - if(energeticStates==null || energeticStates.size()==0)energeticStatesArray= empty; - else energeticStatesArray=energeticStates.values().toArray(new energeticState[energeticStates.size()]); + if(energeticStates==null || energeticStates.isEmpty()) { + energeticStatesArray = empty; + } else { + energeticStatesArray = energeticStates.values().toArray(new energeticState[energeticStates.size()]); + } } private double doubleOrNaN(String s, String name){ s=s.replaceAll("#",""); - if(s.length()>0) { + if(!s.isEmpty()) { try { double value=Double.parseDouble(s); - if(Double.isNaN(value)) return Double.NaN; + if(Double.isNaN(value)) { + return Double.NaN; + } return value != 0 ?value:Double.NaN; } catch (Exception e) { - System.out.println("Invalid Value " + name + " " + N + " " + Z + " " + s); + System.out.println("Invalid Value " + name + ' ' + N + ' ' + Z + ' ' + s); e.printStackTrace(); } } return Double.NaN; } - public static class energeticState{ + public static final class energeticState{ public final float energy; public final float Thalf; public final iaeaDecay[] decaymodes; @@ -150,20 +164,24 @@ public final class iaeaNuclide { energy=0; this.Thalf=Thalf; this.decaymodes=decaymodes; - if(nuclide.energeticStates==null) - nuclide.energeticStates=new TreeMap<>(); + if(nuclide.energeticStates==null) { + nuclide.energeticStates = new TreeMap<>(); + } nuclide.energeticStates.put(energy,this); } private energeticState(String[] cells){ iaeaNuclide nuclide= get((int)doubleOrNaN(cells[0],"protons"),(int)doubleOrNaN(cells[1],"neutrons")); - if(nuclide==null) - throw new Error("Missing nuclide "+(int)doubleOrNaN(cells[0],"protons")+" "+(int)doubleOrNaN(cells[1],"neutrons")); + if(nuclide==null) { + throw new Error("Missing nuclide " + (int) doubleOrNaN(cells[0], "protons") + ' ' + (int) doubleOrNaN(cells[1], "neutrons")); + } energy =(float) (doubleOrNaN(cells[3],"energy level",nuclide)*1000f);//to eV - if(energy<0) throw new Error("Invalid energy "+ nuclide.N +" "+nuclide.Z+ " "+cells[3]); + if(energy<0) { + throw new Error("Invalid energy " + nuclide.N + ' ' + nuclide.Z + ' ' + cells[3]); + } Thalf =(float) doubleOrNaN(cells[10],"half life",nuclide); if(nuclide.energeticStates==null) { - new Exception("Should be initialized before doing this... "+ nuclide.N +" "+nuclide.Z).printStackTrace(); + new Exception("Should be initialized before doing this... "+ nuclide.N + ' ' +nuclide.Z).printStackTrace(); nuclide.energeticStates = new TreeMap<>(); } nuclide.energeticStates.put(energy,this); @@ -181,14 +199,14 @@ public final class iaeaNuclide { private double doubleOrNaN(String s, String name, iaeaNuclide nuclide){ s = s.replaceAll("#", ""); - if (s.length() > 0) { + if (!s.isEmpty()) { try { return Double.parseDouble(s); } catch (Exception e) { if(nuclide==null){ - System.out.println("Invalid Value " + name + " " + s); + System.out.println("Invalid Value " + name + ' ' + s); }else { - System.out.println("Invalid Value " + name + " " + nuclide.N + " " + nuclide.Z + " " + s); + System.out.println("Invalid Value " + name + ' ' + nuclide.N + ' ' + nuclide.Z + ' ' + s); } e.printStackTrace(); } @@ -208,9 +226,9 @@ public final class iaeaNuclide { private static iaeaDecay[] getDecaysFixed(String decay1, double chance1,String decay2, double chance2,String decay3, double chance3){ boolean do1,do2,do3; - do1= decay1.length()>0 && !Double.isNaN(chance1); - do2= decay2.length()>0 && !Double.isNaN(chance2); - do3= decay3.length()>0 && !Double.isNaN(chance3); + do1= !decay1.isEmpty() && !Double.isNaN(chance1); + do2= !decay2.isEmpty() && !Double.isNaN(chance2); + do3= !decay3.isEmpty() && !Double.isNaN(chance3); TreeMap<Double,iaeaDecay> decays=new TreeMap<>(); if(do1 && do2 && chance1==100 && chance2==100 && chance3!=100){ decays.put(1D, new iaeaDecay(1f, decay1)); @@ -229,7 +247,9 @@ public final class iaeaNuclide { } if(do3) { chance3 /= 100d; - if(do2) chance3 *= chance2; + if(do2) { + chance3 *= chance2; + } decays.put(chance3, new iaeaDecay((float) chance3, decay3)); } }else{ @@ -246,8 +266,9 @@ public final class iaeaNuclide { chance3/=normalization; decays.put(chance3, new iaeaDecay((float) chance3, decay3)); } - if(do1||do2||do3) - decays.put(1D,iaeaDecay.DEAD_END); + if(do1||do2||do3) { + decays.put(1D, iaeaDecay.DEAD_END); + } } //if(DEBUG_MODE){ // System.out.println("INVALID SUM?\t"+normalization+"\t"+decay1+"\t"+chance1+"\t"+decay2+"\t"+chance2+"\t"+decay3+"\t"+chance3); @@ -255,7 +276,7 @@ public final class iaeaNuclide { return decays.values().toArray(new iaeaDecay[decays.size()]); } - public static class iaeaDecay{ + public static final class iaeaDecay{ public final float chance; public final String decayName; public static final iaeaDecay DEAD_END=new iaeaDecay(1f,"DEAD_END"); diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/hadron/dHadronDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/hadron/dHadronDefinition.java index 63766d8a4e..29d583d613 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/hadron/dHadronDefinition.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/hadron/dHadronDefinition.java @@ -74,7 +74,9 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi } private dHadronDefinition(boolean check, cElementalDefinitionStackMap quarks) throws tElementalException { - if (check && !canTheyBeTogether(quarks)) throw new tElementalException("Hadron Definition error"); + if (check && !canTheyBeTogether(quarks)) { + throw new tElementalException("Hadron Definition error"); + } quarkStacks = quarks; byte amount = 0; @@ -87,7 +89,9 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi mass += quarkStack.getMass(); charge += quarkStack.getCharge(); type = Math.max(Math.abs(quarkStack.definition.getType()), type); - if (quarkStack.definition.getType() < 0) containsAnti = true; + if (quarkStack.definition.getType() < 0) { + containsAnti = true; + } } this.amount = amount; this.charge = charge; @@ -95,9 +99,11 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi int mult = this.amount * this.amount * (this.amount - 1); this.mass = mass * 5.543F * (float) mult;//yes it becomes heavier - if (this.mass == protonMass && this.amount == 3) rawLifeTime = iElementalDefinition.STABLE_RAW_LIFE_TIME; - else if (this.mass == neutronMass && this.amount == 3) rawLifeTime = 882F; - else { + if (this.mass == protonMass && this.amount == 3) { + rawLifeTime = iElementalDefinition.STABLE_RAW_LIFE_TIME; + } else if (this.mass == neutronMass && this.amount == 3) { + rawLifeTime = 882F; + } else { if (this.amount == 3) { rawLifeTime = 1.34F / this.mass * (float) Math.pow(9.81, charge); } else if (this.amount == 2) { @@ -114,7 +120,9 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi private static boolean canTheyBeTogether(cElementalDefinitionStackMap stacks) { long amount = 0; for (cElementalDefinitionStack quarks : stacks.values()) { - if (!(quarks.definition instanceof eQuarkDefinition)) return false; + if (!(quarks.definition instanceof eQuarkDefinition)) { + return false; + } amount += quarks.amount; } return amount >= 2 && amount <= 12; @@ -149,11 +157,13 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi @Override public String getSymbol() { - String symbol = ""; - for (cElementalDefinitionStack quark : quarkStacks.values()) - for (int i = 0; i < quark.amount; i++) - symbol += quark.definition.getSymbol(); - return symbol; + StringBuilder symbol = new StringBuilder(8); + for (cElementalDefinitionStack quark : quarkStacks.values()) { + for (int i = 0; i < quark.amount; i++) { + symbol.append(quark.definition.getSymbol()); + } + } + return symbol.toString(); } @Override @@ -169,8 +179,9 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi @Override public cElementalDecay[] getNaturalDecayInstant() { cElementalDefinitionStack[] quarkStacks = this.quarkStacks.values(); - if (amount == 2 && quarkStacks.length == 2 && quarkStacks[0].definition.getMass() == quarkStacks[1].definition.getMass() && quarkStacks[0].definition.getType() == -quarkStacks[1].definition.getType()) + if (amount == 2 && quarkStacks.length == 2 && quarkStacks[0].definition.getMass() == quarkStacks[1].definition.getMass() && quarkStacks[0].definition.getType() == -quarkStacks[1].definition.getType()) { return cElementalDecay.noProduct; + } ArrayList<cElementalDefinitionStack> decaysInto = new ArrayList<>(); for (cElementalDefinitionStack quarks : quarkStacks) { if (quarks.definition.getType() == 1 || quarks.definition.getType() == -1) { @@ -190,8 +201,9 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi @Override public cElementalDecay[] getEnergyInducedDecay(long energyLevel) { cElementalDefinitionStack[] quarkStacks = this.quarkStacks.values(); - if (amount == 2 && quarkStacks.length == 2 && quarkStacks[0].definition.getMass() == quarkStacks[1].definition.getMass() && quarkStacks[0].definition.getType() == -quarkStacks[1].definition.getType()) + if (amount == 2 && quarkStacks.length == 2 && quarkStacks[0].definition.getMass() == quarkStacks[1].definition.getMass() && quarkStacks[0].definition.getType() == -quarkStacks[1].definition.getType()) { return cElementalDecay.noProduct; + } return new cElementalDecay[]{new cElementalDecay(0.75F, quarkStacks), eBosonDefinition.deadEnd}; //decay into quarks } @@ -208,16 +220,17 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi @Override public cElementalDecay[] getDecayArray() { cElementalDefinitionStack[] quarkStacks = this.quarkStacks.values(); - if (amount == 2 && quarkStacks.length == 2 && quarkStacks[0].definition.getMass() == quarkStacks[1].definition.getMass() && quarkStacks[0].definition.getType() == -quarkStacks[1].definition.getType()) + if (amount == 2 && quarkStacks.length == 2 && quarkStacks[0].definition.getMass() == quarkStacks[1].definition.getMass() && quarkStacks[0].definition.getType() == -quarkStacks[1].definition.getType()) { return cElementalDecay.noProduct; - else if (amount != 3) + } else if (amount != 3) { return new cElementalDecay[]{new cElementalDecay(0.95F, quarkStacks), eBosonDefinition.deadEnd}; //decay into quarks - else { + } else { ArrayList<eQuarkDefinition> newBaryon = new ArrayList<>(); iElementalDefinition[] Particles = new iElementalDefinition[2]; for (cElementalDefinitionStack quarks : quarkStacks) { - for (int i = 0; i < quarks.amount; i++) + for (int i = 0; i < quarks.amount; i++) { newBaryon.add((eQuarkDefinition) quarks.definition); + } } //remove last eQuarkDefinition lastQuark = newBaryon.remove(2); @@ -242,7 +255,9 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi new cElementalDecay(0.001F, new dHadronDefinition(false, contentOfBaryon), Particles[0], Particles[1], boson_Y__), eBosonDefinition.deadEnd}; } catch (tElementalException e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } return new cElementalDecay[]{eBosonDefinition.deadEnd}; } } @@ -291,12 +306,15 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi @Override public iElementalDefinition getAnti() { cElementalMutableDefinitionStackMap anti = new cElementalMutableDefinitionStackMap(); - for (cElementalDefinitionStack stack : quarkStacks.values()) + for (cElementalDefinitionStack stack : quarkStacks.values()) { anti.putReplace(new cElementalDefinitionStack(stack.definition.getAnti(), stack.amount)); + } try { return new dHadronDefinition(anti.toImmutable_unsafeMightLeaveExposedElementalTree()); } catch (tElementalException e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } return null; } } @@ -322,19 +340,23 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi nbt.setByte("t", nbtType); cElementalDefinitionStack[] quarkStacksValues = quarkStacks.values(); nbt.setInteger("i", quarkStacksValues.length); - for (int i = 0; i < quarkStacksValues.length; i++) + for (int i = 0; i < quarkStacksValues.length; i++) { nbt.setTag(Integer.toString(i), quarkStacksValues[i].toNBT()); + } return nbt; } public static iElementalDefinition fromNBT(NBTTagCompound nbt) { cElementalDefinitionStack[] stacks = new cElementalDefinitionStack[nbt.getInteger("i")]; - for (int i = 0; i < stacks.length; i++) + for (int i = 0; i < stacks.length; i++) { stacks[i] = cElementalDefinitionStack.fromNBT(nbt.getCompoundTag(Integer.toString(i))); + } try { return new dHadronDefinition(stacks); } catch (tElementalException e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } return null; } } @@ -352,7 +374,9 @@ 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 (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } protonMass = -1; neutronMass = -1; } @@ -367,10 +391,13 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi try { cElementalDefinition.addCreatorFromNBT(nbtType, dHadronDefinition.class.getMethod("fromNBT", NBTTagCompound.class),(byte)-64); } catch (Exception e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } + } + if(DEBUG_MODE) { + TecTech.Logger.info("Registered Elemental Matter Class: Hadron " + nbtType + ' ' + -64); } - if(DEBUG_MODE) - TecTech.Logger.info("Registered Elemental Matter Class: Hadron "+nbtType+" "+ -64); } public static void setTransformations(){ @@ -395,18 +422,22 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi @Override public void addScanResults(ArrayList<String> lines, int capabilities, long energyLevel) { - if(Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) - lines.add("CLASS = "+ nbtType +" "+getClassType()); + if(Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) { + lines.add("CLASS = " + nbtType + ' ' + getClassType()); + } if(Util.areBitsSet(SCAN_GET_NOMENCLATURE|SCAN_GET_CHARGE|SCAN_GET_MASS|SCAN_GET_TIMESPAN_INFO, capabilities)) { lines.add("NAME = "+getSimpleName()); //lines.add("SYMBOL = "+getSymbol()); } - if(Util.areBitsSet(SCAN_GET_CHARGE,capabilities)) - lines.add("CHARGE = "+getCharge()/3f+" e"); - if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) - lines.add(getColor()<0?"COLORLESS":"CARRIES COLOR"); - if(Util.areBitsSet(SCAN_GET_MASS,capabilities)) - lines.add("MASS = "+getMass()+" eV/c\u00b2"); + if(Util.areBitsSet(SCAN_GET_CHARGE,capabilities)) { + lines.add("CHARGE = " + getCharge() / 3f + " e"); + } + if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) { + lines.add(getColor() < 0 ? "COLORLESS" : "CARRIES COLOR"); + } + if(Util.areBitsSet(SCAN_GET_MASS,capabilities)) { + lines.add("MASS = " + getMass() + " eV/c\u00b2"); + } if(Util.areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)){ lines.add("HALF LIFE = "+getRawTimeSpan(energyLevel)+ " s"); lines.add(" "+"At current energy level"); diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/primitive/cPrimitiveDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/primitive/cPrimitiveDefinition.java index 1a4582386b..24904e6a31 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/primitive/cPrimitiveDefinition.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/primitive/cPrimitiveDefinition.java @@ -15,7 +15,7 @@ public final class cPrimitiveDefinition extends cElementalPrimitive { magic = new cPrimitiveDefinition("Magic", "Ma", 4, 1e5F, 0, 0, 1), magic_ = new cPrimitiveDefinition("Antimagic", "~Ma", -4, 1e5F, 0, 0, 2); - protected cPrimitiveDefinition(String name, String symbol, int type, float mass, int charge, int color, int ID) { + private cPrimitiveDefinition(String name, String symbol, int type, float mass, int charge, int color, int ID) { super(name, symbol, type, mass, charge, color, ID); } diff --git a/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java b/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java index 1234538839..29533c5a0a 100644 --- a/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java +++ b/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java @@ -22,7 +22,9 @@ public class BlockHint extends EntityFX { prevPosZ = posZ; noClip = true; particleMaxAge = 2000 + TecTech.Rnd.nextInt(200); - for (int i = 0; i < 6; i++) icons[i] = block.getIcon(i, meta); + for (int i = 0; i < 6; i++) { + icons[i] = block.getIcon(i, meta); + } } @Override @@ -38,7 +40,9 @@ public class BlockHint extends EntityFX { //var8, var9 - X U //var 10, var 11 - Y V for(int i=0;i<6;i++){ - if(icons[i]==null) continue; + if(icons[i]==null) { + continue; + } double u=icons[i].getMinU(); double U=icons[i].getMaxU(); double v=icons[i].getMinV(); diff --git a/src/main/java/com/github/technus/tectech/loader/BloodyRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/BloodyRecipeLoader.java index 37e7cc41df..b506ec9fc3 100644 --- a/src/main/java/com/github/technus/tectech/loader/BloodyRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/BloodyRecipeLoader.java @@ -18,11 +18,9 @@ import net.minecraftforge.fluids.FluidStack; public class BloodyRecipeLoader implements Runnable { @Override public void run() { - Object[] o = new Object[0]; - //Quantum Glass GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Containment.get(1, o), + CustomItemList.eM_Containment.get(1), GT_ModHandler.getIC2Item("reinforcedGlass", 1L) }, Materials.Osmium.getMolten(576), new ItemStack(QuantumGlassBlock.INSTANCE, 1), 200, 500000); @@ -35,9 +33,9 @@ public class BloodyRecipeLoader implements Runnable { //Data GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - ItemList.Circuit_Parts_GlassFiber.get(8, o), + ItemList.Circuit_Parts_GlassFiber.get(8), GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silver, 8) - }, Materials.Polytetrafluoroethylene.getMolten(144), CustomItemList.DATApipe.get(1, o), 200, 30720); + }, Materials.Polytetrafluoroethylene.getMolten(144), CustomItemList.DATApipe.get(1), 200, 30720); //endregion @@ -52,42 +50,42 @@ public class BloodyRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Cobalt, 16), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Copper, 16), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NiobiumTitanium, 2) - }, Materials.TungstenSteel.getMolten(576), CustomItemList.eM_Power.get(1, o), 100, 30720); + }, Materials.TungstenSteel.getMolten(576), CustomItemList.eM_Power.get(1), 100, 30720); //Computer Casing GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Power.get(1, o), + CustomItemList.eM_Power.get(1), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StainlessSteel, 8), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 1), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NiobiumTitanium, 2) - }, Materials.Aluminium.getMolten(1296), CustomItemList.eM_Computer_Casing.get(1, o), 200, 122880); + }, Materials.Aluminium.getMolten(1296), CustomItemList.eM_Computer_Casing.get(1), 200, 122880); //Computer Vent Casing GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.StainlessSteel, 1), - ItemList.Electric_Motor_IV.get(2, o), + ItemList.Electric_Motor_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.StainlessSteel, 2), GT_OreDictUnificator.get(OrePrefixes.pipeTiny, Materials.StainlessSteel, 16), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Copper, 16), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 1) - }, Materials.SolderingAlloy.getMolten(1296), CustomItemList.eM_Computer_Vent.get(1, o), 100, 1920); + }, Materials.SolderingAlloy.getMolten(1296), CustomItemList.eM_Computer_Vent.get(1), 100, 1920); //Advanced Computer Casing GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Computer_Casing.get(1, o), + CustomItemList.eM_Computer_Casing.get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 1), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Cobalt, 64), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Electrum, 64), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Superconductor, 4) - }, Materials.Iridium.getMolten(1296), CustomItemList.eM_Computer_Bus.get(1, o), 200, 122880); + }, Materials.Iridium.getMolten(1296), CustomItemList.eM_Computer_Bus.get(1), 200, 122880); //Molecular Casing GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Power.get(1, o), + CustomItemList.eM_Power.get(1), GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Osmiridium, 6), GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmium, 12), GT_OreDictUnificator.get(OrePrefixes.screw, Materials.TungstenSteel, 24), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.TungstenSteel, 24), - ItemList.Field_Generator_IV.get(1, o) - }, Materials.Osmium.getMolten(1296), CustomItemList.eM_Containment.get(1, o), 800, 500000); + ItemList.Field_Generator_IV.get(1) + }, Materials.Osmium.getMolten(1296), CustomItemList.eM_Containment.get(1), 800, 500000); //endregion @@ -95,65 +93,65 @@ public class BloodyRecipeLoader implements Runnable { //region hatches //Dynamo Hatches UV-UIV - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_UV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, Materials.Silver.getMolten(1000), CustomItemList.eM_dynamomulti4_UV.get(1, o), 100, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti4_UV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, Materials.Electrum.getMolten(1000), CustomItemList.eM_dynamomulti16_UV.get(1, o), 200, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti16_UV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, Materials.Tungsten.getMolten(1000), CustomItemList.eM_dynamomulti64_UV.get(1, o), 400, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, Materials.Silver.getMolten(1000), CustomItemList.eM_dynamomulti4_UV.get(1), 100, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti4_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, Materials.Electrum.getMolten(1000), CustomItemList.eM_dynamomulti16_UV.get(1), 200, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti16_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, Materials.Tungsten.getMolten(1000), CustomItemList.eM_dynamomulti64_UV.get(1), 400, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_MAX.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, Materials.Silver.getMolten(2000), CustomItemList.eM_dynamomulti4_UHV.get(1, o), 100, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti4_UHV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2000), CustomItemList.eM_dynamomulti16_UHV.get(1, o), 200, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti16_UHV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2000), CustomItemList.eM_dynamomulti64_UHV.get(1, o), 400, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, Materials.Silver.getMolten(2000), CustomItemList.eM_dynamomulti4_UHV.get(1), 100, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti4_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2000), CustomItemList.eM_dynamomulti16_UHV.get(1), 200, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti16_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2000), CustomItemList.eM_dynamomulti64_UHV.get(1), 400, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_MAX.get(4, o), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 8)}, Materials.Silver.getMolten(4000), CustomItemList.eM_dynamomulti4_UEV.get(1, o), 100, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti4_UEV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 16)}, Materials.Electrum.getMolten(4000), CustomItemList.eM_dynamomulti16_UEV.get(1, o), 200, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti16_UEV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 24)}, Materials.Tungsten.getMolten(4000), CustomItemList.eM_dynamomulti64_UEV.get(1, o), 400, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Dynamo_MAX.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 8)}, Materials.Silver.getMolten(4000), CustomItemList.eM_dynamomulti4_UEV.get(1), 100, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti4_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 16)}, Materials.Electrum.getMolten(4000), CustomItemList.eM_dynamomulti16_UEV.get(1), 200, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_dynamomulti16_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 24)}, Materials.Tungsten.getMolten(4000), CustomItemList.eM_dynamomulti64_UEV.get(1), 400, 2000000); //Energy Hatches UV-UIV - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_UV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, Materials.Silver.getMolten(1000), CustomItemList.eM_energymulti4_UV.get(1, o), 100, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energymulti4_UV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, Materials.Electrum.getMolten(1000), CustomItemList.eM_energymulti16_UV.get(1, o), 200, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energymulti16_UV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, Materials.Tungsten.getMolten(1000), CustomItemList.eM_energymulti64_UV.get(1, o), 400, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, Materials.Silver.getMolten(1000), CustomItemList.eM_energymulti4_UV.get(1), 100, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energymulti4_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, Materials.Electrum.getMolten(1000), CustomItemList.eM_energymulti16_UV.get(1), 200, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energymulti16_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, Materials.Tungsten.getMolten(1000), CustomItemList.eM_energymulti64_UV.get(1), 400, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_MAX.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, Materials.Silver.getMolten(2000), CustomItemList.eM_energymulti4_UHV.get(1, o), 100, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energymulti4_UHV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2000), CustomItemList.eM_energymulti16_UHV.get(1, o), 200, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energymulti16_UHV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2000), CustomItemList.eM_energymulti64_UHV.get(1, o), 400, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, Materials.Silver.getMolten(2000), CustomItemList.eM_energymulti4_UHV.get(1), 100, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energymulti4_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2000), CustomItemList.eM_energymulti16_UHV.get(1), 200, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energymulti16_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2000), CustomItemList.eM_energymulti64_UHV.get(1), 400, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_MAX.get(4, o), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 8)}, Materials.Silver.getMolten(4000), CustomItemList.eM_energymulti4_UEV.get(1, o), 100, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energymulti4_UEV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 16)}, Materials.Electrum.getMolten(4000), CustomItemList.eM_energymulti16_UEV.get(1, o), 200, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energymulti16_UEV.get(1, o), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 24)}, Materials.Tungsten.getMolten(4000), CustomItemList.eM_energymulti64_UEV.get(1, o), 400, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_MAX.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 8)}, Materials.Silver.getMolten(4000), CustomItemList.eM_energymulti4_UEV.get(1), 100, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energymulti4_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 16)}, Materials.Electrum.getMolten(4000), CustomItemList.eM_energymulti16_UEV.get(1), 200, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energymulti16_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 24)}, Materials.Tungsten.getMolten(4000), CustomItemList.eM_energymulti64_UEV.get(1), 400, 2000000); //Data Input GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Computer_Casing.get(1, o), - ItemList.Hatch_Input_Bus_LuV.get(1, o), - ItemList.Circuit_Crystalcomputer.get(1, o), - CustomItemList.DATApipe.get(2, o) - }, Materials.Iridium.getMolten(1296), CustomItemList.dataIn_Hatch.get(1, o), 200, 122880); + CustomItemList.eM_Computer_Casing.get(1), + ItemList.Hatch_Input_Bus_LuV.get(1), + ItemList.Circuit_Crystalcomputer.get(1), + CustomItemList.DATApipe.get(2) + }, Materials.Iridium.getMolten(1296), CustomItemList.dataIn_Hatch.get(1), 200, 122880); //Data Output GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Computer_Casing.get(1, o), - ItemList.Hatch_Output_Bus_LuV.get(1, o), - ItemList.Circuit_Crystalcomputer.get(1, o), - CustomItemList.DATApipe.get(2, o) - }, Materials.Iridium.getMolten(1296), CustomItemList.dataOut_Hatch.get(1, o), 200, 122880); + CustomItemList.eM_Computer_Casing.get(1), + ItemList.Hatch_Output_Bus_LuV.get(1), + ItemList.Circuit_Crystalcomputer.get(1), + CustomItemList.DATApipe.get(2) + }, Materials.Iridium.getMolten(1296), CustomItemList.dataOut_Hatch.get(1), 200, 122880); //Rack GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Computer_Bus.get(1, o), - ItemList.Hatch_Input_Bus_ZPM.get(1, o), - ItemList.Circuit_Crystalcomputer.get(2, o), - CustomItemList.DATApipe.get(4, o) - }, Materials.Iridium.getMolten(1296), CustomItemList.rack_Hatch.get(1, o), 800, 122880); + CustomItemList.eM_Computer_Bus.get(1), + ItemList.Hatch_Input_Bus_ZPM.get(1), + ItemList.Circuit_Crystalcomputer.get(2), + CustomItemList.DATApipe.get(4) + }, Materials.Iridium.getMolten(1296), CustomItemList.rack_Hatch.get(1), 800, 122880); //Object Holder GT_Values.RA.addAssemblylineRecipe(ItemList.Hatch_Input_Bus_ZPM.get(1), 10000, new ItemStack[]{ ItemList.Hatch_Input_Bus_ZPM.get(1), - CustomItemList.eM_Computer_Bus.get(1, o), + CustomItemList.eM_Computer_Bus.get(1), ItemList.Emitter_ZPM.get(8), ItemList.Robot_Arm_ZPM.get(1), ItemList.Electric_Motor_ZPM.get(2), ItemList.Circuit_Crystalmainframe.get(1), GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Naquadah, 2), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Naquadah, 16), - CustomItemList.DATApipe.get(2, o), + CustomItemList.DATApipe.get(2), }, new FluidStack[]{ Materials.UUMatter.getFluid(500), Materials.Iridium.getMolten(1000), @@ -162,42 +160,42 @@ public class BloodyRecipeLoader implements Runnable { //Parameterizer GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Computer_Casing.get(1, o), - ItemList.Circuit_Masterquantumcomputer.get(1, o), - CustomItemList.DATApipe.get(4, o), - ItemList.Cover_Screen.get(1, o ), + CustomItemList.eM_Computer_Casing.get(1), + ItemList.Circuit_Masterquantumcomputer.get(1), + CustomItemList.DATApipe.get(4), + ItemList.Cover_Screen.get(1 ), new ItemStack(Blocks.stone_button, 16), - }, Materials.Iridium.getMolten(2592), CustomItemList.Parametrizer_Hatch.get(1, o), 800, 122880); + }, Materials.Iridium.getMolten(2592), CustomItemList.Parametrizer_Hatch.get(1), 800, 122880); //Uncertainty GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Computer_Casing.get(1, o), - ItemList.Circuit_Ultimatecrystalcomputer.get(1, o), - CustomItemList.DATApipe.get(16, o), - ItemList.Cover_Screen.get(1, o ), + CustomItemList.eM_Computer_Casing.get(1), + ItemList.Circuit_Ultimatecrystalcomputer.get(1), + CustomItemList.DATApipe.get(16), + ItemList.Cover_Screen.get(1 ), new ItemStack(Blocks.stone_button, 16), - }, Materials.Iridium.getMolten(2592), CustomItemList.Uncertainty_Hatch.get(1, o), 1200, 122880); + }, Materials.Iridium.getMolten(2592), CustomItemList.Uncertainty_Hatch.get(1), 1200, 122880); //Elemental Input GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Containment.get(1, o), - ItemList.Hatch_Input_UV.get(1, o), + CustomItemList.eM_Containment.get(1), + ItemList.Hatch_Input_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Naquadah, 2), - ItemList.Sensor_UV.get(1, o) - }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_in_UV.get(1, o), 800, 500000); + ItemList.Sensor_UV.get(1) + }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_in_UV.get(1), 800, 500000); //Elemental Output GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Containment.get(1, o), - ItemList.Hatch_Output_UV.get(1, o), + CustomItemList.eM_Containment.get(1), + ItemList.Hatch_Output_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Naquadah, 2), - ItemList.Emitter_UV.get(1, o) - }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_out_UV.get(1, o), 800, 500000); + ItemList.Emitter_UV.get(1) + }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_out_UV.get(1), 800, 500000); //Overflow GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_Containment.get(1, o), - ItemList.Hatch_Muffler_UV.get(1, o), + CustomItemList.eM_Containment.get(1), + ItemList.Hatch_Muffler_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Naquadah, 1), - ItemList.Field_Generator_UV.get(1, o) - }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_muffler_UV.get(1, o), 800, 500000); + ItemList.Field_Generator_UV.get(1) + }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_muffler_UV.get(1), 800, 500000); //endregion @@ -206,38 +204,38 @@ public class BloodyRecipeLoader implements Runnable { //Microwave Grinder GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - ItemList.Machine_HV_Microwave.get(1,o), + ItemList.Machine_HV_Microwave.get(1), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.StainlessSteel, 4), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 4), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 16), - ItemList.Upgrade_Overclocker.get(4, o), - }, Materials.Copper.getMolten(576), CustomItemList.Machine_Multi_Microwave.get(1, o), 800, 480); + ItemList.Upgrade_Overclocker.get(4), + }, Materials.Copper.getMolten(576), CustomItemList.Machine_Multi_Microwave.get(1), 800, 480); //Active Transformer GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - ItemList.Transformer_ZPM_LuV.get(16, o), - ItemList.Circuit_Board_Elite.get(1, o),//? + ItemList.Transformer_ZPM_LuV.get(16), + ItemList.Circuit_Board_Elite.get(1),//? GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 16), - ItemList.Circuit_Chip_HPIC.get(2, o), - }, Materials.TungstenSteel.getMolten(576), CustomItemList.Machine_Multi_Transformer.get(1, o), 400, 30720); + ItemList.Circuit_Chip_HPIC.get(2), + }, Materials.TungstenSteel.getMolten(576), CustomItemList.Machine_Multi_Transformer.get(1), 400, 30720); //Network Switch GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.Machine_Multi_Transformer.get(1, o), - ItemList.Circuit_Ultimatecrystalcomputer.get(1, o), + CustomItemList.Machine_Multi_Transformer.get(1), + ItemList.Circuit_Ultimatecrystalcomputer.get(1), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Cobalt, 64), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Copper, 64), - CustomItemList.DATApipe.get(4, o), - }, Materials.Iridium.getMolten(1296), CustomItemList.Machine_Multi_Switch.get(1, o), 800, 122880); + CustomItemList.DATApipe.get(4), + }, Materials.Iridium.getMolten(1296), CustomItemList.Machine_Multi_Switch.get(1), 800, 122880); //Quantum Computer GT_Values.RA.addAssemblylineRecipe(ItemList.Tool_DataOrb.get(1), 20000, new ItemStack[]{ CustomItemList.Machine_Multi_Switch.get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 2), ItemList.Tool_DataOrb.get(1), - ItemList.Cover_Screen.get(1, o), + ItemList.Cover_Screen.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Superconductor, 8), - CustomItemList.DATApipe.get(8, o), + CustomItemList.DATApipe.get(8), }, new FluidStack[]{ Materials.UUMatter.getFluid(1000), Materials.Iridium.getMolten(1296), @@ -254,7 +252,7 @@ public class BloodyRecipeLoader implements Runnable { ItemList.Electric_Motor_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Naquadah, 4), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Naquadah, 32), - CustomItemList.DATApipe.get(16, o), + CustomItemList.DATApipe.get(16), }, new FluidStack[]{ Materials.UUMatter.getFluid(1000), Materials.Iridium.getMolten(1296), diff --git a/src/main/java/com/github/technus/tectech/loader/EntityLoader.java b/src/main/java/com/github/technus/tectech/loader/EntityLoader.java index 389238e6c6..5769a5d5d2 100644 --- a/src/main/java/com/github/technus/tectech/loader/EntityLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/EntityLoader.java @@ -11,7 +11,8 @@ import openmodularturrets.entity.projectiles.projectileEM; public class EntityLoader implements Runnable { @Override public void run() { - if(Loader.isModLoaded("openmodularturrets")) + if(Loader.isModLoaded("openmodularturrets")) { EntityRegistry.registerModEntity(projectileEM.class, "projectileEM", 0, TecTech.instance, 16, 5, true); + } } } 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 f05ee2b46f..2e715d7b9c 100644 --- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java @@ -86,23 +86,7 @@ public final class MainLoader { TecTech.Logger.info("Recipe Init Done"); progressBarPostLoad.step("Creative Tab part1"); - mainTab = new CreativeTabs("TecTech") { - @SideOnly(Side.CLIENT) - @Override - public Item getTabIconItem() { - return DebugElementalInstanceContainer_EM.INSTANCE; - } - - @Override - public void displayAllReleventItems(List stuffToShow) { - for(CustomItemList item: CustomItemList.values()){ - if (item.hasBeenSet() && item.getBlock() == GregTech_API.sBlockMachines) { - stuffToShow.add(item.get(1)); - } - } - super.displayAllReleventItems(stuffToShow); - } - }; + mainTab = new MyCreativeTab(); progressBarPostLoad.step("Creative Tab part2"); registerThingsInTabs(); TecTech.Logger.info("CreativeTab initiation complete"); @@ -195,4 +179,24 @@ public final class MainLoader { //todo add GC GS stuff } + + private static final class MyCreativeTab extends CreativeTabs { + private MyCreativeTab() {super("TecTech");} + + @SideOnly(Side.CLIENT) + @Override + public Item getTabIconItem() { + return DebugElementalInstanceContainer_EM.INSTANCE; + } + + @Override + public void displayAllReleventItems(List stuffToShow) { + for(CustomItemList item: CustomItemList.values()){ + if (item.hasBeenSet() && item.getBlock() == GregTech_API.sBlockMachines) { + stuffToShow.add(item.get(1)); + } + } + super.displayAllReleventItems(stuffToShow); + } + } } diff --git a/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java index 0190a11f8d..db323ee038 100644 --- a/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/RecipeLoader.java @@ -26,15 +26,15 @@ public class RecipeLoader implements Runnable { // Recipes init - common goes here rest goes into methods below // =================================================================================================== - for(int i=0;i<=15;i++) - RA.addAssemblerRecipe(new ItemStack[]{ - GT_Utility.getIntegratedCircuit(i), - GT_OreDictUnificator.get(OrePrefixes.dust,Materials.Cobalt,1)}, - Materials.Aluminium.getMolten(864), - new ItemStack(TT_Container_Casings.sHintCasingsTT, 1,i),32,120); - - if (Loader.isModLoaded("dreamcraft")) new DreamCraftRecipeLoader().run();//init recipes for GTNH version - else new BloodyRecipeLoader().run();//init recipes for NON-GTNH version + for(int i=0;i<=15;i++) { + RA.addAssemblerRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(i), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cobalt, 1)}, Materials.Aluminium.getMolten(864), new ItemStack(TT_Container_Casings.sHintCasingsTT, 1, i), 32, 120); + } + + if (Loader.isModLoaded("dreamcraft")) { + new DreamCraftRecipeLoader().run();//init recipes for GTNH version + } else { + new BloodyRecipeLoader().run();//init recipes for NON-GTNH version + } } 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 c066c84aa1..5906f3d3de 100644 --- a/src/main/java/com/github/technus/tectech/loader/ThingsLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/ThingsLoader.java @@ -22,8 +22,9 @@ import static com.github.technus.tectech.TecTech.tectechTexturePage1; public class ThingsLoader implements Runnable { @Override public void run() { - if(Textures.BlockIcons.casingTexturePages[tectechTexturePage1]==null) - Textures.BlockIcons.casingTexturePages[tectechTexturePage1]=new ITexture[128]; + if(Textures.BlockIcons.casingTexturePages[tectechTexturePage1]==null) { + Textures.BlockIcons.casingTexturePages[tectechTexturePage1] = new ITexture[128]; + } TecTech.Logger.info("Added texture page if was null"); TT_Container_Casings.sBlockCasingsTT = new GT_Block_CasingsTT(); TecTech.Logger.info("Elemental Casing registered"); diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java index dd20554887..e64a68304f 100644 --- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java +++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java @@ -54,7 +54,7 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { mRecipeMap = aRecipeMap; transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), getOverlayIdentifier())); if (!NEI_TT_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(TecTech.instance, "NEIPlugins", "register-crafting-handler", Reference.MODID+"@" + getRecipeName() + "@" + getOverlayIdentifier()); + FMLInterModComms.sendRuntimeMessage(TecTech.instance, "NEIPlugins", "register-crafting-handler", Reference.MODID+ '@' + getRecipeName() + '@' + getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); GuiUsageRecipe.usagehandlers.add(this); } @@ -197,7 +197,7 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { if (!(tStack instanceof FixedPositionedStack) || ((FixedPositionedStack) tStack).mChance <= 0 || ((FixedPositionedStack) tStack).mChance == 10000) { break; } - currenttip.add(trans("150","Chance: ") + ((FixedPositionedStack) tStack).mChance / 100 + "." + (((FixedPositionedStack) tStack).mChance % 100 < 10 ? "0" + ((FixedPositionedStack) tStack).mChance % 100 : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%"); + currenttip.add(trans("150","Chance: ") + ((FixedPositionedStack) tStack).mChance / 100 + '.' + (((FixedPositionedStack) tStack).mChance % 100 < 10 ? "0" + ((FixedPositionedStack) tStack).mChance % 100 : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + '%'); break; } } @@ -356,8 +356,8 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { List<ItemStack> permutations = ItemList.itemMap.get(tStack.getItem()); if (!permutations.isEmpty()) { ItemStack stack; - for (Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, stack))) { - stack = (ItemStack) i$.next(); + for (Iterator<ItemStack> iterator = permutations.iterator(); iterator.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, stack))) { + stack = iterator.next(); } } else { ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); @@ -369,7 +369,7 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { } } } - items = tDisplayStacks.toArray(new ItemStack[0]); + items = tDisplayStacks.toArray(new ItemStack[tDisplayStacks.size()]); if (items.length == 0) { items = new ItemStack[]{new ItemStack(Blocks.fire)}; } diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java index 611e2bafa0..5a46f13f12 100644 --- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java +++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java @@ -54,7 +54,7 @@ public class TT_NEI_ScannerHandler extends TemplateRecipeHandler { mRecipeMap = aRecipeMap; transferRects.add(new RecipeTransferRect(new Rectangle(65, 13, 36, 18), getOverlayIdentifier())); if (!NEI_TT_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(TecTech.instance, "NEIPlugins", "register-crafting-handler", Reference.MODID+"@" + getRecipeName() + "@" + getOverlayIdentifier()); + FMLInterModComms.sendRuntimeMessage(TecTech.instance, "NEIPlugins", "register-crafting-handler", Reference.MODID+ '@' + getRecipeName() + '@' + getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); GuiUsageRecipe.usagehandlers.add(this); } @@ -197,7 +197,7 @@ public class TT_NEI_ScannerHandler extends TemplateRecipeHandler { if (!(tStack instanceof FixedPositionedStack) || ((FixedPositionedStack) tStack).mChance <= 0 || ((FixedPositionedStack) tStack).mChance == 10000) { break; } - currenttip.add(trans("150","Chance: ") + ((FixedPositionedStack) tStack).mChance / 100 + "." + (((FixedPositionedStack) tStack).mChance % 100 < 10 ? "0" + ((FixedPositionedStack) tStack).mChance % 100 : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%"); + currenttip.add(trans("150","Chance: ") + ((FixedPositionedStack) tStack).mChance / 100 + '.' + (((FixedPositionedStack) tStack).mChance % 100 < 10 ? "0" + ((FixedPositionedStack) tStack).mChance % 100 : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + '%'); break; } } @@ -356,8 +356,8 @@ public class TT_NEI_ScannerHandler extends TemplateRecipeHandler { List<ItemStack> permutations = ItemList.itemMap.get(tStack.getItem()); if (!permutations.isEmpty()) { ItemStack stack; - for (Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, stack))) { - stack = (ItemStack) i$.next(); + for (Iterator<ItemStack> iterator = permutations.iterator(); iterator.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, stack))) { + stack = iterator.next(); } } else { ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); @@ -369,7 +369,7 @@ public class TT_NEI_ScannerHandler extends TemplateRecipeHandler { } } } - items = tDisplayStacks.toArray(new ItemStack[0]); + items = tDisplayStacks.toArray(new ItemStack[tDisplayStacks.size()]); if (items.length == 0) { items = new ItemStack[]{new ItemStack(Blocks.fire)}; } diff --git a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java index f2296a435d..154dd898f8 100644 --- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java @@ -32,7 +32,9 @@ public class ClientProxy extends CommonProxy { QuantumStuffBlock.renderID = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(QuantumStuffBlock.renderID, new QuantumStuffRender()); - if(Loader.isModLoaded("openmodularturrets")) new TT_turret_loader().run(); + if(Loader.isModLoaded("openmodularturrets")) { + new TT_turret_loader().run(); + } } @Override @@ -93,8 +95,9 @@ public class ClientProxy extends CommonProxy { dist = -dist; } fontRenderer.setUnicodeFlag(origFont); - } else + } else { fontRenderer.drawSplitString(str, x, y, maxWidth, color); + } } @Override 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 df6b18838e..ff26894729 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 @@ -17,7 +17,9 @@ 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[]; + public final cElementalDefinitionStackMap[] input; + public final cElementalDefinitionStackMap[] output; + public final cElementalDefinitionStackMap[] eCatalyst; public final AdditionalCheck additionalCheck; public TT_recipe(boolean aOptimize, @@ -40,13 +42,17 @@ public class TT_recipe extends GT_Recipe { } public boolean EMisRecipeInputEqual(boolean consume, boolean doNotCheckStackSizes, ItemStack[] itemStacks, FluidStack[] fluidStacks, cElementalInstanceStackMap[] in, cElementalInstanceStackMap[] catalyst) { - if(additionalCheck !=null && !additionalCheck.check(this,consume,doNotCheckStackSizes,itemStacks,fluidStacks,in,catalyst)) return false; + if(additionalCheck !=null && !additionalCheck.check(this,consume,doNotCheckStackSizes,itemStacks,fluidStacks,in,catalyst)) { + return false; + } if (eCatalyst != null) { if (catalyst != null && catalyst.length >= eCatalyst.length) { for (int i = 0; i < eCatalyst.length; i++) { if (eCatalyst[i] != null && eCatalyst[i].hasStacks()) { if (catalyst[i] != null && catalyst[i].hasStacks()) { - if (!catalyst[i].removeAllAmounts(true, eCatalyst[i])) return false; + if (!catalyst[i].removeAllAmounts(true, eCatalyst[i])) { + return false; + } } else { return false; } @@ -61,7 +67,9 @@ public class TT_recipe extends GT_Recipe { for (int i = 0; i < input.length; i++) { if (input[i] != null && input[i].hasStacks()) { if (in[i] != null && in[i].hasStacks()) { - if (!in[i].removeAllAmounts(consume, input[i])) return false; + if (!in[i].removeAllAmounts(consume, input[i])) { + return false; + } } else { return false; } @@ -79,13 +87,17 @@ public class TT_recipe extends GT_Recipe { } public boolean EMisRecipeInputEqualConsumeFromOne(boolean consume, boolean doNotCheckStackSizes, ItemStack[] itemStacks, FluidStack[] fluidStacks, cElementalInstanceStackMap in, cElementalInstanceStackMap[] catalyst) { - if(additionalCheck !=null && !additionalCheck.check(this,consume,doNotCheckStackSizes,itemStacks,fluidStacks,in,catalyst)) return false; + if(additionalCheck !=null && !additionalCheck.check(this,consume,doNotCheckStackSizes,itemStacks,fluidStacks,in,catalyst)) { + return false; + } if (eCatalyst != null) { if (catalyst != null && catalyst.length >= eCatalyst.length) { for (int i = 0; i < eCatalyst.length; i++) { if (eCatalyst[i] != null && eCatalyst[i].hasStacks()) { if (catalyst[i] != null && catalyst[i].hasStacks()) { - if (!catalyst[i].removeAllAmounts(true, eCatalyst[i])) return false; + if (!catalyst[i].removeAllAmounts(true, eCatalyst[i])) { + return false; + } } else { return false; } @@ -100,7 +112,9 @@ public class TT_recipe extends GT_Recipe { for (cElementalDefinitionStackMap anInput : input) { if (anInput != null && anInput.hasStacks()) { if (in.hasStacks()) { - if (!in.removeAllAmounts(consume, anInput)) return false; + if (!in.removeAllAmounts(consume, anInput)) { + return false; + } } else { return false; } @@ -134,7 +148,9 @@ public class TT_recipe extends GT_Recipe { } public T findRecipe(ItemStack dataHandler){ - if(dataHandler==null || dataHandler.stackTagCompound==null) return null; + if(dataHandler==null || dataHandler.stackTagCompound==null) { + return null; + } return mRecipeMap.get(dataHandler.stackTagCompound.getString(E_RECIPE_ID)); } @@ -216,11 +232,15 @@ public class TT_recipe extends GT_Recipe { } public T findRecipe(ItemStack dataHandler){ - if(dataHandler==null || dataHandler.stackTagCompound==null) return null; + if(dataHandler==null || dataHandler.stackTagCompound==null) { + return null; + } try { return mRecipeMap.get(cElementalDefinition.fromNBT(dataHandler.stackTagCompound.getCompoundTag(E_RECIPE_ID))); }catch (Exception e){ - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } return null; } } 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 4c61e1fe48..5f69cbbc6d 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 @@ -18,8 +18,12 @@ public class TT_recipeAdder extends GT_RecipeAdder { public static final FluidStack[] nullFluid=new FluidStack[0]; public static boolean addResearchableAssemblylineRecipe(ItemStack aResearchItem, int totalComputationRequired, int computationRequiredPerSec, int researchEUt, int researchAmperage, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int assDuration, int assEUt) { - if(aInputs==null)aInputs=nullItem; - if(aFluidInputs==null)aFluidInputs=nullFluid; + if(aInputs==null) { + aInputs = nullItem; + } + if(aFluidInputs==null) { + aFluidInputs = nullFluid; + } if (aResearchItem==null || totalComputationRequired<=0 || aOutput == null || aInputs.length>15) { return false; } @@ -28,10 +32,16 @@ public class TT_recipeAdder extends GT_RecipeAdder { TecTech.Logger.error("addResearchableAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); } } - if(researchAmperage<=0) researchAmperage=1; - else if(researchAmperage > Short.MAX_VALUE) researchAmperage=Short.MAX_VALUE; - if(computationRequiredPerSec<=0) computationRequiredPerSec=1; - else if(computationRequiredPerSec > Short.MAX_VALUE) computationRequiredPerSec=Short.MAX_VALUE; + if(researchAmperage<=0) { + researchAmperage = 1; + } else if(researchAmperage > Short.MAX_VALUE) { + researchAmperage = Short.MAX_VALUE; + } + if(computationRequiredPerSec<=0) { + computationRequiredPerSec = 1; + } else if(computationRequiredPerSec > Short.MAX_VALUE) { + computationRequiredPerSec = Short.MAX_VALUE; + } TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result")}, null, null, totalComputationRequired, researchEUt, researchAmperage| computationRequiredPerSec<<16); GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false, aInputs, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result")}, aFluidInputs, null, assDuration, assEUt, 0,true); GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe.GT_Recipe_AssemblyLine( aResearchItem, 0/*ignored*/, aInputs, aFluidInputs, aOutput, assDuration, assEUt)); @@ -49,8 +59,12 @@ public class TT_recipeAdder extends GT_RecipeAdder { ItemStack aResearchItem, int totalComputationRequired, int computationRequiredPerSec, int researchEUt, int researchAmperage, ItemStack[] aInputs, FluidStack[] aFluidInputs, cElementalDefinitionStackMap[] eInputs, ItemStack aOutput, int machineDuration, int machineEUt, int machineAmperage) { - if(aInputs==null)aInputs=nullItem; - if(aFluidInputs==null)aFluidInputs=nullFluid; + if(aInputs==null) { + aInputs = nullItem; + } + if(aFluidInputs==null) { + aFluidInputs = nullFluid; + } if (aResearchItem==null || totalComputationRequired<=0 || aOutput == null) { return false; } @@ -59,10 +73,16 @@ public class TT_recipeAdder extends GT_RecipeAdder { TecTech.Logger.error("addResearchableEMmachineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); } } - if(researchAmperage<=0) researchAmperage=1; - else if(researchAmperage > Short.MAX_VALUE) researchAmperage=Short.MAX_VALUE; - if(computationRequiredPerSec<=0) computationRequiredPerSec=1; - else if(computationRequiredPerSec > Short.MAX_VALUE) computationRequiredPerSec=Short.MAX_VALUE; + if(researchAmperage<=0) { + researchAmperage = 1; + } else if(researchAmperage > Short.MAX_VALUE) { + researchAmperage = Short.MAX_VALUE; + } + if(computationRequiredPerSec<=0) { + computationRequiredPerSec = 1; + } else if(computationRequiredPerSec > Short.MAX_VALUE) { + computationRequiredPerSec = Short.MAX_VALUE; + } TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataOrb.getWithName(1L, "Writes Research result for "+ GT_MetaTileEntity_EM_machine.machine)}, null, null, totalComputationRequired, researchEUt, researchAmperage| computationRequiredPerSec<<16); TT_recipe.TT_Recipe_Map.sMachineRecipes.add(new TT_recipe.TT_assLineRecipe(false,aResearchItem,aInputs,new ItemStack[]{aOutput},new ItemStack[]{ItemList.Tool_DataOrb.getWithName(1L, "Reads Research result")}, aFluidInputs,machineDuration,machineEUt,machineAmperage,eInputs)); @@ -76,10 +96,16 @@ public class TT_recipeAdder extends GT_RecipeAdder { if (aResearchItem==null || totalComputationRequired<=0 || aOutput == null) { return false; } - if(researchAmperage<=0) researchAmperage=1; - else if(researchAmperage > Short.MAX_VALUE) researchAmperage=Short.MAX_VALUE; - if(computationRequiredPerSec<=0) computationRequiredPerSec=1; - else if(computationRequiredPerSec > Short.MAX_VALUE) computationRequiredPerSec=Short.MAX_VALUE; + if(researchAmperage<=0) { + researchAmperage = 1; + } else if(researchAmperage > Short.MAX_VALUE) { + researchAmperage = Short.MAX_VALUE; + } + if(computationRequiredPerSec<=0) { + computationRequiredPerSec = 1; + } else if(computationRequiredPerSec > Short.MAX_VALUE) { + computationRequiredPerSec = Short.MAX_VALUE; + } TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataOrb.getWithName(1L, "Writes Research result for "+ GT_MetaTileEntity_EM_crafting.crafter)}, null, null, totalComputationRequired, researchEUt, researchAmperage| computationRequiredPerSec<<16); TT_recipe.TT_Recipe_Map.sCrafterRecipes.add(new TT_recipe.TT_assLineRecipe(false,aResearchItem,null,new ItemStack[]{aOutput},new ItemStack[]{ItemList.Tool_DataOrb.getWithName(1L, "Reads Research result")}, null,crafterDuration,crafterEUt,crafterAmperage,eInputs,null,catalyst,check)); @@ -90,8 +116,12 @@ public class TT_recipeAdder extends GT_RecipeAdder { iElementalDefinition aResearchEM, int totalComputationRequired, int computationRequiredPerSec, int researchEUt, int researchAmperage, ItemStack[] aInputs, FluidStack[] aFluidInputs, cElementalDefinitionStackMap[] eInputs, ItemStack aOutput, int machineDuration, int machineEUt, int machineAmperage) { - if(aInputs==null)aInputs=nullItem; - if(aFluidInputs==null)aFluidInputs=nullFluid; + if(aInputs==null) { + aInputs = nullItem; + } + if(aFluidInputs==null) { + aFluidInputs = nullFluid; + } if (aResearchEM==null || totalComputationRequired<=0 || aOutput == null) { return false; } @@ -100,10 +130,16 @@ public class TT_recipeAdder extends GT_RecipeAdder { TecTech.Logger.error("addScannableEMmachineRecipe "+aResearchEM+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); } } - if(researchAmperage<=0) researchAmperage=1; - else if(researchAmperage > Short.MAX_VALUE) researchAmperage=Short.MAX_VALUE; - if(computationRequiredPerSec<=0) computationRequiredPerSec=1; - else if(computationRequiredPerSec > Short.MAX_VALUE) computationRequiredPerSec=Short.MAX_VALUE; + if(researchAmperage<=0) { + researchAmperage = 1; + } else if(researchAmperage > Short.MAX_VALUE) { + researchAmperage = Short.MAX_VALUE; + } + if(computationRequiredPerSec<=0) { + computationRequiredPerSec = 1; + } else if(computationRequiredPerSec > Short.MAX_VALUE) { + computationRequiredPerSec = Short.MAX_VALUE; + } ItemStack placeholder=new ItemStack(ElementalDefinitionContainer_EM.INSTANCE); ElementalDefinitionContainer_EM.setContent(placeholder,new cElementalDefinitionStackMap(new cElementalDefinitionStack(aResearchEM,1))); GT_Recipe thisRecipe=TT_recipe.GT_Recipe_MapTT.sScannableFakeRecipes.addFakeRecipe(false, new ItemStack[]{placeholder}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataOrb.getWithName(1L, "Writes Research result for "+ GT_MetaTileEntity_EM_machine.machine)}, null, null, totalComputationRequired, researchEUt, researchAmperage| computationRequiredPerSec<<16); @@ -119,10 +155,16 @@ public class TT_recipeAdder extends GT_RecipeAdder { if (aResearchEM==null || totalComputationRequired<=0 || aOutput == null) { return false; } - if(researchAmperage<=0) researchAmperage=1; - else if(researchAmperage > Short.MAX_VALUE) researchAmperage=Short.MAX_VALUE; - if(computationRequiredPerSec<=0) computationRequiredPerSec=1; - else if(computationRequiredPerSec > Short.MAX_VALUE) computationRequiredPerSec=Short.MAX_VALUE; + if(researchAmperage<=0) { + researchAmperage = 1; + } else if(researchAmperage > Short.MAX_VALUE) { + researchAmperage = Short.MAX_VALUE; + } + if(computationRequiredPerSec<=0) { + computationRequiredPerSec = 1; + } else if(computationRequiredPerSec > Short.MAX_VALUE) { + computationRequiredPerSec = Short.MAX_VALUE; + } ItemStack placeholder=new ItemStack(ElementalDefinitionContainer_EM.INSTANCE); ElementalDefinitionContainer_EM.setContent(placeholder,new cElementalDefinitionStackMap(new cElementalDefinitionStack(aResearchEM,1))); GT_Recipe thisRecipe=TT_recipe.GT_Recipe_MapTT.sScannableFakeRecipes.addFakeRecipe(false, new ItemStack[]{placeholder}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataOrb.getWithName(1L, "Writes Research result for "+ GT_MetaTileEntity_EM_crafting.crafter)}, null, null, totalComputationRequired, researchEUt, researchAmperage| computationRequiredPerSec<<16); diff --git a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java index 4e983bba1f..1259b14d97 100644 --- a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java +++ b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java @@ -63,7 +63,9 @@ public enum CustomItemList implements IItemContainer { @Override public IItemContainer set(Item aItem) { mHasNotBeenSet = false; - if (aItem == null) return this; + if (aItem == null) { + return this; + } ItemStack aStack = new ItemStack(aItem, 1, 0); mStack = GT_Utility.copyAmount(1, aStack); return this; @@ -78,16 +80,20 @@ public enum CustomItemList implements IItemContainer { @Override public Item getItem() { - if (mHasNotBeenSet) + if (mHasNotBeenSet) { throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); - if (GT_Utility.isStackInvalid(mStack)) return null; + } + if (GT_Utility.isStackInvalid(mStack)) { + return null; + } return mStack.getItem(); } @Override public Block getBlock() { - if (mHasNotBeenSet) + if (mHasNotBeenSet) { throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + } return GT_Utility.getBlockFromStack(new ItemStack(getItem())); } @@ -103,46 +109,62 @@ public enum CustomItemList implements IItemContainer { @Override public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT) { - if (GT_Utility.isStackInvalid(aStack)) return false; + if (GT_Utility.isStackInvalid(aStack)) { + return false; + } return GT_Utility.areUnificationsEqual((ItemStack) aStack, aWildcard ? getWildcard(1) : get(1), aIgnoreNBT); } @Override public ItemStack get(long aAmount, Object... aReplacements) { - if (mHasNotBeenSet) + if (mHasNotBeenSet) { throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); - if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + } + if (GT_Utility.isStackInvalid(mStack)) { + return GT_Utility.copyAmount(aAmount, aReplacements); + } return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(mStack)); } @Override public ItemStack getWildcard(long aAmount, Object... aReplacements) { - if (mHasNotBeenSet) + if (mHasNotBeenSet) { throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); - if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + } + if (GT_Utility.isStackInvalid(mStack)) { + return GT_Utility.copyAmount(aAmount, aReplacements); + } return GT_Utility.copyAmountAndMetaData(aAmount, W, GT_OreDictUnificator.get(mStack)); } @Override public ItemStack getUndamaged(long aAmount, Object... aReplacements) { - if (mHasNotBeenSet) + if (mHasNotBeenSet) { throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); - if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + } + if (GT_Utility.isStackInvalid(mStack)) { + return GT_Utility.copyAmount(aAmount, aReplacements); + } return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(mStack)); } @Override public ItemStack getAlmostBroken(long aAmount, Object... aReplacements) { - if (mHasNotBeenSet) + if (mHasNotBeenSet) { throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); - if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + } + if (GT_Utility.isStackInvalid(mStack)) { + return GT_Utility.copyAmount(aAmount, aReplacements); + } return GT_Utility.copyAmountAndMetaData(aAmount, mStack.getMaxDamage() - 1, GT_OreDictUnificator.get(mStack)); } @Override public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements) { ItemStack rStack = get(1, aReplacements); - if (GT_Utility.isStackInvalid(rStack)) return null; + if (GT_Utility.isStackInvalid(rStack)) { + return null; + } rStack.setStackDisplayName(aDisplayName); return GT_Utility.copyAmount(aAmount, rStack); } @@ -150,32 +172,43 @@ public enum CustomItemList implements IItemContainer { @Override public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements) { ItemStack rStack = get(1, aReplacements); - if (GT_Utility.isStackInvalid(rStack)) return null; + if (GT_Utility.isStackInvalid(rStack)) { + return null; + } GT_ModHandler.chargeElectricItem(rStack, aEnergy, Integer.MAX_VALUE, true, false); return GT_Utility.copyAmount(aAmount, rStack); } @Override public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements) { - if (mHasNotBeenSet) + if (mHasNotBeenSet) { throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); - if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements); + } + if (GT_Utility.isStackInvalid(mStack)) { + return GT_Utility.copyAmount(aAmount, aReplacements); + } return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(mStack)); } @Override public IItemContainer registerOre(Object... aOreNames) { - if (mHasNotBeenSet) + if (mHasNotBeenSet) { throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); - for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, get(1)); + } + for (Object tOreName : aOreNames) { + GT_OreDictUnificator.registerOre(tOreName, get(1)); + } return this; } @Override public IItemContainer registerWildcardAsOre(Object... aOreNames) { - if (mHasNotBeenSet) + if (mHasNotBeenSet) { throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); - for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, getWildcard(1)); + } + for (Object tOreName : aOreNames) { + GT_OreDictUnificator.registerOre(tOreName, getWildcard(1)); + } return this; } }
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassItem.java b/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassItem.java index 171e8db6e9..aff5f8bbb7 100644 --- a/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassItem.java +++ b/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassItem.java @@ -16,8 +16,8 @@ import static com.github.technus.tectech.CommonValues.TEC_MARK_EM; public class QuantumGlassItem extends ItemBlock { public static QuantumGlassItem INSTANCE; - public QuantumGlassItem(Block b) { - super(b); + public QuantumGlassItem(Block block) { + super(block); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassRender.java b/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassRender.java index 0cbac64692..cec06002fa 100644 --- a/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassRender.java +++ b/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassRender.java @@ -13,9 +13,6 @@ import org.lwjgl.opengl.GL11; */ public final class QuantumGlassRender implements ISimpleBlockRenderingHandler { - public QuantumGlassRender() { - } - @Override public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { GL11.glTranslatef(-0.5F, -0.5F, -0.5F); diff --git a/src/main/java/com/github/technus/tectech/thing/block/QuantumStuffRender.java b/src/main/java/com/github/technus/tectech/thing/block/QuantumStuffRender.java index ec7f7ed0e0..add97c46a1 100644 --- a/src/main/java/com/github/technus/tectech/thing/block/QuantumStuffRender.java +++ b/src/main/java/com/github/technus/tectech/thing/block/QuantumStuffRender.java @@ -16,8 +16,6 @@ import org.lwjgl.opengl.GL11; public final class QuantumStuffRender implements ISimpleBlockRenderingHandler { private static Tessellator tes=Tessellator.instance; - public QuantumStuffRender() {} - @Override public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { GL11.glTranslatef(-0.5F, -0.5F, -0.5F); @@ -60,8 +58,8 @@ public final class QuantumStuffRender implements ISimpleBlockRenderingHandler { tes.setBrightness(15728880); IIcon side = QuantumStuffBlock.stuff; for(int i=0;i<6;i++){ - float b = 1 - TecTech.Rnd.nextFloat() / 4f, g = b - TecTech.Rnd.nextFloat() / 4f, r = g - TecTech.Rnd.nextFloat() / 4f - 0.25f; - tes.setColorOpaque_F(r, g, b); + float f = 1 - TecTech.Rnd.nextFloat() / 4f, g = f - TecTech.Rnd.nextFloat() / 4f, r = g - TecTech.Rnd.nextFloat() / 4f - 0.25f; + tes.setColorOpaque_F(r, g, f); float rotX=TecTech.Rnd.nextFloat()*2*(float) Math.PI,rotY=TecTech.Rnd.nextFloat()*2*(float) Math.PI,rotZ=TecTech.Rnd.nextFloat()*2*(float) Math.PI; tesAbuse(x,y,z,-1.425f,-1.425f,.1f,rotX,rotY,rotZ,side.getMinU(), side.getMaxV()); tesAbuse(x,y,z,-1.425f,1.425f,.1f,rotX,rotY,rotZ,side.getMinU(), side.getMinV()); diff --git a/src/main/java/com/github/technus/tectech/thing/block/ReactorSimItem.java b/src/main/java/com/github/technus/tectech/thing/block/ReactorSimItem.java index c21820eea5..4625dca434 100644 --- a/src/main/java/com/github/technus/tectech/thing/block/ReactorSimItem.java +++ b/src/main/java/com/github/technus/tectech/thing/block/ReactorSimItem.java @@ -16,8 +16,8 @@ import static com.github.technus.tectech.CommonValues.TEC_MARK_GENERAL; public class ReactorSimItem extends ItemBlock { public static QuantumGlassItem INSTANCE; - public ReactorSimItem(Block b) { - super(b); + public ReactorSimItem(Block block) { + super(block); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsTT.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsTT.java index 52da618bac..2ea22b625d 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsTT.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsTT.java @@ -26,12 +26,12 @@ public class GT_Block_CasingsTT extends GT_Block_Casings_Abstract { public static final byte texturePage=tectechTexturePage1; public static final short textureOffset = texturePage << 7;//Start of PAGE 8 (which is the 9th page) (8*128) private static IIcon eM0, eM1, eM1s, eM2, eM2s, eM3, eM3s, eM4, eM5, eM6, eM7, eM7s, eM8, eM9, eM10, eM11, eM12, eM13, eM14; - private static IIcon debug[] = new IIcon[6]; + private static IIcon[] debug = new IIcon[6]; public GT_Block_CasingsTT() { super(GT_Item_CasingsTT.class, "gt.blockcasingsTT", GT_Material_Casings.INSTANCE); - for (byte i = 0; i < 16; i = (byte) (i + 1)) { - Textures.BlockIcons.casingTexturePages[texturePage][i] = new GT_CopiedBlockTexture(this, 6, i); + for (byte b = 0; b < 16; b = (byte) (b + 1)) { + Textures.BlockIcons.casingTexturePages[texturePage][b] = new GT_CopiedBlockTexture(this, 6, b); /*IMPORTANT for block recoloring**/ } GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "High Power Casing"); @@ -124,13 +124,19 @@ public class GT_Block_CasingsTT extends GT_Block_Casings_Abstract { case 0: return eM0; case 1: - if (aSide < 2) return eM1; + if (aSide < 2) { + return eM1; + } return eM1s; case 2: - if (aSide < 2) return eM2; + if (aSide < 2) { + return eM2; + } return eM2s; case 3: - if (aSide < 2) return eM3; + if (aSide < 2) { + return eM3; + } return eM3s; case 4: return eM4; @@ -139,7 +145,9 @@ public class GT_Block_CasingsTT extends GT_Block_Casings_Abstract { case 6: return eM6; case 7: - if (aSide < 2) return eM7; + if (aSide < 2) { + return eM7; + } return eM7s; case 8: return eM8; diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java index d98edd473b..5112f156c7 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java @@ -20,7 +20,7 @@ import java.util.List; * Created by danie_000 on 03.10.2016. */ public class GT_Block_HintTT extends GT_Block_Casings_Abstract { - private static IIcon hint[] = new IIcon[16]; + private static IIcon[] hint = new IIcon[16]; public GT_Block_HintTT() { super(GT_Item_HintTT.class, "gt.blockhintTT", GT_Material_Casings.INSTANCE); diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsTT.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsTT.java index 88bbbca39d..6751e4b24b 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsTT.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsTT.java @@ -21,8 +21,11 @@ public class GT_Item_CasingsTT extends GT_Item_Casings_Abstract { @Override public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { - if(aStack.getItemDamage()>0 && aStack.getItemDamage()<15) aList.add(TEC_MARK_EM); - else aList.add(TEC_MARK_GENERAL); + if(aStack.getItemDamage()>0 && aStack.getItemDamage()<15) { + aList.add(TEC_MARK_EM); + } else { + aList.add(TEC_MARK_GENERAL); + } switch (aStack.getItemDamage()) { case 0://"High Power Casing" aList.add("Well suited for high power applications."); diff --git a/src/main/java/com/github/technus/tectech/thing/casing/TT_Container_Casings.java b/src/main/java/com/github/technus/tectech/thing/casing/TT_Container_Casings.java index 98f53cfe30..4526a98f2e 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/TT_Container_Casings.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/TT_Container_Casings.java @@ -5,7 +5,9 @@ import net.minecraft.block.Block; /** * Created by danie_000 on 03.10.2016. */ -public class TT_Container_Casings { +public final class TT_Container_Casings { public static Block sBlockCasingsTT; public static Block sHintCasingsTT; + + private TT_Container_Casings() {} } 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 index 6e98f99790..ab83518607 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java @@ -31,7 +31,7 @@ import static gregtech.api.GregTech_API.sBlockCasings1; /** * Created by Tec on 15.03.2017. */ -public class ConstructableTriggerItem extends Item { +public final class ConstructableTriggerItem extends Item { public static ConstructableTriggerItem INSTANCE; public static HashMap<String,MultiblockInfoContainer> multiblockMap= new HashMap<>(); @@ -44,7 +44,9 @@ public class ConstructableTriggerItem extends Item { @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(tTileEntity==null || aPlayer instanceof FakePlayer) { + return aPlayer instanceof EntityPlayerMP; + } if (aPlayer instanceof EntityPlayerMP) { //struct gen if (aPlayer.isSneaking() && aPlayer.capabilities.isCreativeMode) { @@ -149,9 +151,9 @@ public class ConstructableTriggerItem extends Item { }); } - public abstract static class MultiblockInfoContainer { - public abstract void construct(int stackSize, boolean hintsOnly, TileEntity tileEntity, int aSide); + public interface MultiblockInfoContainer { + void construct(int stackSize, boolean hintsOnly, TileEntity tileEntity, int aSide); @SideOnly(Side.CLIENT) - public abstract String[] getDescription(int stackSize); + String[] getDescription(int stackSize); } } diff --git a/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java b/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java index e8711b331a..52ebed6a21 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java @@ -27,7 +27,7 @@ import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; /** * Created by Tec on 15.03.2017. */ -public class DebugElementalInstanceContainer_EM extends Item { +public final class DebugElementalInstanceContainer_EM extends Item { public static DebugElementalInstanceContainer_EM INSTANCE; private DebugElementalInstanceContainer_EM() { @@ -42,15 +42,17 @@ public class DebugElementalInstanceContainer_EM extends Item { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (aPlayer instanceof EntityPlayerMP) { aStack.stackSize = 1; - if (tTileEntity != null && tTileEntity instanceof IGregTechTileEntity) { + if (tTileEntity instanceof IGregTechTileEntity) { IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); - if (metaTE != null && metaTE instanceof iElementalInstanceContainer) { + if (metaTE instanceof iElementalInstanceContainer) { cElementalInstanceStackMap content = ((iElementalInstanceContainer) metaTE).getContainerHandler(); if (tNBT.hasKey("content")) { try { content.putUnifyAll(cElementalInstanceStackMap.fromNBT(tNBT.getCompoundTag("content"))); } catch (tElementalException e) { - if (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/ElementalDefinitionContainer_EM.java b/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionContainer_EM.java index c5b2d3100e..c2137df464 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionContainer_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionContainer_EM.java @@ -20,7 +20,7 @@ import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; /** * Created by Tec on 15.03.2017. */ -public class ElementalDefinitionContainer_EM extends Item { +public final class ElementalDefinitionContainer_EM extends Item { public static ElementalDefinitionContainer_EM INSTANCE; private ElementalDefinitionContainer_EM() { @@ -33,14 +33,18 @@ public class ElementalDefinitionContainer_EM extends Item { public static cElementalDefinitionStackMap setContent(ItemStack containerItem, cElementalDefinitionStackMap definitions){ if(containerItem.getItem() instanceof ElementalDefinitionContainer_EM) { NBTTagCompound tNBT = containerItem.stackTagCompound; - if (tNBT == null) tNBT=containerItem.stackTagCompound=new NBTTagCompound(); + if (tNBT == null) { + tNBT = containerItem.stackTagCompound = new NBTTagCompound(); + } cElementalDefinitionStackMap oldMap=null; if (tNBT.hasKey("content")) { try { oldMap=cElementalDefinitionStackMap.fromNBT(tNBT.getCompoundTag("content")); } catch (tElementalException e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } } } tNBT.setTag("info", definitions.getInfoNBT()); @@ -54,11 +58,15 @@ public class ElementalDefinitionContainer_EM extends Item { if(containerItem.getItem() instanceof ElementalDefinitionContainer_EM){ NBTTagCompound tNBT = containerItem.stackTagCompound; - if (tNBT == null || !tNBT.hasKey("content")) return null; + if (tNBT == null || !tNBT.hasKey("content")) { + return null; + } try { return cElementalDefinitionStackMap.fromNBT(tNBT.getCompoundTag("content")); } catch (tElementalException e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } } } return null; @@ -67,14 +75,18 @@ public class ElementalDefinitionContainer_EM extends Item { public static cElementalDefinitionStackMap clearContent(ItemStack containerItem){ if(containerItem.getItem() instanceof ElementalDefinitionContainer_EM){ NBTTagCompound tNBT = containerItem.stackTagCompound; - if (tNBT == null) return null; + if (tNBT == null) { + return null; + } cElementalDefinitionStackMap oldMap=null; if (tNBT.hasKey("content")) { try { oldMap=cElementalDefinitionStackMap.fromNBT(tNBT.getCompoundTag("content")); } catch (tElementalException e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } } } tNBT.removeTag("info"); diff --git a/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java b/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java index b5250dc3d4..4ba1323d15 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java @@ -26,7 +26,7 @@ import static com.github.technus.tectech.auxiliary.Reference.MODID; /** * Created by Tec on 15.03.2017. */ -public class ElementalDefinitionScanStorage_EM extends Item { +public final class ElementalDefinitionScanStorage_EM extends Item { public static ElementalDefinitionScanStorage_EM INSTANCE; public static IIcon offline, online; @@ -39,23 +39,26 @@ public class ElementalDefinitionScanStorage_EM extends Item { //return previous thing public static void setContent(ItemStack containerItem, cElementalInstanceStackMap definitions, int[] detailsOnDepthLevels){ if(containerItem.getItem() instanceof ElementalDefinitionScanStorage_EM) { - if (containerItem.stackTagCompound == null) containerItem.stackTagCompound=new NBTTagCompound(); + if (containerItem.stackTagCompound == null) { + containerItem.stackTagCompound = new NBTTagCompound(); + } containerItem.stackTagCompound.setTag("elementalInfo", definitions.getScanInfoNBT(detailsOnDepthLevels)); } } public static void clearContent(ItemStack containerItem){ if(containerItem.getItem() instanceof ElementalDefinitionScanStorage_EM){ - if (containerItem.stackTagCompound == null) return; + if (containerItem.stackTagCompound == null) { + return; + } containerItem.stackTagCompound=null; - return; } - return; } public static String[] getLines(ItemStack containerItem){ - if(containerItem.stackTagCompound!=null && containerItem.stackTagCompound.hasKey("elementalInfo")) + if(containerItem.stackTagCompound!=null && containerItem.stackTagCompound.hasKey("elementalInfo")) { return Util.infoFromNBT(containerItem.stackTagCompound.getCompoundTag("elementalInfo")); + } return null; } @@ -94,16 +97,18 @@ public class ElementalDefinitionScanStorage_EM extends Item { @Override public IIcon getIconIndex(ItemStack itemStack) { NBTTagCompound tagCompound=itemStack.stackTagCompound; - if(tagCompound!=null && tagCompound.hasKey("elementalInfo")) + if(tagCompound!=null && tagCompound.hasKey("elementalInfo")) { return online; + } return offline; } @Override public IIcon getIcon(ItemStack itemStack, int pass) { NBTTagCompound tagCompound=itemStack.stackTagCompound; - if(tagCompound!=null && tagCompound.hasKey("elementalInfo")) + if(tagCompound!=null && tagCompound.hasKey("elementalInfo")) { return online; + } return offline; } @@ -117,8 +122,9 @@ public class ElementalDefinitionScanStorage_EM extends Item { public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { if(world.isRemote){ NBTTagCompound tagCompound=itemStack.stackTagCompound; - if(tagCompound!=null && tagCompound.hasKey("elementalInfo")) - player.openGui(TecTech.instance, ModGuiHandler.SCAN_DISPLAY_SCREEN_ID,world,0,0,0); + if(tagCompound!=null && tagCompound.hasKey("elementalInfo")) { + player.openGui(TecTech.instance, ModGuiHandler.SCAN_DISPLAY_SCREEN_ID, world, 0, 0, 0); + } } return itemStack; } diff --git a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java index 67e9488d3e..883a1923a1 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java @@ -29,7 +29,7 @@ import static com.github.technus.tectech.thing.CustomItemList.parametrizerMemory /** * Created by Tec on 15.03.2017. */ -public class ParametrizerMemoryCard extends Item { +public final class ParametrizerMemoryCard extends Item { public static ParametrizerMemoryCard INSTANCE; public static IIcon locked,unlocked; @@ -45,12 +45,14 @@ public class ParametrizerMemoryCard extends Item { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (aPlayer instanceof EntityPlayerMP) { aStack.stackSize = 1; - if (tTileEntity != null && tTileEntity instanceof IGregTechTileEntity) { + if (tTileEntity instanceof IGregTechTileEntity) { IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); if (metaTE != null) { if (metaTE instanceof GT_MetaTileEntity_Hatch_Param) { GT_MetaTileEntity_Hatch_Param parametrizer = (GT_MetaTileEntity_Hatch_Param) metaTE; - if (aStack.getTagCompound() == null) aStack.setTagCompound(new NBTTagCompound()); + if (aStack.getTagCompound() == null) { + aStack.setTagCompound(new NBTTagCompound()); + } NBTTagCompound tNBT = aStack.getTagCompound(); if (aStack.getItemDamage() == 1) { //write to parametrizer @@ -72,7 +74,9 @@ public class ParametrizerMemoryCard extends Item { return true; }else if(metaTE instanceof GT_MetaTileEntity_MultiblockBase_EM){ GT_MetaTileEntity_MultiblockBase_EM base = (GT_MetaTileEntity_MultiblockBase_EM) metaTE; - if (aStack.getTagCompound() == null) aStack.setTagCompound(new NBTTagCompound()); + if (aStack.getTagCompound() == null) { + aStack.setTagCompound(new NBTTagCompound()); + } NBTTagCompound tNBT = aStack.getTagCompound(); if(aStack.getItemDamage()== 1){ //write to base diff --git a/src/main/java/com/github/technus/tectech/thing/item/gui/ScanDisplayScreen.java b/src/main/java/com/github/technus/tectech/thing/item/gui/ScanDisplayScreen.java index 205db9b161..140e8e07be 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/gui/ScanDisplayScreen.java +++ b/src/main/java/com/github/technus/tectech/thing/item/gui/ScanDisplayScreen.java @@ -91,15 +91,17 @@ public class ScanDisplayScreen extends GuiScreen { baseX=(width- sizeX)/2; baseY=(height- sizeY)/2-12; int buttonBaseY=baseY+145; - buttonList.add(pgUp=new Button(0,baseX+77,buttonBaseY,0,220)); - buttonList.add(up=new Button(1,baseX+99,buttonBaseY,20,220)); - buttonList.add(down=new Button(2,baseX+121,buttonBaseY,40,220)); - buttonList.add(pgDown=new Button(3,baseX+143,buttonBaseY,60,220)); + buttonList.add(pgUp= new Button(0, baseX + 77, buttonBaseY, 0, 220)); + buttonList.add(up= new Button(1, baseX + 99, buttonBaseY, 20, 220)); + buttonList.add(down= new Button(2, baseX + 121, buttonBaseY, 40, 220)); + buttonList.add(pgDown= new Button(3, baseX + 143, buttonBaseY, 60, 220)); } @Override protected void actionPerformed(GuiButton button) { - if (lines.length <= renderedLines) return; + if (lines.length <= renderedLines) { + return; + } if (button == pgUp) { firstLine -= renderedLines; } else if (button == up) { @@ -109,11 +111,15 @@ public class ScanDisplayScreen extends GuiScreen { } else if (button == pgDown) { firstLine += renderedLines; } - if (firstLine > lines.length - renderedLines) firstLine = lines.length - renderedLines; - if (firstLine < 0) firstLine = 0; + if (firstLine > lines.length - renderedLines) { + firstLine = lines.length - renderedLines; + } + if (firstLine < 0) { + firstLine = 0; + } } - private class Button extends GuiButton{ + private static class Button extends GuiButton{ int u,v; Button(int id,int x,int y,int u,int v){ super(id,x,y,20,20,""); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java index 8cfc075b31..16eb50b4e4 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java @@ -33,11 +33,11 @@ public abstract class GT_MetaTileEntity_Hatch_DataConnector extends GT_MetaTileE public short id = -1; - public GT_MetaTileEntity_Hatch_DataConnector(int aID, String aName, String aNameRegional, int aTier, String descr) { + protected GT_MetaTileEntity_Hatch_DataConnector(int aID, String aName, String aNameRegional, int aTier, String descr) { super(aID, aName, aNameRegional, aTier, 0, descr); } - public GT_MetaTileEntity_Hatch_DataConnector(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + protected GT_MetaTileEntity_Hatch_DataConnector(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); } @@ -64,16 +64,18 @@ public abstract class GT_MetaTileEntity_Hatch_DataConnector extends GT_MetaTileE public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); aNBT.setShort("eID", id); - if (q != null) + if (q != null) { aNBT.setTag("eDATA", q.toNbt()); + } } @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); id = aNBT.getShort("eID"); - if (aNBT.hasKey("eDATA")) + if (aNBT.hasKey("eDATA")) { q = new QuantumDataPacket(aNBT.getCompoundTag("eDATA")); + } } @Override @@ -139,11 +141,9 @@ public abstract class GT_MetaTileEntity_Hatch_DataConnector extends GT_MetaTileE @Override public String[] getInfoData() { - if (id > 0) return new String[]{ - "ID: " + EnumChatFormatting.AQUA + id, - "Computation: " + EnumChatFormatting.AQUA + (q != null ? q.computation : 0), - "PacketHistory: " + EnumChatFormatting.RED + (q != null ? q.trace.size() : 0), - }; + if (id > 0) { + return new String[]{"ID: " + EnumChatFormatting.AQUA + id, "Computation: " + EnumChatFormatting.AQUA + (q != null ? q.computation : 0), "PacketHistory: " + EnumChatFormatting.RED + (q != null ? q.trace.size() : 0),}; + } return new String[]{ "Computation: " + EnumChatFormatting.AQUA + (q != null ? q.computation : 0), "PacketHistory: " + EnumChatFormatting.RED + (q != null ? q.trace.size() : 0), diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java index 78d278e463..d83c0ba7e1 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java @@ -87,7 +87,7 @@ public class GT_MetaTileEntity_Hatch_DynamoMulti extends GT_MetaTileEntity_Hatch @Override public long getMinimumStoredEU() { - return 128 * Amperes; + return 128L * Amperes; } @Override 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 9a51b0278e..4ff8a5db75 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 @@ -42,7 +42,7 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta private byte deathDelay = 2; public final int eTier; - public GT_MetaTileEntity_Hatch_ElementalContainer(int aID, String aName, String aNameRegional, int aTier, String descr) { + protected GT_MetaTileEntity_Hatch_ElementalContainer(int aID, String aName, String aNameRegional, int aTier, String descr) { super(aID, aName, aNameRegional, aTier, 0, descr); eTier=aTier; } @@ -52,7 +52,7 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta // eTier=aTier; //} - public GT_MetaTileEntity_Hatch_ElementalContainer(String aName, int aTier, int eTier, String aDescription, ITexture[][][] aTextures) { + protected GT_MetaTileEntity_Hatch_ElementalContainer(String aName, int aTier, int eTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); this.eTier=eTier; } @@ -96,8 +96,12 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta try { content = cElementalInstanceStackMap.fromNBT(aNBT.getCompoundTag("eM_Stacks")); } catch (tElementalException e) { - if (DEBUG_MODE) e.printStackTrace(); - if (content == null) content = new cElementalInstanceStackMap(); + if (DEBUG_MODE) { + e.printStackTrace(); + } + if (content == null) { + content = new cElementalInstanceStackMap(); + } } } @@ -115,29 +119,37 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta } else { if (deathDelay == 1) { IGregTechTileEntity tGTTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()); - if (tGTTileEntity == null || !(tGTTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_OverflowElemental)) + if (tGTTileEntity == null || !(tGTTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_OverflowElemental)) { tGTTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSide((byte) 0); - if (tGTTileEntity == null || !(tGTTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_OverflowElemental)) + } + if (tGTTileEntity == null || !(tGTTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_OverflowElemental)) { tGTTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSide((byte) 1); + } if (tGTTileEntity != null && tGTTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_OverflowElemental) { GT_MetaTileEntity_Hatch_OverflowElemental aMetaTileEntity = (GT_MetaTileEntity_Hatch_OverflowElemental) tGTTileEntity.getMetaTileEntity(); if (aMetaTileEntity.addOverflowMatter(overflowMatter)) { - if (TecTech.ModConfig.BOOM_ENABLE) tGTTileEntity.doExplosion(V[14]); - else - TecTech.proxy.broadcast("Container1 BOOM! " + getBaseMetaTileEntity().getXCoord() + " " + getBaseMetaTileEntity().getYCoord() + " " + getBaseMetaTileEntity().getZCoord()); + if (TecTech.ModConfig.BOOM_ENABLE) { + tGTTileEntity.doExplosion(V[14]); + } else { + TecTech.proxy.broadcast("Container1 BOOM! " + getBaseMetaTileEntity().getXCoord() + ' ' + getBaseMetaTileEntity().getYCoord() + ' ' + getBaseMetaTileEntity().getZCoord()); + } } deathDelay = 3;//needed in some cases like repetitive failures. Should be 4 since there is -- at end but meh... overflowMatter = 0F; } } else if (deathDelay < 1) { - if (TecTech.ModConfig.BOOM_ENABLE) getBaseMetaTileEntity().doExplosion(V[14]); - else - TecTech.proxy.broadcast("Container0 BOOM! " + getBaseMetaTileEntity().getXCoord() + " " + getBaseMetaTileEntity().getYCoord() + " " + getBaseMetaTileEntity().getZCoord()); + if (TecTech.ModConfig.BOOM_ENABLE) { + getBaseMetaTileEntity().doExplosion(V[14]); + } else { + TecTech.proxy.broadcast("Container0 BOOM! " + getBaseMetaTileEntity().getXCoord() + ' ' + getBaseMetaTileEntity().getYCoord() + ' ' + getBaseMetaTileEntity().getZCoord()); + } } deathDelay--; } } else if (MOVE_AT == Tick) { - if (content.hasStacks()) moveAround(aBaseMetaTileEntity); + if (content.hasStacks()) { + moveAround(aBaseMetaTileEntity); + } getBaseMetaTileEntity().setActive(content.hasStacks()); } } @@ -213,9 +225,9 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta public String[] getInfoData() { if(TecTech.ModConfig.EASY_SCAN) { if (id > 0) { - if (content == null || content.size() == 0) + if (content == null || content.size() == 0) { return new String[]{"ID: " + EnumChatFormatting.AQUA + id, "No Stacks"}; - else { + } else { String[] lines = content.getElementalInfo(); String[] output = new String[lines.length + 1]; output[0] = "ID: " + EnumChatFormatting.AQUA + id; @@ -223,16 +235,20 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta return output; } } - if (content == null || content.size() == 0) return new String[]{"No Stacks"}; + if (content == null || content.size() == 0) { + return new String[]{"No Stacks"}; + } return content.getElementalInfo(); } else { if(id>0){ - if (content == null || content.size() == 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) + if (content == null || content.size() == 0) { return new String[]{"No Stacks"}; + } return new String[]{"Contains EM"}; } } @@ -259,9 +275,12 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta @Override public void onRemoval() { - if (isValidMetaTileEntity(this) && getBaseMetaTileEntity().isActive()) - if (TecTech.ModConfig.BOOM_ENABLE) getBaseMetaTileEntity().doExplosion(V[15]); - else - TecTech.proxy.broadcast("BOOM! " + getBaseMetaTileEntity().getXCoord() + " " + getBaseMetaTileEntity().getYCoord() + " " + getBaseMetaTileEntity().getZCoord()); + if (isValidMetaTileEntity(this) && getBaseMetaTileEntity().isActive()) { + if (TecTech.ModConfig.BOOM_ENABLE) { + getBaseMetaTileEntity().doExplosion(V[15]); + } else { + TecTech.proxy.broadcast("BOOM! " + getBaseMetaTileEntity().getXCoord() + ' ' + getBaseMetaTileEntity().getYCoord() + ' ' + getBaseMetaTileEntity().getZCoord()); + } + } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java index 45bd08fbca..ea40ec8fc3 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java @@ -97,7 +97,9 @@ public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch { @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) return true; + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } //if(aBaseMetaTileEntity.isActive()) // aPlayer.addChatComponentMessage(new ChatComponentText("It is still active...")); //else if(heat>0) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputData.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputData.java index 2d5a0a3b6b..8a3ae77b7f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputData.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputData.java @@ -51,7 +51,10 @@ public class GT_MetaTileEntity_Hatch_InputData extends GT_MetaTileEntity_Hatch_D @Override public void moveAround(IGregTechTileEntity aBaseMetaTileEntity) { - if (delDelay) delDelay = false; - else q = null; + if (delDelay) { + delDelay = false; + } else { + q = null; + } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java index afaadef072..ef5bc961bb 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java @@ -65,17 +65,24 @@ public class GT_MetaTileEntity_Hatch_OutputData extends GT_MetaTileEntity_Hatch_ public iConnectsToDataPipe getNext(iConnectsToDataPipe source/*==this*/) { IGregTechTileEntity base = getBaseMetaTileEntity(); byte color = base.getColorization(); - if (color < 0) return null; + if (color < 0) { + return null; + } IGregTechTileEntity next = base.getIGregTechTileEntityAtSide(base.getFrontFacing()); - if (next == null || color != base.getColorization()) return null; + if (next == null || color != base.getColorization()) { + return null; + } IMetaTileEntity meta = next.getMetaTileEntity(); if (meta instanceof iConnectsToDataPipe) { if (meta instanceof GT_MetaTileEntity_Hatch_InputData - && GT_Utility.getOppositeSide(next.getFrontFacing()) == base.getFrontFacing()) + && GT_Utility.getOppositeSide(next.getFrontFacing()) == base.getFrontFacing()) { return (iConnectsToDataPipe) meta; + } if (meta instanceof GT_MetaTileEntity_Pipe_Data /*&& ((GT_MetaTileEntity_Pipe_Data) meta).connectionCount==2*/)//Checked later + { return (iConnectsToDataPipe) meta; + } } return null; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java index b334befcce..22ae90a3c0 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java @@ -46,7 +46,9 @@ public class GT_MetaTileEntity_Hatch_OutputElemental extends GT_MetaTileEntity_H @Override public void moveAround(IGregTechTileEntity aBaseMetaTileEntity) { byte color = getBaseMetaTileEntity().getColorization(); - if (color < 0) return; + if (color < 0) { + return; + } byte front = aBaseMetaTileEntity.getFrontFacing(); byte opposite = GT_Utility.getOppositeSide(front); for (byte dist = 1; dist < 16; dist++) { @@ -61,10 +63,18 @@ public class GT_MetaTileEntity_Hatch_OutputElemental extends GT_MetaTileEntity_H content.clear(); return; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_EM) { - if (((GT_MetaTileEntity_Pipe_EM) aMetaTileEntity).connectionCount > 2) return; - } else return; - } else return; - } else return; + if (((GT_MetaTileEntity_Pipe_EM) aMetaTileEntity).connectionCount > 2) { + return; + } + } else { + return; + } + } else { + return; + } + } else { + return; + } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java index 65b2b084b2..4fa2682a27 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java @@ -210,10 +210,13 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity @Override public void onRemoval() { - if (isValidMetaTileEntity(this) && getBaseMetaTileEntity().isActive()) - if (TecTech.ModConfig.BOOM_ENABLE) getBaseMetaTileEntity().doExplosion(V[15]); - else - TecTech.proxy.broadcast("Muffler BOOM! " + getBaseMetaTileEntity().getXCoord() + " " + getBaseMetaTileEntity().getYCoord() + " " + getBaseMetaTileEntity().getZCoord()); + if (isValidMetaTileEntity(this) && getBaseMetaTileEntity().isActive()) { + if (TecTech.ModConfig.BOOM_ENABLE) { + getBaseMetaTileEntity().doExplosion(V[15]); + } else { + TecTech.proxy.broadcast("Muffler BOOM! " + getBaseMetaTileEntity().getXCoord() + ' ' + getBaseMetaTileEntity().getYCoord() + ' ' + getBaseMetaTileEntity().getZCoord()); + } + } } //Return - Should Explode diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java index 98dc1038dc..ba65fe90a8 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java @@ -54,13 +54,17 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - if (mTier >= 10) return new GT_Container_ParamAdv(aPlayerInventory, aBaseMetaTileEntity); + if (mTier >= 10) { + return new GT_Container_ParamAdv(aPlayerInventory, aBaseMetaTileEntity); + } return new GT_Container_Param(aPlayerInventory, aBaseMetaTileEntity); } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - if (mTier >= 10) return new GT_GUIContainer_ParamAdv(aPlayerInventory, aBaseMetaTileEntity); + if (mTier >= 10) { + return new GT_GUIContainer_ParamAdv(aPlayerInventory, aBaseMetaTileEntity); + } return new GT_GUIContainer_Param(aPlayerInventory, aBaseMetaTileEntity); } @@ -100,18 +104,9 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { @Override public String[] getInfoData() { - if(mTier>=10) - return new String[]{ - "Parametrizer ID: " + EnumChatFormatting.GREEN + param, - "Value 0I: " + EnumChatFormatting.AQUA + value0i, - "Value 0FB: " + EnumChatFormatting.AQUA + Float.intBitsToFloat(value0i)+" "+ Util.intBitsToShortString(value0i), - "Value 1I: " + EnumChatFormatting.BLUE + value1i, - "Value 1FB: " + EnumChatFormatting.BLUE + Float.intBitsToFloat(value1i)+" "+ Util.intBitsToShortString(value1i), - "Input 0I: " + EnumChatFormatting.GOLD + input0i, - "Input 0FB: " + EnumChatFormatting.GOLD + Float.intBitsToFloat(input0i)+" "+ Util.intBitsToShortString(input0i), - "Input 1I: " + EnumChatFormatting.YELLOW + input1i, - "Input 1FB: " + EnumChatFormatting.YELLOW + Float.intBitsToFloat(input1i)+" "+ Util.intBitsToShortString(input1i), - }; + if(mTier>=10) { + return new String[]{"Parametrizer ID: " + EnumChatFormatting.GREEN + param, "Value 0I: " + EnumChatFormatting.AQUA + value0i, "Value 0FB: " + EnumChatFormatting.AQUA + Float.intBitsToFloat(value0i) + ' ' + Util.intBitsToShortString(value0i), "Value 1I: " + EnumChatFormatting.BLUE + value1i, "Value 1FB: " + EnumChatFormatting.BLUE + Float.intBitsToFloat(value1i) + ' ' + Util.intBitsToShortString(value1i), "Input 0I: " + EnumChatFormatting.GOLD + input0i, "Input 0FB: " + EnumChatFormatting.GOLD + Float.intBitsToFloat(input0i) + ' ' + Util.intBitsToShortString(input0i), "Input 1I: " + EnumChatFormatting.YELLOW + input1i, "Input 1FB: " + EnumChatFormatting.YELLOW + Float.intBitsToFloat(input1i) + ' ' + Util.intBitsToShortString(input1i),}; + } return new String[]{ "Parametrizer ID: " + EnumChatFormatting.GREEN + param, "Value 0I: " + EnumChatFormatting.AQUA + value0i, @@ -187,7 +182,9 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) return true; + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } aBaseMetaTileEntity.openGUI(aPlayer); return true; } 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 fb7f62b8cf..b06bef34ee 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 @@ -36,7 +36,7 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { private static Textures.BlockIcons.CustomIcon EM_R_ACTIVE; public int heat = 0; private float overClock = 1, overVolt = 1; - private static Map<String, rackComponent> componentBinds = new HashMap<>(); + private static Map<String, RackComponent> componentBinds = new HashMap<>(); public GT_MetaTileEntity_Hatch_Rack(int aID, String aName, String aNameRegional, int aTier, String descr) { super(aID, aName, aNameRegional, aTier, 4, descr); @@ -107,13 +107,17 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - if (aBaseMetaTileEntity.isActive() || heat > 500) return false; + if (aBaseMetaTileEntity.isActive() || heat > 500) { + return false; + } return aSide == aBaseMetaTileEntity.getFrontFacing(); } @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - if (aBaseMetaTileEntity.isActive() || heat > 500) return false; + if (aBaseMetaTileEntity.isActive() || heat > 500) { + return false; + } return aSide == aBaseMetaTileEntity.getFrontFacing(); } @@ -129,7 +133,9 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) return true; + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } //if(aBaseMetaTileEntity.isActive()) // aPlayer.addChatComponentMessage(new ChatComponentText("It is still active...")); //else if(heat>0) @@ -142,9 +148,13 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { private int getComputationPower(float overclock, float overvolt, boolean tickingComponents) { float computation = 0, heat = 0; for (int i = 0; i < mInventory.length; i++) { - if (mInventory[i] == null || mInventory[i].stackSize != 1) continue; - rackComponent comp = componentBinds.get(getUniqueIdentifier(mInventory[i])); - if (comp == null) continue; + if (mInventory[i] == null || mInventory[i].stackSize != 1) { + continue; + } + RackComponent comp = componentBinds.get(getUniqueIdentifier(mInventory[i])); + if (comp == null) { + continue; + } if (tickingComponents) { if (this.heat > comp.maxHeat) { mInventory[i] = null; @@ -152,8 +162,9 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { } else if (comp.subZero || this.heat >= 0) { heat += (1f + comp.coEff * this.heat / 10000f) * (comp.heat > 0 ? comp.heat * overclock * overclock * overvolt : comp.heat); //=MAX(0;MIN(MIN($B4;1*C$3+C$3-0,25);1+RAND()+(C$3-1)-($B4-1)/2)) - if (overvolt * 10f > 7f + TecTech.Rnd.nextFloat()) + if (overvolt * 10f > 7f + TecTech.Rnd.nextFloat()) { computation += comp.computation * Math.max(0, Math.min(Math.min(overclock, overvolt + overvolt - 0.25), 1 + TecTech.Rnd.nextFloat() + (overvolt - 1) - (overclock - 1) / 2)); + } } } else { computation += comp.computation * overclock; @@ -171,7 +182,9 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { } public int tickComponents(float oc, float ov) { - if (oc > 3 + TecTech.Rnd.nextFloat() || ov > 2 + TecTech.Rnd.nextFloat()) getBaseMetaTileEntity().setToFire(); + if (oc > 3 + TecTech.Rnd.nextFloat() || ov > 2 + TecTech.Rnd.nextFloat()) { + getBaseMetaTileEntity().setToFire(); + } overClock = oc; overVolt = ov; return getComputationPower(overClock, overVolt, true); @@ -184,24 +197,35 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { if (heat > 0) { float heatC = 0; for (int i = 0; i < mInventory.length; i++) { - if (mInventory[i] == null || mInventory[i].stackSize != 1) continue; - rackComponent comp = componentBinds.get(getUniqueIdentifier(mInventory[i])); - if (comp == null) continue; + if (mInventory[i] == null || mInventory[i].stackSize != 1) { + continue; + } + RackComponent comp = componentBinds.get(getUniqueIdentifier(mInventory[i])); + if (comp == null) { + continue; + } if (heat > comp.maxHeat) { mInventory[i] = null; } else if (comp.heat < 0) { - heatC += comp.heat * (heat / 10000); + heatC += comp.heat * (heat / 10000f); } } heat += Math.max(-heat, Math.ceil(heatC)); } - if (heat > 0) heat -= Math.max(heat / 1000, 1); - else if (heat < 0) heat -= Math.min(heat / 1000, -1); + if (heat > 0) { + heat -= Math.max(heat / 1000, 1); + } else if (heat < 0) { + heat -= Math.min(heat / 1000, -1); + } - if (heat > 9000) aBaseMetaTileEntity.setOnFire(); - else if (heat > 10000) aBaseMetaTileEntity.setToFire(); - else if (heat < -10000) heat = -10000; + if (heat > 9000) { + aBaseMetaTileEntity.setOnFire(); + } else if (heat > 10000) { + aBaseMetaTileEntity.setToFire(); + } else if (heat < -10000) { + heat = -10000; + } } } } @@ -243,63 +267,63 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { } public static void run() {//20k heat cap max! - new rackComponent(ItemList.Circuit_Primitive.get(1), 1, 4, 0, 500, true); - new rackComponent(ItemList.Circuit_Basic.get(1), 4, 8, 0, 1000, true); - new rackComponent(ItemList.Circuit_Good.get(1), 6, 9, -.05f, 1500, true); - new rackComponent(ItemList.Circuit_Parts_Advanced.get(1), 1, 2, -.05f, 2000, true); - new rackComponent(ItemList.Circuit_Advanced.get(1), 8, 10, -.1f, 2500, true); - new rackComponent(ItemList.Circuit_Data.get(1), 1, 1, -.1f, 3000, true); - new rackComponent(ItemList.Circuit_Master.get(1), 12, 10, -.2F, 5000, true); - new rackComponent(ItemList.Circuit_Elite.get(1), 16, 12, -.15F, 3500, true); - - new rackComponent("IC2:ic2.reactorVent", 0, -1, 10f, 1000, false); - new rackComponent("IC2:ic2.reactorVentCore", 0, -1, 20f, 2500, false); - new rackComponent("IC2:ic2.reactorVentGold", 0, -1, 40f, 5000, false); - new rackComponent("IC2:ic2.reactorVentDiamond", 0, -1, 80f, 10000, false);//2x oc + new RackComponent(ItemList.Circuit_Primitive.get(1), 1, 4, 0, 500, true); + new RackComponent(ItemList.Circuit_Basic.get(1), 4, 8, 0, 1000, true); + new RackComponent(ItemList.Circuit_Good.get(1), 6, 9, -.05f, 1500, true); + new RackComponent(ItemList.Circuit_Parts_Advanced.get(1), 1, 2, -.05f, 2000, true); + new RackComponent(ItemList.Circuit_Advanced.get(1), 8, 10, -.1f, 2500, true); + new RackComponent(ItemList.Circuit_Data.get(1), 1, 1, -.1f, 3000, true); + new RackComponent(ItemList.Circuit_Master.get(1), 12, 10, -.2F, 5000, true); + new RackComponent(ItemList.Circuit_Elite.get(1), 16, 12, -.15F, 3500, true); + + new RackComponent("IC2:ic2.reactorVent", 0, -1, 10f, 1000, false); + new RackComponent("IC2:ic2.reactorVentCore", 0, -1, 20f, 2500, false); + new RackComponent("IC2:ic2.reactorVentGold", 0, -1, 40f, 5000, false); + new RackComponent("IC2:ic2.reactorVentDiamond", 0, -1, 80f, 10000, false);//2x oc if (Loader.isModLoaded("dreamcraft")) { - new rackComponent("dreamcraft:item.HighEnergyCircuitParts", 3, 2, -.1f, 9001, true); - new rackComponent("dreamcraft:item.HighEnergyFlowCircuit", 24, 16, -.25f, 10000, true); - new rackComponent("dreamcraft:item.NanoCircuit", 32, 20, -.15f, 8000, true); - new rackComponent("dreamcraft:item.PikoCircuit", 64, 32, -.2f, 8500, true); - new rackComponent("dreamcraft:item.QuantumCircuit", 128, 48, -.3f, 9000, true); + new RackComponent("dreamcraft:item.HighEnergyCircuitParts", 3, 2, -.1f, 9001, true); + new RackComponent("dreamcraft:item.HighEnergyFlowCircuit", 24, 16, -.25f, 10000, true); + new RackComponent("dreamcraft:item.NanoCircuit", 32, 20, -.15f, 8000, true); + new RackComponent("dreamcraft:item.PikoCircuit", 64, 32, -.2f, 8500, true); + new RackComponent("dreamcraft:item.QuantumCircuit", 128, 48, -.3f, 9000, true); } if (Loader.isModLoaded("OpenComputers")) { - new rackComponent("OpenComputers:item.23", 0, 1, 0f, 100, true);//Transistor - new rackComponent("OpenComputers:item.24", 7, 12, -.05f, 1500, true);//chip t1 - new rackComponent("OpenComputers:item.25", 18, 20, -.1f, 3000, true);//chip t2 - new rackComponent("OpenComputers:item.26", 25, 22, -.15f, 4500, true);//chip t3 - new rackComponent("OpenComputers:item.27", 10, 15, -.05f, 3000, true);//alu - new rackComponent("OpenComputers:item.28", 25, 18, -.05f, 1500, true);//cu - - new rackComponent("OpenComputers:item.70", 42, 30, -.05f, 1500, true);//bus t1 - new rackComponent("OpenComputers:item.71", 70, 50, -.1f, 3000, true);//bus t2 - new rackComponent("OpenComputers:item.72", 105, 72, -.15f, 4500, true);//bus t3 - - new rackComponent("OpenComputers:item.29", 106, 73, -.1f, 1500, true);//cpu t1 - new rackComponent("OpenComputers:item.42", 226, 153, -.15f, 3000, true);//cpu t2 - new rackComponent("OpenComputers:item.43", 374, 241, -.2f, 4500, true);//cpu t3 - - new rackComponent("OpenComputers:item.8", 20, 27, -.1f, 1500, true);//gpu t1 - new rackComponent("OpenComputers:item.9", 62, 67, -.2f, 3000, true);//gpu t2 - new rackComponent("OpenComputers:item.10", 130, 111, -.3f, 4500, true);//gpu t3 - - new rackComponent("OpenComputers:item.101", 350, 234, -.1f, 1500, true);//apu t1 - new rackComponent("OpenComputers:item.102", 606, 398, -.2f, 4500, true);//apu t2 - new rackComponent("OpenComputers:item.103", 1590, 1006, -.3f, 9000, true);//apu tC + new RackComponent("OpenComputers:item.23", 0, 1, 0f, 100, true);//Transistor + new RackComponent("OpenComputers:item.24", 7, 12, -.05f, 1500, true);//chip t1 + new RackComponent("OpenComputers:item.25", 18, 20, -.1f, 3000, true);//chip t2 + new RackComponent("OpenComputers:item.26", 25, 22, -.15f, 4500, true);//chip t3 + new RackComponent("OpenComputers:item.27", 10, 15, -.05f, 3000, true);//alu + new RackComponent("OpenComputers:item.28", 25, 18, -.05f, 1500, true);//cu + + new RackComponent("OpenComputers:item.70", 42, 30, -.05f, 1500, true);//bus t1 + new RackComponent("OpenComputers:item.71", 70, 50, -.1f, 3000, true);//bus t2 + new RackComponent("OpenComputers:item.72", 105, 72, -.15f, 4500, true);//bus t3 + + new RackComponent("OpenComputers:item.29", 106, 73, -.1f, 1500, true);//cpu t1 + new RackComponent("OpenComputers:item.42", 226, 153, -.15f, 3000, true);//cpu t2 + new RackComponent("OpenComputers:item.43", 374, 241, -.2f, 4500, true);//cpu t3 + + new RackComponent("OpenComputers:item.8", 20, 27, -.1f, 1500, true);//gpu t1 + new RackComponent("OpenComputers:item.9", 62, 67, -.2f, 3000, true);//gpu t2 + new RackComponent("OpenComputers:item.10", 130, 111, -.3f, 4500, true);//gpu t3 + + new RackComponent("OpenComputers:item.101", 350, 234, -.1f, 1500, true);//apu t1 + new RackComponent("OpenComputers:item.102", 606, 398, -.2f, 4500, true);//apu t2 + new RackComponent("OpenComputers:item.103", 1590, 1006, -.3f, 9000, true);//apu tC } } - public static class rackComponent implements Comparable<rackComponent> { + public static class RackComponent implements Comparable<RackComponent> { private final String unlocalizedName; private final float heat, coEff, computation, maxHeat; private final boolean subZero; - rackComponent(ItemStack is, float computation, float heat, float coEff, float maxHeat, boolean subZero) { + RackComponent(ItemStack is, float computation, float heat, float coEff, float maxHeat, boolean subZero) { this(getUniqueIdentifier(is), computation, heat, coEff, maxHeat, subZero); } - rackComponent(String is, float computation, float heat, float coEff, float maxHeat, boolean subZero) { + RackComponent(String is, float computation, float heat, float coEff, float maxHeat, boolean subZero) { unlocalizedName = is; this.heat = heat; this.coEff = coEff; @@ -307,14 +331,23 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { this.maxHeat = maxHeat; this.subZero = subZero; componentBinds.put(unlocalizedName, this); - if (DEBUG_MODE) + if (DEBUG_MODE) { TecTech.Logger.info("Component registered: " + unlocalizedName); + } } @Override - public int compareTo(rackComponent o) { + public int compareTo(RackComponent o) { return unlocalizedName.compareTo(o.unlocalizedName); } + + @Override + public boolean equals(Object obj) { + if(obj instanceof RackComponent) { + return compareTo((RackComponent) obj) == 0; + } + return false; + } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java index 8fba255ff2..7736ee2bcc 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java @@ -55,7 +55,9 @@ public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - if (mTier >= 10) return new GT_GUIContainer_UncertaintyAdv(aPlayerInventory, aBaseMetaTileEntity); + if (mTier >= 10) { + return new GT_GUIContainer_UncertaintyAdv(aPlayerInventory, aBaseMetaTileEntity); + } return new GT_GUIContainer_Uncertainty(aPlayerInventory, aBaseMetaTileEntity); } @@ -122,8 +124,9 @@ public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch aNBT.setByte("mMode", mode); aNBT.setByte("mStatus", status); NBTTagCompound mat = new NBTTagCompound(); - for (int i = 0; i < 16; i++) + for (int i = 0; i < 16; i++) { mat.setShort(Integer.toString(i), matrix[i]); + } aNBT.setTag("mMat", mat); } @@ -134,8 +137,9 @@ public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch mode = aNBT.getByte("mMode"); status = aNBT.getByte("mStatus"); NBTTagCompound mat = aNBT.getCompoundTag("mMat"); - for (int i = 0; i < 16; i++) + for (int i = 0; i < 16; i++) { matrix[i] = mat.getShort(Integer.toString(i)); + } } @Override @@ -165,7 +169,9 @@ public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) return true; + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } aBaseMetaTileEntity.openGUI(aPlayer); return true; } @@ -188,8 +194,9 @@ public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch } public void regenerate() { - for (int i = 0; i < matrix.length; i++) + for (int i = 0; i < matrix.length; i++) { matrix[i] = (short) TecTech.Rnd.nextInt(1000); + } } public byte compute() { @@ -265,13 +272,20 @@ public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch int i = TecTech.Rnd.nextInt(16), j = TecTech.Rnd.nextInt(128); matrix[i] += ((matrix[i] & 1) == 0 ? 2 : -2) * j >> 5; matrix[i] += j == 0 ? 1 : 0; - if (matrix[i] < 0) matrix[i] = 0; - else if (matrix[i] > 1000) matrix[i] = 999; + if (matrix[i] < 0) { + matrix[i] = 0; + } else if (matrix[i] > 1000) { + matrix[i] = 999; + } } public byte update(int newMode) { - if (newMode == mode) return status; - if (newMode < 0 || newMode > 5) newMode = 0; + if (newMode == mode) { + return status; + } + if (newMode < 0 || newMode > 5) { + newMode = 0; + } mode = (byte) newMode; regenerate(); compute(); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Holder.java index 9c1a85c373..e8377ba7bb 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Holder.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Holder.java @@ -32,37 +32,49 @@ public class GT_Container_Holder extends GT_ContainerMetaTile_Machine { @Override public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (mActive != 0) return null; + if (mActive != 0) { + return null; + } return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } @Override public ItemStack transferStackInSlot(EntityPlayer aPlayer, int aSlotIndex) { - if (mActive != 0) return null; + if (mActive != 0) { + return null; + } return super.transferStackInSlot(aPlayer, aSlotIndex); } @Override public boolean canDragIntoSlot(Slot par1Slot) { - if (mActive != 0) return false; + if (mActive != 0) { + return false; + } return super.canDragIntoSlot(par1Slot); } @Override public void putStacksInSlots(ItemStack[] par1ArrayOfItemStack) { - if (mActive != 0) return; + if (mActive != 0) { + return; + } super.putStacksInSlots(par1ArrayOfItemStack); } @Override protected boolean mergeItemStack(ItemStack aStack, int aStartIndex, int aSlotCount, boolean par4) { - if (mActive != 0) return false; + if (mActive != 0) { + return false; + } return super.mergeItemStack(aStack, aStartIndex, aSlotCount, par4); } @Override public void putStackInSlot(int par1, ItemStack par2ItemStack) { - if (mActive != 0) return; + if (mActive != 0) { + return; + } super.putStackInSlot(par1, par2ItemStack); } } 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 03eddca2cb..f686c7ef91 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 @@ -12,8 +12,6 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import java.util.Iterator; - public class GT_Container_Param extends GT_ContainerMetaTile_Machine { public int param = 0; public int value0f = 0; @@ -114,8 +112,11 @@ public class GT_Container_Param extends GT_ContainerMetaTile_Machine { doStuff = false; } if (doStuff) { - if (paramH.param > 9) paramH.param = 9; - else if (paramH.param < -1) paramH.param = -1; + if (paramH.param > 9) { + paramH.param = 9; + } else if (paramH.param < -1) { + paramH.param = -1; + } } } return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java index 2eb44ad72a..8c56e57279 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java @@ -12,8 +12,6 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import java.util.Iterator; - public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { public boolean usesFloats = false; public int pointer=0; @@ -67,52 +65,82 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { paramH.param -= aShifthold == 1 ? 16 : 4; break; case 1: - if (secondRow) secondRow = false; - else columnPointer -= aShifthold == 1 ? 16 : 4; + if (secondRow) { + secondRow = false; + } else { + columnPointer -= aShifthold == 1 ? 16 : 4; + } break; case 2: - if (secondRow) columnPointer -= aShifthold == 1 ? 16 : 4; - else secondRow = true; + if (secondRow) { + columnPointer -= aShifthold == 1 ? 16 : 4; + } else { + secondRow = true; + } break; case 3: if (aShifthold == 1) { - if (secondRow) paramH.value1i = 0xFFFFFFFF; - else paramH.value0i = 0xFFFFFFFF; + if (secondRow) { + paramH.value1i = 0xFFFFFFFF; + } else { + paramH.value0i = 0xFFFFFFFF; + } } else { - if (secondRow) paramH.value1i |= 1 << columnPointer; - else paramH.value0i |= 1 << columnPointer; + if (secondRow) { + paramH.value1i |= 1 << columnPointer; + } else { + paramH.value0i |= 1 << columnPointer; + } } break; case 4: paramH.param -= aShifthold == 1 ? 2 : 1; break; case 5: - if (secondRow) secondRow = false; - else columnPointer -= aShifthold == 1 ? 2 : 1; + if (secondRow) { + secondRow = false; + } else { + columnPointer -= aShifthold == 1 ? 2 : 1; + } break; case 6: - if (secondRow) columnPointer -= aShifthold == 1 ? 2 : 1; - else secondRow = true; + if (secondRow) { + columnPointer -= aShifthold == 1 ? 2 : 1; + } else { + secondRow = true; + } break; case 7: if (aShifthold == 1) { - if (secondRow) paramH.value1i = 0; - else paramH.value0i = 0; + if (secondRow) { + paramH.value1i = 0; + } else { + paramH.value0i = 0; + } } else { - if (secondRow) paramH.value1i &= ~(1 << columnPointer); - else paramH.value0i &= ~(1 << columnPointer); + if (secondRow) { + paramH.value1i &= ~(1 << columnPointer); + } else { + paramH.value0i &= ~(1 << columnPointer); + } } break; case 8: paramH.param += aShifthold == 1 ? 16 : 4; break; case 9: - if (secondRow) secondRow = false; - else columnPointer += aShifthold == 1 ? 16 : 4; + if (secondRow) { + secondRow = false; + } else { + columnPointer += aShifthold == 1 ? 16 : 4; + } break; case 10: - if (secondRow) columnPointer += aShifthold == 1 ? 16 : 4; - else secondRow = true; + if (secondRow) { + columnPointer += aShifthold == 1 ? 16 : 4; + } else { + secondRow = true; + } break; case 11: showInts ^= true; @@ -121,32 +149,50 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { paramH.param += aShifthold == 1 ? 2 : 1; break; case 13: - if (secondRow) secondRow = false; - else columnPointer += aShifthold == 1 ? 2 : 1; + if (secondRow) { + secondRow = false; + } else { + columnPointer += aShifthold == 1 ? 2 : 1; + } break; case 14: - if (secondRow) columnPointer += aShifthold == 1 ? 2 : 1; - else secondRow = true; + if (secondRow) { + columnPointer += aShifthold == 1 ? 2 : 1; + } else { + secondRow = true; + } break; case 15: if (aShifthold == 1) { - if (secondRow) paramH.value1i ^= 0xFFFFFFFF; - else paramH.value0i ^= 0xFFFFFFFF; + if (secondRow) { + paramH.value1i ^= 0xFFFFFFFF; + } else { + paramH.value0i ^= 0xFFFFFFFF; + } } else { - if (secondRow) paramH.value1i ^= 1 << columnPointer; - else paramH.value0i ^= 1 << columnPointer; + if (secondRow) { + paramH.value1i ^= 1 << columnPointer; + } else { + paramH.value0i ^= 1 << columnPointer; + } } break; default: doStuff = false; } if (doStuff) { - if(columnPointer>=32) columnPointer=31; - else if(columnPointer<0) columnPointer=0; + if(columnPointer>=32) { + columnPointer = 31; + } else if(columnPointer<0) { + columnPointer = 0; + } paramH.pointer=secondRow?columnPointer+0x100:columnPointer; paramH.setUsingFloats(!showInts); - if (paramH.param > 9) paramH.param = 9; - else if (paramH.param < -1) paramH.param = -1; + if (paramH.param > 9) { + paramH.param = 9; + } else if (paramH.param < -1) { + paramH.param = -1; + } } } return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Rack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Rack.java index 350e508c6e..1ce14585bc 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Rack.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Rack.java @@ -11,8 +11,6 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import java.util.Iterator; - /** * Created by Tec on 09.04.2017. */ @@ -62,43 +60,54 @@ public class GT_Container_Rack extends GT_ContainerMetaTile_Machine { switch (par1) { case 100: heat = par2 != 0; - return; } } @Override public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (heat || mActive != 0) return null; + if (heat || mActive != 0) { + return null; + } return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } @Override public ItemStack transferStackInSlot(EntityPlayer aPlayer, int aSlotIndex) { - if (heat || mActive != 0) return null; + if (heat || mActive != 0) { + return null; + } return super.transferStackInSlot(aPlayer, aSlotIndex); } @Override public boolean canDragIntoSlot(Slot par1Slot) { - if (heat || mActive != 0) return false; + if (heat || mActive != 0) { + return false; + } return super.canDragIntoSlot(par1Slot); } @Override public void putStacksInSlots(ItemStack[] par1ArrayOfItemStack) { - if (heat || mActive != 0) return; + if (heat || mActive != 0) { + return; + } super.putStacksInSlots(par1ArrayOfItemStack); } @Override protected boolean mergeItemStack(ItemStack aStack, int aStartIndex, int aSlotCount, boolean par4) { - if (heat || mActive != 0) return false; + if (heat || mActive != 0) { + return false; + } return super.mergeItemStack(aStack, aStartIndex, aSlotCount, par4); } @Override public void putStackInSlot(int par1, ItemStack par2ItemStack) { - if (heat || mActive != 0) return; + if (heat || mActive != 0) { + return; + } super.putStackInSlot(par1, par2ItemStack); } } 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 768ed48f2e..38162c36f1 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 @@ -12,8 +12,6 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import java.util.Iterator; - 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; @@ -77,9 +75,11 @@ public class GT_Container_Uncertainty extends GT_ContainerMetaTile_Machine { ((GT_MetaTileEntity_Hatch_Uncertainty) mTileEntity.getMetaTileEntity()).compute(); - if (matrix != null) - for (int i = 0; i < 16; i++) + if (matrix != null) { + for (int i = 0; i < 16; i++) { matrix[i] = ((GT_MetaTileEntity_Hatch_Uncertainty) mTileEntity.getMetaTileEntity()).matrix[i]; + } + } selection = ((GT_MetaTileEntity_Hatch_Uncertainty) mTileEntity.getMetaTileEntity()).selection; mode = ((GT_MetaTileEntity_Hatch_Uncertainty) mTileEntity.getMetaTileEntity()).mode; @@ -91,8 +91,11 @@ public class GT_Container_Uncertainty extends GT_ContainerMetaTile_Machine { var1.sendProgressBarUpdate(this, 101, mode); var1.sendProgressBarUpdate(this, 102, status); - if (matrix != null) for (int i = 0; i < 16; i++) - var1.sendProgressBarUpdate(this, 103 + i, matrix[i]); + if (matrix != null) { + for (int i = 0; i < 16; i++) { + var1.sendProgressBarUpdate(this, 103 + i, matrix[i]); + } + } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Holder.java index ec62e2c16f..7019a6128e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Holder.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Holder.java @@ -27,8 +27,9 @@ public class GT_GUIContainer_Holder extends GT_GUIContainerMetaTile_Machine { int y = (height - ySize) / 2; drawTexturedModalRect(x, y, 0, 0, xSize, ySize); if (mContainer != null) { - if (((GT_Container_Holder) mContainer).mActive == 1) + if (((GT_Container_Holder) mContainer).mActive == 1) { drawTexturedModalRect(x + 151, y + 23, 183, 23, 18, 18); + } } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Rack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Rack.java index 42b74da7b8..396a690a8f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Rack.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Rack.java @@ -27,10 +27,12 @@ public class GT_GUIContainer_Rack extends GT_GUIContainerMetaTile_Machine { int y = (height - ySize) / 2; drawTexturedModalRect(x, y, 0, 0, xSize, ySize); if (mContainer != null) { - if (((GT_Container_Rack) mContainer).mActive == 1) + if (((GT_Container_Rack) mContainer).mActive == 1) { drawTexturedModalRect(x + 151, y + 23, 183, 23, 18, 18); - if (((GT_Container_Rack) mContainer).heat) + } + if (((GT_Container_Rack) mContainer).heat) { drawTexturedModalRect(x + 151, y + 41, 183, 41, 18, 18); + } } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java index d70ed025df..f5fe2bd002 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java @@ -17,10 +17,11 @@ public class GT_GUIContainer_Uncertainty extends GT_GUIContainerMetaTile_Machine @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { proxy.renderUnicodeString("Schr\u00F6dinger", 46, 7, 167, 0xffffff); - if (mContainer != null && ((GT_Container_Uncertainty) mContainer).status == 0) + if (mContainer != null && ((GT_Container_Uncertainty) mContainer).status == 0) { proxy.renderUnicodeString("Status: OK", 46, 16, 167, 0xffffff); - else + } else { proxy.renderUnicodeString("Status: NG", 46, 16, 167, 0xffffff); + } } @Override @@ -97,10 +98,11 @@ public class GT_GUIContainer_Uncertainty extends GT_GUIContainerMetaTile_Machine } x -= 6; y -= 6; - for (int i = 0; i < 16; i++) - if (TecTech.Rnd.nextInt(1000) < ((GT_Container_Uncertainty) mContainer).matrix[i]) - drawTexturedModalRect(x + 12 * (i / 4), y + 12 * (i % 4), - fU + 12 * (i / 4), V + 12 * (i % 4), 10, 10); + for (int i = 0; i < 16; i++) { + if (TecTech.Rnd.nextInt(1000) < ((GT_Container_Uncertainty) mContainer).matrix[i]) { + drawTexturedModalRect(x + 12 * (i / 4), y + 12 * (i % 4), fU + 12 * (i / 4), V + 12 * (i % 4), 10, 10); + } + } if (((GT_Container_Uncertainty) mContainer).selection > -1) { int sel = ((GT_Container_Uncertainty) mContainer).selection; drawTexturedModalRect(x + 12 * (sel / 4), y + 12 * (sel % 4), 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 6c0a4ce038..b327424937 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 @@ -18,10 +18,11 @@ public class GT_GUIContainer_UncertaintyAdv extends GT_GUIContainerMetaTile_Mach @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { proxy.renderUnicodeString("Schr\u00F6dinger X", 46, 7, 167, 0xffffff); - if (mContainer != null && ((GT_Container_Uncertainty) mContainer).status == 0) + if (mContainer != null && ((GT_Container_Uncertainty) mContainer).status == 0) { proxy.renderUnicodeString("Status: OK", 46, 16, 167, 0xffffff); - else + } else { proxy.renderUnicodeString("Status: NG", 46, 16, 167, 0xffffff); + } } @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 0bd68e88b0..748fa18f5a 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 @@ -153,8 +153,11 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E @Override public void construct(int stackSize, boolean hintsOnly) { - if((stackSize &1)==1) StructureBuilder(shape, blockType, blockMeta,16, 16, 0, getBaseMetaTileEntity(),hintsOnly); - else StructureBuilder(shape2, blockType2, blockMeta2,16, 16, 0, getBaseMetaTileEntity(),hintsOnly); + if((stackSize &1)==1) { + StructureBuilder(shape, blockType, blockMeta, 16, 16, 0, getBaseMetaTileEntity(), hintsOnly); + } else { + StructureBuilder(shape2, blockType2, blockMeta2, 16, 16, 0, getBaseMetaTileEntity(), hintsOnly); + } } @Override 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 6d552c7263..bc814e30d2 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 @@ -159,7 +159,9 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB eTier = 0; return false; } - if (test) return true; + if (test) { + return true; + } eTier = 0; return false; } @@ -176,17 +178,15 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB iGregTechTileEntity.getZCoord()+zDir, TT_Container_Casings.sHintCasingsTT,12); } else{ - if(iGregTechTileEntity.getBlockOffset(xDir,0,zDir).getMaterial() == Material.air) - iGregTechTileEntity.getWorld().setBlock( - iGregTechTileEntity.getXCoord()+xDir, - iGregTechTileEntity.getYCoord(), - iGregTechTileEntity.getZCoord()+zDir, - TT_Container_Casings.sHintCasingsTT,12,2); + if(iGregTechTileEntity.getBlockOffset(xDir,0,zDir).getMaterial() == Material.air) { + iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord(), iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2); + } + } + if ((stackSize & 1) == 1) { + StructureBuilder(shape, blockType, blockMeta1, 11, 1, 18, iGregTechTileEntity, hintsOnly); + } else { + StructureBuilder(shape, blockType, blockMeta2, 11, 1, 18, iGregTechTileEntity, hintsOnly); } - if ((stackSize & 1) == 1) - StructureBuilder(shape, blockType, blockMeta1, 11, 1, 18, iGregTechTileEntity,hintsOnly); - else - StructureBuilder(shape, blockType, blockMeta2, 11, 1, 18, iGregTechTileEntity,hintsOnly); } @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 c1460a9886..e7d518c874 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 @@ -106,9 +106,9 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } if(overClockRatio>0 && overVoltageRatio>=0.7f && overClockRatio<=3 && overVoltageRatio<=2){ float eut=V[8] * (float)overVoltageRatio * (float)overClockRatio; - if(eut<Integer.MAX_VALUE-7) - mEUt = -(int)eut; - else{ + if(eut<Integer.MAX_VALUE-7) { + mEUt = -(int) eut; + } else{ mEUt = -(int)V[8]; return false; } @@ -116,8 +116,12 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB int rackComputation; for (GT_MetaTileEntity_Hatch_Rack rack : eRacks) { - if (!GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) continue; - if (rack.heat > maxCurrentTemp) maxCurrentTemp = rack.heat; + if (!GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { + continue; + } + if (rack.heat > maxCurrentTemp) { + maxCurrentTemp = rack.heat; + } rackComputation = rack.tickComponents((float) overClockRatio, (float) overVoltageRatio); if (rackComputation > 0) { eAvailableData += rackComputation; @@ -126,9 +130,12 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB rack.getBaseMetaTileEntity().setActive(true); } - for (GT_MetaTileEntity_Hatch_InputData di : eInputData) + for (GT_MetaTileEntity_Hatch_InputData di : eInputData) { if (di.q != null)//ok for power losses + { thingsActive++; + } + } if (thingsActive > 0 && eCertainStatus == 0) { thingsActive += eOutputData.size(); @@ -150,19 +157,24 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB @Override public void outputAfterRecipe_EM() { - if (eOutputData.size() > 0) { + if (!eOutputData.isEmpty()) { Vec3pos pos = new Vec3pos(getBaseMetaTileEntity()); QuantumDataPacket pack = new QuantumDataPacket(pos, eAvailableData); - for (GT_MetaTileEntity_Hatch_InputData i : eInputData) { - if (i.q == null || i.q.contains(pos)) continue; - pack = pack.unifyPacketWith(i.q); - if (pack == null) return; + for (GT_MetaTileEntity_Hatch_InputData hatch : eInputData) { + if (hatch.q == null || hatch.q.contains(pos)) { + continue; + } + pack = pack.unifyPacketWith(hatch.q); + if (pack == null) { + return; + } } pack.computation /= eOutputData.size(); - for (GT_MetaTileEntity_Hatch_OutputData o : eOutputData) + for (GT_MetaTileEntity_Hatch_OutputData o : eOutputData) { o.q = pack; + } } } @@ -174,8 +186,9 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB @Override protected void afterRecipeCheckFailed() { super.afterRecipeCheckFailed(); - for (GT_MetaTileEntity_Hatch_Rack r : eRacks) + for (GT_MetaTileEntity_Hatch_Rack r : eRacks) { r.getBaseMetaTileEntity().setActive(false); + } } @Override @@ -186,77 +199,114 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB @Override public void parametersOutAndStatusesWrite_EM(boolean machineBusy) { double ocRatio = getParameterIn(0, 0); - if (ocRatio < 0) setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); - else if (ocRatio < 1) setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); - else if (ocRatio == 1) setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); - else if (ocRatio <= 3) setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_HIGH); - else if (Double.isNaN(ocRatio)) setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); - else setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + if (ocRatio < 0) { + setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + } else if (ocRatio < 1) { + setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + } else if (ocRatio == 1) { + setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + } else if (ocRatio <= 3) { + setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_HIGH); + } else if (Double.isNaN(ocRatio)) { + setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + } else { + setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + } double ovRatio = getParameterIn(0, 1); - if (ovRatio < 0.7f) setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); - else if (ovRatio < 0.8f) setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); - else if (ovRatio <= 1.2f) setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); - else if (ovRatio <= 2) setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_HIGH); - else if (Double.isNaN(ovRatio)) setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); - else setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + if (ovRatio < 0.7f) { + setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + } else if (ovRatio < 0.8f) { + setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + } else if (ovRatio <= 1.2f) { + setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + } else if (ovRatio <= 2) { + setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_HIGH); + } else if (Double.isNaN(ovRatio)) { + setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + } else { + setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + } setParameterOut(0, 0, maxCurrentTemp); setParameterOut(0, 1, eAvailableData); - if (maxCurrentTemp < -10000) setStatusOfParameterOut(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); - else if (maxCurrentTemp < 0) setStatusOfParameterOut(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); - else if (maxCurrentTemp == 0) setStatusOfParameterOut(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); - else if (maxCurrentTemp <= 5000) setStatusOfParameterOut(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_HIGH); - else setStatusOfParameterOut(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + if (maxCurrentTemp < -10000) { + setStatusOfParameterOut(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + } else if (maxCurrentTemp < 0) { + setStatusOfParameterOut(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + } else if (maxCurrentTemp == 0) { + setStatusOfParameterOut(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + } else if (maxCurrentTemp <= 5000) { + setStatusOfParameterOut(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_HIGH); + } else { + setStatusOfParameterOut(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + } - if (!machineBusy) setStatusOfParameterOut(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); - else if (eAvailableData <= 0) setStatusOfParameterOut(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); - else setStatusOfParameterOut(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + if (!machineBusy) { + setStatusOfParameterOut(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + } else if (eAvailableData <= 0) { + setStatusOfParameterOut(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + } else { + setStatusOfParameterOut(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + } } @Override public void onRemoval() { super.onRemoval(); - for (GT_MetaTileEntity_Hatch_Rack r : eRacks) + for (GT_MetaTileEntity_Hatch_Rack r : eRacks) { r.getBaseMetaTileEntity().setActive(false); + } } @Override public void stopMachine() { super.stopMachine(); eAvailableData=0; - for (GT_MetaTileEntity_Hatch_Rack r : eRacks) + for (GT_MetaTileEntity_Hatch_Rack r : eRacks) { r.getBaseMetaTileEntity().setActive(false); + } } @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - for (GT_MetaTileEntity_Hatch_Rack rack : eRacks) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) + for (GT_MetaTileEntity_Hatch_Rack rack : eRacks) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { rack.getBaseMetaTileEntity().setActive(false); + } + } eRacks.clear(); - if (!structureCheck_EM(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 (!structureCheck_EM(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 (!structureCheck_EM(slice, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, offset)) + while (offset > -16) { + if (!structureCheck_EM(slice, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, offset)) { break; + } totalLen++; offset--; } - if (totalLen > 16) return false; - if (!structureCheck_EM(cap, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, ++offset)) + if (totalLen > 16) { + return false; + } + if (!structureCheck_EM(cap, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, ++offset)) { return false; - if (!structureCheck_EM(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) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) + for (GT_MetaTileEntity_Hatch_Rack rack : eRacks) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { rack.getBaseMetaTileEntity().setActive(iGregTechTileEntity.isActive()); + } + } return eUncertainHatches.size() == 1; } @@ -282,7 +332,9 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB @Override protected void extraExplosions_EM() { - for (MetaTileEntity tTileEntity : eRacks) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); + for (MetaTileEntity tTileEntity : eRacks) { + tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); + } } @Override @@ -301,9 +353,13 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB //NEW METHOD public final boolean addRackToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Rack) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return eRacks.add((GT_MetaTileEntity_Hatch_Rack) aMetaTileEntity); @@ -315,7 +371,9 @@ 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 (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_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java index d884f347e7..7edd9caa5f 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 @@ -124,8 +124,12 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase private float m1,m2,m3; private boolean startRecipe(cElementalInstanceStack input) { m3=(float)Math.ceil(input.getLifeTime() / Math.pow(input.amount,3)); - if(m3<1) explodeMultiblock(); - if(m3>=Integer.MAX_VALUE) return false; + if(m3<1) { + explodeMultiblock(); + } + if(m3>=Integer.MAX_VALUE) { + return false; + } mMaxProgresstime = 1;//(int)m3; mEfficiencyIncrease = 10000; m1 = input.getMass()/input.amount; @@ -170,7 +174,7 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase "PowerPass: " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + " SafeVoid: " + EnumChatFormatting.BLUE + eSafeVoid, "Computation: " + EnumChatFormatting.GREEN + eAvailableData + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW + eRequiredData + EnumChatFormatting.RESET, - m1+" "+m2+" "+m3 + m1+" "+m2+ ' ' +m3 }; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java index 0a3d5eb913..0d1671f5fa 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java @@ -110,7 +110,7 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo if (info != null) { if (map.removeAllAmounts(false, (iHasElementalDefinition) info.input())) { ArrayList<ItemStack> items = OreDictionary.getOres(((aOredictDequantizationInfo) info).out); - if (items != null && items.size() > 0) { + if (items != null && !items.isEmpty()) { mOutputItems = new ItemStack[]{items.get(0)}; startRecipe((iHasElementalDefinition) info.input(),stack.getEnergy()); return true; 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 cd6cde613f..729d60bfbb 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 @@ -115,10 +115,14 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa if (itemStack != null && itemStack.stackSize == 1) { Item ofThis = itemStack.getItem(); if (ofThis instanceof IElectricItem) { - if (doChargeItemStack((IElectricItem) ofThis, itemStack) == 0) getBaseMetaTileEntity().disableWorking(); + if (doChargeItemStack((IElectricItem) ofThis, itemStack) == 0) { + getBaseMetaTileEntity().disableWorking(); + } return; } else if (TecTech.hasCOFH && ofThis instanceof IEnergyContainerItem) { - if (doChargeItemStackRF((IEnergyContainerItem) ofThis, itemStack) == 0) getBaseMetaTileEntity().disableWorking(); + if (doChargeItemStackRF((IEnergyContainerItem) ofThis, itemStack) == 0) { + getBaseMetaTileEntity().disableWorking(); + } return; } } @@ -139,16 +143,22 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa private long doChargeItemStack(IElectricItem item, ItemStack stack) { try { double euDiff = item.getMaxCharge(stack) - ElectricItem.manager.getCharge(stack); - if (euDiff > 0) setEUVar(getEUVar() - (getEUVar() >> 5)); + if (euDiff > 0) { + setEUVar(getEUVar() - (getEUVar() >> 5)); + } long remove = (long) Math.ceil( ElectricItem.manager.charge(stack, Math.min(euDiff, getEUVar()) , item.getTier(stack), true, false)); setEUVar(getEUVar() - remove); - if (getEUVar() < 0) setEUVar(0); + if (getEUVar() < 0) { + setEUVar(0); + } return remove; } catch (Exception e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } } return 0; } @@ -160,10 +170,14 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa RF = item.receiveEnergy(stack, RF > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) RF, false); RF = RF * 100L / mEUtoRF; setEUVar(getEUVar() - RF); - if (getEUVar() < 0) setEUVar(0); + if (getEUVar() < 0) { + setEUVar(0); + } return RF; } catch (Exception e) { - if (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_junction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java index 1e17491b75..c50caf132f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java @@ -95,18 +95,24 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB } else { setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); dest = getParameterIn(i, 1); - if (dest < 0) setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); - else if (dest == 0) setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); - else if (dest > eOutputHatches.size()) setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); - else if (Double.isNaN(dest)) setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); - else setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + if (dest < 0) { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + } else if (dest == 0) { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + } else if (dest > eOutputHatches.size()) { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + } else if (Double.isNaN(dest)) { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + } else { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + } } } } @Override public boolean checkRecipe_EM(ItemStack itemStack) { - for (GT_MetaTileEntity_Hatch_InputElemental in : eInputHatches) + for (GT_MetaTileEntity_Hatch_InputElemental in : eInputHatches) { if (in.getContainerHandler().hasStacks()) { mEUt = -(int) V[8]; eAmpereFlow = 1 + (eInputHatches.size() + eOutputHatches.size() >> 1); @@ -114,6 +120,7 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB mEfficiencyIncrease = 10000; return true; } + } return false; } @@ -123,15 +130,21 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB for (int i = 0; i < 10; i++) { src= getParameterIn(i,0); dest= getParameterIn(i,1); - if(Double.isNaN(src) || Double.isNaN(dest)) continue; + if(Double.isNaN(src) || Double.isNaN(dest)) { + continue; + } int inIndex = (int)src - 1; - if (inIndex < 0 || inIndex >= eInputHatches.size()) continue; + if (inIndex < 0 || inIndex >= eInputHatches.size()) { + continue; + } int outIndex = (int)dest - 1; GT_MetaTileEntity_Hatch_InputElemental in = eInputHatches.get(inIndex); if (outIndex == -1) {//param==0 -> null the content cleanHatchContentEM_EM(in); } else { - if (outIndex < 0 || outIndex >= eOutputHatches.size()) continue; + if (outIndex < 0 || outIndex >= eOutputHatches.size()) { + continue; + } GT_MetaTileEntity_Hatch_OutputElemental out = eOutputHatches.get(outIndex); out.getContainerHandler().putUnifyAll(in.getContainerHandler()); in.getContainerHandler().clear(); 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 06d8f58183..896746b359 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 @@ -21,6 +21,8 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; +import java.util.ArrayList; + import static com.github.technus.tectech.Util.*; import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition.DEFAULT_ENERGY_LEVEL; @@ -95,7 +97,8 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock @Override 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]); + ArrayList<ItemStack> storedInputs = getStoredInputs(); + ItemStack[] inI = storedInputs.toArray(new ItemStack[storedInputs.size()]); if (inI.length > 0) { for (ItemStack is : inI) { //ITEM STACK quantization @@ -107,10 +110,13 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock //ORE DICT quantization int[] oreIDs = OreDictionary.getOreIDs(is); for (int ID : oreIDs) { - if (DEBUG_MODE) - TecTech.Logger.info("Quantifier-Ore-recipe " + is.getItem().getUnlocalizedName() + "." + is.getItemDamage() + " " + OreDictionary.getOreName(ID)); + 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; + if (aOQI == null) { + continue; + } iHasElementalDefinition into = aOQI.output(); if (into != null && isInputEqual(true, false, GT_MetaTileEntity_MultiblockBase_EM.nothingF, new ItemStack[]{new ItemStack(is.getItem(), aOQI.amount, is.getItemDamage())}, null, inI)) { startRecipe(into); @@ -119,8 +125,9 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock } } else { //Do ITEM STACK quantization - if (DEBUG_MODE) - TecTech.Logger.info("Quantifier-Item-recipe " + is.getItem().getUnlocalizedName() + "." + is.getItemDamage()); + if (DEBUG_MODE) { + TecTech.Logger.info("Quantifier-Item-recipe " + is.getItem().getUnlocalizedName() + '.' + is.getItemDamage()); + } iHasElementalDefinition into = aIQI.output(); if (into != null && isInputEqual(true, false, GT_MetaTileEntity_MultiblockBase_EM.nothingF, new ItemStack[]{new ItemStack(is.getItem(), aIQI.input().stackSize, is.getItemDamage())}, null, inI)) { startRecipe(into); @@ -129,11 +136,14 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock } } } - FluidStack[] inF = getStoredFluids().toArray(new FluidStack[0]); + ArrayList<FluidStack> storedFluids = getStoredFluids(); + FluidStack[] inF = storedFluids.toArray(new FluidStack[storedFluids.size()]); if (inF.length > 0) { for (FluidStack fs : inF) { aFluidQuantizationInfo aFQI = bTransformationInfo.fluidQuantization.get(fs.getFluid().getID()); - if (aFQI == null) continue; + if (aFQI == null) { + continue; + } iHasElementalDefinition into = aFQI.output(); if (into != null && fs.amount >= aFQI.input().amount && isInputEqual(true, false, new FluidStack[]{aFQI.input()}, GT_MetaTileEntity_MultiblockBase_EM.nothingI, inF, (ItemStack[]) null)) { 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 d84c791404..dc7c99df7b 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 @@ -89,17 +89,22 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - for (GT_MetaTileEntity_Hatch_Holder rack : eHolders) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) + for (GT_MetaTileEntity_Hatch_Holder rack : eHolders) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { rack.getBaseMetaTileEntity().setActive(false); + } + } eHolders.clear(); - if (!structureCheck_EM(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) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) + for (GT_MetaTileEntity_Hatch_Holder rack : eHolders) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { rack.getBaseMetaTileEntity().setActive(iGregTechTileEntity.isActive()); + } + } return eHolders.size() == 1; } @@ -118,9 +123,11 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB super.saveNBTData(aNBT); aNBT.setLong("eComputationRemaining",computationRemaining); aNBT.setLong("eComputationRequired",computationRequired); - if(holdItem!=null) + if(holdItem!=null) { aNBT.setTag("eHold", holdItem.writeToNBT(new NBTTagCompound())); - else aNBT.removeTag("eHold"); + } else { + aNBT.removeTag("eHold"); + } } @Override @@ -128,9 +135,11 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB super.loadNBTData(aNBT); computationRemaining=aNBT.getLong("eComputationRemaining"); computationRequired=aNBT.getLong("eComputationRequired"); - if(aNBT.hasKey("eHold")) - holdItem =ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("eHold")); - else holdItem=null; + if(aNBT.hasKey("eHold")) { + holdItem = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("eHold")); + } else { + holdItem = null; + } } @Override @@ -171,8 +180,9 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB computationRequired = computationRemaining = 0; mMaxProgresstime = 0; mEfficiencyIncrease = 0; - for (GT_MetaTileEntity_Hatch_Holder r : eHolders) + for (GT_MetaTileEntity_Hatch_Holder r : eHolders) { r.getBaseMetaTileEntity().setActive(false); + } } } } @@ -182,7 +192,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB public boolean checkRecipe_EM(ItemStack itemStack) { tRecipe=null; aRecipe=null; - if(eHolders.size()>0 && eHolders.get(0).mInventory[0]!=null) { + if(!eHolders.isEmpty() && eHolders.get(0).mInventory[0]!=null) { holdItem = eHolders.get(0).mInventory[0].copy(); if(ItemList.Tool_DataStick.isStackEqual(itemStack, false, true)) { for (GT_Recipe.GT_Recipe_AssemblyLine assRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) { @@ -246,8 +256,9 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } holdItem=null; computationRequired=computationRemaining=0; - for (GT_MetaTileEntity_Hatch_Holder r : eHolders) + for (GT_MetaTileEntity_Hatch_Holder r : eHolders) { r.getBaseMetaTileEntity().setActive(false); + } return false; } @@ -266,7 +277,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB @Override public void outputAfterRecipe_EM() { - if(eHolders.size()>0) { + if(!eHolders.isEmpty()) { if (tRecipe != null && ItemList.Tool_DataStick.isStackEqual(mInventory[1], false, true)){ eHolders.get(0).getBaseMetaTileEntity().setActive(false); eHolders.get(0).mInventory[0] = null; @@ -278,17 +289,17 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB tNBT.setInteger("time", tRecipe.mDuration); tNBT.setInteger("eu", tRecipe.mEUt); for (int i = 0; i < tRecipe.mInputs.length; i++) { - tNBT.setTag("" + i, tRecipe.mInputs[i].writeToNBT(new NBTTagCompound())); + tNBT.setTag(String.valueOf(i), tRecipe.mInputs[i].writeToNBT(new NBTTagCompound())); } for (int i = 0; i < tRecipe.mFluidInputs.length; i++) { tNBT.setTag("f" + i, tRecipe.mFluidInputs[i].writeToNBT(new NBTTagCompound())); } tNBT.setString("author", EnumChatFormatting.BLUE + "Tec" + EnumChatFormatting.DARK_BLUE + "Tech" + EnumChatFormatting.WHITE + " Assembling Line Recipe Generator"); NBTTagList tNBTList = new NBTTagList(); - tNBTList.appendTag(new NBTTagString("Construction plan for " + tRecipe.mOutput.stackSize + " " + GT_LanguageManager.getTranslation(tRecipe.mOutput.getDisplayName()) + ". Needed EU/t: " + tRecipe.mEUt + " Production time: " + tRecipe.mDuration / 20)); + tNBTList.appendTag(new NBTTagString("Construction plan for " + tRecipe.mOutput.stackSize + ' ' + GT_LanguageManager.getTranslation(tRecipe.mOutput.getDisplayName()) + ". Needed EU/t: " + tRecipe.mEUt + " Production time: " + tRecipe.mDuration / 20)); for (int i = 0; i < tRecipe.mInputs.length; i++) { if (tRecipe.mInputs[i] != null) { - tNBTList.appendTag(new NBTTagString("Input Bus " + (i + 1) + ": " + tRecipe.mInputs[i].stackSize + " " + GT_LanguageManager.getTranslation(tRecipe.mInputs[i].getDisplayName()))); + tNBTList.appendTag(new NBTTagString("Input Bus " + (i + 1) + ": " + tRecipe.mInputs[i].stackSize + ' ' + GT_LanguageManager.getTranslation(tRecipe.mInputs[i].getDisplayName()))); } } for (int i = 0; i < tRecipe.mFluidInputs.length; i++) { @@ -318,7 +329,9 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB @Override protected void extraExplosions_EM() { - for (MetaTileEntity tTileEntity : eHolders) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); + for (MetaTileEntity tTileEntity : eHolders) { + tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); + } } @Override @@ -347,15 +360,17 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB @Override public void onRemoval() { super.onRemoval(); - for (GT_MetaTileEntity_Hatch_Holder r : eHolders) + for (GT_MetaTileEntity_Hatch_Holder r : eHolders) { r.getBaseMetaTileEntity().setActive(false); + } } @Override public void stopMachine() { super.stopMachine(); - for (GT_MetaTileEntity_Hatch_Holder r : eHolders) + for (GT_MetaTileEntity_Hatch_Holder r : eHolders) { r.getBaseMetaTileEntity().setActive(false); + } computationRequired=computationRemaining=0; tRecipe=null; aRecipe=null; @@ -364,9 +379,13 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB //NEW METHOD public final boolean addHolderToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Holder) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return eHolders.add((GT_MetaTileEntity_Hatch_Holder) aMetaTileEntity); @@ -378,7 +397,9 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB try { adderMethodMap.put("addHolderToMachineList", GT_MetaTileEntity_EM_research.class.getMethod("addHolderToMachineList", IGregTechTileEntity.class, int.class)); } catch (NoSuchMethodException e) { - if (TecTechConfig.DEBUG_MODE) e.printStackTrace(); + if (TecTechConfig.DEBUG_MODE) { + e.printStackTrace(); + } } } 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 06b4cf6f31..d5a773e4ad 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 @@ -101,8 +101,9 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - if (!structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0)) + 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(); } @@ -130,13 +131,21 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa super.saveNBTData(aNBT); aNBT.setLong("eComputationRemaining", totalComputationRemaining); aNBT.setLong("eComputationRequired", totalComputationRequired); - if(objectResearched!=null) - aNBT.setTag("eObject",objectResearched.toNBT()); - else aNBT.removeTag("eObject"); - if(scanComplexity!=null) aNBT.setIntArray("eScanComplexity",scanComplexity); - else aNBT.removeTag("eScanComplexity"); - if(objectsScanned!=null) aNBT.setTag("eScanObjects",objectsScanned.toNBT()); - else aNBT.removeTag("eScanObjects"); + if(objectResearched!=null) { + aNBT.setTag("eObject", objectResearched.toNBT()); + } else { + aNBT.removeTag("eObject"); + } + if(scanComplexity!=null) { + aNBT.setIntArray("eScanComplexity", scanComplexity); + } else { + aNBT.removeTag("eScanComplexity"); + } + if(objectsScanned!=null) { + aNBT.setTag("eScanObjects", objectsScanned.toNBT()); + } else { + aNBT.removeTag("eScanObjects"); + } } @Override @@ -146,12 +155,21 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa totalComputationRequired =aNBT.getLong("eComputationRequired"); if(aNBT.hasKey("eObject")) { objectResearched = cElementalDefinitionStack.fromNBT(aNBT.getCompoundTag("eObject")); - if(objectResearched.definition==nbtE__) objectResearched=null; - }else objectResearched=null; - if(aNBT.hasKey("eScanComplexity")) scanComplexity=aNBT.getIntArray("eScanComplexity"); - else scanComplexity=null; + if(objectResearched.definition==nbtE__) { + objectResearched = null; + } + }else { + objectResearched = null; + } + if(aNBT.hasKey("eScanComplexity")) { + scanComplexity = aNBT.getIntArray("eScanComplexity"); + } else { + scanComplexity = null; + } try { - if (aNBT.hasKey("eScanObjects")) objectsScanned = cElementalInstanceStackMap.fromNBT(aNBT.getCompoundTag("eScanObjects")); + if (aNBT.hasKey("eScanObjects")) { + objectsScanned = cElementalInstanceStackMap.fromNBT(aNBT.getCompoundTag("eScanObjects")); + } }catch (tElementalException e){ objectsScanned=new cElementalInstanceStackMap(); } @@ -190,7 +208,9 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa totalComputationRequired = totalComputationRemaining = 0; mMaxProgresstime = 0; mEfficiencyIncrease = 0; - } else quantumStuff(true); + } else { + quantumStuff(true); + } } } } @@ -198,7 +218,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa @Override public boolean checkRecipe_EM(ItemStack itemStack) { eRecipe=null; - if(eInputHatches.size()>0 && eInputHatches.get(0).getContainerHandler().hasStacks() && !eOutputHatches.isEmpty()) { + if(!eInputHatches.isEmpty() && eInputHatches.get(0).getContainerHandler().hasStacks() && !eOutputHatches.isEmpty()) { cElementalInstanceStackMap researchEM = eInputHatches.get(0).getContainerHandler(); if(ItemList.Tool_DataOrb.isStackEqual(itemStack, false, true)) { GT_Recipe scannerRecipe=null; @@ -257,7 +277,9 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa for (int i = 0; i < 20; i++) { if (scanComplexityTemp[i] != SCAN_DO_NOTHING) { maxDepth = i; - if(!DEBUG_MODE) scanComplexityTemp[i]&=~SCAN_GET_CLASS_TYPE; + if(!DEBUG_MODE) { + scanComplexityTemp[i] &= ~SCAN_GET_CLASS_TYPE; + } addComputationRequirements(i+1,scanComplexityTemp[i]); } } @@ -282,57 +304,57 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa private void addComputationRequirements(int depthPlus, int capabilities){ if(areBitsSet(SCAN_GET_NOMENCLATURE,capabilities)){ - totalComputationRequired +=depthPlus*5; + totalComputationRequired +=depthPlus*5L; eRequiredData+=depthPlus; } if(areBitsSet(SCAN_GET_DEPTH_LEVEL,capabilities)){ - totalComputationRequired +=depthPlus*10; + totalComputationRequired +=depthPlus*10L; eRequiredData+=depthPlus; } if(areBitsSet(SCAN_GET_AMOUNT,capabilities)){ - totalComputationRequired +=depthPlus*64; - eRequiredData+=depthPlus*8; + totalComputationRequired +=depthPlus*64L; + eRequiredData+=depthPlus*8L; } if(areBitsSet(SCAN_GET_CHARGE,capabilities)){ - totalComputationRequired +=depthPlus*128; - eRequiredData+=depthPlus*4; + totalComputationRequired +=depthPlus*128L; + eRequiredData+=depthPlus*4L; } if(areBitsSet(SCAN_GET_MASS,capabilities)){ - totalComputationRequired +=depthPlus*256; - eRequiredData+=depthPlus*4; + totalComputationRequired +=depthPlus*256L; + eRequiredData+=depthPlus*4L; } if(areBitsSet(SCAN_GET_ENERGY_LEVEL,capabilities)){ - totalComputationRequired +=depthPlus*512; - eRequiredData+=depthPlus*16; + totalComputationRequired +=depthPlus*512L; + eRequiredData+=depthPlus*16L; } if(areBitsSet(SCAN_GET_TIMESPAN_INFO,capabilities)){ - totalComputationRequired +=depthPlus*1024; - eRequiredData+=depthPlus*32; + totalComputationRequired +=depthPlus*1024L; + eRequiredData+=depthPlus*32L; } if(areBitsSet(SCAN_GET_ENERGY_STATES,capabilities)){ - totalComputationRequired +=depthPlus*2048; - eRequiredData+=depthPlus*32; + totalComputationRequired +=depthPlus*2048L; + eRequiredData+=depthPlus*32L; } if(areBitsSet(SCAN_GET_COLOR,capabilities)){ - totalComputationRequired +=depthPlus*1024; - eRequiredData+=depthPlus*48; + totalComputationRequired +=depthPlus*1024L; + eRequiredData+=depthPlus*48L; } if(areBitsSet(SCAN_GET_AGE,capabilities)){ - totalComputationRequired +=depthPlus*2048; - eRequiredData+=depthPlus*64; + totalComputationRequired +=depthPlus*2048L; + eRequiredData+=depthPlus*64L; } if(areBitsSet(SCAN_GET_TIMESPAN_MULT,capabilities)){ - totalComputationRequired +=depthPlus*2048; - eRequiredData+=depthPlus*64; + totalComputationRequired +=depthPlus*2048L; + eRequiredData+=depthPlus*64L; } } @@ -433,11 +455,13 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa int zDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetZ * 4+base.getZCoord(); Block block = base.getWorld().getBlock(xDir, yDir, zDir); if (shouldExist) { - if(block != null && block.getMaterial()== Material.air) - base.getWorld().setBlock(xDir, yDir, zDir, QuantumStuffBlock.INSTANCE,0,2); + if(block != null && block.getMaterial()== Material.air) { + base.getWorld().setBlock(xDir, yDir, zDir, QuantumStuffBlock.INSTANCE, 0, 2); + } } else { - if (block instanceof QuantumStuffBlock) - base.getWorld().setBlock(xDir, yDir, zDir, Blocks.air,0,2); + if (block instanceof QuantumStuffBlock) { + base.getWorld().setBlock(xDir, yDir, zDir, Blocks.air, 0, 2); + } } } } 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 7b2dbd35c7..1db5cf2ead 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 @@ -83,9 +83,11 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas @Override public boolean checkRecipe_EM(ItemStack itemStack) { short thingsActive = 0; - for (GT_MetaTileEntity_Hatch_InputData di : eInputData) - if (di.q != null) + for (GT_MetaTileEntity_Hatch_InputData di : eInputData) { + if (di.q != null) { thingsActive++; + } + } if (thingsActive > 0) { thingsActive += eOutputData.size(); @@ -100,23 +102,28 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas @Override public void outputAfterRecipe_EM() { - if (eOutputData.size() > 0) { + if (!eOutputData.isEmpty()) { double total = 0; double dest; double weight; for (int i = 0; i < 10; i++) {//each param pair dest= getParameterIn(i,1); weight= getParameterIn(i,0); - if (weight > 0 && dest >= 0) + if (weight > 0 && dest >= 0) { total += weight;//Total weighted div + } } Vec3pos pos = new Vec3pos(getBaseMetaTileEntity()); QuantumDataPacket pack = new QuantumDataPacket(pos, 0); - for (GT_MetaTileEntity_Hatch_InputData i : eInputData) { - if (i.q == null || i.q.contains(pos)) continue; - pack = pack.unifyPacketWith(i.q); - if (pack == null) return; + for (GT_MetaTileEntity_Hatch_InputData hatch : eInputData) { + if (hatch.q == null || hatch.q.contains(pos)) { + continue; + } + pack = pack.unifyPacketWith(hatch.q); + if (pack == null) { + return; + } } long remaining = pack.computation; @@ -126,7 +133,9 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas weight= getParameterIn(i,0); if (weight > 0 && dest >= 0) { int outIndex = (int)dest - 1; - if (outIndex < 0 || outIndex >= eOutputData.size()) continue; + if (outIndex < 0 || outIndex >= eOutputData.size()) { + continue; + } GT_MetaTileEntity_Hatch_OutputData out = eOutputData.get(outIndex); if(Double.isInfinite(total)){ if(Double.isInfinite(weight)){ @@ -137,11 +146,14 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas long part = (long) Math.floor(pack.computation * weight / total); if (part > 0) { remaining -= part; - if (remaining > 0) out.q = new QuantumDataPacket(pack, part); - else if (part + remaining > 0) { + if (remaining > 0) { + out.q = new QuantumDataPacket(pack, part); + } else if (part + remaining > 0) { out.q = new QuantumDataPacket(pack, part + remaining); break; - } else break; + } else { + break; + } } } } @@ -163,11 +175,17 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas } else { setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); dest = getParameterIn(i, 1); - if (dest < 0) setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); - else if (dest == 0) setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); - else if (dest > eOutputData.size()) setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); - else if (Double.isNaN(dest)) setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); - else setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + if (dest < 0) { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + } else if (dest == 0) { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + } else if (dest > eOutputData.size()) { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + } else if (Double.isNaN(dest)) { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + } else { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + } } } } 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 6ef8f8adc8..0ef0b04c17 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 @@ -134,8 +134,11 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock @Override public void construct(int stackSize, boolean hintsOnly) { - if((stackSize &0x1)==1) StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); - else StructureBuilder(shapeFlipped, blockType, blockMeta,2, 1, 0, getBaseMetaTileEntity(),hintsOnly); + if((stackSize &0x1)==1) { + StructureBuilder(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), hintsOnly); + } else { + StructureBuilder(shapeFlipped, blockType, blockMeta, 2, 1, 0, getBaseMetaTileEntity(), hintsOnly); + } } @Override @@ -156,7 +159,9 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock @Override public boolean checkRecipe_EM(ItemStack itemStack) { hasBeenPausedThisCycle =false; - if(powerSetting<300 || timerSetting<=0 || timerSetting>3000) return false; + if(powerSetting<300 || timerSetting<=0 || timerSetting>3000) { + return false; + } if (timerValue <= 0) { timerValue=timerSetting; } @@ -169,7 +174,9 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock @Override public void outputAfterRecipe_EM() { - if(hasBeenPausedThisCycle) return;//skip timer and actions if paused + if(hasBeenPausedThisCycle) { + return;//skip timer and actions if paused + } timerValue--; IGregTechTileEntity mte=getBaseMetaTileEntity(); int xDirShift = ForgeDirection.getOrientation(mte.getBackFacing()).offsetX*2; @@ -212,8 +219,9 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock ((EntityItem) entity).delayBeforeCanPickup=2; ((EntityItem) entity).setDead(); } else if (entity instanceof EntityLivingBase) { - if(!GT_Utility.isWearingFullElectroHazmat((EntityLivingBase) entity)) + if(!GT_Utility.isWearingFullElectroHazmat((EntityLivingBase) entity)) { ((EntityLivingBase) entity).attackEntityFrom(microwaving, damagingFactor); + } } } } @@ -227,7 +235,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock damagingFactor>>=1; } while(damagingFactor>0); - mOutputItems=itemsToOutput.toArray(new ItemStack[0]); + mOutputItems= itemsToOutput.toArray(new ItemStack[itemsToOutput.size()]); if(timerValue<=0) { mte.getWorld().playSoundEffect(xPos,yPos,zPos, Reference.MODID+":microwave_ding", 1, 1); @@ -251,18 +259,30 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock @Override public void parametersOutAndStatusesWrite_EM(boolean machineBusy) { double powerParameter = getParameterIn(0, 0); - if (powerParameter < 300) setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); - else if (powerParameter < 1000) setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); - else if (powerParameter == 1000) setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); - else if (powerParameter == Double.POSITIVE_INFINITY) setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); - else if (Double.isNaN(powerParameter)) setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); - else setStatusOfParameterOut(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_HIGH); + if (powerParameter < 300) { + setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + } else if (powerParameter < 1000) { + setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + } else if (powerParameter == 1000) { + setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + } else if (powerParameter == Double.POSITIVE_INFINITY) { + setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + } else if (Double.isNaN(powerParameter)) { + setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + } else { + setStatusOfParameterOut(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_HIGH); + } double timerParameter = getParameterIn(0, 1); - if (timerParameter <= 1) setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); - else if (timerParameter <= 3000) setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); - else if (Double.isNaN(timerParameter)) setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); - else setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + if (timerParameter <= 1) { + setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + } else if (timerParameter <= 3000) { + setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + } else if (Double.isNaN(timerParameter)) { + setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + } else { + setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + } setParameterOut(0, 0, timerValue); setParameterOut(0, 1, timerSetting - timerValue); @@ -270,7 +290,9 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock @Override public boolean onRunningTick(ItemStack aStack) { - if(eSafeVoid) hasBeenPausedThisCycle = true; + if(eSafeVoid) { + hasBeenPausedThisCycle = true; + } return hasBeenPausedThisCycle || super.onRunningTick(aStack);//consume eu and other resources if not paused } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java index cc031e6772..c744c6019c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java @@ -43,8 +43,9 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { @Override public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex < 0) + if (aSlotIndex < 0) { return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); if (tSlot != null && mTileEntity.getMetaTileEntity() != null) { GT_MetaTileEntity_MultiblockBase_EM base = (GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity(); @@ -53,13 +54,18 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { if(ePowerPassButton) { base.ePowerPass ^= true; if (!allowedToWorkButton) {//TRANSFORMER HACK - if (base.ePowerPass) base.getBaseMetaTileEntity().enableWorking(); - else base.getBaseMetaTileEntity().disableWorking(); + if (base.ePowerPass) { + base.getBaseMetaTileEntity().enableWorking(); + } else { + base.getBaseMetaTileEntity().disableWorking(); + } } } break; case 2: - if(eSafeVoidButton) base.eSafeVoid ^= true; + if(eSafeVoidButton) { + base.eSafeVoid ^= true; + } break; case 3: if(allowedToWorkButton) { @@ -78,8 +84,9 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { @Override public void detectAndSendChanges() { super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null || eParamsInStatus == null) + if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null || eParamsInStatus == null) { return; + } eParamsInStatus = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).eParamsInStatus; eParamsOutStatus = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).eParamsOutStatus; eCertainMode = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).eCertainMode; @@ -91,8 +98,9 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { for (Object crafter : crafters) { ICrafting var1 = (ICrafting) crafter; int i = 100; - for (int j = 0; j < eParamsInStatus.length; j++) + for (int j = 0; j < eParamsInStatus.length; j++) { var1.sendProgressBarUpdate(this, i++, eParamsInStatus[j] | eParamsOutStatus[j] << 8); + } var1.sendProgressBarUpdate(this, 120, eCertainMode | eCertainStatus << 8); var1.sendProgressBarUpdate(this, 121, (ePowerPass ? 1 : 0) + (eSafeVoid ? 2 : 0) + (allowedToWork ? 4 : 0)); } @@ -101,7 +109,9 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { @Override public void updateProgressBar(int par1, int par2) { super.updateProgressBar(par1, par2); - if (eParamsInStatus == null) return; + if (eParamsInStatus == null) { + return; + } if (par1 >= 100 && par1 < 120) { eParamsInStatus[par1 - 100] = (byte) (par2 & 0xff); eParamsOutStatus[par1 - 100] = (byte) (par2 >>> 8); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java index 8c56bbf5e8..3456f22a05 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java @@ -36,24 +36,33 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach fontRendererObj.drawString(mName, 10, -18, 16448255); if (mContainer != null) { - if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 1) != 0) + if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 1) != 0) { fontRendererObj.drawString("Pipe is loose.", 10, -10, 16448255); - if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 2) != 0) + } + if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 2) != 0) { fontRendererObj.drawString("Screws are loose.", 10, -2, 16448255); - if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 4) != 0) + } + if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 4) != 0) { fontRendererObj.drawString("Something is stuck.", 10, 6, 16448255); - if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 8) != 0) + } + if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 8) != 0) { fontRendererObj.drawString("Plating is dented.", 10, 14, 16448255); - if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 16) != 0) + } + if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 16) != 0) { fontRendererObj.drawString("Circuitry burned out.", 10, 22, 16448255); - if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 32) != 0) + } + if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 32) != 0) { fontRendererObj.drawString("That doesn't belong there.", 10, 30, 16448255); - if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 64) != 0) + } + if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 64) != 0) { fontRendererObj.drawString("Incomplete Structure.", 10, 38, 16448255); - if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 128) != 0) + } + if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 128) != 0) { fontRendererObj.drawString("Too Uncertain.", 10, 46, 16448255); - if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 256) != 0) + } + if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 256) != 0) { fontRendererObj.drawString("Invalid Parameters.", 10, 54, 16448255); + } if (((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode == 0) { if (((GT_Container_MultiMachineEM) mContainer).mActive == 0) { @@ -78,29 +87,32 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach counter = (byte) ((1 + counter) % 6); GL11.glColor4f(1f, 1f, 1f, 1f); - if(!ePowerPassButton) + if(!ePowerPassButton) { drawTexturedModalRect(x + 151, y + 23, 215, 23, 18, 18); - else if (((GT_Container_MultiMachineEM) mContainer).ePowerPass) + } else if (((GT_Container_MultiMachineEM) mContainer).ePowerPass) { drawTexturedModalRect(x + 151, y + 23, 183, 23, 18, 18); + } - if(!eSafeVoidButton) + if(!eSafeVoidButton) { drawTexturedModalRect(x + 151, y + 41, 215, 41, 18, 18); - else if (((GT_Container_MultiMachineEM) mContainer).eSafeVoid) + } else if (((GT_Container_MultiMachineEM) mContainer).eSafeVoid) { drawTexturedModalRect(x + 151, y + 41, 183, 41, 18, 18); + } - if(!allowedToWorkButton) + if(!allowedToWorkButton) { drawTexturedModalRect(x + 151, y + 57, 215, 57, 18, 18); - else if (((GT_Container_MultiMachineEM) mContainer).allowedToWork) + } else if (((GT_Container_MultiMachineEM) mContainer).allowedToWork) { drawTexturedModalRect(x + 151, y + 57, 183, 57, 18, 18); + } x += 11; y += 96; for (int i = 0; i < 20; ) { - byte j = (byte) (i >>> 1); - LEDdrawP(x, y, i, 0, ((GT_Container_MultiMachineEM) mContainer).eParamsInStatus[j]); - LEDdrawP(x, y, i++, 1, ((GT_Container_MultiMachineEM) mContainer).eParamsOutStatus[j]); - LEDdrawP(x, y, i, 0, ((GT_Container_MultiMachineEM) mContainer).eParamsInStatus[j + 10]); - LEDdrawP(x, y, i++, 1, ((GT_Container_MultiMachineEM) mContainer).eParamsOutStatus[j + 10]); + byte b = (byte) (i >>> 1); + LEDdrawP(x, y, i, 0, ((GT_Container_MultiMachineEM) mContainer).eParamsInStatus[b]); + LEDdrawP(x, y, i++, 1, ((GT_Container_MultiMachineEM) mContainer).eParamsOutStatus[b]); + LEDdrawP(x, y, i, 0, ((GT_Container_MultiMachineEM) mContainer).eParamsInStatus[b + 10]); + LEDdrawP(x, y, i++, 1, ((GT_Container_MultiMachineEM) mContainer).eParamsOutStatus[b + 10]); } short rU = 183, Vs = 77; @@ -173,7 +185,7 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach private void LEDdrawP(int x, int y, int i, int j, byte status) { int v = 192, su = 8, sv = 6, u = 11; switch (status) { - case STATUS_WRONG: + case STATUS_WRONG: {//fallthrough if (counter < 2) { drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * j, su, sv); break; @@ -181,6 +193,7 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (8 + j), su, sv); break; } + } case STATUS_OK://ok drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (4 + j), su, sv); break; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java index 7a5597281d..fd85b39647 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java @@ -139,8 +139,11 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt protected long getAvailableData_EM() { long result = 0; Vec3pos pos = new Vec3pos(getBaseMetaTileEntity()); - for (GT_MetaTileEntity_Hatch_InputData in : eInputData) - if (in.q != null) result += in.q.computationIfNotContained(pos); + for (GT_MetaTileEntity_Hatch_InputData in : eInputData) { + if (in.q != null) { + result += in.q.computationIfNotContained(pos); + } + } return result; } @@ -164,21 +167,29 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt protected void afterRecipeCheckFailed(){ if (outputEM != null) { float mass = 0; - for (cElementalInstanceStackMap tree : outputEM) - if(tree!=null) mass += tree.getMass(); + for (cElementalInstanceStackMap tree : outputEM) { + if (tree != null) { + mass += tree.getMass(); + } + } if (mass > 0) { - if (eMufflerHatches.size() < 1) explodeMultiblock(); - else { + if (eMufflerHatches.size() < 1) { + explodeMultiblock(); + } else { mass /= eMufflerHatches.size(); - for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) - if (dump.addOverflowMatter(mass)) explodeMultiblock(); + for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) { + if (dump.addOverflowMatter(mass)) { + explodeMultiblock(); + } + } } } outputEM = null; } - for (GT_MetaTileEntity_Hatch_OutputData data : eOutputData) + for (GT_MetaTileEntity_Hatch_OutputData data : eOutputData) { data.q = null; + } mOutputItems = null; mOutputFluids = null; @@ -202,21 +213,29 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt public void stopMachine() { if (outputEM != null) { float mass = 0; - for (cElementalInstanceStackMap tree : outputEM) - if(tree!=null) mass += tree.getMass(); + for (cElementalInstanceStackMap tree : outputEM) { + if (tree != null) { + mass += tree.getMass(); + } + } if (mass > 0) { - if (eMufflerHatches.size() < 1) explodeMultiblock(); - else { + if (eMufflerHatches.size() < 1) { + explodeMultiblock(); + } else { mass /= eMufflerHatches.size(); - for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) - if (dump.addOverflowMatter(mass)) explodeMultiblock(); + for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) { + if (dump.addOverflowMatter(mass)) { + explodeMultiblock(); + } + } } } outputEM = null; } - for (GT_MetaTileEntity_Hatch_OutputData data : eOutputData) + for (GT_MetaTileEntity_Hatch_OutputData data : eOutputData) { data.q = null; + } mOutputItems = null; mOutputFluids = null; @@ -243,15 +262,17 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt IGregTechTileEntity base=getBaseMetaTileEntity(); return base.getWorld().doChunksNearChunkExist(base.getXCoord(),base.getYCoord(),base.getZCoord(),3); //todo check if it is actually checking if chunks are loaded - }else return false; + }else { + return false; + } } - public GT_MetaTileEntity_MultiblockBase_EM(int aID, String aName, String aNameRegional) { + protected GT_MetaTileEntity_MultiblockBase_EM(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); parametersLoadDefault_EM(); } - public GT_MetaTileEntity_MultiblockBase_EM(String aName) { + protected GT_MetaTileEntity_MultiblockBase_EM(String aName) { super(aName); parametersLoadDefault_EM(); } @@ -276,7 +297,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + } return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4]}; } @@ -307,31 +330,35 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //Ensures compatibility if (mOutputItems != null) { aNBT.setInteger("mOutputItemsLength", mOutputItems.length); - for (int i = 0; i < mOutputItems.length; i++) + for (int i = 0; i < mOutputItems.length; i++) { if (mOutputItems[i] != null) { NBTTagCompound tNBT = new NBTTagCompound(); mOutputItems[i].writeToNBT(tNBT); aNBT.setTag("mOutputItem" + i, tNBT); } + } } //Ensures compatibility if (mOutputFluids != null) { aNBT.setInteger("mOutputFluidsLength", mOutputFluids.length); - for (int i = 0; i < mOutputFluids.length; i++) + for (int i = 0; i < mOutputFluids.length; i++) { if (mOutputFluids[i] != null) { NBTTagCompound tNBT = new NBTTagCompound(); mOutputFluids[i].writeToNBT(tNBT); aNBT.setTag("mOutputFluids" + i, tNBT); } + } } if (outputEM != null) { aNBT.setInteger("eOutputStackCount", outputEM.length); NBTTagCompound output = new NBTTagCompound(); - for (int i = 0; i < outputEM.length; i++) - if(outputEM[i]!=null) + for (int i = 0; i < outputEM.length; i++) { + if (outputEM[i] != null) { output.setTag(Integer.toString(i), outputEM[i].toNBT()); + } + } aNBT.setTag("outputEM", output); } else { aNBT.setInteger("eOutputStackCount", 0); @@ -339,28 +366,33 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } NBTTagCompound paramI = new NBTTagCompound(); - for (int i = 0; i < iParamsIn.length; i++) + for (int i = 0; i < iParamsIn.length; i++) { paramI.setInteger(Integer.toString(i), iParamsIn[i]); + } aNBT.setTag("eParamsIn", paramI); NBTTagCompound paramO = new NBTTagCompound(); - for (int i = 0; i < iParamsOut.length; i++) + for (int i = 0; i < iParamsOut.length; i++) { paramO.setInteger(Integer.toString(i), iParamsOut[i]); + } aNBT.setTag("eParamsOut", paramO); NBTTagCompound paramB = new NBTTagCompound(); - for (int i = 0; i < bParamsAreFloats.length; i++) + for (int i = 0; i < bParamsAreFloats.length; i++) { paramB.setBoolean(Integer.toString(i), bParamsAreFloats[i]); + } aNBT.setTag("eParamsB", paramB); NBTTagCompound paramIs = new NBTTagCompound(); - for (int i = 0; i < eParamsInStatus.length; i++) + for (int i = 0; i < eParamsInStatus.length; i++) { paramIs.setByte(Integer.toString(i), eParamsInStatus[i]); + } aNBT.setTag("eParamsInS", paramIs); NBTTagCompound paramOs = new NBTTagCompound(); - for (int i = 0; i < eParamsOutStatus.length; i++) + for (int i = 0; i < eParamsOutStatus.length; i++) { paramOs.setByte(Integer.toString(i), eParamsOutStatus[i]); + } aNBT.setTag("eParamsOutS", paramOs); } @@ -387,16 +419,18 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt int aOutputItemsLength = aNBT.getInteger("mOutputItemsLength"); if (aOutputItemsLength > 0) { mOutputItems = new ItemStack[aOutputItemsLength]; - for (int i = 0; i < mOutputItems.length; i++) + for (int i = 0; i < mOutputItems.length; i++) { mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i); + } } //Ensures compatibility int aOutputFluidsLength = aNBT.getInteger("mOutputFluidsLength"); if (aOutputFluidsLength > 0) { mOutputFluids = new FluidStack[aOutputFluidsLength]; - for (int i = 0; i < mOutputFluids.length; i++) + for (int i = 0; i < mOutputFluids.length; i++) { mOutputFluids[i] = GT_Utility.loadFluid(aNBT, "mOutputFluids" + i); + } } int outputLen = aNBT.getInteger("eOutputStackCount"); @@ -408,32 +442,41 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt try { outputEM[i] = cElementalInstanceStackMap.fromNBT(compound.getCompoundTag(Integer.toString(i))); } catch (tElementalException e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } outputEM[i] = null; } } } - } else outputEM = null; + } else { + outputEM = null; + } NBTTagCompound paramI = aNBT.getCompoundTag("eParamsIn"); - for (int i = 0; i < iParamsIn.length; i++) + for (int i = 0; i < iParamsIn.length; i++) { iParamsIn[i] = paramI.getInteger(Integer.toString(i)); + } NBTTagCompound paramO = aNBT.getCompoundTag("eParamsOut"); - for (int i = 0; i < iParamsOut.length; i++) + for (int i = 0; i < iParamsOut.length; i++) { iParamsOut[i] = paramO.getInteger(Integer.toString(i)); + } NBTTagCompound paramB = aNBT.getCompoundTag("eParamsB"); - for (int i = 0; i < bParamsAreFloats.length; i++) + for (int i = 0; i < bParamsAreFloats.length; i++) { bParamsAreFloats[i] = paramB.getBoolean(Integer.toString(i)); + } NBTTagCompound paramIs = aNBT.getCompoundTag("eParamsInS"); - for (int i = 0; i < eParamsInStatus.length; i++) + for (int i = 0; i < eParamsInStatus.length; i++) { eParamsInStatus[i] = paramIs.getByte(Integer.toString(i)); + } NBTTagCompound paramOs = aNBT.getCompoundTag("eParamsOutS"); - for (int i = 0; i < eParamsOutStatus.length; i++) + for (int i = 0; i < eParamsOutStatus.length; i++) { eParamsOutStatus[i] = paramOs.getByte(Integer.toString(i)); + } } private boolean cyclicUpdate() { @@ -451,7 +494,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } public final boolean setParameterPairIn_ClearOut(int hatchNo, boolean usesFloats, double value0, double value1) { - if (mMaxProgresstime > 0) return false; + if (mMaxProgresstime > 0) { + return false; + } bParamsAreFloats[hatchNo] = usesFloats; if (usesFloats) { iParamsIn[hatchNo] = Float.floatToIntBits((float) value0); @@ -474,7 +519,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } public final int getParameterInInt(int hatchNo, int paramID){ - if(bParamsAreFloats[hatchNo]) return (int)Float.intBitsToFloat(iParamsIn[hatchNo+10*paramID]); + if(bParamsAreFloats[hatchNo]) { + return (int) Float.intBitsToFloat(iParamsIn[hatchNo + 10 * paramID]); + } return iParamsIn[hatchNo+10*paramID]; } @@ -551,7 +598,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { explodedThisTick=false; - if (mEfficiency < 0) mEfficiency = 0; + if (mEfficiency < 0) { + mEfficiency = 0; + } if (--mUpdate == 0 || --mStartUpCheck == 0 || cyclicUpdate() || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) { mInputHatches.clear(); @@ -563,20 +612,38 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt mMufflerHatches.clear(); mMaintenanceHatches.clear(); - for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eOutputHatches) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_elemental)) hatch_elemental.id = -1; - for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eInputHatches) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_elemental)) hatch_elemental.id = -1; + for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eOutputHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_elemental)) { + hatch_elemental.id = -1; + } + } + for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eInputHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_elemental)) { + hatch_elemental.id = -1; + } + } - for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eOutputData) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_data)) hatch_data.id = -1; - for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eInputData) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_data)) hatch_data.id = -1; + for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eOutputData) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_data)) { + hatch_data.id = -1; + } + } + for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eInputData) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_data)) { + hatch_data.id = -1; + } + } - for (GT_MetaTileEntity_Hatch_Uncertainty hatch : eUncertainHatches) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) hatch.getBaseMetaTileEntity().setActive(false); - for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) hatch.getBaseMetaTileEntity().setActive(false); + for (GT_MetaTileEntity_Hatch_Uncertainty hatch : eUncertainHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { + hatch.getBaseMetaTileEntity().setActive(false); + } + } + for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { + hatch.getBaseMetaTileEntity().setActive(false); + } + } eUncertainHatches.clear(); eEnergyMulti.clear(); @@ -588,56 +655,93 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt eOutputData.clear(); eInputData.clear(); - if (getBaseMetaTileEntity() instanceof BaseTileEntity) + if (getBaseMetaTileEntity() instanceof BaseTileEntity) { ((BaseTileEntity) getBaseMetaTileEntity()).ignoreUnloadedChunks = mMachine; + } mMachine = checkMachine(aBaseMetaTileEntity, mInventory[1]); if (!mMachine) { - if (ePowerPass && getEUVar() > V[3] || eDismantleBoom && mMaxProgresstime > 0 && areChunksAroundLoaded_EM()) + if (ePowerPass && getEUVar() > V[3] || eDismantleBoom && mMaxProgresstime > 0 && areChunksAroundLoaded_EM()) { explodeMultiblock(); - if (outputEM != null) - for (cElementalInstanceStackMap tree : outputEM) - if (tree!=null && tree.hasStacks()) explodeMultiblock(); + } + if (outputEM != null) { + for (cElementalInstanceStackMap tree : outputEM) { + if (tree != null && tree.hasStacks()) { + explodeMultiblock(); + } + } + } } - if (eUncertainHatches.size() > 1) mMachine = false; + if (eUncertainHatches.size() > 1) { + mMachine = false; + } if (mMachine) { short id = 1; - for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eOutputHatches) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_elemental)) hatch_elemental.id = id++; + for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eOutputHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_elemental)) { + hatch_elemental.id = id++; + } + } id = 1; - for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eInputHatches) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_elemental)) hatch_elemental.id = id++; + for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eInputHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_elemental)) { + hatch_elemental.id = id++; + } + } id = 1; - for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eOutputData) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_data)) hatch_data.id = id++; + for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eOutputData) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_data)) { + hatch_data.id = id++; + } + } id = 1; - for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eInputData) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_data)) hatch_data.id = id++; + for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eInputData) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_data)) { + hatch_data.id = id++; + } + } - if (mEnergyHatches.size() > 0 || eEnergyMulti.size() > 0) { + if (!mEnergyHatches.isEmpty() || !eEnergyMulti.isEmpty()) { maxEUinputMin = V[15]; maxEUinputMax = V[0]; - for (GT_MetaTileEntity_Hatch_Energy hatch : mEnergyHatches) + for (GT_MetaTileEntity_Hatch_Energy hatch : mEnergyHatches) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { - if (hatch.maxEUInput() < maxEUinputMin) maxEUinputMin = hatch.maxEUInput(); - if (hatch.maxEUInput() > maxEUinputMax) maxEUinputMax = hatch.maxEUInput(); + if (hatch.maxEUInput() < maxEUinputMin) { + maxEUinputMin = hatch.maxEUInput(); + } + if (hatch.maxEUInput() > maxEUinputMax) { + maxEUinputMax = hatch.maxEUInput(); + } } - for (GT_MetaTileEntity_Hatch_EnergyMulti hatch : eEnergyMulti) + } + for (GT_MetaTileEntity_Hatch_EnergyMulti hatch : eEnergyMulti) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { - if (hatch.maxEUInput() < maxEUinputMin) maxEUinputMin = hatch.maxEUInput(); - if (hatch.maxEUInput() > maxEUinputMax) maxEUinputMax = hatch.maxEUInput(); + if (hatch.maxEUInput() < maxEUinputMin) { + maxEUinputMin = hatch.maxEUInput(); + } + if (hatch.maxEUInput() > maxEUinputMax) { + maxEUinputMax = hatch.maxEUInput(); + } } + } eMaxAmpereFlow = 0; //counts only full amps - for (GT_MetaTileEntity_Hatch_Energy hatch : mEnergyHatches) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) eMaxAmpereFlow += hatch.maxEUInput() / maxEUinputMin; - for (GT_MetaTileEntity_Hatch_EnergyMulti hatch : eEnergyMulti) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) + for (GT_MetaTileEntity_Hatch_Energy hatch : mEnergyHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { + eMaxAmpereFlow += hatch.maxEUInput() / maxEUinputMin; + } + } + for (GT_MetaTileEntity_Hatch_EnergyMulti hatch : eEnergyMulti) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { eMaxAmpereFlow += hatch.maxEUInput() / maxEUinputMin * hatch.Amperes; - if (getEUVar() > maxEUStore()) setEUVar(maxEUStore()); + } + } + if (getEUVar() > maxEUStore()) { + setEUVar(maxEUStore()); + } } else { maxEUinputMin = 0; maxEUinputMax = 0; @@ -645,12 +749,17 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt setEUVar(0); } - for (GT_MetaTileEntity_Hatch_Uncertainty hatch : eUncertainHatches) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) hatch.getBaseMetaTileEntity().setActive(true); + for (GT_MetaTileEntity_Hatch_Uncertainty hatch : eUncertainHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { + hatch.getBaseMetaTileEntity().setActive(true); + } + } for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches){ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { hatch.getBaseMetaTileEntity().setActive(true); - if(hatch.param>=0) bParamsAreFloats[hatch.param]=hatch.isUsingFloats(); + if(hatch.param>=0) { + bParamsAreFloats[hatch.param] = hatch.isUsingFloats(); + } } } } else { @@ -665,9 +774,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (mStartUpCheck < 0) {//E if (mMachine) {//S byte Tick = (byte) (aTick % 20); - if (MULTI_PURGE_1_AT == Tick || MULTI_PURGE_2_AT == Tick) + if (MULTI_PURGE_1_AT == Tick || MULTI_PURGE_2_AT == Tick) { purgeAllOverflowEM_EM(); - else if (MULTI_CHECK_AT == Tick) + } else if (MULTI_CHECK_AT == Tick) { for (GT_MetaTileEntity_Hatch_Maintenance tHatch : mMaintenanceHatches) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { if (GT_MetaTileEntity_MultiBlockBase.disableMaintenance) { @@ -678,14 +787,27 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt mSolderingTool = true; mCrowbar = true; } else { - if (tHatch.mAuto && !(mWrench && mScrewdriver && mSoftHammer && mHardHammer && mSolderingTool && mCrowbar)) + if (tHatch.mAuto && !(mWrench && mScrewdriver && mSoftHammer && mHardHammer && mSolderingTool && mCrowbar)) { tHatch.autoMaintainance(); - if (tHatch.mWrench) mWrench = true; - if (tHatch.mScrewdriver) mScrewdriver = true; - if (tHatch.mSoftHammer) mSoftHammer = true; - if (tHatch.mHardHammer) mHardHammer = true; - if (tHatch.mSolderingTool) mSolderingTool = true; - if (tHatch.mCrowbar) mCrowbar = true; + } + if (tHatch.mWrench) { + mWrench = true; + } + if (tHatch.mScrewdriver) { + mScrewdriver = true; + } + if (tHatch.mSoftHammer) { + mSoftHammer = true; + } + if (tHatch.mHardHammer) { + mHardHammer = true; + } + if (tHatch.mSolderingTool) { + mSolderingTool = true; + } + if (tHatch.mCrowbar) { + mCrowbar = true; + } tHatch.mWrench = false; tHatch.mScrewdriver = false; @@ -696,17 +818,20 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } } - else if (MOVE_AT == Tick && eSafeVoid) { + } else if (MOVE_AT == Tick && eSafeVoid) { for (GT_MetaTileEntity_Hatch_OverflowElemental voider : eMufflerHatches) { - if (voider.overflowMax < voider.getOverflowMatter()) continue; + if (voider.overflowMax < voider.getOverflowMatter()) { + continue; + } float remaining = voider.overflowMax - voider.getOverflowMatter(); for (GT_MetaTileEntity_Hatch_InputElemental in : eInputHatches) { for (cElementalInstanceStack instance : in.getContainerHandler().values()) { long qty = (long) Math.floor(remaining / instance.definition.getMass()); if (qty > 0) { qty = Math.min(qty, instance.amount); - if (voider.addOverflowMatter(instance.definition.getMass() * qty)) + if (voider.addOverflowMatter(instance.definition.getMass() * qty)) { voider.setOverflowMatter(voider.overflowMax); + } in.getContainerHandler().removeAmount(false, new cElementalDefinitionStack(instance.definition, qty)); } } @@ -716,8 +841,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt long qty = (long)Math.floor(remaining / instance.definition.getMass()); if (qty > 0) { qty = Math.min(qty, instance.amount); - if (voider.addOverflowMatter(instance.definition.getMass() * qty)) + if (voider.addOverflowMatter(instance.definition.getMass() * qty)) { voider.setOverflowMatter(voider.overflowMax); + } out.getContainerHandler().removeAmount(false, new cElementalDefinitionStack(instance.definition, qty)); } } @@ -726,26 +852,33 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } if (getRepairStatus() >= minRepairStatus) {//S - if (MULTI_CHECK_AT == Tick) + if (MULTI_CHECK_AT == Tick) { hatchesStatusUpdate_EM(); + } //region power pass and controller charging {//DO long euVar; for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { - if (getEUVar() > getMinimumStoredEU()) break; + if (getEUVar() > getMinimumStoredEU()) { + break; + } if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { euVar = tHatch.maxEUInput(); - if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euVar, false)) + if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euVar, false)) { setEUVar(getEUVar() + euVar); + } } } for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) { - if (getEUVar() > getMinimumStoredEU()) break; + if (getEUVar() > getMinimumStoredEU()) { + break; + } if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { euVar = tHatch.maxEUInput() * tHatch.Amperes; - if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euVar, false)) + if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euVar, false)) { setEUVar(getEUVar() + euVar); + } } } if (ePowerPass) { @@ -753,16 +886,18 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { euVar = tHatch.maxEUOutput(); if (tHatch.getBaseMetaTileEntity().getStoredEU() <= tHatch.maxEUStore() - euVar && - aBaseMetaTileEntity.decreaseStoredEnergyUnits(euVar + Math.min(euVar >> 7,1), false)) + aBaseMetaTileEntity.decreaseStoredEnergyUnits(euVar + Math.min(euVar >> 7,1), false)) { tHatch.setEUVar(tHatch.getBaseMetaTileEntity().getStoredEU() + euVar); + } } } for (GT_MetaTileEntity_Hatch_DynamoMulti tHatch : eDynamoMulti) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { euVar = tHatch.maxEUOutput() * tHatch.Amperes; if (tHatch.getBaseMetaTileEntity().getStoredEU() <= tHatch.maxEUStore() - euVar && - aBaseMetaTileEntity.decreaseStoredEnergyUnits(euVar + Math.min(euVar >> 7,tHatch.Amperes), false)) + aBaseMetaTileEntity.decreaseStoredEnergyUnits(euVar + Math.min(euVar >> 7,tHatch.Amperes), false)) { tHatch.setEUVar(tHatch.getBaseMetaTileEntity().getStoredEU() + euVar); + } } } } @@ -772,7 +907,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (mMaxProgresstime > 0 && doRandomMaintenanceDamage()) {//Start if (onRunningTick(mInventory[1])) {//Compute EU cleanMassEM_EM(getExcessMassPerTick_EM(mInventory[1])); - if (!polluteEnvironment(getPollutionPerTick(mInventory[1]))) stopMachine(); + if (!polluteEnvironment(getPollutionPerTick(mInventory[1]))) { + stopMachine(); + } if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime && RECIPE_AT == Tick) {//progress increase and done hatchesStatusUpdate_EM(); @@ -780,15 +917,25 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt outputAfterRecipe_EM(); cleanOutputEM_EM(); - if (mOutputItems != null) for (ItemStack tStack : mOutputItems) - if (tStack != null) addOutput(tStack); + if (mOutputItems != null) { + for (ItemStack tStack : mOutputItems) { + if (tStack != null) { + addOutput(tStack); + } + } + } mOutputItems = null; if (mOutputFluids != null) { if (mOutputFluids.length == 1) { - for (FluidStack tStack : mOutputFluids) - if (tStack != null) addOutput(tStack); - } else if (mOutputFluids.length > 1) addFluidOutputs(mOutputFluids); + for (FluidStack tStack : mOutputFluids) { + if (tStack != null) { + addOutput(tStack); + } + } + } else if (mOutputFluids.length > 1) { + addFluidOutputs(mOutputFluids); + } } mOutputFluids = null; @@ -804,7 +951,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt mMaxProgresstime=0;//Just to be sure... } updateSlots(); - } else notAllowedToWork_stopMachine_EM(); + } else { + notAllowedToWork_stopMachine_EM(); + } } }// else {//failed to consume power/resources - inside on running tick // stopMachine(); @@ -831,8 +980,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt 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; - for (GT_MetaTileEntity_Hatch_Muffler aMuffler : mMufflerHatches) + for (GT_MetaTileEntity_Hatch_Muffler aMuffler : mMufflerHatches) { aMuffler.getBaseMetaTileEntity().setActive(active); + } } } @@ -869,8 +1019,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public boolean onRunningTick(ItemStack aStack) { if (eRequiredData > eAvailableData) { - if(energyFlowOnRunningTick(aStack,false)) + if(energyFlowOnRunningTick(aStack,false)) { stopMachine(); + } return false; } return energyFlowOnRunningTick(aStack,true); @@ -927,30 +1078,46 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Deprecated @Override public final boolean addEnergyOutput(long EU) { - if (EU <= 0L) return true; - for (GT_MetaTileEntity_Hatch tHatch : eDynamoMulti) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)){ - if(tHatch.maxEUOutput()<EU) explodeMultiblock(); - if(tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(EU, false)) + if (EU <= 0L) { + return true; + } + for (GT_MetaTileEntity_Hatch tHatch : eDynamoMulti) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + if (tHatch.maxEUOutput() < EU) { + explodeMultiblock(); + } + if (tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(EU, false)) { return true; + } } - for (GT_MetaTileEntity_Hatch tHatch : mDynamoHatches) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)){ - if(tHatch.maxEUOutput()<EU) explodeMultiblock(); - if(tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(EU, false)) + } + for (GT_MetaTileEntity_Hatch tHatch : mDynamoHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + if (tHatch.maxEUOutput() < EU) { + explodeMultiblock(); + } + if (tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(EU, false)) { return true; + } } + } return false; } private boolean addEnergyOutput_EM(long EU, long Amperes) { - if(EU<0) EU=-EU; - if(Amperes<0) Amperes=-Amperes; + if(EU<0) { + EU = -EU; + } + if(Amperes<0) { + Amperes = -Amperes; + } long euVar = EU * Amperes; long diff; for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - if (tHatch.maxEUOutput() < EU) explodeMultiblock(); + if (tHatch.maxEUOutput() < EU) { + explodeMultiblock(); + } diff = tHatch.maxEUStore() - tHatch.getBaseMetaTileEntity().getStoredEU(); if (diff > 0) { if (euVar > diff) { @@ -965,7 +1132,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } for (GT_MetaTileEntity_Hatch_DynamoMulti tHatch : eDynamoMulti) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - if (tHatch.maxEUOutput() < EU) explodeMultiblock(); + if (tHatch.maxEUOutput() < EU) { + explodeMultiblock(); + } diff = tHatch.maxEUStore() - tHatch.getBaseMetaTileEntity().getStoredEU(); if (diff > 0) { if (euVar > diff) { @@ -984,29 +1153,41 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Deprecated @Override public final boolean drainEnergyInput(long EU) { - if (EU <= 0L) return true; - for (GT_MetaTileEntity_Hatch tHatch : eEnergyMulti) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch) && tHatch.maxEUInput()>EU && tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(EU, false)) + if (EU <= 0L) { + return true; + } + for (GT_MetaTileEntity_Hatch tHatch : eEnergyMulti) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch) && tHatch.maxEUInput() > EU && tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(EU, false)) { return true; - for (GT_MetaTileEntity_Hatch tHatch : mEnergyHatches) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch) && tHatch.maxEUInput()>EU && tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(EU, false)) + } + } + for (GT_MetaTileEntity_Hatch tHatch : mEnergyHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch) && tHatch.maxEUInput() > EU && tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(EU, false)) { return true; + } + } return false; } private boolean drainEnergyInput_EM(long EUtTierVoltage, long EUtEffective, long Amperes) { - if(EUtTierVoltage<0) EUtTierVoltage=-EUtTierVoltage; - if(EUtEffective<0) EUtEffective=-EUtEffective; - if(Amperes<0) Amperes=-Amperes; + if(EUtTierVoltage<0) { + EUtTierVoltage = -EUtTierVoltage; + } + if(EUtEffective<0) { + EUtEffective = -EUtEffective; + } + if(Amperes<0) { + Amperes = -Amperes; + } long EUuse = EUtEffective * Amperes; if (EUuse > getEUVar() || //not enough power EUtTierVoltage > maxEUinputMax || //TIER IS BASED ON BEST HATCH! not total EUtEffective input (EUtTierVoltage*Amperes - 1) / maxEUinputMin + 1 > eMaxAmpereFlow) {// EUuse==0? --> (EUuse - 1) / maxEUinputMin + 1 = 1! //if not too much A if (DEBUG_MODE) { - TecTech.Logger.debug("L1 " + EUuse + " " + getEUVar() + " " + (EUuse > getEUVar())); - TecTech.Logger.debug("L2 " + EUtEffective + " " + maxEUinputMax + " " + (EUtEffective > maxEUinputMax)); - TecTech.Logger.debug("L3 " + EUuse + " " + eMaxAmpereFlow); - TecTech.Logger.debug("L4 " + ((EUuse - 1) / maxEUinputMin + 1) + " " + eMaxAmpereFlow + " " + ((EUuse - 1) / maxEUinputMin + 1 > eMaxAmpereFlow)); + TecTech.Logger.debug("L1 " + EUuse + ' ' + getEUVar() + ' ' + (EUuse > getEUVar())); + TecTech.Logger.debug("L2 " + EUtEffective + ' ' + maxEUinputMax + ' ' + (EUtEffective > maxEUinputMax)); + TecTech.Logger.debug("L3 " + EUuse + ' ' + eMaxAmpereFlow); + TecTech.Logger.debug("L4 " + ((EUuse - 1) / maxEUinputMin + 1) + ' ' + eMaxAmpereFlow + ' ' + ((EUuse - 1) / maxEUinputMin + 1 > eMaxAmpereFlow)); } return false; } @@ -1042,20 +1223,32 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override // same as gt sum of all hatches public final long getMaxInputVoltage() { long rVoltage = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) rVoltage += tHatch.maxEUInput(); - for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) rVoltage += tHatch.maxEUInput(); + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + rVoltage += tHatch.maxEUInput(); + } + } + for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + rVoltage += tHatch.maxEUInput(); + } + } return rVoltage; } //new Method public final long getMaxInputEnergy(){ long energy = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) energy += tHatch.maxEUInput(); - for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) energy += tHatch.maxEUInput() * tHatch.Amperes; + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + energy += tHatch.maxEUInput(); + } + } + for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + energy += tHatch.maxEUInput() * tHatch.Amperes; + } + } return energy; } @@ -1108,59 +1301,92 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt private void purgeAllOverflowEM_EM() { float mass = 0; for (GT_MetaTileEntity_Hatch_InputElemental tHatch : eInputHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) tHatch.updateSlots(); + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + tHatch.updateSlots(); + } mass += tHatch.overflowMatter; tHatch.overflowMatter = 0; } for (GT_MetaTileEntity_Hatch_OutputElemental tHatch : eOutputHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) tHatch.updateSlots(); + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + tHatch.updateSlots(); + } mass += tHatch.overflowMatter; tHatch.overflowMatter = 0; } if (mass > 0) { - if (eMufflerHatches.size() < 1) explodeMultiblock(); + if (eMufflerHatches.size() < 1) { + explodeMultiblock(); + } mass /= eMufflerHatches.size(); - for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) - if (dump.addOverflowMatter(mass)) explodeMultiblock(); + for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) { + if (dump.addOverflowMatter(mass)) { + explodeMultiblock(); + } + } } } public void cleanHatchContentEM_EM(GT_MetaTileEntity_Hatch_ElementalContainer target) { - if (target == null) return; + if (target == null) { + return; + } float mass = target.getContainerHandler().getMass(); if (mass > 0) { - if (eMufflerHatches.size() < 1) explodeMultiblock(); + if (eMufflerHatches.size() < 1) { + explodeMultiblock(); + } mass /= eMufflerHatches.size(); - for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) - if (dump.addOverflowMatter(mass)) explodeMultiblock(); + for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) { + if (dump.addOverflowMatter(mass)) { + explodeMultiblock(); + } + } } } public void cleanStackEM_EM(cElementalInstanceStack target) { - if (target == null) return; + if (target == null) { + return; + } cleanMassEM_EM(target.getMass()); } public void cleanMassEM_EM(float mass) { if (mass > 0) { - if (eMufflerHatches.size() < 1) explodeMultiblock(); + if (eMufflerHatches.size() < 1) { + explodeMultiblock(); + } mass /= eMufflerHatches.size(); - for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) - if (dump.addOverflowMatter(mass)) explodeMultiblock(); + for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) { + if (dump.addOverflowMatter(mass)) { + explodeMultiblock(); + } + } } } private void cleanOutputEM_EM() { - if (outputEM == null) return; + if (outputEM == null) { + return; + } float mass = 0; - for (cElementalInstanceStackMap map : outputEM) - if(map!=null) mass += map.getMass(); + for (cElementalInstanceStackMap map : outputEM) { + if (map != null) { + mass += map.getMass(); + } + } if (mass > 0) { - if (eMufflerHatches.size() < 1) explodeMultiblock(); + if (eMufflerHatches.size() < 1) { + explodeMultiblock(); + } mass /= eMufflerHatches.size(); - for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) - if (dump.addOverflowMatter(mass)) explodeMultiblock(); + for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) { + if (dump.addOverflowMatter(mass)) { + explodeMultiblock(); + } + } } outputEM = null; } @@ -1178,7 +1404,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt boolean busy=mMaxProgresstime>0; if (busy) {//write from buffer to hatches only for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches) { - if (!GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch) || hatch.param < 0) continue; + if (!GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch) || hatch.param < 0) { + continue; + } int paramID = hatch.param; if(bParamsAreFloats[hatch.param] == hatch.isUsingFloats()){ hatch.input0i = iParamsOut[paramID]; @@ -1194,7 +1422,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt parametersInRead_EM(); } else {//if has nothing to do update all for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches) { - if (!GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch) || hatch.param < 0) continue; + if (!GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch) || hatch.param < 0) { + continue; + } int paramID = hatch.param; bParamsAreFloats[hatch.param] = hatch.isUsingFloats(); iParamsIn[paramID] = hatch.value0i; @@ -1203,8 +1433,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt hatch.input1i = iParamsOut[paramID + 10]; } } - for (GT_MetaTileEntity_Hatch_Uncertainty uncertainty : eUncertainHatches) + for (GT_MetaTileEntity_Hatch_Uncertainty uncertainty : eUncertainHatches) { eCertainStatus = uncertainty.update(eCertainMode); + } eAvailableData = getAvailableData_EM(); parametersOutAndStatusesWrite_EM(busy); } @@ -1226,10 +1457,12 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public final void explodeMultiblock() { - if(explodedThisTick)return; + if(explodedThisTick) { + return; + } explodedThisTick=true; if (!TecTech.ModConfig.BOOM_ENABLE) { - TecTech.proxy.broadcast("Multi Explode BOOM! " + getBaseMetaTileEntity().getXCoord() + " " + getBaseMetaTileEntity().getYCoord() + " " + getBaseMetaTileEntity().getZCoord()); + TecTech.proxy.broadcast("Multi Explode BOOM! " + getBaseMetaTileEntity().getXCoord() + ' ' + getBaseMetaTileEntity().getYCoord() + ' ' + getBaseMetaTileEntity().getZCoord()); StackTraceElement[] ste = Thread.currentThread().getStackTrace(); TecTech.proxy.broadcast("Multi Explode BOOM! " + ste[2].toString()); return; @@ -1237,23 +1470,57 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt extraExplosions_EM(); GT_Pollution.addPollution(getBaseMetaTileEntity(), 600000); mInventory[1] = null; - for (MetaTileEntity tTileEntity : mInputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); - for (MetaTileEntity tTileEntity : mOutputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); - for (MetaTileEntity tTileEntity : mInputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); - for (MetaTileEntity tTileEntity : mOutputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); - for (MetaTileEntity tTileEntity : mDynamoHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]); - for (MetaTileEntity tTileEntity : mMufflerHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); - for (MetaTileEntity tTileEntity : mEnergyHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]); - for (MetaTileEntity tTileEntity : mMaintenanceHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); - for (MetaTileEntity tTileEntity : eParamHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); - for (MetaTileEntity tTileEntity : eInputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]); - for (MetaTileEntity tTileEntity : eOutputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]); - for (MetaTileEntity tTileEntity : eMufflerHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]); - for (MetaTileEntity tTileEntity : eEnergyMulti) tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]); - for (MetaTileEntity tTileEntity : eUncertainHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); - 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]); + for (MetaTileEntity tTileEntity : mInputBusses) { + tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); + } + for (MetaTileEntity tTileEntity : mOutputBusses) { + tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); + } + for (MetaTileEntity tTileEntity : mInputHatches) { + tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); + } + for (MetaTileEntity tTileEntity : mOutputHatches) { + tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); + } + for (MetaTileEntity tTileEntity : mDynamoHatches) { + tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]); + } + for (MetaTileEntity tTileEntity : mMufflerHatches) { + tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); + } + for (MetaTileEntity tTileEntity : mEnergyHatches) { + tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]); + } + for (MetaTileEntity tTileEntity : mMaintenanceHatches) { + tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); + } + for (MetaTileEntity tTileEntity : eParamHatches) { + tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); + } + for (MetaTileEntity tTileEntity : eInputHatches) { + tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]); + } + for (MetaTileEntity tTileEntity : eOutputHatches) { + tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]); + } + for (MetaTileEntity tTileEntity : eMufflerHatches) { + tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]); + } + for (MetaTileEntity tTileEntity : eEnergyMulti) { + tTileEntity.getBaseMetaTileEntity().doExplosion(V[14]); + } + for (MetaTileEntity tTileEntity : eUncertainHatches) { + tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); + } + 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]); + } getBaseMetaTileEntity().doExplosion(V[15]); } @@ -1267,135 +1534,197 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt public void onRemoval() { try { if (eOutputHatches != null) { - for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eOutputHatches) + for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eOutputHatches) { hatch_elemental.id = -1; - for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eInputHatches) + } + for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eInputHatches) { hatch_elemental.id = -1; + } for (GT_MetaTileEntity_Hatch_OutputData hatch_data : eOutputData) { hatch_data.id = -1; hatch_data.q = null; } - for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eInputData) + for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eInputData) { hatch_data.id = -1; - for (GT_MetaTileEntity_Hatch_Uncertainty hatch : eUncertainHatches) + } + for (GT_MetaTileEntity_Hatch_Uncertainty hatch : eUncertainHatches) { hatch.getBaseMetaTileEntity().setActive(false); - for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches) + } + for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches) { hatch.getBaseMetaTileEntity().setActive(false); + } } - if (ePowerPass && getEUVar()>V[3] || eDismantleBoom && mMaxProgresstime > 0 && areChunksAroundLoaded_EM()) + if (ePowerPass && getEUVar()>V[3] || eDismantleBoom && mMaxProgresstime > 0 && areChunksAroundLoaded_EM()) { explodeMultiblock(); - if (outputEM != null) - for (cElementalInstanceStackMap output : outputEM) - if (output!=null && output.hasStacks()) explodeMultiblock(); + } + if (outputEM != null) { + for (cElementalInstanceStackMap output : outputEM) { + if (output != null && output.hasStacks()) { + explodeMultiblock(); + } + } + } } catch (Exception e) { - if (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } } } //region adder methods @Override public final boolean addToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); } - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { return mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { return mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { return mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { return mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { return mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { return mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) { return mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { return mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputElemental) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputElemental) { return eInputHatches.add((GT_MetaTileEntity_Hatch_InputElemental) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputElemental) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputElemental) { return eOutputHatches.add((GT_MetaTileEntity_Hatch_OutputElemental) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Param) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Param) { return eParamHatches.add((GT_MetaTileEntity_Hatch_Param) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Uncertainty) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Uncertainty) { return eUncertainHatches.add((GT_MetaTileEntity_Hatch_Uncertainty) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OverflowElemental) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OverflowElemental) { return eMufflerHatches.add((GT_MetaTileEntity_Hatch_OverflowElemental) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) { return eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) { return eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputData) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputData) { return eInputData.add((GT_MetaTileEntity_Hatch_InputData) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputData) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputData) { return eOutputData.add((GT_MetaTileEntity_Hatch_OutputData) aMetaTileEntity); + } return false; } public final boolean addClassicToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); } - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { return mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { return mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { return mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { return mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { return mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { return mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) { return mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { return mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Param) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Param) { return eParamHatches.add((GT_MetaTileEntity_Hatch_Param) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Uncertainty) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Uncertainty) { return eUncertainHatches.add((GT_MetaTileEntity_Hatch_Uncertainty) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyMulti) { return eEnergyMulti.add((GT_MetaTileEntity_Hatch_EnergyMulti) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DynamoMulti) { return eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputData) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputData) { return eInputData.add((GT_MetaTileEntity_Hatch_InputData) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputData) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputData) { return eOutputData.add((GT_MetaTileEntity_Hatch_OutputData) aMetaTileEntity); + } return false; } public final boolean addElementalToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); } - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputElemental) + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputElemental) { return eInputHatches.add((GT_MetaTileEntity_Hatch_InputElemental) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputElemental) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputElemental) { return eOutputHatches.add((GT_MetaTileEntity_Hatch_OutputElemental) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OverflowElemental) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OverflowElemental) { return eMufflerHatches.add((GT_MetaTileEntity_Hatch_OverflowElemental) aMetaTileEntity); + } return false; } public final boolean addClassicMufflerToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); @@ -1404,9 +1733,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } public final boolean addElementalMufflerToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OverflowElemental) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return eMufflerHatches.add((GT_MetaTileEntity_Hatch_OverflowElemental) aMetaTileEntity); @@ -1416,9 +1749,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public final boolean addMufflerToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); @@ -1432,9 +1769,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public final boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = getRecipeMap(); @@ -1455,9 +1796,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public final boolean addOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); @@ -1476,9 +1821,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Deprecated @Override public final boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); @@ -1493,9 +1842,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Deprecated @Override public final boolean addDynamoToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); @@ -1509,9 +1862,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //New Method public final boolean addEnergyIOToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); @@ -1533,9 +1890,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //NEW METHOD public final boolean addElementalInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputElemental) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); //((GT_MetaTileEntity_Hatch_Elemental) aMetaTileEntity).mRecipeMap = getRecipeMap(); @@ -1546,9 +1907,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //NEW METHOD public final boolean addElementalOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputElemental) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return eOutputHatches.add((GT_MetaTileEntity_Hatch_OutputElemental) aMetaTileEntity); @@ -1558,9 +1923,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //NEW METHOD public final boolean addClassicInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = getRecipeMap(); @@ -1576,9 +1945,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //NEW METHOD public final boolean addClassicOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); @@ -1596,7 +1969,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt return false; } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Param) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return eParamHatches.add((GT_MetaTileEntity_Hatch_Param) aMetaTileEntity); @@ -1610,7 +1985,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt return false; } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Uncertainty) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return eUncertainHatches.add((GT_MetaTileEntity_Hatch_Uncertainty) aMetaTileEntity); @@ -1620,9 +1997,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public final boolean addMaintenanceToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); @@ -1640,9 +2021,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //NEW METHOD public final boolean addClassicMaintenanceToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); @@ -1652,9 +2037,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //NEW METHOD public final boolean addDataConnectorToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; + if (aTileEntity == null) { + return false; + } IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputData) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return eInputData.add((GT_MetaTileEntity_Hatch_InputData) aMetaTileEntity); @@ -1691,7 +2080,9 @@ 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 (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } } } @@ -1700,7 +2091,9 @@ 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 (DEBUG_MODE) e.printStackTrace(); + if (DEBUG_MODE) { + e.printStackTrace(); + } } return false; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java index da81932189..185e46e074 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java @@ -6,7 +6,7 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockCont /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_Centrifuge extends GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behaviour { final int tier; public Behaviour_Centrifuge(int tier){ this.tier=tier; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java index fccca17ddc..b922c82fb0 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java @@ -6,7 +6,7 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockCont /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_Electrolyzer extends GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_Electrolyzer implements GT_MetaTileEntity_EM_machine.Behaviour { final int tier; public Behaviour_Electrolyzer(int tier){ this.tier=tier; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java index 26e9cacbf2..97ed34d990 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java @@ -6,7 +6,7 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockCont /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_ElectromagneticSeparator extends GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_ElectromagneticSeparator implements GT_MetaTileEntity_EM_machine.Behaviour { final int tier; public Behaviour_ElectromagneticSeparator(int tier){ this.tier=tier; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Mixer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Mixer.java index 50acb59a85..153fd4c4a5 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Mixer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Mixer.java @@ -6,7 +6,7 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockCont /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_Mixer extends GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_Mixer implements GT_MetaTileEntity_EM_machine.Behaviour { final int tier; public Behaviour_Mixer(int tier){ this.tier=tier; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java index 8a003e35b0..ecd0fb464c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java @@ -6,7 +6,7 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockCont /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_PrecisionLaser extends GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_PrecisionLaser implements GT_MetaTileEntity_EM_machine.Behaviour { final int tier; public Behaviour_PrecisionLaser(int tier){ this.tier=tier; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java index 7b922521d0..16a2c4d4a6 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java @@ -6,7 +6,7 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockCont /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_Recycler extends GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_Recycler implements GT_MetaTileEntity_EM_machine.Behaviour { final int tier; public Behaviour_Recycler(int tier){ this.tier=tier; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java index 61c94fdc48..16f46023ec 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java @@ -93,29 +93,55 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa @Override public boolean checkRecipe_EM(ItemStack itemStack) { Behaviour currentBehaviour = GT_MetaTileEntity_EM_machine.map.get(new GT_ItemStack(itemStack)); - if(currentBehaviour ==null) return false; + if(currentBehaviour ==null) { + return false; + } //mux input double[] parameters=new double[]{getParameterIn(0,0),getParameterIn(0,1),getParameterIn(1,0),getParameterIn(1,1), getParameterIn(2,0),getParameterIn(2,1),getParameterIn(3,0),getParameterIn(3,1)}; - if(!currentBehaviour.setAndCheckParametersOutAndStatuses(this,parameters))return false; + if(!currentBehaviour.setAndCheckParametersOutAndStatuses(this,parameters)) { + return false; + } cElementalInstanceStackMap[] handles=new cElementalInstanceStackMap[6]; int pointer= getParameterInInt(4,0)-1; - if(pointer>=0 && pointer<eInputHatches.size()) handles[0]=eInputHatches.get(pointer).getContainerHandler(); + if(pointer>=0 && pointer<eInputHatches.size()) { + handles[0] = eInputHatches.get(pointer).getContainerHandler(); + } pointer= getParameterInInt(4,1)-1; - if(pointer>=0 && pointer<eInputHatches.size()) handles[1]=eInputHatches.get(pointer).getContainerHandler(); + if(pointer>=0 && pointer<eInputHatches.size()) { + handles[1] = eInputHatches.get(pointer).getContainerHandler(); + } pointer= getParameterInInt(5,0)-1; - if(pointer>=0 && pointer<eInputHatches.size()) handles[2]=eInputHatches.get(pointer).getContainerHandler(); + if(pointer>=0 && pointer<eInputHatches.size()) { + handles[2] = eInputHatches.get(pointer).getContainerHandler(); + } pointer= getParameterInInt(5,1)-1; - if(pointer>=0 && pointer<eInputHatches.size()) handles[3]=eInputHatches.get(pointer).getContainerHandler(); + if(pointer>=0 && pointer<eInputHatches.size()) { + handles[3] = eInputHatches.get(pointer).getContainerHandler(); + } pointer= getParameterInInt(6,0)-1; - if(pointer>=0 && pointer<eInputHatches.size()) handles[4]=eInputHatches.get(pointer).getContainerHandler(); + if(pointer>=0 && pointer<eInputHatches.size()) { + handles[4] = eInputHatches.get(pointer).getContainerHandler(); + } pointer= getParameterInInt(6,1)-1; - if(pointer>=0 && pointer<eInputHatches.size()) handles[5]=eInputHatches.get(pointer).getContainerHandler(); - for(int i=1;i<6;i++) if(handles[i]!=null) for(int j=0;j<i;j++) if (handles[i]==handles[j]) return false; + if(pointer>=0 && pointer<eInputHatches.size()) { + handles[5] = eInputHatches.get(pointer).getContainerHandler(); + } + for(int i=1;i<6;i++) { + if (handles[i] != null) { + for (int j = 0; j < i; j++) { + if (handles[i] == handles[j]) { + return false; + } + } + } + } MultiblockControl<cElementalInstanceStackMap[]> control= currentBehaviour.process(handles,parameters); - if(control==null) return false; + if(control==null) { + return false; + } //update other pare outputEM=control.getValue(); mEUt=control.getEUT(); @@ -131,19 +157,35 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa public void outputAfterRecipe_EM() { cElementalInstanceStackMap[] handles=new cElementalInstanceStackMap[6]; int pointer= getParameterInInt(7,0)-1; - if(pointer>=0 && pointer<eOutputHatches.size()) handles[0]=eOutputHatches.get(pointer).getContainerHandler(); + if(pointer>=0 && pointer<eOutputHatches.size()) { + handles[0] = eOutputHatches.get(pointer).getContainerHandler(); + } pointer= getParameterInInt(7,1)-1; - if(pointer>=0 && pointer<eOutputHatches.size()) handles[1]=eOutputHatches.get(pointer).getContainerHandler(); + if(pointer>=0 && pointer<eOutputHatches.size()) { + handles[1] = eOutputHatches.get(pointer).getContainerHandler(); + } pointer= getParameterInInt(8,0)-1; - if(pointer>=0 && pointer<eOutputHatches.size()) handles[2]=eOutputHatches.get(pointer).getContainerHandler(); + if(pointer>=0 && pointer<eOutputHatches.size()) { + handles[2] = eOutputHatches.get(pointer).getContainerHandler(); + } pointer= getParameterInInt(8,1)-1; - if(pointer>=0 && pointer<eOutputHatches.size()) handles[3]=eOutputHatches.get(pointer).getContainerHandler(); + if(pointer>=0 && pointer<eOutputHatches.size()) { + handles[3] = eOutputHatches.get(pointer).getContainerHandler(); + } pointer= getParameterInInt(9,0)-1; - if(pointer>=0 && pointer<eOutputHatches.size()) handles[4]=eOutputHatches.get(pointer).getContainerHandler(); + if(pointer>=0 && pointer<eOutputHatches.size()) { + handles[4] = eOutputHatches.get(pointer).getContainerHandler(); + } pointer= getParameterInInt(9,1)-1; - if(pointer>=0 && pointer<eOutputHatches.size()) handles[5]=eOutputHatches.get(pointer).getContainerHandler(); + if(pointer>=0 && pointer<eOutputHatches.size()) { + handles[5] = eOutputHatches.get(pointer).getContainerHandler(); + } //output - for(int i=0;i<6;i++) if(handles[i]!=null && outputEM[i].hasStacks()) handles[i].putUnifyAll(outputEM[i].takeAll()); + for(int i=0;i<6;i++) { + if (handles[i] != null && outputEM[i].hasStacks()) { + handles[i].putUnifyAll(outputEM[i].takeAll()); + } + } //all other are handled by base multi block code - cleaning is automatic } @@ -165,9 +207,11 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa BitSet checkArray = new BitSet(); for (int i = 4; i <= 6; i++) { pointer = getParameterInInt(i, 0); - if (Double.isNaN(pointer)) setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); - else if (pointer <= 0) setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); - //else if(pointer==0) + if (Double.isNaN(pointer)) { + setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + } else if (pointer <= 0) { + setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + }//else if(pointer==0) // setStatusOfParameterIn(i,0,STATUS_LOW); else if (pointer <= eInputHatches.size()) { if (checkArray.get(pointer)) { @@ -176,35 +220,54 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); checkArray.set(pointer); } - } else setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + } else { + setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + } pointer = getParameterInInt(i, 1); - if (Double.isNaN(pointer)) setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); - else if (pointer < 0) setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); - else if (pointer == 0) setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); - else if (pointer <= eInputHatches.size()) { + if (Double.isNaN(pointer)) { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + } else if (pointer < 0) { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + } else if (pointer == 0) { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + } else if (pointer <= eInputHatches.size()) { if (checkArray.get(pointer)) { setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); } else { setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); checkArray.set(pointer); } - } else setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + } else { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + } } } { for (int i = 7; i <= 9; i++) { pointer = getParameterInInt(i, 0); - if (Double.isNaN(pointer)) setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); - else if (pointer < 0) setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); - else if (pointer == 0) setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); - else if (pointer <= eOutputHatches.size()) setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); - else setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + if (Double.isNaN(pointer)) { + setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + } else if (pointer < 0) { + setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + } else if (pointer == 0) { + setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + } else if (pointer <= eOutputHatches.size()) { + setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + } else { + setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + } pointer = getParameterInInt(i, 1); - if (Double.isNaN(pointer)) setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); - else if (pointer < 0) setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); - else if (pointer == 0) setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); - else if (pointer <= eOutputHatches.size()) setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); - else setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + if (Double.isNaN(pointer)) { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + } else if (pointer < 0) { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + } else if (pointer == 0) { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + } else if (pointer <= eOutputHatches.size()) { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + } else { + setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + } } } } @@ -215,9 +278,9 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa map.put(is,behaviour); } - public abstract static class Behaviour { - public abstract boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parameters); + public interface Behaviour { + boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parameters); - public abstract MultiblockControl<cElementalInstanceStackMap[]> process(cElementalInstanceStackMap[] inputs, double[] parameters); + MultiblockControl<cElementalInstanceStackMap[]> process(cElementalInstanceStackMap[] inputs, double[] parameters); } } 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 9574d81b84..ded80ee73e 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 @@ -111,30 +111,34 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements iConn if ((aTick & 31) == 31) { mConnections = 0; connectionCount = 0; - if (aBaseMetaTileEntity.getColorization() < 0) return; - for (byte i = 0, j; i < 6; i++) { - j = GT_Utility.getOppositeSide(i); - //if (!aBaseMetaTileEntity.getCoverBehaviorAtSide(i).alwaysLookConnected(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity)) { - TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i); + if (aBaseMetaTileEntity.getColorization() < 0) { + return; + } + for (byte b0 = 0, b1; b0 < 6; b0++) { + b1 = GT_Utility.getOppositeSide(b0); + //if (!aBaseMetaTileEntity.getCoverBehaviorAtSide(b0).alwaysLookConnected(b0, aBaseMetaTileEntity.getCoverIDAtSide(b0), aBaseMetaTileEntity.getCoverDataAtSide(b0), aBaseMetaTileEntity)) { + TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(b0); if (tTileEntity instanceof IColoredTileEntity) { //if (aBaseMetaTileEntity.getColorization() >= 0) { byte tColor = ((IColoredTileEntity) tTileEntity).getColorization(); - if (tColor != aBaseMetaTileEntity.getColorization()) continue; + if (tColor != aBaseMetaTileEntity.getColorization()) { + continue; + } //} } - if (tTileEntity instanceof iConnectsToDataPipe && ((iConnectsToDataPipe) tTileEntity).canConnect(j)) { - mConnections |= 1 << i; + if (tTileEntity instanceof iConnectsToDataPipe && ((iConnectsToDataPipe) tTileEntity).canConnect(b1)) { + mConnections |= 1 << b0; connectionCount++; } else if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof iConnectsToDataPipe) { - if (//((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).alwaysLookConnected(j, ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j), ((IGregTechTileEntity) tTileEntity)) || - ((iConnectsToDataPipe) ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()).canConnect(j)) { - mConnections |= 1 << i; + if (//((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(b1).alwaysLookConnected(b1, ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(b1), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(b1), ((IGregTechTileEntity) tTileEntity)) || + ((iConnectsToDataPipe) ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()).canConnect(b1)) { + mConnections |= 1 << b0; connectionCount++; } } //} //else { - // mConnections |= (1 << i); + // mConnections |= (1 << b0); // if (mOld != mConnections) { // connectionCount++; // mOld = mConnections; @@ -155,18 +159,26 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements iConn @Override public iConnectsToDataPipe getNext(iConnectsToDataPipe source) { - if (connectionCount != 2) return null; - for (byte s = 0; s < 6; s++) { - if ((mConnections & 1 << s) == 0) continue;//if not connected continue - IGregTechTileEntity next = getBaseMetaTileEntity().getIGregTechTileEntityAtSide(s); - if (next == null) continue; + if (connectionCount != 2) { + return null; + } + for (byte b = 0; b < 6; b++) { + if ((mConnections & 1 << b) == 0) { + continue;//if not connected continue + } + IGregTechTileEntity next = getBaseMetaTileEntity().getIGregTechTileEntityAtSide(b); + if (next == null) { + continue; + } IMetaTileEntity meta = next.getMetaTileEntity(); if (meta instanceof iConnectsToDataPipe && meta != source) { - if (meta instanceof GT_MetaTileEntity_Hatch_InputData) + if (meta instanceof GT_MetaTileEntity_Hatch_InputData) { return (iConnectsToDataPipe) meta; + } if (meta instanceof GT_MetaTileEntity_Pipe_Data && - ((GT_MetaTileEntity_Pipe_Data) meta).connectionCount == 2) + ((GT_MetaTileEntity_Pipe_Data) meta).connectionCount == 2) { return (iConnectsToDataPipe) meta; + } } } return null; @@ -190,19 +202,33 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements iConn if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;} byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections; - if((tConn & 1 << ForgeDirection.DOWN.ordinal()) != 0) tSide0 = 0f; - if((tConn & 1 << ForgeDirection.UP.ordinal()) != 0) tSide1 = 1f; - if((tConn & 1 << ForgeDirection.NORTH.ordinal()) != 0) tSide2 = 0f; - if((tConn & 1 << ForgeDirection.SOUTH.ordinal()) != 0) tSide3 = 1f; - if((tConn & 1 << ForgeDirection.WEST.ordinal()) != 0) tSide4 = 0f; - if((tConn & 1 << ForgeDirection.EAST.ordinal()) != 0) tSide5 = 1f; + if((tConn & 1 << ForgeDirection.DOWN.ordinal()) != 0) { + tSide0 = 0f; + } + if((tConn & 1 << ForgeDirection.UP.ordinal()) != 0) { + tSide1 = 1f; + } + if((tConn & 1 << ForgeDirection.NORTH.ordinal()) != 0) { + tSide2 = 0f; + } + if((tConn & 1 << ForgeDirection.SOUTH.ordinal()) != 0) { + tSide3 = 1f; + } + if((tConn & 1 << ForgeDirection.WEST.ordinal()) != 0) { + tSide4 = 0f; + } + if((tConn & 1 << ForgeDirection.EAST.ordinal()) != 0) { + tSide5 = 1f; + } return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3); } @Override public float getThickNess() { - if(GT_Mod.instance.isClientSide() && GT_Client.hideValue==1) return 0.0625F; + if(GT_Mod.instance.isClientSide() && GT_Client.hideValue==1) { + return 0.0625F; + } return 0.375f; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java index 7eb294b178..3d1b5f6fb9 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java @@ -110,30 +110,34 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements iConnec if ((aTick & 31) == 31) { mConnections = 0; connectionCount = 0; - if (aBaseMetaTileEntity.getColorization() < 0) return; - for (byte i = 0, j; i < 6; i++) { - j = GT_Utility.getOppositeSide(i); - //if (!aBaseMetaTileEntity.getCoverBehaviorAtSide(i).alwaysLookConnected(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity)) { - TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i); + if (aBaseMetaTileEntity.getColorization() < 0) { + return; + } + for (byte b0 = 0, b1; b0 < 6; b0++) { + b1 = GT_Utility.getOppositeSide(b0); + //if (!aBaseMetaTileEntity.getCoverBehaviorAtSide(b0).alwaysLookConnected(b0, aBaseMetaTileEntity.getCoverIDAtSide(b0), aBaseMetaTileEntity.getCoverDataAtSide(b0), aBaseMetaTileEntity)) { + TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(b0); if (tTileEntity instanceof IColoredTileEntity) { //if (aBaseMetaTileEntity.getColorization() >= 0) { byte tColor = ((IColoredTileEntity) tTileEntity).getColorization(); - if (tColor != aBaseMetaTileEntity.getColorization()) continue; + if (tColor != aBaseMetaTileEntity.getColorization()) { + continue; + } //} } - if (tTileEntity instanceof iConnectsToEMpipe && ((iConnectsToEMpipe) tTileEntity).canConnect(j)) { - mConnections |= 1 << i; + if (tTileEntity instanceof iConnectsToEMpipe && ((iConnectsToEMpipe) tTileEntity).canConnect(b1)) { + mConnections |= 1 << b0; connectionCount++; } else if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof iConnectsToEMpipe) { - if (//((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).alwaysLookConnected(j, ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j), ((IGregTechTileEntity) tTileEntity)) || - ((iConnectsToEMpipe) ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()).canConnect(j)) { - mConnections |= 1 << i; + if (//((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(b1).alwaysLookConnected(b1, ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(b1), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(b1), ((IGregTechTileEntity) tTileEntity)) || + ((iConnectsToEMpipe) ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()).canConnect(b1)) { + mConnections |= 1 << b0; connectionCount++; } } //} //else { - // mConnections |= (1 << i); + // mConnections |= (1 << b0); // if (mOld != mConnections) { // connectionCount++; // mOld = mConnections; @@ -170,19 +174,33 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements iConnec if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;} byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections; - if((tConn & 1 << ForgeDirection.DOWN.ordinal()) != 0) tSide0 = 0f; - if((tConn & 1 << ForgeDirection.UP.ordinal()) != 0) tSide1 = 1f; - if((tConn & 1 << ForgeDirection.NORTH.ordinal()) != 0) tSide2 = 0f; - if((tConn & 1 << ForgeDirection.SOUTH.ordinal()) != 0) tSide3 = 1f; - if((tConn & 1 << ForgeDirection.WEST.ordinal()) != 0) tSide4 = 0f; - if((tConn & 1 << ForgeDirection.EAST.ordinal()) != 0) tSide5 = 1f; + if((tConn & 1 << ForgeDirection.DOWN.ordinal()) != 0) { + tSide0 = 0f; + } + if((tConn & 1 << ForgeDirection.UP.ordinal()) != 0) { + tSide1 = 1f; + } + if((tConn & 1 << ForgeDirection.NORTH.ordinal()) != 0) { + tSide2 = 0f; + } + if((tConn & 1 << ForgeDirection.SOUTH.ordinal()) != 0) { + tSide3 = 1f; + } + if((tConn & 1 << ForgeDirection.WEST.ordinal()) != 0) { + tSide4 = 0f; + } + if((tConn & 1 << ForgeDirection.EAST.ordinal()) != 0) { + tSide5 = 1f; + } return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3); } @Override public float getThickNess() { - if(GT_Mod.instance.isClientSide() && GT_Client.hideValue==1) return 0.0625F; + if(GT_Mod.instance.isClientSide() && GT_Client.hideValue==1) { + return 0.0625F; + } return 0.5f; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java index b070909181..dd50ba289d 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java @@ -111,7 +111,9 @@ public class GT_MetaTileEntity_DebugPowerGenerator extends GT_MetaTileEntity_Tie @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) return true; + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } aBaseMetaTileEntity.openGUI(aPlayer); return true; } 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 aee848e262..653fcd6a3e 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 @@ -26,7 +26,7 @@ import static com.github.technus.tectech.Util.StructureWriter; */ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_TieredMachineBlock { private static GT_RenderedTexture MARK; - public short numbers[] = new short[6]; + public short[] numbers = new short[6]; public boolean size = false; public String[] result = new String[]{"Undefined"}; @@ -103,8 +103,9 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isAllowedToWork()) { result = StructureWriter(getBaseMetaTileEntity(), numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5], false); - for (String s : result) + for (String s : result) { TecTech.Logger.info(s); + } aBaseMetaTileEntity.disableWorking(); } } @@ -112,13 +113,16 @@ 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(getBaseMetaTileEntity(), numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5], true); - for (String s : result) + for (String s : result) { TecTech.Logger.info(s); + } } @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) return true; + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } aBaseMetaTileEntity.openGUI(aPlayer); //if (TecTechConfig.DEBUG_MODE && aPlayer.getHeldItem() != null) // TecTech.Logger.info("UnlocalizedName: " + getUniqueIdentifier(aPlayer.getHeldItem())); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPowerGenerator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPowerGenerator.java index f890d766aa..9d7c5293b3 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPowerGenerator.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPowerGenerator.java @@ -12,8 +12,6 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import java.util.Iterator; - public class GT_Container_DebugPowerGenerator extends GT_ContainerMetaTile_Machine { public int EUT=0,AMP=0; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugStructureWriter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugStructureWriter.java index 2d8098c3f9..ba41d75c98 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugStructureWriter.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugStructureWriter.java @@ -12,12 +12,10 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import java.util.Iterator; - public class GT_Container_DebugStructureWriter extends GT_ContainerMetaTile_Machine { public boolean size = false; - public short numbers[] = new short[6]; + public short[] numbers = new short[6]; public GT_Container_DebugStructureWriter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); @@ -54,7 +52,9 @@ public class GT_Container_DebugStructureWriter Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); if (tSlot != null && mTileEntity.getMetaTileEntity() != null) { GT_MetaTileEntity_DebugStructureWriter dsw = (GT_MetaTileEntity_DebugStructureWriter) mTileEntity.getMetaTileEntity(); - if (dsw.numbers == null) return null; + if (dsw.numbers == null) { + return null; + } switch (aSlotIndex) { case 0: dsw.numbers[size ? 3 : 0] -= aShifthold == 1 ? 512 : 64; @@ -110,8 +110,9 @@ public class GT_Container_DebugStructureWriter return; } GT_MetaTileEntity_DebugStructureWriter dsw = (GT_MetaTileEntity_DebugStructureWriter) mTileEntity.getMetaTileEntity(); - if (numbers != null) + if (numbers != null) { System.arraycopy(dsw.numbers, 0, numbers, 0, dsw.numbers.length); + } size = dsw.size; for (Object crafter : crafters) { @@ -137,7 +138,9 @@ public class GT_Container_DebugStructureWriter size = par2 == 1; break; default: - if (numbers != null && par1 >= 100 && par1 <= 105) numbers[par1 - 100] = (short) par2; + if (numbers != null && par1 >= 100 && par1 <= 105) { + numbers[par1 - 100] = (short) par2; + } break; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugStructureWriter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugStructureWriter.java index aaa0d0a505..8e42e25324 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugStructureWriter.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugStructureWriter.java @@ -16,7 +16,9 @@ public class GT_GUIContainer_DebugStructureWriter extends GT_GUIContainerMetaTil fontRendererObj.drawString("StructPrint", 46, 8, 16448255); if (mContainer != null) { GT_Container_DebugStructureWriter dsw = (GT_Container_DebugStructureWriter) mContainer; - if (dsw.numbers == null) return; + if (dsw.numbers == null) { + return; + } fontRendererObj.drawString(dsw.size ? "Size" : "Offset", 46, 16, 16448255); fontRendererObj.drawString("A: " + dsw.numbers[dsw.size ? 3 : 0], 46, 24, 16448255); fontRendererObj.drawString("B: " + dsw.numbers[dsw.size ? 4 : 1], 46, 32, 16448255); diff --git a/src/main/java/com/github/technus/tectech/thing/tileEntity/ReactorSimTileEntity.java b/src/main/java/com/github/technus/tectech/thing/tileEntity/ReactorSimTileEntity.java index 20421365f0..e9d8694957 100644 --- a/src/main/java/com/github/technus/tectech/thing/tileEntity/ReactorSimTileEntity.java +++ b/src/main/java/com/github/technus/tectech/thing/tileEntity/ReactorSimTileEntity.java @@ -18,17 +18,6 @@ import net.minecraftforge.fluids.FluidStack; public class ReactorSimTileEntity extends TileEntityNuclearReactorElectric { private boolean hadRedstone =true; - public ReactorSimTileEntity() { - //this.updateTicker = IC2.random.nextInt(this.getTickRate()); - //this.inputTank = new FluidTank(10000); - //this.outputTank = new FluidTank(10000); - //this.reactorSlot = new InvSlotReactor(this, "reactor", 0, 54); - //this.coolantinputSlot = new InvSlotConsumableLiquidByList(this, "coolantinputSlot", 55, InvSlot.Access.I, 1, InvSlot.InvSide.ANY, InvSlotConsumableLiquid.OpType.Drain, BlocksItems.getFluid(InternalName.fluidCoolant)); - //this.hotcoolinputSlot = new InvSlotConsumableLiquidByTank(this, "hotcoolinputSlot", 56, InvSlot.Access.I, 1, InvSlot.InvSide.ANY, InvSlotConsumableLiquid.OpType.Fill, this.outputTank); - //this.coolantoutputSlot = new InvSlotOutput(this, "coolantoutputSlot", 57, 1); - //this.hotcoolantoutputSlot = new InvSlotOutput(this, "hotcoolantoutputSlot", 58, 1); - } - @Override public void onLoaded() { super.onLoaded(); @@ -155,8 +144,9 @@ public class ReactorSimTileEntity extends TileEntityNuclearReactorElectric { protected void updateEntityServer() { if(updateTicker++ % getTickRate() == 0) { if (!worldObj.isRemote && worldObj.doChunksNearChunkExist(xCoord, yCoord, zCoord, 2)) { - if(hadRedstone && !receiveredstone()) hadRedstone=false; - else if(!hadRedstone && receiveredstone()){ + if(hadRedstone && !receiveredstone()) { + hadRedstone = false; + } else if(!hadRedstone && receiveredstone()){ doUpdates(); hadRedstone=true; } diff --git a/src/main/java/openmodularturrets/blocks/turretbases/TurretBaseItemEM.java b/src/main/java/openmodularturrets/blocks/turretbases/TurretBaseItemEM.java index 5bbfee8b1e..61f877e81b 100644 --- a/src/main/java/openmodularturrets/blocks/turretbases/TurretBaseItemEM.java +++ b/src/main/java/openmodularturrets/blocks/turretbases/TurretBaseItemEM.java @@ -14,8 +14,8 @@ import java.util.List; * Created by Bass on 28/07/2017. */ public class TurretBaseItemEM extends ItemBlock { - public TurretBaseItemEM(Block b) { - super(b); + public TurretBaseItemEM(Block block) { + super(block); } @Override diff --git a/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadItemEM.java b/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadItemEM.java index e368973f7a..db3c089e47 100644 --- a/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadItemEM.java +++ b/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadItemEM.java @@ -19,8 +19,8 @@ import static com.github.technus.tectech.CommonValues.TEC_MARK_EM; public class TurretHeadItemEM extends ItemBlock { private static final DecimalFormat df = new DecimalFormat("0.0"); - public TurretHeadItemEM(Block b) { - super(b); + public TurretHeadItemEM(Block block) { + super(block); } @Override @@ -28,15 +28,15 @@ public class TurretHeadItemEM extends ItemBlock { list.add(TEC_MARK_EM); list.add(""); list.add(EnumChatFormatting.GOLD + "--" + StatCollector.translateToLocal("tooltip.info") + "--"); - list.add(StatCollector.translateToLocal("tooltip.tier") + ": " + EnumChatFormatting.WHITE + "5"); + list.add(StatCollector.translateToLocal("tooltip.tier") + ": " + EnumChatFormatting.WHITE + '5'); list.add(StatCollector.translateToLocal("tooltip.range") + ": " + EnumChatFormatting.WHITE + ConfigHandler.getLaserTurretSettings().getRange()); list.add(StatCollector.translateToLocal("tooltip.accuracy") + ": " + EnumChatFormatting.WHITE + StatCollector.translateToLocal("turret.accuracy.high")); list.add(StatCollector.translateToLocal("tooltip.ammo") + ": " + EnumChatFormatting.WHITE + StatCollector.translateToLocal("turret.ammo.4")); list.add(StatCollector.translateToLocal("tooltip.tierRequired") + ": " + EnumChatFormatting.WHITE + StatCollector.translateToLocal("base.tier.5")); list.add(""); list.add(EnumChatFormatting.DARK_PURPLE + "--" + StatCollector.translateToLocal("tooltip.damage.label") + "--"); - list.add(StatCollector.translateToLocal("tooltip.damage.stat") + ": " + EnumChatFormatting.WHITE + (float)ConfigHandler.getLaserTurretSettings().getDamage() / 2.0F + " " + StatCollector.translateToLocal("tooltip.health")); - list.add(StatCollector.translateToLocal("tooltip.aoe") + ": " + EnumChatFormatting.WHITE + "0"); + list.add(StatCollector.translateToLocal("tooltip.damage.stat") + ": " + EnumChatFormatting.WHITE + (float)ConfigHandler.getLaserTurretSettings().getDamage() / 2.0F + ' ' + StatCollector.translateToLocal("tooltip.health")); + list.add(StatCollector.translateToLocal("tooltip.aoe") + ": " + EnumChatFormatting.WHITE + '0'); list.add(StatCollector.translateToLocal("tooltip.firerate") + ": " + EnumChatFormatting.WHITE + df.format((double)(20.0F / (float)ConfigHandler.getLaserTurretSettings().getFireRate()))); list.add(StatCollector.translateToLocal("tooltip.energy.stat") + ": " + EnumChatFormatting.WHITE + ConfigHandler.getLaserTurretSettings().getPowerUsage() + " RF"); list.add(""); diff --git a/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadRenderEM.java b/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadRenderEM.java index f0aa331645..23379b9585 100644 --- a/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadRenderEM.java +++ b/src/main/java/openmodularturrets/blocks/turretheads/TurretHeadRenderEM.java @@ -5,7 +5,4 @@ import openmodularturrets.client.render.renderers.blockitem.LaserTurretRenderer; /** * Created by Bass on 28/07/2017. */ -public class TurretHeadRenderEM extends LaserTurretRenderer { - public TurretHeadRenderEM() { - } -} +public class TurretHeadRenderEM extends LaserTurretRenderer {} diff --git a/src/main/java/openmodularturrets/entity/projectiles/projectileEM.java b/src/main/java/openmodularturrets/entity/projectiles/projectileEM.java index 28f305c85b..53e6186a25 100644 --- a/src/main/java/openmodularturrets/entity/projectiles/projectileEM.java +++ b/src/main/java/openmodularturrets/entity/projectiles/projectileEM.java @@ -51,11 +51,18 @@ public class projectileEM extends TurretProjectile { cElementalInstanceStack consumeFromThis=avalableEM.get(TecTech.Rnd.nextInt(avalableEM.size())); massFactor =consumeFromThis.definition.getMass()/ dHadronDefinition.hadron_n_.getMass(); - if(consumeFromThis.definition.getType()>1 || consumeFromThis.definition.getType()<-1) exotic = true; - if(consumeFromThis.definition.getType()<0) antiMatter = true; + if(consumeFromThis.definition.getType()>1 || consumeFromThis.definition.getType()<-1) { + exotic = true; + } + if(consumeFromThis.definition.getType()<0) { + antiMatter = true; + } - if (consumeFromThis.definition.getCharge() == 0) gravity = massFactor/100f; - else gravity = Math.min(0.0025F/Math.abs(consumeFromThis.definition.getCharge()),massFactor/100f); + if (consumeFromThis.definition.getCharge() == 0) { + gravity = massFactor / 100f; + } else { + gravity = Math.min(0.0025F / Math.abs(consumeFromThis.definition.getCharge()), massFactor / 100f); + } avalableEM.removeAmount(false,consumeFromThis.definition.getStackForm(1)); } @@ -96,12 +103,16 @@ public class projectileEM extends TurretProjectile { if(canDamagePlayer((EntityPlayer)movingobjectposition.entityHit)) { movingobjectposition.entityHit.setFire((exotic?10:1)*2); movingobjectposition.entityHit.attackEntityFrom(new NormalDamageSource("laser"), damage); - if(antiMatter) movingobjectposition.entityHit.hurtResistantTime = 0; + if(antiMatter) { + movingobjectposition.entityHit.hurtResistantTime = 0; + } } } else { movingobjectposition.entityHit.setFire((exotic?10:1)*2); movingobjectposition.entityHit.attackEntityFrom(new NormalDamageSource("laser"), damage); - if(antiMatter) movingobjectposition.entityHit.hurtResistantTime = 0; + if(antiMatter) { + movingobjectposition.entityHit.hurtResistantTime = 0; + } } if (TecTech.ModConfig.ENABLE_TURRET_EXPLOSIONS && antiMatter) { diff --git a/src/main/java/openmodularturrets/entity/projectiles/projectileRenderEM.java b/src/main/java/openmodularturrets/entity/projectiles/projectileRenderEM.java index 7580ee1c5c..9faeb02da6 100644 --- a/src/main/java/openmodularturrets/entity/projectiles/projectileRenderEM.java +++ b/src/main/java/openmodularturrets/entity/projectiles/projectileRenderEM.java @@ -18,9 +18,6 @@ import org.lwjgl.opengl.GL11; public class projectileRenderEM extends Render { private static final ResourceLocation textures = new ResourceLocation(Reference.MODID + ":textures/entity/projectileEM.png"); - public projectileRenderEM() { - } - private void render(projectileEM entity, double par2, double par4, double par6, float par9) { bindEntityTexture(entity); GL11.glPushMatrix(); @@ -37,8 +34,8 @@ public class projectileRenderEM extends Render { GL11.glEnable('\u803a'); float f11 = - par9; if(f11 > 0.0F) { - float i = -MathHelper.sin(f11 * 3.0F) * f11; - GL11.glRotatef(i, 0.0F, 0.0F, 1.0F); + float f = -MathHelper.sin(f11 * 3.0F) * f11; + GL11.glRotatef(f, 0.0F, 0.0F, 1.0F); } GL11.glDisable(2896); diff --git a/src/main/java/openmodularturrets/tileentity/turret/TileTurretHeadEM.java b/src/main/java/openmodularturrets/tileentity/turret/TileTurretHeadEM.java index eab654f486..286f12d853 100644 --- a/src/main/java/openmodularturrets/tileentity/turret/TileTurretHeadEM.java +++ b/src/main/java/openmodularturrets/tileentity/turret/TileTurretHeadEM.java @@ -19,9 +19,6 @@ import openmodularturrets.util.TurretHeadUtil; public class TileTurretHeadEM extends TurretHead{ private cElementalInstanceStackMap hatchContentPointer; - public TileTurretHeadEM() { - } - @Override public int getTurretRange() { return ConfigHandler.getLaserTurretSettings().getRange()<<1; @@ -44,8 +41,9 @@ public class TileTurretHeadEM extends TurretHead{ @Override public void updateEntity() { - if(!worldObj.isRemote && base instanceof TileTurretBaseEM) - hatchContentPointer =((TileTurretBaseEM) base).getContainerHandler(); + if(!worldObj.isRemote && base instanceof TileTurretBaseEM) { + hatchContentPointer = ((TileTurretBaseEM) base).getContainerHandler(); + } super.updateEntity(); } diff --git a/src/main/java/openmodularturrets/tileentity/turretbase/TileTurretBaseEM.java b/src/main/java/openmodularturrets/tileentity/turretbase/TileTurretBaseEM.java index 3a0679aee6..7bb87c8826 100644 --- a/src/main/java/openmodularturrets/tileentity/turretbase/TileTurretBaseEM.java +++ b/src/main/java/openmodularturrets/tileentity/turretbase/TileTurretBaseEM.java @@ -28,28 +28,34 @@ public class TileTurretBaseEM extends TurretBaseTierFiveTileEntity { World worldIn = getWorldObj(); TileEntity te; if ((te = worldIn.getTileEntity(xCoord + 1, yCoord, zCoord)) instanceof IGregTechTileEntity && - ((IGregTechTileEntity) te).getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_InputElemental) + ((IGregTechTileEntity) te).getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_InputElemental) { return getFromHatch((GT_MetaTileEntity_Hatch_InputElemental) ((IGregTechTileEntity) te).getMetaTileEntity()); + } if ((te = worldIn.getTileEntity(xCoord - 1, yCoord, zCoord)) instanceof IGregTechTileEntity && - ((IGregTechTileEntity) te).getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_InputElemental) + ((IGregTechTileEntity) te).getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_InputElemental) { return getFromHatch((GT_MetaTileEntity_Hatch_InputElemental) ((IGregTechTileEntity) te).getMetaTileEntity()); + } if ((te = worldIn.getTileEntity(xCoord, yCoord + 1, zCoord)) instanceof IGregTechTileEntity && - ((IGregTechTileEntity) te).getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_InputElemental) + ((IGregTechTileEntity) te).getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_InputElemental) { return getFromHatch((GT_MetaTileEntity_Hatch_InputElemental) ((IGregTechTileEntity) te).getMetaTileEntity()); + } if ((te = worldIn.getTileEntity(xCoord, yCoord - 1, zCoord)) instanceof IGregTechTileEntity && - ((IGregTechTileEntity) te).getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_InputElemental) + ((IGregTechTileEntity) te).getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_InputElemental) { return getFromHatch((GT_MetaTileEntity_Hatch_InputElemental) ((IGregTechTileEntity) te).getMetaTileEntity()); + } if ((te = worldIn.getTileEntity(xCoord, yCoord, zCoord + 1)) instanceof IGregTechTileEntity && - ((IGregTechTileEntity) te).getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_InputElemental) + ((IGregTechTileEntity) te).getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_InputElemental) { return getFromHatch((GT_MetaTileEntity_Hatch_InputElemental) ((IGregTechTileEntity) te).getMetaTileEntity()); + } if ((te = worldIn.getTileEntity(xCoord, yCoord, zCoord - 1)) instanceof IGregTechTileEntity && - ((IGregTechTileEntity) te).getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_InputElemental) + ((IGregTechTileEntity) te).getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_InputElemental) { return getFromHatch((GT_MetaTileEntity_Hatch_InputElemental) ((IGregTechTileEntity) te).getMetaTileEntity()); + } return null; } |