diff options
Diffstat (limited to 'src/main/java/goodgenerator/blocks')
30 files changed, 2118 insertions, 1710 deletions
diff --git a/src/main/java/goodgenerator/blocks/myFluids/FluidsBuilder.java b/src/main/java/goodgenerator/blocks/myFluids/FluidsBuilder.java index 720d782538..de8cca2b43 100644 --- a/src/main/java/goodgenerator/blocks/myFluids/FluidsBuilder.java +++ b/src/main/java/goodgenerator/blocks/myFluids/FluidsBuilder.java @@ -30,7 +30,8 @@ public class FluidsBuilder { public static void crackedNaquadahGas_Lightly() { Fluid tmp = BaseFluid.BuildFluid("lightlyCrackedNaquadahGas"); - tmp.setGaseous(true).setTemperature(800); + tmp.setGaseous(true) + .setTemperature(800); BaseFluid tmp2 = new BaseFluid(tmp, Material.water); tmp2.SetTexture("lightlyCrackedNaquadahGas"); tmp2.setBlockName("lightlyCrackedNaquadahGas"); @@ -40,7 +41,8 @@ public class FluidsBuilder { public static void crackedNaquadahGas_Moderately() { Fluid tmp = BaseFluid.BuildFluid("moderatelyCrackedNaquadahGas"); - tmp.setGaseous(true).setTemperature(800); + tmp.setGaseous(true) + .setTemperature(800); BaseFluid tmp2 = new BaseFluid(tmp, Material.water); tmp2.SetTexture("moderatelyCrackedNaquadahGas"); tmp2.setBlockName("moderatelyCrackedNaquadahGas"); @@ -50,7 +52,8 @@ public class FluidsBuilder { public static void crackedNaquadahGas_Heavily() { Fluid tmp = BaseFluid.BuildFluid("heavilyCrackedNaquadahGas"); - tmp.setGaseous(true).setTemperature(800); + tmp.setGaseous(true) + .setTemperature(800); BaseFluid tmp2 = new BaseFluid(tmp, Material.water); tmp2.SetTexture("heavilyCrackedNaquadahGas"); tmp2.setBlockName("heavilyCrackedNaquadahGas"); @@ -60,7 +63,8 @@ public class FluidsBuilder { public static void crackedLightNaquadahFuel_Lightly() { Fluid tmp = BaseFluid.BuildFluid("lightlyCrackedLightNaquadahFuel"); - tmp.setGaseous(false).setTemperature(1200); + tmp.setGaseous(false) + .setTemperature(1200); BaseFluid tmp2 = new BaseFluid(tmp, Material.water); tmp2.SetTexture("lightlyCrackedLightNaquadahFuel"); tmp2.setBlockName("lightlyCrackedLightNaquadahFuel"); @@ -70,7 +74,8 @@ public class FluidsBuilder { public static void crackedLightNaquadahFuel_Moderately() { Fluid tmp = BaseFluid.BuildFluid("moderatelyCrackedLightNaquadahFuel"); - tmp.setGaseous(false).setTemperature(1200); + tmp.setGaseous(false) + .setTemperature(1200); BaseFluid tmp2 = new BaseFluid(tmp, Material.water); tmp2.SetTexture("moderatelyCrackedLightNaquadahFuel"); tmp2.setBlockName("moderatelyCrackedLightNaquadahFuel"); @@ -80,7 +85,8 @@ public class FluidsBuilder { public static void crackedLightNaquadahFuel_Heavily() { Fluid tmp = BaseFluid.BuildFluid("heavilyCrackedLightNaquadahFuel"); - tmp.setGaseous(false).setTemperature(1200); + tmp.setGaseous(false) + .setTemperature(1200); BaseFluid tmp2 = new BaseFluid(tmp, Material.water); tmp2.SetTexture("heavilyCrackedLightNaquadahFuel"); tmp2.setBlockName("heavilyCrackedLightNaquadahFuel"); @@ -90,7 +96,8 @@ public class FluidsBuilder { public static void crackedHeavyNaquadahFuel_Lightly() { Fluid tmp = BaseFluid.BuildFluid("lightlyCrackedHeavyNaquadahFuel"); - tmp.setGaseous(false).setTemperature(1200); + tmp.setGaseous(false) + .setTemperature(1200); BaseFluid tmp2 = new BaseFluid(tmp, Material.water); tmp2.SetTexture("lightlyCrackedHeavyNaquadahFuel"); tmp2.setBlockName("lightlyCrackedHeavyNaquadahFuel"); @@ -100,7 +107,8 @@ public class FluidsBuilder { public static void crackedHeavyNaquadahFuel_Moderately() { Fluid tmp = BaseFluid.BuildFluid("moderatelyCrackedHeavyNaquadahFuel"); - tmp.setGaseous(false).setTemperature(1200); + tmp.setGaseous(false) + .setTemperature(1200); BaseFluid tmp2 = new BaseFluid(tmp, Material.water); tmp2.SetTexture("moderatelyCrackedHeavyNaquadahFuel"); tmp2.setBlockName("moderatelyCrackedHeavyNaquadahFuel"); @@ -110,7 +118,8 @@ public class FluidsBuilder { public static void crackedHeavyNaquadahFuel_Heavily() { Fluid tmp = BaseFluid.BuildFluid("heavilyCrackedHeavyNaquadahFuel"); - tmp.setGaseous(false).setTemperature(1200); + tmp.setGaseous(false) + .setTemperature(1200); BaseFluid tmp2 = new BaseFluid(tmp, Material.water); tmp2.SetTexture("heavilyCrackedHeavyNaquadahFuel"); tmp2.setBlockName("heavilyCrackedHeavyNaquadahFuel"); @@ -120,7 +129,10 @@ public class FluidsBuilder { public static void crackedNaquadahAsphalt_Lightly() { Fluid tmp = BaseFluid.BuildFluid("lightlyCrackedNaquadahAsphalt"); - tmp.setGaseous(false).setTemperature(1800).setDensity(20000).setViscosity(20000); + tmp.setGaseous(false) + .setTemperature(1800) + .setDensity(20000) + .setViscosity(20000); BaseFluid tmp2 = new BaseFluid(tmp, Material.water); tmp2.SetTexture("lightlyCrackedNaquadahAsphalt"); tmp2.setBlockName("lightlyCrackedNaquadahAsphalt"); @@ -130,7 +142,10 @@ public class FluidsBuilder { public static void crackedNaquadahAsphalt_Moderately() { Fluid tmp = BaseFluid.BuildFluid("moderatelyCrackedNaquadahAsphalt"); - tmp.setGaseous(false).setTemperature(1800).setDensity(20000).setViscosity(20000); + tmp.setGaseous(false) + .setTemperature(1800) + .setDensity(20000) + .setViscosity(20000); BaseFluid tmp2 = new BaseFluid(tmp, Material.water); tmp2.SetTexture("moderatelyCrackedNaquadahAsphalt"); tmp2.setBlockName("moderatelyCrackedNaquadahAsphalt"); @@ -140,7 +155,10 @@ public class FluidsBuilder { public static void crackedNaquadahAsphalt_Heavily() { Fluid tmp = BaseFluid.BuildFluid("heavilyCrackedNaquadahAsphalt"); - tmp.setGaseous(false).setTemperature(1800).setDensity(20000).setViscosity(20000); + tmp.setGaseous(false) + .setTemperature(1800) + .setDensity(20000) + .setViscosity(20000); BaseFluid tmp2 = new BaseFluid(tmp, Material.water); tmp2.SetTexture("heavilyCrackedNaquadahAsphalt"); tmp2.setBlockName("heavilyCrackedNaquadahAsphalt"); @@ -150,7 +168,8 @@ public class FluidsBuilder { public static void combustionPromotor() { Fluid tmp = BaseFluid.BuildFluid("combustionPromotor"); - tmp.setGaseous(false).setTemperature(300); + tmp.setGaseous(false) + .setTemperature(300); BaseFluid tmp2 = new BaseFluid(tmp, Material.water); tmp2.SetTexture("combustionPromotor"); tmp2.setBlockName("combustionPromotor"); @@ -160,7 +179,9 @@ public class FluidsBuilder { public static void coalTar() { Fluid tmp = BaseFluid.BuildFluid("fluid.coalTar"); - tmp.setGaseous(false).setTemperature(450).setUnlocalizedName("fluid.coalTar"); + tmp.setGaseous(false) + .setTemperature(450) + .setUnlocalizedName("fluid.coalTar"); BaseFluid tmp2 = new BaseFluid(tmp, Material.water); tmp2.SetTexture("coalTar"); tmp2.setBlockTextureName("coalTar"); @@ -170,7 +191,9 @@ public class FluidsBuilder { public static void supercriticalSteam() { Fluid tmp = BaseFluid.BuildFluid("supercriticalSteam"); - tmp.setGaseous(true).setTemperature(648).setUnlocalizedName("supercriticalSteam"); + tmp.setGaseous(true) + .setTemperature(648) + .setUnlocalizedName("supercriticalSteam"); BaseFluid tmp2 = new BaseFluid(tmp, Material.water); tmp2.SetTexture("supercriticalSteam"); tmp2.setBlockTextureName("supercriticalSteam"); diff --git a/src/main/java/goodgenerator/blocks/regularBlock/TEBlock.java b/src/main/java/goodgenerator/blocks/regularBlock/TEBlock.java index 0c7b2caf10..6c13a9c680 100644 --- a/src/main/java/goodgenerator/blocks/regularBlock/TEBlock.java +++ b/src/main/java/goodgenerator/blocks/regularBlock/TEBlock.java @@ -156,7 +156,7 @@ public class TEBlock extends BlockContainer { @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, - float par8, float par9) { + float par8, float par9) { if (world.isRemote) { return false; } else { @@ -167,16 +167,17 @@ public class TEBlock extends BlockContainer { if (tItemStack != null) { Item tItem = tItemStack.getItem(); if (tItem instanceof IEssentiaContainerItem - && ((IEssentiaContainerItem) tItem).getAspects(player.getHeldItem()) != null - && ((IEssentiaContainerItem) tItem).getAspects(player.getHeldItem()).size() > 0) { + && ((IEssentiaContainerItem) tItem).getAspects(player.getHeldItem()) != null + && ((IEssentiaContainerItem) tItem).getAspects(player.getHeldItem()) + .size() > 0) { Aspect tLocked = ((IEssentiaContainerItem) tItem).getAspects(player.getHeldItem()) - .getAspects()[0]; + .getAspects()[0]; ((EssentiaHatch) tile).setLockedAspect(tLocked); GT_Utility.sendChatToPlayer( - player, - String.format( - StatCollector.translateToLocal("essentiahatch.chat.0"), - tLocked.getLocalizedDescription())); + player, + String.format( + StatCollector.translateToLocal("essentiahatch.chat.0"), + tLocked.getLocalizedDescription())); } } else { ((EssentiaHatch) tile).setLockedAspect(null); @@ -191,7 +192,7 @@ public class TEBlock extends BlockContainer { if (tItemStack == null) { ((EssentiaOutputHatch) tile).clear(); GT_Utility - .sendChatToPlayer(player, StatCollector.translateToLocal("essentiaoutputhatch.chat.0")); + .sendChatToPlayer(player, StatCollector.translateToLocal("essentiaoutputhatch.chat.0")); } return true; } else return false; diff --git a/src/main/java/goodgenerator/blocks/regularBlock/TurbineCasing.java b/src/main/java/goodgenerator/blocks/regularBlock/TurbineCasing.java index 19cf4bb10f..986ab4e0c8 100644 --- a/src/main/java/goodgenerator/blocks/regularBlock/TurbineCasing.java +++ b/src/main/java/goodgenerator/blocks/regularBlock/TurbineCasing.java @@ -47,7 +47,7 @@ public class TurbineCasing extends Casing implements ITextureBlock { @Override public ITexture[] getTexture(Block aBlock, ForgeDirection side, IBlockAccess aWorld, int xCoord, int yCoord, - int zCoord) { + int zCoord) { final int ordinalSide = side.ordinal(); int tInvertLeftRightMod = ordinalSide % 2 * 2 - 1; switch (ordinalSide / 2) { diff --git a/src/main/java/goodgenerator/blocks/tileEntity/ComponentAssemblyLine.java b/src/main/java/goodgenerator/blocks/tileEntity/ComponentAssemblyLine.java index 152ceb7839..618477d09c 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/ComponentAssemblyLine.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/ComponentAssemblyLine.java @@ -44,129 +44,149 @@ import gregtech.api.util.GT_StructureUtility; import gregtech.api.util.GT_Utility; public class ComponentAssemblyLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase<ComponentAssemblyLine> - implements ISurvivalConstructable { + implements ISurvivalConstructable { private int casingTier; protected static final String STRUCTURE_PIECE_MAIN = "main"; private static final IStructureDefinition<ComponentAssemblyLine> STRUCTURE_DEFINITION = StructureDefinition - .<ComponentAssemblyLine>builder() - .addShape( - STRUCTURE_PIECE_MAIN, - new String[][] { - { " ", " III ", " HHI~IHH ", "HH III HH", "H H", "H H", "H JJJ H", - "H JJJ H", "H N N H", "HHHHHHHHH" }, - { " ", " ELHHHLE ", "E E", "H H", "A A", "A A", "A A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "HC CH", "AC CA", "AC CA", "A D D A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " BBB ", " EL LE ", "E GGDGG E", "HGG D GGH", "AG C GA", "AG GA", "AG GA", - "AG HHH GA", "AG GA", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "HC CH", "AC CA", "AC CA", "A D D A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " BBB ", " EL LE ", "E GGDGG E", "HGG D GGH", "HG C GH", "HG GH", "HG GH", - "HG HHH GH", "HG GH", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "HC CH", "AC CA", "AC CA", "A D D A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " BBB ", " EL LE ", "E GGDGG E", "HGG D GGH", "AG C GA", "AG GA", "AG GA", - "AG HHH GA", "AG GA", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "HC CH", "AC CA", "AC CA", "A D D A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " BBB ", " EL LE ", "E GGDGG E", "HGG D GGH", "HG C GH", "HG GH", "HG GH", - "HG HHH GH", "HG GH", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "HC CH", "AC CA", "AC CA", "A D D A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " BBB ", " EL LE ", "E GGDGG E", "HGG D GGH", "AG C GA", "AG GA", "AG GA", - "AG HHH GA", "AG GA", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "HC CH", "AC CA", "AC CA", "A D D A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " BBB ", " EL LE ", "E GGDGG E", "HGG D GGH", "HG C GH", "HG GH", "HG GH", - "HG HHH GH", "HG GH", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "HC CH", "AC CA", "AC CA", "A D D A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " BBB ", " EL LE ", "E GGDGG E", "HGG D GGH", "AG C GA", "AG GA", "AG GA", - "AG HHH GA", "AG GA", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", - "A HHH A", "A n n A", "MHHHHHHHM" }, - { " HBH ", " EL LE ", "E E", "HC CH", "AC CA", "AC CA", "A D D A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " ", " ELHHHLE ", "E E", "H H", "A A", "A A", "A A", - "A HHH A", "A A", "MHHHHHHHM" }, - { " ", " ", " HHHHHHH ", "HH HH", "H H", "H H", "H H", - "H H", "H KKK H", "HHHHHHHHH" } }) - .addElement( - 'A', - ofChain( - ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks", 5), - ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks", 13), - ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks", 14), - ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks", 15), - ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks2", 0))) - .addElement('H', ofBlock(GregTech_API.sBlockCasings8, 7)) - .addElement('C', ofBlock(GregTech_API.sBlockCasings2, 5)) - .addElement('D', ofBlock(GregTech_API.sBlockCasings2, 9)) - .addElement('G', ofBlock(GregTech_API.sBlockCasings9, 0)) - .addElement('E', ofBlock(GregTech_API.sBlockCasings9, 1)) - .addElement('F', ofBlock(GregTech_API.sBlockCasings4, 1)) - .addElement( - 'B', - ofBlocksTiered( - (block, meta) -> block == Loaders.componentAssemblylineCasing ? meta : -1, - IntStream.range(0, 14).mapToObj(i -> Pair.of(Loaders.componentAssemblylineCasing, i)) - .collect(Collectors.toList()), - -2, - (t, meta) -> t.casingTier = meta, - t -> t.casingTier)) - .addElement( - 'J', - GT_StructureUtility.buildHatchAdder(ComponentAssemblyLine.class).atLeast(InputBus).dot(1) - .casingIndex(183).buildAndChain(GregTech_API.sBlockCasings8, 7)) - .addElement( - 'N', - GT_StructureUtility.buildHatchAdder(ComponentAssemblyLine.class).atLeast(InputBus).dot(1) - .casingIndex(183).buildAndChain(GT_StructureUtility.ofFrame(Materials.TungstenSteel))) - .addElement( - 'K', - GT_StructureUtility.buildHatchAdder(ComponentAssemblyLine.class).atLeast(OutputBus).dot(2) - .casingIndex(183).buildAndChain(GregTech_API.sBlockCasings8, 7)) - .addElement( - 'L', - GT_StructureUtility.buildHatchAdder(ComponentAssemblyLine.class).atLeast(Energy, ExoticEnergy) - .dot(3).casingIndex(183).buildAndChain(GregTech_API.sBlockCasings8, 7)) - .addElement( - 'I', - GT_StructureUtility.buildHatchAdder(ComponentAssemblyLine.class).atLeast(Maintenance).dot(4) - .casingIndex(183).buildAndChain(GregTech_API.sBlockCasings8, 7)) - .addElement( - 'M', - GT_StructureUtility.buildHatchAdder(ComponentAssemblyLine.class).atLeast(InputHatch).dot(5) - .casingIndex(183).buildAndChain(GregTech_API.sBlockCasings8, 7)) - .addElement('n', GT_StructureUtility.ofFrame(Materials.TungstenSteel)).build(); + .<ComponentAssemblyLine>builder() + .addShape( + STRUCTURE_PIECE_MAIN, + new String[][] { + { " ", " III ", " HHI~IHH ", "HH III HH", "H H", "H H", "H JJJ H", + "H JJJ H", "H N N H", "HHHHHHHHH" }, + { " ", " ELHHHLE ", "E E", "H H", "A A", "A A", "A A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "HC CH", "AC CA", "AC CA", "A D D A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " BBB ", " EL LE ", "E GGDGG E", "HGG D GGH", "AG C GA", "AG GA", "AG GA", + "AG HHH GA", "AG GA", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "HC CH", "AC CA", "AC CA", "A D D A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " BBB ", " EL LE ", "E GGDGG E", "HGG D GGH", "HG C GH", "HG GH", "HG GH", + "HG HHH GH", "HG GH", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "HC CH", "AC CA", "AC CA", "A D D A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " BBB ", " EL LE ", "E GGDGG E", "HGG D GGH", "AG C GA", "AG GA", "AG GA", + "AG HHH GA", "AG GA", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "HC CH", "AC CA", "AC CA", "A D D A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " BBB ", " EL LE ", "E GGDGG E", "HGG D GGH", "HG C GH", "HG GH", "HG GH", + "HG HHH GH", "HG GH", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "HC CH", "AC CA", "AC CA", "A D D A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " BBB ", " EL LE ", "E GGDGG E", "HGG D GGH", "AG C GA", "AG GA", "AG GA", + "AG HHH GA", "AG GA", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "HC CH", "AC CA", "AC CA", "A D D A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " BBB ", " EL LE ", "E GGDGG E", "HGG D GGH", "HG C GH", "HG GH", "HG GH", + "HG HHH GH", "HG GH", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "HC CH", "AC CA", "AC CA", "A D D A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " BBB ", " EL LE ", "E GGDGG E", "HGG D GGH", "AG C GA", "AG GA", "AG GA", + "AG HHH GA", "AG GA", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "H H", "A A", "A A", "A A", + "A HHH A", "A n n A", "MHHHHHHHM" }, + { " HBH ", " EL LE ", "E E", "HC CH", "AC CA", "AC CA", "A D D A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " ", " ELHHHLE ", "E E", "H H", "A A", "A A", "A A", + "A HHH A", "A A", "MHHHHHHHM" }, + { " ", " ", " HHHHHHH ", "HH HH", "H H", "H H", "H H", + "H H", "H KKK H", "HHHHHHHHH" } }) + .addElement( + 'A', + ofChain( + ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks", 5), + ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks", 13), + ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks", 14), + ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks", 15), + ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks2", 0))) + .addElement('H', ofBlock(GregTech_API.sBlockCasings8, 7)) + .addElement('C', ofBlock(GregTech_API.sBlockCasings2, 5)) + .addElement('D', ofBlock(GregTech_API.sBlockCasings2, 9)) + .addElement('G', ofBlock(GregTech_API.sBlockCasings9, 0)) + .addElement('E', ofBlock(GregTech_API.sBlockCasings9, 1)) + .addElement('F', ofBlock(GregTech_API.sBlockCasings4, 1)) + .addElement( + 'B', + ofBlocksTiered( + (block, meta) -> block == Loaders.componentAssemblylineCasing ? meta : -1, + IntStream.range(0, 14) + .mapToObj(i -> Pair.of(Loaders.componentAssemblylineCasing, i)) + .collect(Collectors.toList()), + -2, + (t, meta) -> t.casingTier = meta, + t -> t.casingTier)) + .addElement( + 'J', + GT_StructureUtility.buildHatchAdder(ComponentAssemblyLine.class) + .atLeast(InputBus) + .dot(1) + .casingIndex(183) + .buildAndChain(GregTech_API.sBlockCasings8, 7)) + .addElement( + 'N', + GT_StructureUtility.buildHatchAdder(ComponentAssemblyLine.class) + .atLeast(InputBus) + .dot(1) + .casingIndex(183) + .buildAndChain(GT_StructureUtility.ofFrame(Materials.TungstenSteel))) + .addElement( + 'K', + GT_StructureUtility.buildHatchAdder(ComponentAssemblyLine.class) + .atLeast(OutputBus) + .dot(2) + .casingIndex(183) + .buildAndChain(GregTech_API.sBlockCasings8, 7)) + .addElement( + 'L', + GT_StructureUtility.buildHatchAdder(ComponentAssemblyLine.class) + .atLeast(Energy, ExoticEnergy) + .dot(3) + .casingIndex(183) + .buildAndChain(GregTech_API.sBlockCasings8, 7)) + .addElement( + 'I', + GT_StructureUtility.buildHatchAdder(ComponentAssemblyLine.class) + .atLeast(Maintenance) + .dot(4) + .casingIndex(183) + .buildAndChain(GregTech_API.sBlockCasings8, 7)) + .addElement( + 'M', + GT_StructureUtility.buildHatchAdder(ComponentAssemblyLine.class) + .atLeast(InputHatch) + .dot(5) + .casingIndex(183) + .buildAndChain(GregTech_API.sBlockCasings8, 7)) + .addElement('n', GT_StructureUtility.ofFrame(Materials.TungstenSteel)) + .build(); public ComponentAssemblyLine(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -190,36 +210,41 @@ public class ComponentAssemblyLine extends GT_MetaTileEntity_ExtendedPowerMultiB protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("High-Capacity Component Assembler") - .addInfo("Controller block for the Component Assembly Line.") - .addInfo("Assembles basic components (motors, pumps, etc.) in large batches.") - .addInfo( - "The " + EnumChatFormatting.BOLD - + EnumChatFormatting.YELLOW - + "Component Assembly Line Casing " - + EnumChatFormatting.RESET - + EnumChatFormatting.GRAY - + "limits the recipes the machine can perform. See the NEI pages for details.") - .addInfo( - "Supports " + EnumChatFormatting.BLUE - + "Tec" - + EnumChatFormatting.DARK_BLUE - + "Tech" - + EnumChatFormatting.GRAY - + " laser and multi-amp hatches!") - .addInfo("Supports overclocking beyond MAX!") - .addInfo(EnumChatFormatting.ITALIC + "Much more efficient than other competing brands!") - .addInfo("The structure is too complex!").addInfo(BLUE_PRINT_INFO).addSeparator() - .beginStructureBlock(9, 10, 33, false) - .addStructureInfo("This structure is too complex! See schematic for details.") - .addOtherStructurePart("Borosilicate Glass", "Can be UV tier or higher") - .addInputBus("Start of conveyor belt", 1).addOutputBus("End of conveyor belt", 2) - .addEnergyHatch("Second-top layer", 3).addMaintenanceHatch("Around the controller", 4) - .addInputHatch("Bottom left and right corners", 5).toolTipFinisher( - EnumChatFormatting.AQUA + "MadMan310" - + EnumChatFormatting.GRAY - + " via " - + EnumChatFormatting.GREEN - + "Good Generator"); + .addInfo("Controller block for the Component Assembly Line.") + .addInfo("Assembles basic components (motors, pumps, etc.) in large batches.") + .addInfo( + "The " + EnumChatFormatting.BOLD + + EnumChatFormatting.YELLOW + + "Component Assembly Line Casing " + + EnumChatFormatting.RESET + + EnumChatFormatting.GRAY + + "limits the recipes the machine can perform. See the NEI pages for details.") + .addInfo( + "Supports " + EnumChatFormatting.BLUE + + "Tec" + + EnumChatFormatting.DARK_BLUE + + "Tech" + + EnumChatFormatting.GRAY + + " laser and multi-amp hatches!") + .addInfo("Supports overclocking beyond MAX!") + .addInfo(EnumChatFormatting.ITALIC + "Much more efficient than other competing brands!") + .addInfo("The structure is too complex!") + .addInfo(BLUE_PRINT_INFO) + .addSeparator() + .beginStructureBlock(9, 10, 33, false) + .addStructureInfo("This structure is too complex! See schematic for details.") + .addOtherStructurePart("Borosilicate Glass", "Can be UV tier or higher") + .addInputBus("Start of conveyor belt", 1) + .addOutputBus("End of conveyor belt", 2) + .addEnergyHatch("Second-top layer", 3) + .addMaintenanceHatch("Around the controller", 4) + .addInputHatch("Bottom left and right corners", 5) + .toolTipFinisher( + EnumChatFormatting.AQUA + "MadMan310" + + EnumChatFormatting.GRAY + + " via " + + EnumChatFormatting.GREEN + + "Good Generator"); return tt; } @@ -238,21 +263,33 @@ public class ComponentAssemblyLine extends GT_MetaTileEntity_ExtendedPowerMultiB String[] ret = new String[origin.length + 1]; System.arraycopy(origin, 0, ret, 0, origin.length); ret[origin.length] = StatCollector.translateToLocal("scanner.info.CASS.tier") - + (casingTier >= 0 ? GT_Values.VN[casingTier + 1] : "None!"); + + (casingTier >= 0 ? GT_Values.VN[casingTier + 1] : "None!"); return ret; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean aActive, boolean aRedstone) { + int colorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(183), - TextureFactory.builder().addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE_GLOW).extFacing().glow() - .build() }; - return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(183), - TextureFactory.builder().addIcon(OVERLAY_FRONT_PROCESSING_ARRAY).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_GLOW).extFacing().glow().build() }; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(183), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(183) }; } @@ -300,13 +337,13 @@ public class ComponentAssemblyLine extends GT_MetaTileEntity_ExtendedPowerMultiB public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { inputSeparation = !inputSeparation; GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); + aPlayer, + StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); } @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ, ItemStack aTool) { + float aX, float aY, float aZ, ItemStack aTool) { if (aPlayer.isSneaking()) { batchMode = !batchMode; if (batchMode) { diff --git a/src/main/java/goodgenerator/blocks/tileEntity/CoolantTower.java b/src/main/java/goodgenerator/blocks/tileEntity/CoolantTower.java index 3fd7108603..ae3395ffb9 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/CoolantTower.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/CoolantTower.java @@ -37,7 +37,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; public class CoolantTower extends GT_MetaTileEntity_TooltipMultiBlockBase_EM - implements IConstructable, ISurvivalConstructable { + implements IConstructable, ISurvivalConstructable { protected IStructureDefinition<CoolantTower> multiDefinition = null; private final int CASING_INDEX = 1542; @@ -54,58 +54,45 @@ public class CoolantTower extends GT_MetaTileEntity_TooltipMultiBlockBase_EM public IStructureDefinition<? extends GT_MetaTileEntity_MultiblockBase_EM> getStructure_EM() { if (multiDefinition == null) { multiDefinition = StructureDefinition.<CoolantTower>builder() - .addShape( - mName, - transpose( - new String[][] { - { " ", " ", " BBB ", " B B ", " B B ", - " B B ", " B B ", " B B ", " BBB ", - " ", " " }, - { " ", " ", " BBB ", " BBBBB ", " BB BB ", - " BB BB ", " BB BB ", " BBBBB ", " BBB ", - " ", " " }, - { " ", " ", " ", " BBB ", " B B ", - " B B ", " B B ", " BBB ", " ", - " ", " " }, - { " ", " ", " ", " BBB ", " B B ", - " B B ", " B B ", " BBB ", " ", - " ", " " }, - { " ", " ", " ", " BBB ", " B B ", - " B B ", " B B ", " BBB ", " ", - " ", " " }, - { " ", " ", " BBB ", " BBBBB ", " BB BB ", - " BB BB ", " BB BB ", " BBBBB ", " BBB ", - " ", " " }, - { " ", " ", " BBB ", " B B ", " B B ", - " B B ", " B B ", " B B ", " BBB ", - " ", " " }, - { " ", " ", " BBB ", " B B ", " B B ", - " B B ", " B B ", " B B ", " BBB ", - " ", " " }, - { " ", " BBB ", " BBBBB ", " BB BB ", " BB BB ", - " BB BB ", " BB BB ", " BB BB ", " BBBBB ", - " BBB ", " " }, - { " ", " BBB ", " B B ", " B B ", " B B ", - " B B ", " B B ", " B B ", " B B ", - " BBB ", " " }, - { " ", " BBBBB ", " BB BB ", " BB BB ", " B B ", - " B B ", " B B ", " BB BB ", " BB BB ", - " BBBBB ", " " }, - { " HH~HH ", " HBBBBBH ", " HB BH ", "HB BH", "HB BH", - "HB BH", "HB BH", "HB BH", " HB BH ", - " HBBBBBH ", " HHHHH " }, - { " CCCCC ", " C C ", " C C ", "C C", "C C", - "C C", "C C", "C C", " C C ", - " C C ", " CCCCC " }, })) - .addElement('B', ofBlockAnyMeta(GregTech_API.sBlockConcretes, 8)) - .addElement('C', ofFrame(Materials.TungstenCarbide)) - .addElement( - 'H', - buildHatchAdder(CoolantTower.class) - .atLeast(GT_HatchElement.InputHatch, GT_HatchElement.OutputHatch) - .casingIndex(CASING_INDEX).dot(1) - .buildAndChain(ofBlockAnyMeta(GregTech_API.sBlockConcretes, 8))) - .build(); + .addShape( + mName, + transpose( + new String[][] { + { " ", " ", " BBB ", " B B ", " B B ", " B B ", + " B B ", " B B ", " BBB ", " ", " " }, + { " ", " ", " BBB ", " BBBBB ", " BB BB ", " BB BB ", + " BB BB ", " BBBBB ", " BBB ", " ", " " }, + { " ", " ", " ", " BBB ", " B B ", " B B ", + " B B ", " BBB ", " ", " ", " " }, + { " ", " ", " ", " BBB ", " B B ", " B B ", + " B B ", " BBB ", " ", " ", " " }, + { " ", " ", " ", " BBB ", " B B ", " B B ", + " B B ", " BBB ", " ", " ", " " }, + { " ", " ", " BBB ", " BBBBB ", " BB BB ", " BB BB ", + " BB BB ", " BBBBB ", " BBB ", " ", " " }, + { " ", " ", " BBB ", " B B ", " B B ", " B B ", + " B B ", " B B ", " BBB ", " ", " " }, + { " ", " ", " BBB ", " B B ", " B B ", " B B ", + " B B ", " B B ", " BBB ", " ", " " }, + { " ", " BBB ", " BBBBB ", " BB BB ", " BB BB ", " BB BB ", + " BB BB ", " BB BB ", " BBBBB ", " BBB ", " " }, + { " ", " BBB ", " B B ", " B B ", " B B ", " B B ", + " B B ", " B B ", " B B ", " BBB ", " " }, + { " ", " BBBBB ", " BB BB ", " BB BB ", " B B ", " B B ", + " B B ", " BB BB ", " BB BB ", " BBBBB ", " " }, + { " HH~HH ", " HBBBBBH ", " HB BH ", "HB BH", "HB BH", "HB BH", + "HB BH", "HB BH", " HB BH ", " HBBBBBH ", " HHHHH " }, + { " CCCCC ", " C C ", " C C ", "C C", "C C", "C C", + "C C", "C C", " C C ", " C C ", " CCCCC " }, })) + .addElement('B', ofBlockAnyMeta(GregTech_API.sBlockConcretes, 8)) + .addElement('C', ofFrame(Materials.TungstenCarbide)) + .addElement( + 'H', + buildHatchAdder(CoolantTower.class).atLeast(GT_HatchElement.InputHatch, GT_HatchElement.OutputHatch) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(ofBlockAnyMeta(GregTech_API.sBlockConcretes, 8))) + .build(); } return multiDefinition; } @@ -124,10 +111,15 @@ public class CoolantTower extends GT_MetaTileEntity_TooltipMultiBlockBase_EM @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Coolant Tower").addInfo("Controller block for the Coolant Tower.") - .addInfo("Turn Steam back to Distilled Water.").addInfo(BLUE_PRINT_INFO).addSeparator() - .addController("Mid of the second layer.").addInputHatch("Input Hatch", 1) - .addOutputHatch("Output Hatch", 1).toolTipFinisher("Good Generator"); + tt.addMachineType("Coolant Tower") + .addInfo("Controller block for the Coolant Tower.") + .addInfo("Turn Steam back to Distilled Water.") + .addInfo(BLUE_PRINT_INFO) + .addSeparator() + .addController("Mid of the second layer.") + .addInputHatch("Input Hatch", 1) + .addOutputHatch("Output Hatch", 1) + .toolTipFinisher("Good Generator"); return tt; } @@ -201,15 +193,26 @@ public class CoolantTower extends GT_MetaTileEntity_TooltipMultiBlockBase_EM @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean aActive, boolean aRedstone) { + int colorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { - if (aActive) return new ITexture[] { casingTexturePages[12][6], - TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).extFacing().glow() - .build() }; - return new ITexture[] { casingTexturePages[12][6], - TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).extFacing().glow().build() }; + if (aActive) return new ITexture[] { casingTexturePages[12][6], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; + return new ITexture[] { casingTexturePages[12][6], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_HEAT_EXCHANGER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { casingTexturePages[12][6] }; } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/EssentiaHatch.java b/src/main/java/goodgenerator/blocks/tileEntity/EssentiaHatch.java index 563029aa03..f9eab80f03 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/EssentiaHatch.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/EssentiaHatch.java @@ -91,19 +91,19 @@ public class EssentiaHatch extends TileEntity implements IAspectContainer, IEsse TileEntity[] te = new TileEntity[ForgeDirection.VALID_DIRECTIONS.length]; for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) { te[i] = ThaumcraftApiHelper.getConnectableTile( - this.worldObj, - this.xCoord, - this.yCoord, - this.zCoord, - ForgeDirection.VALID_DIRECTIONS[i]); + this.worldObj, + this.xCoord, + this.yCoord, + this.zCoord, + ForgeDirection.VALID_DIRECTIONS[i]); if (te[i] != null) { IEssentiaTransport pipe = (IEssentiaTransport) te[i]; if (!pipe.canOutputTo(ForgeDirection.VALID_DIRECTIONS[i])) { continue; } if ((pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i].getOpposite()) != null) - && (pipe.getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]) - < getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]))) { + && (pipe.getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]) + < getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]))) { Aspect readyInput = pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i].getOpposite()); int type = LargeEssentiaEnergyData.getAspectTypeIndex(readyInput); if (type != -1 && (mState & (1 << type)) == 0) continue; @@ -111,11 +111,11 @@ public class EssentiaHatch extends TileEntity implements IAspectContainer, IEsse addToContainer(mLocked, pipe.takeEssentia(mLocked, 1, ForgeDirection.VALID_DIRECTIONS[i])); } if (mLocked == null) addToContainer( + pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]), + pipe.takeEssentia( pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]), - pipe.takeEssentia( - pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]), - 1, - ForgeDirection.VALID_DIRECTIONS[i])); + 1, + ForgeDirection.VALID_DIRECTIONS[i])); } } } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/EssentiaOutputHatch_ME.java b/src/main/java/goodgenerator/blocks/tileEntity/EssentiaOutputHatch_ME.java index d8057832cc..b576b44e7f 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/EssentiaOutputHatch_ME.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/EssentiaOutputHatch_ME.java @@ -133,7 +133,8 @@ public class EssentiaOutputHatch_ME extends EssentiaOutputHatch implements IActi protected boolean getEssentiaMonitor() { IMEEssentiaMonitor essentiaMonitor = null; IGrid grid = null; - IGridNode node = this.getProxy().getNode(); + IGridNode node = this.getProxy() + .getNode(); if (node != null) { grid = node.getGrid(); diff --git a/src/main/java/goodgenerator/blocks/tileEntity/ExtremeHeatExchanger.java b/src/main/java/goodgenerator/blocks/tileEntity/ExtremeHeatExchanger.java index 472579d6ac..af1fd82030 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/ExtremeHeatExchanger.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/ExtremeHeatExchanger.java @@ -54,7 +54,7 @@ import gregtech.api.util.GT_Utility; import gregtech.api.util.IGT_HatchAdder; public class ExtremeHeatExchanger extends GT_MetaTileEntity_TooltipMultiBlockBase_EM - implements IConstructable, ISurvivalConstructable { + implements IConstructable, ISurvivalConstructable { protected IStructureDefinition<ExtremeHeatExchanger> multiDefinition = null; @@ -78,11 +78,11 @@ public class ExtremeHeatExchanger extends GT_MetaTileEntity_TooltipMultiBlockBas public IStructureDefinition<ExtremeHeatExchanger> getStructure_EM() { if (multiDefinition == null) { multiDefinition = StructureDefinition.<ExtremeHeatExchanger>builder() - .addShape( - mName, - transpose( - new String[][] { - // spotless:off + .addShape( + mName, + transpose( + new String[][] { + // spotless:off { " CCC ", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", " CCC " }, { " CCC ", "GPPPG", "GWWWG", "GPPPG", "GWWWG", "GPPPG", "GWWWG", "GPPPG", "GWWWG", "GPPPG", " CCC " }, { " CFC ", "GPPPG", "GWWWG", "GPPPG", "GWWWG", "GPPPG", "GWWWG", "GPPPG", "GWWWG", "GPPPG", " CEC " }, @@ -90,32 +90,39 @@ public class ExtremeHeatExchanger extends GT_MetaTileEntity_TooltipMultiBlockBas { " CCC ", "GPPPG", "GWWWG", "GPPPG", "GWWWG", "GPPPG", "GWWWG", "GPPPG", "GWWWG", "GPPPG", " CCC " }, { " C~C ", "BBBBB", "BBBBB", "BBBBB", "BBBBB", "BBBBB", "BBBBB", "BBBBB", "BBBBB", "BBBBB", " CCC " }, //spotless:on - })) - .addElement( - 'B', - ofChain( - buildHatchAdder(ExtremeHeatExchanger.class) - .atLeast(GT_HatchElement.InputHatch, GT_HatchElement.Maintenance) - .casingIndex(48).dot(1).build(), - onElementPass(x -> x.casingAmount++, ofBlock(GregTech_API.sBlockCasings4, 0)))) - .addElement( - 'T', - ofChain( - buildHatchAdder(ExtremeHeatExchanger.class) - .atLeast(GT_HatchElement.OutputHatch, GT_HatchElement.Maintenance) - .casingIndex(48).dot(2).build(), - onElementPass(x -> x.casingAmount++, ofBlock(GregTech_API.sBlockCasings4, 0)))) - .addElement('F', EHEHatches.HotInputHatch.newAny(48, 3)) - .addElement('E', EHEHatches.ColdOutputHatch.newAny(48, 4)) - .addElement( - 'C', - ofChain( - buildHatchAdder(ExtremeHeatExchanger.class).atLeast(GT_HatchElement.Maintenance) - .casingIndex(48).dot(5).build(), - onElementPass(x -> x.casingAmount++, ofBlock(GregTech_API.sBlockCasings4, 0)))) - .addElement('G', Glasses.chainAllGlasses()) - .addElement('P', ofBlock(GregTech_API.sBlockCasings2, 15)) - .addElement('W', ofBlock(Loaders.pressureResistantWalls, 0)).build(); + })) + .addElement( + 'B', + ofChain( + buildHatchAdder(ExtremeHeatExchanger.class) + .atLeast(GT_HatchElement.InputHatch, GT_HatchElement.Maintenance) + .casingIndex(48) + .dot(1) + .build(), + onElementPass(x -> x.casingAmount++, ofBlock(GregTech_API.sBlockCasings4, 0)))) + .addElement( + 'T', + ofChain( + buildHatchAdder(ExtremeHeatExchanger.class) + .atLeast(GT_HatchElement.OutputHatch, GT_HatchElement.Maintenance) + .casingIndex(48) + .dot(2) + .build(), + onElementPass(x -> x.casingAmount++, ofBlock(GregTech_API.sBlockCasings4, 0)))) + .addElement('F', EHEHatches.HotInputHatch.newAny(48, 3)) + .addElement('E', EHEHatches.ColdOutputHatch.newAny(48, 4)) + .addElement( + 'C', + ofChain( + buildHatchAdder(ExtremeHeatExchanger.class).atLeast(GT_HatchElement.Maintenance) + .casingIndex(48) + .dot(5) + .build(), + onElementPass(x -> x.casingAmount++, ofBlock(GregTech_API.sBlockCasings4, 0)))) + .addElement('G', Glasses.chainAllGlasses()) + .addElement('P', ofBlock(GregTech_API.sBlockCasings2, 15)) + .addElement('W', ofBlock(Loaders.pressureResistantWalls, 0)) + .build(); } return multiDefinition; } @@ -153,7 +160,8 @@ public class ExtremeHeatExchanger extends GT_MetaTileEntity_TooltipMultiBlockBas if (hotFluid != null) { hotName = loadedHotName; tRunningRecipe = (ExtremeHeatExchangerRecipe) GoodGeneratorRecipeMaps.extremeHeatExchangerFuels - .getBackend().findFuel(hotFluid); + .getBackend() + .findFuel(hotFluid); } } else { hotName = null; @@ -191,14 +199,20 @@ public class ExtremeHeatExchanger extends GT_MetaTileEntity_TooltipMultiBlockBas protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Heat Exchanger/Plasma Heat Exchanger") - .addInfo("Controller block for the Extreme Heat Exchanger.") - .addInfo("Accept Hot fluid like lava, hot coolant or plasma.") - .addInfo("Output SC Steam/SH Steam/Steam.").addInfo("Check NEI for more info.").addInfo(BLUE_PRINT_INFO) - .addSeparator().addController("Front bottom").addOtherStructurePart("Input Hatch", "distilled water", 1) - .addOtherStructurePart("Output Hatch", "SC Steam/SH Steam/Steam", 2) - .addOtherStructurePart("Input Hatch", "Hot fluid or plasma", 3) - .addOtherStructurePart("Output Hatch", "Cold fluid", 4).addMaintenanceHatch("Any Casing", 1, 2, 5) - .addCasingInfoMin("Robust Tungstensteel Machine Casings", 25, false).toolTipFinisher("Good Generator"); + .addInfo("Controller block for the Extreme Heat Exchanger.") + .addInfo("Accept Hot fluid like lava, hot coolant or plasma.") + .addInfo("Output SC Steam/SH Steam/Steam.") + .addInfo("Check NEI for more info.") + .addInfo(BLUE_PRINT_INFO) + .addSeparator() + .addController("Front bottom") + .addOtherStructurePart("Input Hatch", "distilled water", 1) + .addOtherStructurePart("Output Hatch", "SC Steam/SH Steam/Steam", 2) + .addOtherStructurePart("Input Hatch", "Hot fluid or plasma", 3) + .addOtherStructurePart("Output Hatch", "Cold fluid", 4) + .addMaintenanceHatch("Any Casing", 1, 2, 5) + .addCasingInfoMin("Robust Tungstensteel Machine Casings", 25, false) + .toolTipFinisher("Good Generator"); return tt; } @@ -207,10 +221,13 @@ public class ExtremeHeatExchanger extends GT_MetaTileEntity_TooltipMultiBlockBas tRunningRecipe = null; if (mHotFluidHatch.getFluid() == null) return CheckRecipeResultRegistry.SUCCESSFUL; ExtremeHeatExchangerRecipe tRecipe = (ExtremeHeatExchangerRecipe) GoodGeneratorRecipeMaps.extremeHeatExchangerFuels - .getBackend().findFuel(mHotFluidHatch.getFluid()); + .getBackend() + .findFuel(mHotFluidHatch.getFluid()); if (tRecipe == null) return CheckRecipeResultRegistry.NO_RECIPE; tRunningRecipe = tRecipe; - this.hotName = mHotFluidHatch.getFluid().getFluid().getName(); + this.hotName = mHotFluidHatch.getFluid() + .getFluid() + .getName(); int tMaxConsume = tRecipe.getMaxHotFluidConsume(); int transformed_threshold = tRecipe.mSpecialValue; int tRealConsume = Math.min(tMaxConsume, mHotFluidHatch.getFluid().amount); @@ -218,7 +235,8 @@ public class ExtremeHeatExchanger extends GT_MetaTileEntity_TooltipMultiBlockBas double efficiency = 1d; int shs_reduction_per_config = 150; - if (mInventory[1] != null && mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) { + if (mInventory[1] != null && mInventory[1].getUnlocalizedName() + .startsWith("gt.integrated_circuit")) { int circuit_config = mInventory[1].getItemDamage(); if (circuit_config >= 1 && circuit_config <= 25) { penalty = (circuit_config - 1) * penalty_per_config; @@ -250,7 +268,8 @@ public class ExtremeHeatExchanger extends GT_MetaTileEntity_TooltipMultiBlockBas addOutput(new FluidStack(tReadySteam, waterAmount * 160)); } else { GT_Log.exp.println(this.mName + " had no more Distilled water!"); - mHotFluidHatch.getBaseMetaTileEntity().doExplosion(V[8]); + mHotFluidHatch.getBaseMetaTileEntity() + .doExplosion(V[8]); return false; } } @@ -294,49 +313,60 @@ public class ExtremeHeatExchanger extends GT_MetaTileEntity_TooltipMultiBlockBas public String[] getInfoData() { int tThreshold = tRunningRecipe != null ? tRunningRecipe.mSpecialValue : 0; return new String[] { - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mProgresstime / 20) - + EnumChatFormatting.RESET - + " s / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mMaxProgresstime / 20) - + EnumChatFormatting.RESET - + " s", - StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " - + EnumChatFormatting.RED - + (getIdealStatus() - getRepairStatus()) - + EnumChatFormatting.RESET - + " " - + StatCollector.translateToLocal("GT5U.multiblock.efficiency") - + ": " - + EnumChatFormatting.YELLOW - + mEfficiency / 100.0F - + EnumChatFormatting.RESET - + " %", - StatCollector.translateToLocal("scanner.info.XHE.0") + " " - + (transformed ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW) - + GT_Utility.formatNumbers(this.mEUt) - + EnumChatFormatting.RESET - + " EU/t", - StatCollector.translateToLocal("scanner.info.XHE.1") + " " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(tThreshold) - + EnumChatFormatting.RESET - + " L/s" }; + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime / 20) + + EnumChatFormatting.RESET + + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime / 20) + + EnumChatFormatting.RESET + + " s", + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + + (getIdealStatus() - getRepairStatus()) + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + + EnumChatFormatting.YELLOW + + mEfficiency / 100.0F + + EnumChatFormatting.RESET + + " %", + StatCollector.translateToLocal("scanner.info.XHE.0") + " " + + (transformed ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW) + + GT_Utility.formatNumbers(this.mEUt) + + EnumChatFormatting.RESET + + " EU/t", + StatCollector.translateToLocal("scanner.info.XHE.1") + " " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(tThreshold) + + EnumChatFormatting.RESET + + " L/s" }; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean aActive, boolean aRedstone) { + int colorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { - if (aActive) return new ITexture[] { casingTexturePages[0][48], - TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).extFacing().glow() - .build() }; - return new ITexture[] { casingTexturePages[0][48], - TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).extFacing().glow().build() }; + if (aActive) return new ITexture[] { casingTexturePages[0][48], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; + return new ITexture[] { casingTexturePages[0][48], TextureFactory.builder() + .addIcon(OVERLAY_FRONT_HEAT_EXCHANGER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { casingTexturePages[0][48] }; } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/FuelRefineFactory.java b/src/main/java/goodgenerator/blocks/tileEntity/FuelRefineFactory.java index fa5003c013..85c4bffbab 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/FuelRefineFactory.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/FuelRefineFactory.java @@ -49,13 +49,13 @@ import gregtech.api.util.GT_OverclockCalculator; import gregtech.api.util.GT_Recipe; public class FuelRefineFactory extends GT_MetaTileEntity_TooltipMultiBlockBase_EM - implements IConstructable, ISurvivalConstructable { + implements IConstructable, ISurvivalConstructable { private IStructureDefinition<FuelRefineFactory> multiDefinition = null; private int Tier = -1; private int[] cnt = new int[] { 0, 0, 0, 0 }; private static final Block[] coils = new Block[] { Loaders.FRF_Coil_1, Loaders.FRF_Coil_2, Loaders.FRF_Coil_3, - Loaders.FRF_Coil_4 }; + Loaders.FRF_Coil_4 }; public FuelRefineFactory(String name) { super(name); @@ -88,44 +88,46 @@ public class FuelRefineFactory extends GT_MetaTileEntity_TooltipMultiBlockBase_E public IStructureDefinition<FuelRefineFactory> getStructure_EM() { if (multiDefinition == null) { multiDefinition = StructureDefinition.<FuelRefineFactory>builder() - .addShape( - mName, - transpose( - new String[][] { { " ", " CCC ", " " }, - { " XGX ", " CCFFFCC ", " XGX " }, - { " CC CC ", " CFFCCCFFC ", " CC CC " }, - { " C C ", " CFCC CCFC ", " C C " }, - { " C C ", " CFC CFC ", " C C " }, - { " C C ", " CFC CFC ", " C C " }, - { " X X ", "CFC CFC", " X X " }, - { " G G ", "CFC CFC", " G G " }, - { " X X ", "CFC CFC", " X X " }, - { " C C ", " CFC CFC ", " C C " }, - { " C C ", " CFC CFC ", " C C " }, - { " C C ", " CFCC CCFC ", " C C " }, - { " CC CC ", " CFFC~CFFC ", " CC CC " }, - { " XGX ", " CCFFFCC ", " XGX " }, - { " ", " CCC ", " " } })) - .addElement( - 'X', - buildHatchAdder(FuelRefineFactory.class) - .atLeast( - GT_HatchElement.Maintenance, - GT_HatchElement.InputHatch, - GT_HatchElement.InputBus, - GT_HatchElement.OutputHatch, - HatchElement.EnergyMulti.or(GT_HatchElement.Energy)) - .casingIndex(179).dot(1).buildAndChain(ofBlock(Loaders.FRF_Casings, 0))) - .addElement('C', ofBlock(Loaders.FRF_Casings, 0)) - .addElement('G', ofBlock(Loaders.fieldRestrictingGlass, 0)) - .addElement( - 'F', - ofChain( - onElementPass(x -> ++x.cnt[0], ofFieldCoil(0)), - onElementPass(x -> ++x.cnt[1], ofFieldCoil(1)), - onElementPass(x -> ++x.cnt[2], ofFieldCoil(2)), - onElementPass(x -> ++x.cnt[3], ofFieldCoil(3)))) - .build(); + .addShape( + mName, + transpose( + new String[][] { { " ", " CCC ", " " }, + { " XGX ", " CCFFFCC ", " XGX " }, + { " CC CC ", " CFFCCCFFC ", " CC CC " }, + { " C C ", " CFCC CCFC ", " C C " }, + { " C C ", " CFC CFC ", " C C " }, + { " C C ", " CFC CFC ", " C C " }, + { " X X ", "CFC CFC", " X X " }, + { " G G ", "CFC CFC", " G G " }, + { " X X ", "CFC CFC", " X X " }, + { " C C ", " CFC CFC ", " C C " }, + { " C C ", " CFC CFC ", " C C " }, + { " C C ", " CFCC CCFC ", " C C " }, + { " CC CC ", " CFFC~CFFC ", " CC CC " }, + { " XGX ", " CCFFFCC ", " XGX " }, + { " ", " CCC ", " " } })) + .addElement( + 'X', + buildHatchAdder(FuelRefineFactory.class) + .atLeast( + GT_HatchElement.Maintenance, + GT_HatchElement.InputHatch, + GT_HatchElement.InputBus, + GT_HatchElement.OutputHatch, + HatchElement.EnergyMulti.or(GT_HatchElement.Energy)) + .casingIndex(179) + .dot(1) + .buildAndChain(ofBlock(Loaders.FRF_Casings, 0))) + .addElement('C', ofBlock(Loaders.FRF_Casings, 0)) + .addElement('G', ofBlock(Loaders.fieldRestrictingGlass, 0)) + .addElement( + 'F', + ofChain( + onElementPass(x -> ++x.cnt[0], ofFieldCoil(0)), + onElementPass(x -> ++x.cnt[1], ofFieldCoil(1)), + onElementPass(x -> ++x.cnt[2], ofFieldCoil(2)), + onElementPass(x -> ++x.cnt[3], ofFieldCoil(3)))) + .build(); } return multiDefinition; } @@ -158,24 +160,24 @@ public class FuelRefineFactory extends GT_MetaTileEntity_TooltipMultiBlockBase_E @Override public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { return BlocksToPlace.create(coils[getIndex(trigger)], 0); } @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { if (check(t, world, x, y, z)) return PlaceResult.SKIP; return StructureUtility.survivalPlaceBlock( - coils[getIndex(trigger)], - 0, - world, - x, - y, - z, - env.getSource(), - env.getActor(), - env.getChatter()); + coils[getIndex(trigger)], + 0, + world, + x, + y, + z, + env.getSource(), + env.getActor(), + env.getChatter()); } }; } @@ -183,15 +185,21 @@ public class FuelRefineFactory extends GT_MetaTileEntity_TooltipMultiBlockBase_E @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Naquadah Fuel Refinery").addInfo("Controller block for the Naquadah Fuel Refinery") - .addInfo("But at what cost?").addInfo("Produces naquadah fuels.") - .addInfo("Needs field restriction coils to control the fatal radiation.") - .addInfo("Use higher tier coils to unlock more fuel types and reduce the processing times.") - .addInfo("The structure is too complex!").addInfo(BLUE_PRINT_INFO).addSeparator() - .beginStructureBlock(3, 15, 15, false).addInputHatch("The casings adjoin the field restriction glass.") - .addInputBus("The casings adjoin the field restriction glass.", 1) - .addOutputHatch("The casings adjoin the field restriction glass.", 1) - .addEnergyHatch("The casings adjoin the field restriction glass.", 1).toolTipFinisher("Good Generator"); + tt.addMachineType("Naquadah Fuel Refinery") + .addInfo("Controller block for the Naquadah Fuel Refinery") + .addInfo("But at what cost?") + .addInfo("Produces naquadah fuels.") + .addInfo("Needs field restriction coils to control the fatal radiation.") + .addInfo("Use higher tier coils to unlock more fuel types and reduce the processing times.") + .addInfo("The structure is too complex!") + .addInfo(BLUE_PRINT_INFO) + .addSeparator() + .beginStructureBlock(3, 15, 15, false) + .addInputHatch("The casings adjoin the field restriction glass.") + .addInputBus("The casings adjoin the field restriction glass.", 1) + .addOutputHatch("The casings adjoin the field restriction glass.", 1) + .addEnergyHatch("The casings adjoin the field restriction glass.", 1) + .toolTipFinisher("Good Generator"); return tt; } @@ -344,15 +352,18 @@ public class FuelRefineFactory extends GT_MetaTileEntity_TooltipMultiBlockBase_E @Override @SuppressWarnings("ALL") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean aActive, boolean aRedstone) { + int colorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(179), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW).glow() - .build() }; + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE), TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW) + .glow() + .build() }; return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(179), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE), TextureFactory.builder() - .addIcon(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_GLOW).glow().build() }; + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE), TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_GLOW) + .glow() + .build() }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(179) }; } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/DieselGenerator.java b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/DieselGenerator.java index 117b35f5aa..4d54be44d1 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/DieselGenerator.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/DieselGenerator.java @@ -26,13 +26,13 @@ public class DieselGenerator extends GT_MetaTileEntity_BasicGenerator { public DieselGenerator(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - new String[] { "Requires liquid Fuel", "Causes " - + (int) (GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond * (1.1 - aTier * 0.1)) - + " Pollution per second" }); + aID, + aName, + aNameRegional, + aTier, + new String[] { "Requires liquid Fuel", + "Causes " + (int) (GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond * (1.1 - aTier * 0.1)) + + " Pollution per second" }); mEfficiency = 100 - aTier * 10; } @@ -83,13 +83,13 @@ public class DieselGenerator extends GT_MetaTileEntity_BasicGenerator { public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aTick % 100 == 0 && mFluid != null && mFluid.amount > this.getCapacity()) { GT_Log.err.println( - "Dupe Abuse: " + aBaseMetaTileEntity.getOwnerName() - + " Coords: " - + aBaseMetaTileEntity.getXCoord() - + " " - + aBaseMetaTileEntity.getYCoord() - + " " - + aBaseMetaTileEntity.getZCoord()); + "Dupe Abuse: " + aBaseMetaTileEntity.getOwnerName() + + " Coords: " + + aBaseMetaTileEntity.getXCoord() + + " " + + aBaseMetaTileEntity.getYCoord() + + " " + + aBaseMetaTileEntity.getZCoord()); aBaseMetaTileEntity.setToFire(); } super.onPostTick(aBaseMetaTileEntity, aTick); @@ -98,83 +98,113 @@ public class DieselGenerator extends GT_MetaTileEntity_BasicGenerator { @Override public ITexture[] getFront(byte aColor) { return new ITexture[] { super.getFront(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_FRONT), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_FRONT_GLOW).glow().build()), - OVERLAYS_ENERGY_OUT[this.mTier] }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_FRONT), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_FRONT_GLOW) + .glow() + .build()), + OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBack(byte aColor) { return new ITexture[] { super.getBack(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_BACK), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_BACK_GLOW).glow().build()) }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BACK), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_BACK_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getBottom(byte aColor) { return new ITexture[] { super.getBottom(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_BOTTOM), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_BOTTOM_GLOW).glow().build()) }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BOTTOM), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_BOTTOM_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getTop(byte aColor) { return new ITexture[] { super.getTop(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_TOP), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_TOP_GLOW).glow().build()) }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_TOP), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_TOP_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getSides(byte aColor) { return new ITexture[] { super.getSides(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_SIDE), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_SIDE_GLOW).glow().build()) }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_SIDE), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_SIDE_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getFrontActive(byte aColor) { return new ITexture[] { super.getFrontActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_FRONT_ACTIVE), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_FRONT_ACTIVE_GLOW).glow().build()), - OVERLAYS_ENERGY_OUT[this.mTier] }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_FRONT_ACTIVE), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_FRONT_ACTIVE_GLOW) + .glow() + .build()), + OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBackActive(byte aColor) { return new ITexture[] { super.getBackActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_BACK_ACTIVE), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_BACK_ACTIVE_GLOW).glow().build()) }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BACK_ACTIVE), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_BACK_ACTIVE_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getBottomActive(byte aColor) { return new ITexture[] { super.getBottomActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_BOTTOM_ACTIVE), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_BOTTOM_ACTIVE_GLOW).glow().build()) }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BOTTOM_ACTIVE), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_BOTTOM_ACTIVE_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getTopActive(byte aColor) { return new ITexture[] { super.getTopActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_TOP_ACTIVE), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_TOP_ACTIVE_GLOW).glow().build()) }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_TOP_ACTIVE), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_TOP_ACTIVE_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getSidesActive(byte aColor) { return new ITexture[] { super.getSidesActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_SIDE_ACTIVE), - TextureFactory.builder().addIcon(DIESEL_GENERATOR_SIDE_ACTIVE_GLOW).glow().build()) }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_SIDE_ACTIVE), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_SIDE_ACTIVE_GLOW) + .glow() + .build()) }; } @Override diff --git a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/NeutronAccelerator.java b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/NeutronAccelerator.java index 2a110b3b67..730374db66 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/NeutronAccelerator.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/NeutronAccelerator.java @@ -29,8 +29,8 @@ public class NeutronAccelerator extends GT_MetaTileEntity_Hatch_Energy { @Override public String[] getDescription() { return new String[] { "Input EU to Accelerate the Neutron!", "Max EU input: " + this.maxEUInput(), - "Max EU consumption: " + this.getMaxEUConsume(), - "Every EU can be transformed into 10~20 eV Neutron Kinetic Energy." }; + "Max EU consumption: " + this.getMaxEUConsume(), + "Every EU can be transformed into 10~20 eV Neutron Kinetic Energy." }; } @Override diff --git a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/NeutronSensor.java b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/NeutronSensor.java index 6ca0a358f7..86bcbeece9 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/NeutronSensor.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/NeutronSensor.java @@ -33,7 +33,7 @@ public class NeutronSensor extends GT_MetaTileEntity_Hatch { private static final IIconContainer textureFont = new Textures.BlockIcons.CustomIcon("icons/NeutronSensorFont"); private static final IIconContainer textureFont_Glow = new Textures.BlockIcons.CustomIcon( - "icons/NeutronSensorFont_GLOW"); + "icons/NeutronSensorFont_GLOW"); protected int threshold = 0; protected boolean inverted = false; @@ -50,8 +50,8 @@ public class NeutronSensor extends GT_MetaTileEntity_Hatch { @Override public String[] getDescription() { return new String[] { "Can be installed in Neutron Activator.", - "Output Redstone Signal according to the Neutron Kinetic Energy.", - "Right click to open the GUI and setting." }; + "Output Redstone Signal according to the Neutron Kinetic Energy.", + "Right click to open the GUI and setting." }; } @Override @@ -85,7 +85,7 @@ public class NeutronSensor extends GT_MetaTileEntity_Hatch { */ private void setThresholdFromString(String text) { Matcher matcher = Pattern.compile("^(<|>|<=|>=|==|!=)([0-9]*)(|k|m)(ev)$", Pattern.CASE_INSENSITIVE) - .matcher(text); + .matcher(text); if (!matcher.matches()) { Log.error("Failed to parse Neutron Sensor setting: \"" + text + "\"!"); @@ -171,7 +171,7 @@ public class NeutronSensor extends GT_MetaTileEntity_Hatch { @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, ForgeDirection side, - float aX, float aY, float aZ) { + float aX, float aY, float aZ) { GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -187,8 +187,10 @@ public class NeutronSensor extends GT_MetaTileEntity_Hatch { @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[] { aBaseTexture, TextureFactory.of(textureFont), - TextureFactory.builder().addIcon(textureFont_Glow).glow().build() }; + return new ITexture[] { aBaseTexture, TextureFactory.of(textureFont), TextureFactory.builder() + .addIcon(textureFont_Glow) + .glow() + .build() }; } @Override @@ -222,13 +224,13 @@ public class NeutronSensor extends GT_MetaTileEntity_Hatch { @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection Side, - ItemStack aStack) { + ItemStack aStack) { return false; } @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { + ItemStack aStack) { return false; } @@ -243,25 +245,33 @@ public class NeutronSensor extends GT_MetaTileEntity_Hatch { final String NORMAL = GT_Utility.trans("NORMAL", "Normal"); builder.widget( - new CoverCycleButtonWidget().setToggle(() -> inverted, (val) -> inverted = val) - .setTextureGetter( - (state) -> state == 1 ? GT_UITextures.OVERLAY_BUTTON_REDSTONE_ON - : GT_UITextures.OVERLAY_BUTTON_REDSTONE_OFF) - .addTooltip(0, NORMAL).addTooltip(1, INVERTED).setPos(10, 8)) - .widget( - new TextWidget().setStringSupplier(() -> inverted ? INVERTED : NORMAL) - .setDefaultColor(COLOR_TEXT_GRAY.get()).setTextAlignment(Alignment.CenterLeft) - .setPos(28, 12)) - .widget( - new NumericWidget().setBounds(0, 1200000000).setGetter(() -> threshold) - .setSetter((value) -> threshold = (int) value).setScrollValues(1000, 1, 1_000_000) - .setTextColor(Color.WHITE.dark(1)).setTextAlignment(Alignment.CenterLeft) - .setFocusOnGuiOpen(true) - .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD.withOffset(-1, -1, 2, 2)) - .setPos(10, 28).setSize(77, 12)) - .widget( - new TextWidget(StatCollector.translateToLocal("gui.NeutronSensor.4")) - .setDefaultColor(COLOR_TEXT_GRAY.get()).setTextAlignment(Alignment.CenterLeft) - .setPos(90, 30)); + new CoverCycleButtonWidget().setToggle(() -> inverted, (val) -> inverted = val) + .setTextureGetter( + (state) -> state == 1 ? GT_UITextures.OVERLAY_BUTTON_REDSTONE_ON + : GT_UITextures.OVERLAY_BUTTON_REDSTONE_OFF) + .addTooltip(0, NORMAL) + .addTooltip(1, INVERTED) + .setPos(10, 8)) + .widget( + new TextWidget().setStringSupplier(() -> inverted ? INVERTED : NORMAL) + .setDefaultColor(COLOR_TEXT_GRAY.get()) + .setTextAlignment(Alignment.CenterLeft) + .setPos(28, 12)) + .widget( + new NumericWidget().setBounds(0, 1200000000) + .setGetter(() -> threshold) + .setSetter((value) -> threshold = (int) value) + .setScrollValues(1000, 1, 1_000_000) + .setTextColor(Color.WHITE.dark(1)) + .setTextAlignment(Alignment.CenterLeft) + .setFocusOnGuiOpen(true) + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD.withOffset(-1, -1, 2, 2)) + .setPos(10, 28) + .setSize(77, 12)) + .widget( + new TextWidget(StatCollector.translateToLocal("gui.NeutronSensor.4")) + .setDefaultColor(COLOR_TEXT_GRAY.get()) + .setTextAlignment(Alignment.CenterLeft) + .setPos(90, 30)); } } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/YOTTAHatch.java b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/YOTTAHatch.java index 065a15b1a8..f905e82f8c 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/YOTTAHatch.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/YOTTAHatch.java @@ -45,7 +45,7 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Utility; public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyable, IActionHost, ICellContainer, - IMEInventory<IAEFluidStack>, IMEInventoryHandler<IAEFluidStack> { + IMEInventory<IAEFluidStack>, IMEInventoryHandler<IAEFluidStack> { private static final IIconContainer textureFont = new Textures.BlockIcons.CustomIcon("icons/YOTTAHatch"); @@ -57,20 +57,19 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl private BigInteger lastAmt = BigInteger.ZERO; private AccessRestriction readMode = AccessRestriction.READ_WRITE; private final AccessRestriction[] AEModes = new AccessRestriction[] { AccessRestriction.NO_ACCESS, - AccessRestriction.READ, AccessRestriction.WRITE, AccessRestriction.READ_WRITE }; + AccessRestriction.READ, AccessRestriction.WRITE, AccessRestriction.READ_WRITE }; private static final BigInteger MAX_LONG_BIGINT = BigInteger.valueOf(Long.MAX_VALUE); public YOTTAHatch(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 0, - new String[] { "Special I/O port for AE2FC.", - "Directly connected YOTTank with AE fluid storage system.", - "Use screwdriver to set storage priority", "Use soldering iron to set read/write mode" }); + aID, + aName, + aNameRegional, + aTier, + 0, + new String[] { "Special I/O port for AE2FC.", "Directly connected YOTTank with AE fluid storage system.", + "Use screwdriver to set storage priority", "Use soldering iron to set read/write mode" }); } public YOTTAHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { @@ -107,21 +106,19 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl @Override public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, - ItemStack toolStack) { + ItemStack toolStack) { if (aPlayer.isSneaking()) this.priority -= 10; else this.priority += 10; - GT_Utility.sendChatToPlayer( - aPlayer, - String.format(StatCollector.translateToLocal("yothatch.chat.0"), this.priority)); + GT_Utility + .sendChatToPlayer(aPlayer, String.format(StatCollector.translateToLocal("yothatch.chat.0"), this.priority)); } @Override public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ, ItemStack toolStack) { + float aX, float aY, float aZ, ItemStack toolStack) { this.readMode = AEModes[(readMode.ordinal() + 1) % 4]; - GT_Utility.sendChatToPlayer( - aPlayer, - String.format(StatCollector.translateToLocal("yothatch.chat.1"), this.readMode)); + GT_Utility + .sendChatToPlayer(aPlayer, String.format(StatCollector.translateToLocal("yothatch.chat.1"), this.readMode)); return true; } @@ -157,7 +154,9 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl @Override public IItemList<IAEFluidStack> getAvailableItems(IItemList<IAEFluidStack> out) { - if (host == null || host.getBaseMetaTileEntity() == null || !host.getBaseMetaTileEntity().isActive()) + if (host == null || host.getBaseMetaTileEntity() == null + || !host.getBaseMetaTileEntity() + .isActive()) return out; if (host.mFluid == null || host.mStorageCurrent.signum() <= 0) return out; long ready; @@ -209,12 +208,15 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl grid.postEvent(new MENetworkCellArrayUpdate()); IStorageGrid storageGrid = grid.getCache(IStorageGrid.class); if (storageGrid == null) { - node.getGrid().postEvent(new MENetworkStorageEvent(null, StorageChannel.FLUIDS)); + node.getGrid() + .postEvent(new MENetworkStorageEvent(null, StorageChannel.FLUIDS)); } else { - node.getGrid().postEvent( + node.getGrid() + .postEvent( new MENetworkStorageEvent(storageGrid.getFluidInventory(), StorageChannel.FLUIDS)); } - node.getGrid().postEvent(new MENetworkCellArrayUpdate()); + node.getGrid() + .postEvent(new MENetworkCellArrayUpdate()); } } faster(); @@ -228,7 +230,10 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl @Override public int getCapacity() { - if (host == null || host.getBaseMetaTileEntity() == null || !host.getBaseMetaTileEntity().isActive()) return 0; + if (host == null || host.getBaseMetaTileEntity() == null + || !host.getBaseMetaTileEntity() + .isActive()) + return 0; if (host.mStorage.compareTo(YottaFluidTank.MAX_INT_BIGINT) >= 0) { return Integer.MAX_VALUE; } else return host.mStorage.intValue(); @@ -236,7 +241,10 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl @Override public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { - if (host == null || host.getBaseMetaTileEntity() == null || !host.getBaseMetaTileEntity().isActive()) return 0; + if (host == null || host.getBaseMetaTileEntity() == null + || !host.getBaseMetaTileEntity() + .isActive()) + return 0; if (host.mLockedFluid != null && !host.mLockedFluid.isFluidEqual(resource)) return 0; if (host.mFluid == null || host.mFluid.isFluidEqual(resource)) { if (host.mFluid == null) { @@ -262,7 +270,10 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl } public long fill(@SuppressWarnings("unused") ForgeDirection from, IAEFluidStack resource, boolean doFill) { - if (host == null || host.getBaseMetaTileEntity() == null || !host.getBaseMetaTileEntity().isActive()) return 0; + if (host == null || host.getBaseMetaTileEntity() == null + || !host.getBaseMetaTileEntity() + .isActive()) + return 0; if (host.mLockedFluid != null && host.mLockedFluid.getFluid() != resource.getFluid()) return 0; if (host.mFluid == null || host.mFluid.getFluid() == resource.getFluid()) { if (host.mFluid == null) { @@ -289,7 +300,9 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl @Override public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { - if (host == null || host.getBaseMetaTileEntity() == null || !host.getBaseMetaTileEntity().isActive()) + if (host == null || host.getBaseMetaTileEntity() == null + || !host.getBaseMetaTileEntity() + .isActive()) return null; if (host.mFluid == null || host.mFluid.getFluid() != resource.getFluid()) return null; int ready; @@ -304,8 +317,10 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl } public IAEFluidStack drain(@SuppressWarnings("unused") ForgeDirection from, IAEFluidStack resource, - boolean doDrain) { - if (host == null || host.getBaseMetaTileEntity() == null || !host.getBaseMetaTileEntity().isActive()) + boolean doDrain) { + if (host == null || host.getBaseMetaTileEntity() == null + || !host.getBaseMetaTileEntity() + .isActive()) return null; if (host.mFluid == null || host.mFluid.getFluid() != resource.getFluid()) return null; long ready; @@ -323,7 +338,9 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl @Override public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { - if (host == null || host.getBaseMetaTileEntity() == null || !host.getBaseMetaTileEntity().isActive()) + if (host == null || host.getBaseMetaTileEntity() == null + || !host.getBaseMetaTileEntity() + .isActive()) return null; if (host.mFluid == null) return null; final FluidStack drainStack = host.mFluid.copy(); @@ -335,7 +352,9 @@ public class YOTTAHatch extends GT_MetaTileEntity_Hatch implements IGridProxyabl @Override public FluidTankInfo[] getTankInfo(ForgeDirection from) { - if (host == null || host.getBaseMetaTileEntity() == null || !host.getBaseMetaTileEntity().isActive()) + if (host == null || host.getBaseMetaTileEntity() == null + || !host.getBaseMetaTileEntity() + .isActive()) return EMPTY_TANK_INFO; return host.getTankInfo(from); diff --git a/src/main/java/goodgenerator/blocks/tileEntity/LargeEssentiaGenerator.java b/src/main/java/goodgenerator/blocks/tileEntity/LargeEssentiaGenerator.java index 545aaccfc5..b590378922 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/LargeEssentiaGenerator.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/LargeEssentiaGenerator.java @@ -52,7 +52,7 @@ import thaumcraft.api.aspects.AspectList; import thaumcraft.common.config.ConfigBlocks; public class LargeEssentiaGenerator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM - implements IConstructable, ISurvivalConstructable { + implements IConstructable, ISurvivalConstructable { private IStructureDefinition<LargeEssentiaGenerator> multiDefinition = null; protected int mStableValue = 0; @@ -85,9 +85,9 @@ public class LargeEssentiaGenerator extends GT_MetaTileEntity_TooltipMultiBlockB public boolean checkMachine_EM(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mStableValue = 0; return structureCheck_EM(mName, 4, 0, 4) && (mDynamoHatches.size() + eDynamoMulti.size()) == 1 - && checkHatchTier() - && checkNoLaser() - && updateEssentiaHatchState(); + && checkHatchTier() + && checkNoLaser() + && updateEssentiaHatchState(); } private boolean checkNoLaser() { @@ -137,18 +137,20 @@ public class LargeEssentiaGenerator extends GT_MetaTileEntity_TooltipMultiBlockB @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (this.getBaseMetaTileEntity().isServerSide()) { + if (this.getBaseMetaTileEntity() + .isServerSide()) { ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); - if (tCurrentItem != null - && tCurrentItem.getItem().equals(ItemRefer.Essentia_Upgrade_Empty.get(1).getItem())) { + if (tCurrentItem != null && tCurrentItem.getItem() + .equals( + ItemRefer.Essentia_Upgrade_Empty.get(1) + .getItem())) { int tMeta = tCurrentItem.getItemDamage(); if ((mUpgrade & (1 << tMeta)) == 0 && tMeta != 0) { tCurrentItem.stackSize--; mUpgrade = mUpgrade | (1 << tMeta); GT_Utility.sendChatToPlayer( - aPlayer, - tCurrentItem.getDisplayName() - + StatCollector.translateToLocal("largeessentiagenerator.chat")); + aPlayer, + tCurrentItem.getDisplayName() + StatCollector.translateToLocal("largeessentiagenerator.chat")); } updateEssentiaHatchState(); return true; @@ -162,47 +164,50 @@ public class LargeEssentiaGenerator extends GT_MetaTileEntity_TooltipMultiBlockB public IStructureDefinition<LargeEssentiaGenerator> getStructure_EM() { if (multiDefinition == null) { multiDefinition = StructureDefinition.<LargeEssentiaGenerator>builder() - .addShape( - mName, - transpose( - new String[][] { - { "A A", " ", " ", " ", " ~ ", - " ", " ", " ", "A A" }, - { "T C T", " CEC ", " CEEEC ", " CEEEEEC ", "CEEEEEEEC", - " CEEEEEC ", " CEEEC ", " CEC ", "T C T" }, - { "T TXT T", " TCXCT ", " TCCXCCT ", "TCCCXCCCT", "XXXXXXXXX", - "TCCCXCCCT", " TCCXCCT ", " TCXCT ", "T TXT T" } })) - .addElement('A', ofBlock(ConfigBlocks.blockCosmeticOpaque, 1)) - .addElement('T', ofBlock(ConfigBlocks.blockCosmeticSolid, 7)) - .addElement('C', ofBlock(Loaders.magicCasing, 0)) // - .addElement('E', ofChain(onElementPass(x -> { - ++x.mStableValue; - x.mTierLimit = Math.max(x.mTierLimit, 4); - }, ofBlock(Loaders.essentiaCell, 0)), onElementPass(x -> { - x.mStableValue += 2; - x.mTierLimit = Math.max(x.mTierLimit, 5); - }, ofBlock(Loaders.essentiaCell, 1)), onElementPass(x -> { - x.mStableValue += 5; - x.mTierLimit = Math.max(x.mTierLimit, 6); - }, ofBlock(Loaders.essentiaCell, 2)), onElementPass(x -> { - x.mStableValue += 10; - x.mTierLimit = Math.max(x.mTierLimit, 8); - }, - ofBlock(Loaders.essentiaCell, 3)))) - .addElement( - 'X', - ofChain( - buildHatchAdder(LargeEssentiaGenerator.class).atLeast( - HatchElement.DynamoMulti.or(GT_HatchElement.Dynamo), - GT_HatchElement.Maintenance, - GT_HatchElement.InputHatch).casingIndex(1536).dot(1).build(), - ofBlock(Loaders.magicCasing, 0), - ofSpecificTileAdder( - LargeEssentiaGenerator::addEssentiaHatch, - EssentiaHatch.class, - Loaders.magicCasing, - 0))) - .build(); + .addShape( + mName, + transpose( + new String[][] { + { "A A", " ", " ", " ", " ~ ", " ", " ", + " ", "A A" }, + { "T C T", " CEC ", " CEEEC ", " CEEEEEC ", "CEEEEEEEC", " CEEEEEC ", " CEEEC ", + " CEC ", "T C T" }, + { "T TXT T", " TCXCT ", " TCCXCCT ", "TCCCXCCCT", "XXXXXXXXX", "TCCCXCCCT", " TCCXCCT ", + " TCXCT ", "T TXT T" } })) + .addElement('A', ofBlock(ConfigBlocks.blockCosmeticOpaque, 1)) + .addElement('T', ofBlock(ConfigBlocks.blockCosmeticSolid, 7)) + .addElement('C', ofBlock(Loaders.magicCasing, 0)) // + .addElement('E', ofChain(onElementPass(x -> { + ++x.mStableValue; + x.mTierLimit = Math.max(x.mTierLimit, 4); + }, ofBlock(Loaders.essentiaCell, 0)), onElementPass(x -> { + x.mStableValue += 2; + x.mTierLimit = Math.max(x.mTierLimit, 5); + }, ofBlock(Loaders.essentiaCell, 1)), onElementPass(x -> { + x.mStableValue += 5; + x.mTierLimit = Math.max(x.mTierLimit, 6); + }, ofBlock(Loaders.essentiaCell, 2)), onElementPass(x -> { + x.mStableValue += 10; + x.mTierLimit = Math.max(x.mTierLimit, 8); + }, ofBlock(Loaders.essentiaCell, 3)))) + .addElement( + 'X', + ofChain( + buildHatchAdder(LargeEssentiaGenerator.class) + .atLeast( + HatchElement.DynamoMulti.or(GT_HatchElement.Dynamo), + GT_HatchElement.Maintenance, + GT_HatchElement.InputHatch) + .casingIndex(1536) + .dot(1) + .build(), + ofBlock(Loaders.magicCasing, 0), + ofSpecificTileAdder( + LargeEssentiaGenerator::addEssentiaHatch, + EssentiaHatch.class, + Loaders.magicCasing, + 0))) + .build(); } return multiDefinition; } @@ -459,28 +464,36 @@ public class LargeEssentiaGenerator extends GT_MetaTileEntity_TooltipMultiBlockB @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Essentia Generator").addInfo("Controller block for the Large Essentia Generator") - .addInfo("Maybe some Thaumaturges are upset by it. . .").addInfo("Transform Essentia into energy!") - .addInfo("The Diffusion Cell determines the highest hatch tier that the LEG can accept.") - .addInfo("Supports normal Dynamo Hatches or TecTech ones for up to 64A, but no Laser Hatches.") - .addInfo("You can find more information about this generator in the Thaumonomicon.") - .addInfo("The structure is too complex!").addInfo(BLUE_PRINT_INFO).addSeparator() - .addMaintenanceHatch("Hint block with dot 1", 1).addInputHatch("Hint block with dot 1", 1) - .addDynamoHatch("Hint block with dot 1", 1) - .addOtherStructurePart("Essentia Input Hatch", "Essentia Input", 1).toolTipFinisher("Good Generator"); + tt.addMachineType("Essentia Generator") + .addInfo("Controller block for the Large Essentia Generator") + .addInfo("Maybe some Thaumaturges are upset by it. . .") + .addInfo("Transform Essentia into energy!") + .addInfo("The Diffusion Cell determines the highest hatch tier that the LEG can accept.") + .addInfo("Supports normal Dynamo Hatches or TecTech ones for up to 64A, but no Laser Hatches.") + .addInfo("You can find more information about this generator in the Thaumonomicon.") + .addInfo("The structure is too complex!") + .addInfo(BLUE_PRINT_INFO) + .addSeparator() + .addMaintenanceHatch("Hint block with dot 1", 1) + .addInputHatch("Hint block with dot 1", 1) + .addDynamoHatch("Hint block with dot 1", 1) + .addOtherStructurePart("Essentia Input Hatch", "Essentia Input", 1) + .toolTipFinisher("Good Generator"); return tt; } @Override @SuppressWarnings("ALL") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean aActive, boolean aRedstone) { + int colorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(1536), - new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG), TextureFactory.builder() - .addIcon(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG_GLOW).glow().build() }; + new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG), TextureFactory.builder() + .addIcon(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG_GLOW) + .glow() + .build() }; return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(1536), - new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG) }; + new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG) }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(1536) }; } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/LargeEssentiaSmeltery.java b/src/main/java/goodgenerator/blocks/tileEntity/LargeEssentiaSmeltery.java index 023f43844a..039bd76c51 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/LargeEssentiaSmeltery.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/LargeEssentiaSmeltery.java @@ -50,16 +50,16 @@ import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.lib.crafting.ThaumcraftCraftingManager; public class LargeEssentiaSmeltery extends GT_MetaTileEntity_TooltipMultiBlockBase_EM - implements IConstructable, ISurvivalConstructable { + implements IConstructable, ISurvivalConstructable { private static final IIconContainer textureFontOn = new Textures.BlockIcons.CustomIcon( - "icons/LargeEssentiaSmeltery_On"); + "icons/LargeEssentiaSmeltery_On"); private static final IIconContainer textureFontOn_Glow = new Textures.BlockIcons.CustomIcon( - "icons/LargeEssentiaSmeltery_On_GLOW"); + "icons/LargeEssentiaSmeltery_On_GLOW"); private static final IIconContainer textureFontOff = new Textures.BlockIcons.CustomIcon( - "icons/LargeEssentiaSmeltery_Off"); + "icons/LargeEssentiaSmeltery_Off"); private static final IIconContainer textureFontOff_Glow = new Textures.BlockIcons.CustomIcon( - "icons/LargeEssentiaSmeltery_Off_GLOW"); + "icons/LargeEssentiaSmeltery_Off_GLOW"); private static final String STRUCTURE_PIECE_FIRST = "first"; private static final String STRUCTURE_PIECE_LATER = "later"; private static final String STRUCTURE_PIECE_LAST = "last"; @@ -130,8 +130,8 @@ public class LargeEssentiaSmeltery extends GT_MetaTileEntity_TooltipMultiBlockBa if (len > MAX_STRUCTURE_LENGTH - 1 || len < DEFAULT_STRUCTURE_LENGTH) return false; if (!structureCheck_EM(STRUCTURE_PIECE_LAST, 2, 2, -len - 1)) return false; if (this.mCasing >= 24 && this.mMaintenanceHatches.size() == 1 - && this.mInputBusses.size() >= 1 - && this.mEssentiaOutputHatches.size() >= 1) { + && this.mInputBusses.size() >= 1 + && this.mEssentiaOutputHatches.size() >= 1) { this.mParallel = Math.floor(this.mParallel += 1 << this.pTier); return true; } @@ -142,48 +142,44 @@ public class LargeEssentiaSmeltery extends GT_MetaTileEntity_TooltipMultiBlockBa public IStructureDefinition<? extends GT_MetaTileEntity_MultiblockBase_EM> getStructure_EM() { if (this.multiDefinition == null) { this.multiDefinition = StructureDefinition.<LargeEssentiaSmeltery>builder() - .addShape( - "first", - transpose( - new String[][] { { " A " }, { " AAA " }, { "AA~AA" }, { " AAA " }, { " A " } })) - .addShape( - "later", - transpose( - new String[][] { { " ABA " }, { "AECEA" }, { "D---D" }, { "AEFEA" }, { " AAA " } })) - .addShape( - "last", - transpose( - new String[][] { { " A " }, { " AAA " }, { "AAAAA" }, { " AAA " }, { " A " } })) - .addElement('C', ofBlock(Loaders.essentiaFilterCasing, 0)) - .addElement('D', ofBlock(ConfigBlocks.blockCosmeticOpaque, 2)) - .addElement( - 'F', - ThaumicBases.isModLoaded() - ? ofBlock(Block.getBlockFromName("thaumicbases:advAlchFurnace"), 0) - : ofBlock(ConfigBlocks.blockStoneDevice, 0)) - .addElement( - 'E', - ofChain( - onElementPass(x -> x.onEssentiaCellFound(0), ofBlock(Loaders.essentiaCell, 0)), - onElementPass(x -> x.onEssentiaCellFound(1), ofBlock(Loaders.essentiaCell, 1)), - onElementPass(x -> x.onEssentiaCellFound(2), ofBlock(Loaders.essentiaCell, 2)), - onElementPass(x -> x.onEssentiaCellFound(3), ofBlock(Loaders.essentiaCell, 3)))) - .addElement( - 'A', - ofChain( - buildHatchAdder(LargeEssentiaSmeltery.class).atLeast( - GT_HatchElement.Maintenance, - GT_HatchElement.Energy, - GT_HatchElement.InputBus).casingIndex(CASING_INDEX).dot(1).build(), - ofSpecificTileAdder( - LargeEssentiaSmeltery::addEssentiaOutputHatchToMachineList, - EssentiaOutputHatch.class, - Loaders.essentiaOutputHatch, - 0), - onElementPass( - LargeEssentiaSmeltery::onCasingFound, - ofBlock(Loaders.magicCasing, 0)))) - .addElement('B', GT_HatchElement.Muffler.newAny(CASING_INDEX, 2)).build(); + .addShape( + "first", + transpose(new String[][] { { " A " }, { " AAA " }, { "AA~AA" }, { " AAA " }, { " A " } })) + .addShape( + "later", + transpose(new String[][] { { " ABA " }, { "AECEA" }, { "D---D" }, { "AEFEA" }, { " AAA " } })) + .addShape( + "last", + transpose(new String[][] { { " A " }, { " AAA " }, { "AAAAA" }, { " AAA " }, { " A " } })) + .addElement('C', ofBlock(Loaders.essentiaFilterCasing, 0)) + .addElement('D', ofBlock(ConfigBlocks.blockCosmeticOpaque, 2)) + .addElement( + 'F', + ThaumicBases.isModLoaded() ? ofBlock(Block.getBlockFromName("thaumicbases:advAlchFurnace"), 0) + : ofBlock(ConfigBlocks.blockStoneDevice, 0)) + .addElement( + 'E', + ofChain( + onElementPass(x -> x.onEssentiaCellFound(0), ofBlock(Loaders.essentiaCell, 0)), + onElementPass(x -> x.onEssentiaCellFound(1), ofBlock(Loaders.essentiaCell, 1)), + onElementPass(x -> x.onEssentiaCellFound(2), ofBlock(Loaders.essentiaCell, 2)), + onElementPass(x -> x.onEssentiaCellFound(3), ofBlock(Loaders.essentiaCell, 3)))) + .addElement( + 'A', + ofChain( + buildHatchAdder(LargeEssentiaSmeltery.class) + .atLeast(GT_HatchElement.Maintenance, GT_HatchElement.Energy, GT_HatchElement.InputBus) + .casingIndex(CASING_INDEX) + .dot(1) + .build(), + ofSpecificTileAdder( + LargeEssentiaSmeltery::addEssentiaOutputHatchToMachineList, + EssentiaOutputHatch.class, + Loaders.essentiaOutputHatch, + 0), + onElementPass(LargeEssentiaSmeltery::onCasingFound, ofBlock(Loaders.magicCasing, 0)))) + .addElement('B', GT_HatchElement.Muffler.newAny(CASING_INDEX, 2)) + .build(); } return this.multiDefinition; } @@ -191,17 +187,26 @@ public class LargeEssentiaSmeltery extends GT_MetaTileEntity_TooltipMultiBlockBa @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Essentia Smeltery").addInfo("Controller block for the Large Essentia Smeltery") - .addInfo("Necessary evil.").addInfo("Advanced Essentia smelting technology.") - .addInfo("Max parallel dictated by structure size and Essentia Diffusion Cell tier") - .addInfo("Energy Hatch tier: HV+") - .addInfo("You can find more information about this machine in the Thaumonomicon.") - .addPollutionAmount(getPollutionPerSecond(null)).addInfo("The structure is too complex!") - .addInfo(BLUE_PRINT_INFO).addSeparator().addController("Front center").addCasingInfo("Magic Casing", 24) - .addMaintenanceHatch("Hint block with dot 1").addInputBus("Hint block with dot 1") - .addInputHatch("Hint block with dot 1").addEnergyHatch("Hint block with dot 1") - .addOtherStructurePart("Essentia Output Hatch", "Hint block with dot 1") - .addMufflerHatch("Hint block with dot 2").toolTipFinisher("Good Generator"); + tt.addMachineType("Essentia Smeltery") + .addInfo("Controller block for the Large Essentia Smeltery") + .addInfo("Necessary evil.") + .addInfo("Advanced Essentia smelting technology.") + .addInfo("Max parallel dictated by structure size and Essentia Diffusion Cell tier") + .addInfo("Energy Hatch tier: HV+") + .addInfo("You can find more information about this machine in the Thaumonomicon.") + .addPollutionAmount(getPollutionPerSecond(null)) + .addInfo("The structure is too complex!") + .addInfo(BLUE_PRINT_INFO) + .addSeparator() + .addController("Front center") + .addCasingInfo("Magic Casing", 24) + .addMaintenanceHatch("Hint block with dot 1") + .addInputBus("Hint block with dot 1") + .addInputHatch("Hint block with dot 1") + .addEnergyHatch("Hint block with dot 1") + .addOtherStructurePart("Essentia Output Hatch", "Hint block with dot 1") + .addMufflerHatch("Hint block with dot 2") + .toolTipFinisher("Good Generator"); return tt; } @@ -214,31 +219,35 @@ public class LargeEssentiaSmeltery extends GT_MetaTileEntity_TooltipMultiBlockBa public String[] getInfoData() { String[] info = super.getInfoData(); info[8] = "Node Power: " + EnumChatFormatting.RED - + this.nodePower - + EnumChatFormatting.RESET - + " Purification Efficiency: " - + EnumChatFormatting.AQUA - + this.nodePurificationEfficiency - + "%" - + EnumChatFormatting.RESET - + " Speed Up: " - + EnumChatFormatting.GRAY - + this.nodeIncrease - + "%" - + EnumChatFormatting.RESET; + + this.nodePower + + EnumChatFormatting.RESET + + " Purification Efficiency: " + + EnumChatFormatting.AQUA + + this.nodePurificationEfficiency + + "%" + + EnumChatFormatting.RESET + + " Speed Up: " + + EnumChatFormatting.GRAY + + this.nodeIncrease + + "%" + + EnumChatFormatting.RESET; return info; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean aActive, boolean aRedstone) { + int colorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.of(textureFontOn), - TextureFactory.builder().addIcon(textureFontOn_Glow).glow().build() }; + TextureFactory.of(textureFontOn), TextureFactory.builder() + .addIcon(textureFontOn_Glow) + .glow() + .build() }; else return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.of(textureFontOff), - TextureFactory.builder().addIcon(textureFontOff_Glow).glow().build() }; + TextureFactory.of(textureFontOff), TextureFactory.builder() + .addIcon(textureFontOff_Glow) + .glow() + .build() }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) }; } @@ -317,19 +326,23 @@ public class LargeEssentiaSmeltery extends GT_MetaTileEntity_TooltipMultiBlockBa this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; this.mEfficiencyIncrease = 10000; - final World WORLD = this.getBaseMetaTileEntity().getWorld(); - int x = this.getBaseMetaTileEntity().getXCoord(); - int y = this.getBaseMetaTileEntity().getYCoord(); - int z = this.getBaseMetaTileEntity().getZCoord(); + final World WORLD = this.getBaseMetaTileEntity() + .getWorld(); + int x = this.getBaseMetaTileEntity() + .getXCoord(); + int y = this.getBaseMetaTileEntity() + .getYCoord(); + int z = this.getBaseMetaTileEntity() + .getZCoord(); this.drainNodePower(WORLD, x, y, z); this.nodePower -= expectedPower(); calculatePerfectOverclockedNessMulti( - RECIPE_EUT, - (int) Math.ceil(this.mOutputAspects.visSize() * RECIPE_DURATION * (1 - this.nodeIncrease * 0.005)), - 1, - Math.min(Integer.MAX_VALUE, getMaxInputEnergy_EM())); + RECIPE_EUT, + (int) Math.ceil(this.mOutputAspects.visSize() * RECIPE_DURATION * (1 - this.nodeIncrease * 0.005)), + 1, + Math.min(Integer.MAX_VALUE, getMaxInputEnergy_EM())); this.updateSlots(); if (this.mEUt > 0) this.mEUt = -this.mEUt; @@ -431,19 +444,23 @@ public class LargeEssentiaSmeltery extends GT_MetaTileEntity_TooltipMultiBlockBa public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if (aTick % 5 == 0 && this.mMachine) { - final World WORLD = this.getBaseMetaTileEntity().getWorld(); - int x = this.getBaseMetaTileEntity().getXCoord(); - int y = this.getBaseMetaTileEntity().getYCoord(); - int z = this.getBaseMetaTileEntity().getZCoord(); + final World WORLD = this.getBaseMetaTileEntity() + .getWorld(); + int x = this.getBaseMetaTileEntity() + .getXCoord(); + int y = this.getBaseMetaTileEntity() + .getYCoord(); + int z = this.getBaseMetaTileEntity() + .getZCoord(); this.drainNodePower(WORLD, x, y, z); this.nodePurificationEfficiency = Math.max(0, this.nodePurificationEfficiency - 1); if (this.nodePurificationEfficiency < 100) { this.nodePurificationEfficiency = (int) Math.min( - 100, - this.nodePurificationEfficiency - + Math.ceil(VisNetHandler.drainVis(WORLD, x, y, z, Aspect.ORDER, 200) * 0.05)); + 100, + this.nodePurificationEfficiency + + Math.ceil(VisNetHandler.drainVis(WORLD, x, y, z, Aspect.ORDER, 200) * 0.05)); } this.nodeIncrease = Math.min(100, VisNetHandler.drainVis(WORLD, x, y, z, Aspect.ENTROPY, 125)); @@ -455,14 +472,19 @@ public class LargeEssentiaSmeltery extends GT_MetaTileEntity_TooltipMultiBlockBa this.nodePurificationEfficiency = Math.max(0, this.nodePurificationEfficiency - 1); if (xstr.nextInt(20) == 0) { if (xstr.nextInt(100) < Math.max(100 - this.nodePurificationEfficiency, 0)) { - final World WORLD = this.getBaseMetaTileEntity().getWorld(); + final World WORLD = this.getBaseMetaTileEntity() + .getWorld(); GT_MetaTileEntity_Hatch_Muffler mufflerHatch = this.mMufflerHatches - .get(xstr.nextInt(this.mMufflerHatches.size())); - int x = mufflerHatch.getBaseMetaTileEntity().getXCoord(); - int y = mufflerHatch.getBaseMetaTileEntity().getYCoord(); - int z = mufflerHatch.getBaseMetaTileEntity().getZCoord(); - - ForgeDirection facing = mufflerHatch.getBaseMetaTileEntity().getFrontFacing(); + .get(xstr.nextInt(this.mMufflerHatches.size())); + int x = mufflerHatch.getBaseMetaTileEntity() + .getXCoord(); + int y = mufflerHatch.getBaseMetaTileEntity() + .getYCoord(); + int z = mufflerHatch.getBaseMetaTileEntity() + .getZCoord(); + + ForgeDirection facing = mufflerHatch.getBaseMetaTileEntity() + .getFrontFacing(); switch (facing) { case SOUTH: z += 1; diff --git a/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer1.java b/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer1.java index 9dd9d9ee5b..cad1cb001c 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer1.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer1.java @@ -25,8 +25,15 @@ import gregtech.api.util.GT_Utility; public class LargeFusionComputer1 extends LargeFusionComputer { private static final ITexture textureOverlay = TextureFactory.of( - TextureFactory.builder().addIcon(OVERLAY_FUSION1).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FUSION1_GLOW).extFacing().glow().build()); + TextureFactory.builder() + .addIcon(OVERLAY_FUSION1) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FUSION1_GLOW) + .extFacing() + .glow() + .build()); public LargeFusionComputer1(int id, String name, String nameRegional) { super(id, name, nameRegional); @@ -39,44 +46,50 @@ public class LargeFusionComputer1 extends LargeFusionComputer { @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Fusion Reactor").addInfo("Millions of nuclear.") - .addInfo("Controller block for the Compact Fusion Reactor MK-I Prototype.") - .addInfo( - EnumChatFormatting.AQUA + GT_Utility.formatNumbers(getSingleHatchPower()) - + EnumChatFormatting.GRAY - + " EU/t and " - + EnumChatFormatting.AQUA - + GT_Utility.formatNumbers(capableStartupCanonical() / 32 / M) - + "M" - + EnumChatFormatting.GRAY - + " EU capacity per Energy Hatch") - .addInfo("If the recipe has a startup cost greater than the") - .addInfo("number of energy hatches * cap, you can't do it") - .addInfo( - "If the recipe requires a voltage tier over " - + GT_Utility.getColoredTierNameFromTier((byte) tier()) - + EnumChatFormatting.GRAY - + " , you can't do it either") - .addInfo("Make sure the whole structure is built in the 3x3") - .addInfo("chunk area of the ring center (not controller).").addInfo("It can run 64x recipes at most.") - .addInfo( - "Support" + EnumChatFormatting.BLUE - + " Tec" - + EnumChatFormatting.DARK_BLUE - + "Tech" - + EnumChatFormatting.GRAY - + " Energy/Laser Hatches!") - .addInfo("The structure is too complex!").addInfo(BLUE_PRINT_INFO).addSeparator() - .addCasingInfo("LuV Machine Casing", 1664).addCasingInfo("Ameliorated Superconduct Coil", 560) - .addCasingInfo("Naquadah Alloy Frame Boxes", 128) - .addCasingInfo("Rhodium-Plated Palladium Reinforced Borosilicate Glass Block", 63) - .addEnergyHatch("1-32, Hint block with dot 2", 2).addInputHatch("1-16, Hint block with dot 1", 1) - .addOutputHatch("1-16, Hint block with dot 1", 1).addStructureInfo("Supports Crafting Input Buffer") - .addStructureInfo( - "ALL Hatches must be " + GT_Utility.getColoredTierNameFromTier((byte) hatchTier()) - + EnumChatFormatting.GRAY - + " or better") - .toolTipFinisher("Good Generator"); + tt.addMachineType("Fusion Reactor") + .addInfo("Millions of nuclear.") + .addInfo("Controller block for the Compact Fusion Reactor MK-I Prototype.") + .addInfo( + EnumChatFormatting.AQUA + GT_Utility.formatNumbers(getSingleHatchPower()) + + EnumChatFormatting.GRAY + + " EU/t and " + + EnumChatFormatting.AQUA + + GT_Utility.formatNumbers(capableStartupCanonical() / 32 / M) + + "M" + + EnumChatFormatting.GRAY + + " EU capacity per Energy Hatch") + .addInfo("If the recipe has a startup cost greater than the") + .addInfo("number of energy hatches * cap, you can't do it") + .addInfo( + "If the recipe requires a voltage tier over " + GT_Utility.getColoredTierNameFromTier((byte) tier()) + + EnumChatFormatting.GRAY + + " , you can't do it either") + .addInfo("Make sure the whole structure is built in the 3x3") + .addInfo("chunk area of the ring center (not controller).") + .addInfo("It can run 64x recipes at most.") + .addInfo( + "Support" + EnumChatFormatting.BLUE + + " Tec" + + EnumChatFormatting.DARK_BLUE + + "Tech" + + EnumChatFormatting.GRAY + + " Energy/Laser Hatches!") + .addInfo("The structure is too complex!") + .addInfo(BLUE_PRINT_INFO) + .addSeparator() + .addCasingInfo("LuV Machine Casing", 1664) + .addCasingInfo("Ameliorated Superconduct Coil", 560) + .addCasingInfo("Naquadah Alloy Frame Boxes", 128) + .addCasingInfo("Rhodium-Plated Palladium Reinforced Borosilicate Glass Block", 63) + .addEnergyHatch("1-32, Hint block with dot 2", 2) + .addInputHatch("1-16, Hint block with dot 1", 1) + .addOutputHatch("1-16, Hint block with dot 1", 1) + .addStructureInfo("Supports Crafting Input Buffer") + .addStructureInfo( + "ALL Hatches must be " + GT_Utility.getColoredTierNameFromTier((byte) hatchTier()) + + EnumChatFormatting.GRAY + + " or better") + .toolTipFinisher("Good Generator"); return tt; } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer2.java b/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer2.java index 28b1acdcb6..7a72e7842f 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer2.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer2.java @@ -25,8 +25,15 @@ import gregtech.api.util.GT_Utility; public class LargeFusionComputer2 extends LargeFusionComputer { private static final ITexture textureOverlay = TextureFactory.of( - TextureFactory.builder().addIcon(OVERLAY_FUSION2).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FUSION2_GLOW).extFacing().glow().build()); + TextureFactory.builder() + .addIcon(OVERLAY_FUSION2) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FUSION2_GLOW) + .extFacing() + .glow() + .build()); public LargeFusionComputer2(int id, String name, String nameRegional) { super(id, name, nameRegional); @@ -39,45 +46,51 @@ public class LargeFusionComputer2 extends LargeFusionComputer { @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Fusion Reactor").addInfo("Millions of nuclear.") - .addInfo("Controller block for the Compact Fusion Reactor MK-II.") - .addInfo( - EnumChatFormatting.AQUA + GT_Utility.formatNumbers(getSingleHatchPower()) - + EnumChatFormatting.GRAY - + " EU/t and " - + EnumChatFormatting.AQUA - + GT_Utility.formatNumbers(capableStartupCanonical() / 32 / M) - + "M" - + EnumChatFormatting.GRAY - + " EU capacity per Energy Hatch") - .addInfo("If the recipe has a startup cost greater than the") - .addInfo("number of energy hatches * cap, you can't do it") - .addInfo( - "If the recipe requires a voltage tier over " - + GT_Utility.getColoredTierNameFromTier((byte) tier()) - + EnumChatFormatting.GRAY - + " , you can't do it either") - .addInfo("Make sure the whole structure is built in the 3x3") - .addInfo("chunk area of the ring center (not controller).") - .addInfo("Startup < 160,000,000 EU: 128x Parallel").addInfo("Startup >= 160,000,000 EU: 64x Parallel") - .addInfo( - "Support" + EnumChatFormatting.BLUE - + " Tec" - + EnumChatFormatting.DARK_BLUE - + "Tech" - + EnumChatFormatting.GRAY - + " Energy/Laser Hatches!") - .addInfo("The structure is too complex!").addInfo(BLUE_PRINT_INFO).addSeparator() - .addCasingInfo("Fusion Machine Casing", 1664).addCasingInfo("Compact Fusion Coil", 560) - .addCasingInfo("Duranium Frame Box", 128) - .addCasingInfo("Iridium Reinforced Borosilicate Glass Block", 63) - .addEnergyHatch("1-32, Hint block with dot 2", 2).addInputHatch("1-16, Hint block with dot 1", 1) - .addOutputHatch("1-16, Hint block with dot 1", 1).addStructureInfo("Supports Crafting Input Buffer") - .addStructureInfo( - "ALL Hatches must be " + GT_Utility.getColoredTierNameFromTier((byte) hatchTier()) - + EnumChatFormatting.GRAY - + " or better") - .toolTipFinisher("Good Generator"); + tt.addMachineType("Fusion Reactor") + .addInfo("Millions of nuclear.") + .addInfo("Controller block for the Compact Fusion Reactor MK-II.") + .addInfo( + EnumChatFormatting.AQUA + GT_Utility.formatNumbers(getSingleHatchPower()) + + EnumChatFormatting.GRAY + + " EU/t and " + + EnumChatFormatting.AQUA + + GT_Utility.formatNumbers(capableStartupCanonical() / 32 / M) + + "M" + + EnumChatFormatting.GRAY + + " EU capacity per Energy Hatch") + .addInfo("If the recipe has a startup cost greater than the") + .addInfo("number of energy hatches * cap, you can't do it") + .addInfo( + "If the recipe requires a voltage tier over " + GT_Utility.getColoredTierNameFromTier((byte) tier()) + + EnumChatFormatting.GRAY + + " , you can't do it either") + .addInfo("Make sure the whole structure is built in the 3x3") + .addInfo("chunk area of the ring center (not controller).") + .addInfo("Startup < 160,000,000 EU: 128x Parallel") + .addInfo("Startup >= 160,000,000 EU: 64x Parallel") + .addInfo( + "Support" + EnumChatFormatting.BLUE + + " Tec" + + EnumChatFormatting.DARK_BLUE + + "Tech" + + EnumChatFormatting.GRAY + + " Energy/Laser Hatches!") + .addInfo("The structure is too complex!") + .addInfo(BLUE_PRINT_INFO) + .addSeparator() + .addCasingInfo("Fusion Machine Casing", 1664) + .addCasingInfo("Compact Fusion Coil", 560) + .addCasingInfo("Duranium Frame Box", 128) + .addCasingInfo("Iridium Reinforced Borosilicate Glass Block", 63) + .addEnergyHatch("1-32, Hint block with dot 2", 2) + .addInputHatch("1-16, Hint block with dot 1", 1) + .addOutputHatch("1-16, Hint block with dot 1", 1) + .addStructureInfo("Supports Crafting Input Buffer") + .addStructureInfo( + "ALL Hatches must be " + GT_Utility.getColoredTierNameFromTier((byte) hatchTier()) + + EnumChatFormatting.GRAY + + " or better") + .toolTipFinisher("Good Generator"); return tt; } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer3.java b/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer3.java index bc7253c3d9..4a4f9832d0 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer3.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer3.java @@ -25,8 +25,15 @@ import gregtech.api.util.GT_Utility; public class LargeFusionComputer3 extends LargeFusionComputer { private static final ITexture textureOverlay = TextureFactory.of( - TextureFactory.builder().addIcon(OVERLAY_FUSION3).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FUSION3_GLOW).extFacing().glow().build()); + TextureFactory.builder() + .addIcon(OVERLAY_FUSION3) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FUSION3_GLOW) + .extFacing() + .glow() + .build()); public LargeFusionComputer3(int id, String name, String nameRegional) { super(id, name, nameRegional); @@ -39,46 +46,52 @@ public class LargeFusionComputer3 extends LargeFusionComputer { @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Fusion Reactor").addInfo("Millions of nuclear.") - .addInfo("Controller block for the Compact Fusion Reactor MK-III.") - .addInfo( - EnumChatFormatting.AQUA + GT_Utility.formatNumbers(getSingleHatchPower()) - + EnumChatFormatting.GRAY - + " EU/t and " - + EnumChatFormatting.AQUA - + GT_Utility.formatNumbers(capableStartupCanonical() / 32 / M) - + "M" - + EnumChatFormatting.GRAY - + " EU capacity per Energy Hatch") - .addInfo("If the recipe has a startup cost greater than the") - .addInfo("number of energy hatches * cap, you can't do it") - .addInfo( - "If the recipe requires a voltage tier over " - + GT_Utility.getColoredTierNameFromTier((byte) tier()) - + EnumChatFormatting.GRAY - + " , you can't do it either") - .addInfo("Make sure the whole structure is built in the 3x3") - .addInfo("chunk area of the ring center (not controller).") - .addInfo("Startup < 160,000,000 EU: 192x Parallel").addInfo("Startup < 320,000,000 EU: 128x Parallel") - .addInfo("Startup >= 320,000,000 EU: 64x Parallel") - .addInfo( - "Support" + EnumChatFormatting.BLUE - + " Tec" - + EnumChatFormatting.DARK_BLUE - + "Tech" - + EnumChatFormatting.GRAY - + " Energy/Laser Hatches!") - .addInfo("The structure is too complex!").addInfo(BLUE_PRINT_INFO).addSeparator() - .addCasingInfo("Fusion Machine Casing MK II", 1664).addCasingInfo("Advanced Compact Fusion Coil", 560) - .addCasingInfo("Neutronium Frame Box", 128) - .addCasingInfo("Osmium Reinforced Borosilicate Glass Block", 63) - .addEnergyHatch("1-32, Hint block with dot 2", 2).addInputHatch("1-16, Hint block with dot 1", 1) - .addOutputHatch("1-16, Hint block with dot 1", 1).addStructureInfo("Supports Crafting Input Buffer") - .addStructureInfo( - "ALL Hatches must be " + GT_Utility.getColoredTierNameFromTier((byte) hatchTier()) - + EnumChatFormatting.GRAY - + " or better") - .toolTipFinisher("Good Generator"); + tt.addMachineType("Fusion Reactor") + .addInfo("Millions of nuclear.") + .addInfo("Controller block for the Compact Fusion Reactor MK-III.") + .addInfo( + EnumChatFormatting.AQUA + GT_Utility.formatNumbers(getSingleHatchPower()) + + EnumChatFormatting.GRAY + + " EU/t and " + + EnumChatFormatting.AQUA + + GT_Utility.formatNumbers(capableStartupCanonical() / 32 / M) + + "M" + + EnumChatFormatting.GRAY + + " EU capacity per Energy Hatch") + .addInfo("If the recipe has a startup cost greater than the") + .addInfo("number of energy hatches * cap, you can't do it") + .addInfo( + "If the recipe requires a voltage tier over " + GT_Utility.getColoredTierNameFromTier((byte) tier()) + + EnumChatFormatting.GRAY + + " , you can't do it either") + .addInfo("Make sure the whole structure is built in the 3x3") + .addInfo("chunk area of the ring center (not controller).") + .addInfo("Startup < 160,000,000 EU: 192x Parallel") + .addInfo("Startup < 320,000,000 EU: 128x Parallel") + .addInfo("Startup >= 320,000,000 EU: 64x Parallel") + .addInfo( + "Support" + EnumChatFormatting.BLUE + + " Tec" + + EnumChatFormatting.DARK_BLUE + + "Tech" + + EnumChatFormatting.GRAY + + " Energy/Laser Hatches!") + .addInfo("The structure is too complex!") + .addInfo(BLUE_PRINT_INFO) + .addSeparator() + .addCasingInfo("Fusion Machine Casing MK II", 1664) + .addCasingInfo("Advanced Compact Fusion Coil", 560) + .addCasingInfo("Neutronium Frame Box", 128) + .addCasingInfo("Osmium Reinforced Borosilicate Glass Block", 63) + .addEnergyHatch("1-32, Hint block with dot 2", 2) + .addInputHatch("1-16, Hint block with dot 1", 1) + .addOutputHatch("1-16, Hint block with dot 1", 1) + .addStructureInfo("Supports Crafting Input Buffer") + .addStructureInfo( + "ALL Hatches must be " + GT_Utility.getColoredTierNameFromTier((byte) hatchTier()) + + EnumChatFormatting.GRAY + + " or better") + .toolTipFinisher("Good Generator"); return tt; } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer4.java b/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer4.java index 793042f4ec..96a9662475 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer4.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer4.java @@ -43,47 +43,54 @@ public class LargeFusionComputer4 extends LargeFusionComputerPP { @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Fusion Reactor").addInfo("Galaxy Collapse.") - .addInfo("Controller block for the Compact Fusion Reactor MK-IV Prototype.") - .addInfo( - EnumChatFormatting.AQUA + GT_Utility.formatNumbers(getSingleHatchPower()) - + EnumChatFormatting.GRAY - + " EU/t and " - + EnumChatFormatting.AQUA - + GT_Utility.formatNumbers(capableStartupCanonical() / 32 / M) - + "M" - + EnumChatFormatting.GRAY - + " EU capacity per Energy Hatch") - .addInfo("If the recipe has a startup cost greater than the") - .addInfo("number of energy hatches * cap, you can't do it") - .addInfo( - "If the recipe requires a voltage tier over " - + GT_Utility.getColoredTierNameFromTier((byte) tier()) - + EnumChatFormatting.GRAY - + " , you can't do it either") - .addInfo("Make sure the whole structure is built in the 3x3") - .addInfo("chunk area of the ring center (not controller).").addInfo("Performs 4/4 overclock.") - .addInfo("Startup < 160,000,000 EU: 256x Parallel").addInfo("Startup < 320,000,000 EU: 192x Parallel") - .addInfo("Startup < 640,000,000 EU: 128x Parallel").addInfo("Startup >= 640,000,000 EU: 64x Parallel") - .addInfo( - "Support" + EnumChatFormatting.BLUE - + " Tec" - + EnumChatFormatting.DARK_BLUE - + "Tech" - + EnumChatFormatting.GRAY - + " Energy/Laser Hatches!") - .addInfo("The structure is too complex!").addInfo(BLUE_PRINT_INFO).addSeparator() - .addCasingInfo("Fusion Machine Casing MK III", 1664) - .addCasingInfo("Compact Fusion Coil MK-II Prototype", 560) - .addCasingInfo("Infinity Catalyst Frame Box", 128) - .addCasingInfo("Neutronium Reinforced Borosilicate Glass Block", 63) - .addEnergyHatch("1-32, Hint block with dot 2", 2).addInputHatch("1-16, Hint block with dot 1", 1) - .addOutputHatch("1-16, Hint block with dot 1", 1).addStructureInfo("Supports Crafting Input Buffer") - .addStructureInfo( - "ALL Hatches must be " + GT_Utility.getColoredTierNameFromTier((byte) hatchTier()) - + EnumChatFormatting.GRAY - + " or better") - .toolTipFinisher("Good Generator"); + tt.addMachineType("Fusion Reactor") + .addInfo("Galaxy Collapse.") + .addInfo("Controller block for the Compact Fusion Reactor MK-IV Prototype.") + .addInfo( + EnumChatFormatting.AQUA + GT_Utility.formatNumbers(getSingleHatchPower()) + + EnumChatFormatting.GRAY + + " EU/t and " + + EnumChatFormatting.AQUA + + GT_Utility.formatNumbers(capableStartupCanonical() / 32 / M) + + "M" + + EnumChatFormatting.GRAY + + " EU capacity per Energy Hatch") + .addInfo("If the recipe has a startup cost greater than the") + .addInfo("number of energy hatches * cap, you can't do it") + .addInfo( + "If the recipe requires a voltage tier over " + GT_Utility.getColoredTierNameFromTier((byte) tier()) + + EnumChatFormatting.GRAY + + " , you can't do it either") + .addInfo("Make sure the whole structure is built in the 3x3") + .addInfo("chunk area of the ring center (not controller).") + .addInfo("Performs 4/4 overclock.") + .addInfo("Startup < 160,000,000 EU: 256x Parallel") + .addInfo("Startup < 320,000,000 EU: 192x Parallel") + .addInfo("Startup < 640,000,000 EU: 128x Parallel") + .addInfo("Startup >= 640,000,000 EU: 64x Parallel") + .addInfo( + "Support" + EnumChatFormatting.BLUE + + " Tec" + + EnumChatFormatting.DARK_BLUE + + "Tech" + + EnumChatFormatting.GRAY + + " Energy/Laser Hatches!") + .addInfo("The structure is too complex!") + .addInfo(BLUE_PRINT_INFO) + .addSeparator() + .addCasingInfo("Fusion Machine Casing MK III", 1664) + .addCasingInfo("Compact Fusion Coil MK-II Prototype", 560) + .addCasingInfo("Infinity Catalyst Frame Box", 128) + .addCasingInfo("Neutronium Reinforced Borosilicate Glass Block", 63) + .addEnergyHatch("1-32, Hint block with dot 2", 2) + .addInputHatch("1-16, Hint block with dot 1", 1) + .addOutputHatch("1-16, Hint block with dot 1", 1) + .addStructureInfo("Supports Crafting Input Buffer") + .addStructureInfo( + "ALL Hatches must be " + GT_Utility.getColoredTierNameFromTier((byte) hatchTier()) + + EnumChatFormatting.GRAY + + " or better") + .toolTipFinisher("Good Generator"); return tt; } @@ -139,10 +146,16 @@ public class LargeFusionComputer4 extends LargeFusionComputerPP { @Override public ITexture getTextureOverlay() { - if (this.mMaxProgresstime > 0) return TextureFactory - .of(TextureFactory.builder().addIcon(TexturesGtBlock.Casing_Machine_Screen_3).extFacing().build()); - else return TextureFactory - .of(TextureFactory.builder().addIcon(TexturesGtBlock.Casing_Machine_Screen_1).extFacing().build()); + if (this.mMaxProgresstime > 0) return TextureFactory.of( + TextureFactory.builder() + .addIcon(TexturesGtBlock.Casing_Machine_Screen_3) + .extFacing() + .build()); + else return TextureFactory.of( + TextureFactory.builder() + .addIcon(TexturesGtBlock.Casing_Machine_Screen_1) + .extFacing() + .build()); } @Override @@ -195,13 +208,16 @@ public class LargeFusionComputer4 extends LargeFusionComputerPP { @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean aActive, boolean aRedstone) { - if (side == facing) - return new ITexture[] { TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS).extFacing().build(), - getTextureOverlay() }; + int colorIndex, boolean aActive, boolean aRedstone) { + if (side == facing) return new ITexture[] { TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS) + .extFacing() + .build(), getTextureOverlay() }; if (!aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(52) }; - return new ITexture[] { TextureFactory.builder().addIcon(TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_ULTRA) - .extFacing().build() }; + return new ITexture[] { TextureFactory.builder() + .addIcon(TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_ULTRA) + .extFacing() + .build() }; } @Override diff --git a/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer5.java b/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer5.java index 99e5afeba3..aa4766a01a 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer5.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/LargeFusionComputer5.java @@ -43,47 +43,55 @@ public class LargeFusionComputer5 extends LargeFusionComputerPP { @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Fusion Reactor").addInfo("Galaxy Collapse.") - .addInfo("Controller block for the Compact Fusion Reactor MK-V.") - .addInfo( - EnumChatFormatting.AQUA + GT_Utility.formatNumbers(getSingleHatchPower()) - + EnumChatFormatting.GRAY - + " EU/t and " - + EnumChatFormatting.AQUA - + GT_Utility.formatNumbers(capableStartupCanonical() / 32 / M) - + "M" - + EnumChatFormatting.GRAY - + " EU capacity per Energy Hatch") - .addInfo("If the recipe has a startup cost greater than the") - .addInfo("number of energy hatches * cap, you can't do it") - .addInfo( - "If the recipe requires a voltage tier over " - + GT_Utility.getColoredTierNameFromTier((byte) tier()) - + EnumChatFormatting.GRAY - + " , you can't do it either") - .addInfo("Make sure the whole structure is built in the 3x3") - .addInfo("chunk area of the ring center (not controller).").addInfo("Performs 4/4 overclock.") - .addInfo("Startup < 160,000,000 EU: 320x Parallel").addInfo("Startup < 320,000,000 EU: 256x Parallel") - .addInfo("Startup < 640,000,000 EU: 192x Parallel").addInfo("Startup < 1,200,000,000 EU: 128x Parallel") - .addInfo("Startup >= 1,200,000,000 EU: 64x Parallel") - .addInfo( - "Support" + EnumChatFormatting.BLUE - + " Tec" - + EnumChatFormatting.DARK_BLUE - + "Tech" - + EnumChatFormatting.GRAY - + " Energy/Laser Hatches!") - .addInfo("The structure is too complex!").addInfo(BLUE_PRINT_INFO).addSeparator() - .addCasingInfo("Fusion Machine Casing MK IV", 1664) - .addCasingInfo("Compact Fusion Coil MK-II Finaltype", 560).addCasingInfo("Infinity Frame Box", 128) - .addCasingInfo("Cosmic Neutronium Reinforced Borosilicate Glass Block", 63) - .addEnergyHatch("1-32, Hint block with dot 2", 2).addInputHatch("1-16, Hint block with dot 1", 1) - .addOutputHatch("1-16, Hint block with dot 1", 1).addStructureInfo("Supports Crafting Input Buffer") - .addStructureInfo( - "ALL Hatches must be " + GT_Utility.getColoredTierNameFromTier((byte) hatchTier()) - + EnumChatFormatting.GRAY - + " or better") - .toolTipFinisher("Good Generator"); + tt.addMachineType("Fusion Reactor") + .addInfo("Galaxy Collapse.") + .addInfo("Controller block for the Compact Fusion Reactor MK-V.") + .addInfo( + EnumChatFormatting.AQUA + GT_Utility.formatNumbers(getSingleHatchPower()) + + EnumChatFormatting.GRAY + + " EU/t and " + + EnumChatFormatting.AQUA + + GT_Utility.formatNumbers(capableStartupCanonical() / 32 / M) + + "M" + + EnumChatFormatting.GRAY + + " EU capacity per Energy Hatch") + .addInfo("If the recipe has a startup cost greater than the") + .addInfo("number of energy hatches * cap, you can't do it") + .addInfo( + "If the recipe requires a voltage tier over " + GT_Utility.getColoredTierNameFromTier((byte) tier()) + + EnumChatFormatting.GRAY + + " , you can't do it either") + .addInfo("Make sure the whole structure is built in the 3x3") + .addInfo("chunk area of the ring center (not controller).") + .addInfo("Performs 4/4 overclock.") + .addInfo("Startup < 160,000,000 EU: 320x Parallel") + .addInfo("Startup < 320,000,000 EU: 256x Parallel") + .addInfo("Startup < 640,000,000 EU: 192x Parallel") + .addInfo("Startup < 1,200,000,000 EU: 128x Parallel") + .addInfo("Startup >= 1,200,000,000 EU: 64x Parallel") + .addInfo( + "Support" + EnumChatFormatting.BLUE + + " Tec" + + EnumChatFormatting.DARK_BLUE + + "Tech" + + EnumChatFormatting.GRAY + + " Energy/Laser Hatches!") + .addInfo("The structure is too complex!") + .addInfo(BLUE_PRINT_INFO) + .addSeparator() + .addCasingInfo("Fusion Machine Casing MK IV", 1664) + .addCasingInfo("Compact Fusion Coil MK-II Finaltype", 560) + .addCasingInfo("Infinity Frame Box", 128) + .addCasingInfo("Cosmic Neutronium Reinforced Borosilicate Glass Block", 63) + .addEnergyHatch("1-32, Hint block with dot 2", 2) + .addInputHatch("1-16, Hint block with dot 1", 1) + .addOutputHatch("1-16, Hint block with dot 1", 1) + .addStructureInfo("Supports Crafting Input Buffer") + .addStructureInfo( + "ALL Hatches must be " + GT_Utility.getColoredTierNameFromTier((byte) hatchTier()) + + EnumChatFormatting.GRAY + + " or better") + .toolTipFinisher("Good Generator"); return tt; } @@ -139,10 +147,18 @@ public class LargeFusionComputer5 extends LargeFusionComputerPP { @Override public ITexture getTextureOverlay() { - if (this.getBaseMetaTileEntity().isActive()) return TextureFactory.of( - TextureFactory.builder().addIcon(TexturesGtBlock.Casing_Machine_Screen_Rainbow).extFacing().build()); - else return TextureFactory - .of(TextureFactory.builder().addIcon(TexturesGtBlock.Casing_Machine_Screen_1).extFacing().build()); + if (this.getBaseMetaTileEntity() + .isActive()) + return TextureFactory.of( + TextureFactory.builder() + .addIcon(TexturesGtBlock.Casing_Machine_Screen_Rainbow) + .extFacing() + .build()); + else return TextureFactory.of( + TextureFactory.builder() + .addIcon(TexturesGtBlock.Casing_Machine_Screen_1) + .extFacing() + .build()); } @Override @@ -196,13 +212,16 @@ public class LargeFusionComputer5 extends LargeFusionComputerPP { @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean aActive, boolean aRedstone) { - if (side == facing) - return new ITexture[] { TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS).extFacing().build(), - getTextureOverlay() }; + int colorIndex, boolean aActive, boolean aRedstone) { + if (side == facing) return new ITexture[] { TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS) + .extFacing() + .build(), getTextureOverlay() }; if (!aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(52) }; - return new ITexture[] { TextureFactory.builder().addIcon(TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_HYPER) - .extFacing().build() }; + return new ITexture[] { TextureFactory.builder() + .addIcon(TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_HYPER) + .extFacing() + .build() }; } @Override diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MultiNqGenerator.java b/src/main/java/goodgenerator/blocks/tileEntity/MultiNqGenerator.java index a5b0f731b9..cd53c48974 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MultiNqGenerator.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MultiNqGenerator.java @@ -55,7 +55,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; public class MultiNqGenerator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM - implements IConstructable, ISurvivalConstructable { + implements IConstructable, ISurvivalConstructable { protected IStructureDefinition<MultiNqGenerator> multiDefinition = null; protected long leftEnergy = 0; @@ -71,16 +71,16 @@ public class MultiNqGenerator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM static { excitedLiquid = Arrays.asList( - new Pair<>(MaterialsUEVplus.Space.getMolten(20L), ExcitedLiquidCoe[0]), - new Pair<>(MyMaterial.atomicSeparationCatalyst.getMolten(20), ExcitedLiquidCoe[1]), - new Pair<>(Materials.Naquadah.getMolten(20L), ExcitedLiquidCoe[2]), - new Pair<>(Materials.Uranium235.getMolten(180L), ExcitedLiquidCoe[3]), - new Pair<>(Materials.Caesium.getMolten(180L), ExcitedLiquidCoe[4])); + new Pair<>(MaterialsUEVplus.Space.getMolten(20L), ExcitedLiquidCoe[0]), + new Pair<>(MyMaterial.atomicSeparationCatalyst.getMolten(20), ExcitedLiquidCoe[1]), + new Pair<>(Materials.Naquadah.getMolten(20L), ExcitedLiquidCoe[2]), + new Pair<>(Materials.Uranium235.getMolten(180L), ExcitedLiquidCoe[3]), + new Pair<>(Materials.Caesium.getMolten(180L), ExcitedLiquidCoe[4])); coolant = Arrays.asList( - new Pair<>(MaterialsUEVplus.Time.getMolten(20L), CoolantEfficiency[0]), - new Pair<>(FluidRegistry.getFluidStack("cryotheum", 1000), CoolantEfficiency[1]), - new Pair<>(Materials.SuperCoolant.getFluid(1000L), CoolantEfficiency[2]), - new Pair<>(FluidRegistry.getFluidStack("ic2coolant", 1000), CoolantEfficiency[3])); + new Pair<>(MaterialsUEVplus.Time.getMolten(20L), CoolantEfficiency[0]), + new Pair<>(FluidRegistry.getFluidStack("cryotheum", 1000), CoolantEfficiency[1]), + new Pair<>(Materials.SuperCoolant.getFluid(1000L), CoolantEfficiency[2]), + new Pair<>(FluidRegistry.getFluidStack("ic2coolant", 1000), CoolantEfficiency[3])); } @Override @@ -124,32 +124,37 @@ public class MultiNqGenerator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM @Override public IStructureDefinition<MultiNqGenerator> getStructure_EM() { if (multiDefinition == null) { - multiDefinition = StructureDefinition.<MultiNqGenerator>builder().addShape( + multiDefinition = StructureDefinition.<MultiNqGenerator>builder() + .addShape( mName, transpose( - new String[][] { - { "AAAAAAA", "AAAAAAA", "AAAAAAA", "AAAAAAA", "AAAAAAA", "AAAAAAA", "AAAAAAA" }, - { "N N", " ", " CCC ", " CPC ", " CCC ", " ", "N N" }, - { "N N", " ", " CCC ", " CPC ", " CCC ", " ", "N N" }, - { "N N", " ", " CCC ", " CPC ", " CCC ", " ", "N N" }, - { "N N", " ", " CCC ", " CPC ", " CCC ", " ", "N N" }, - { "AAAAAAA", "A A", "A CCC A", "A CPC A", "A CCC A", "A A", "AAAAAAA" }, - { "ANNNNNA", "N N", "N CCC N", "N CPC N", "N CCC N", "N N", "ANNNNNA" }, { - "XXX~XXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", - "XXXXXXX" }, })) - .addElement( - 'X', - ofChain( - buildHatchAdder(MultiNqGenerator.class).atLeast( - HatchElement.DynamoMulti.or(GT_HatchElement.Dynamo), - GT_HatchElement.InputHatch, - GT_HatchElement.OutputHatch, - GT_HatchElement.Maintenance).casingIndex(44).dot(1).build(), - ofBlock(GregTech_API.sBlockCasings3, 12))) - .addElement('A', ofBlock(GregTech_API.sBlockCasings3, 12)) - .addElement('N', ofBlock(Loaders.radiationProtectionSteelFrame, 0)) - .addElement('C', ofBlock(Loaders.MAR_Casing, 0)) - .addElement('P', ofBlock(GregTech_API.sBlockCasings2, 15)).build(); + new String[][] { + { "AAAAAAA", "AAAAAAA", "AAAAAAA", "AAAAAAA", "AAAAAAA", "AAAAAAA", "AAAAAAA" }, + { "N N", " ", " CCC ", " CPC ", " CCC ", " ", "N N" }, + { "N N", " ", " CCC ", " CPC ", " CCC ", " ", "N N" }, + { "N N", " ", " CCC ", " CPC ", " CCC ", " ", "N N" }, + { "N N", " ", " CCC ", " CPC ", " CCC ", " ", "N N" }, + { "AAAAAAA", "A A", "A CCC A", "A CPC A", "A CCC A", "A A", "AAAAAAA" }, + { "ANNNNNA", "N N", "N CCC N", "N CPC N", "N CCC N", "N N", "ANNNNNA" }, + { "XXX~XXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX" }, })) + .addElement( + 'X', + ofChain( + buildHatchAdder(MultiNqGenerator.class) + .atLeast( + HatchElement.DynamoMulti.or(GT_HatchElement.Dynamo), + GT_HatchElement.InputHatch, + GT_HatchElement.OutputHatch, + GT_HatchElement.Maintenance) + .casingIndex(44) + .dot(1) + .build(), + ofBlock(GregTech_API.sBlockCasings3, 12))) + .addElement('A', ofBlock(GregTech_API.sBlockCasings3, 12)) + .addElement('N', ofBlock(Loaders.radiationProtectionSteelFrame, 0)) + .addElement('C', ofBlock(Loaders.MAR_Casing, 0)) + .addElement('P', ofBlock(GregTech_API.sBlockCasings2, 15)) + .build(); } return multiDefinition; } @@ -173,8 +178,8 @@ public class MultiNqGenerator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM this.leftEnergy = aNBT.getLong("mLeftEnergy"); this.basicOutput = aNBT.getInteger("mbasicOutput"); if (FluidRegistry.getFluid(aNBT.getString("mLockedFluidName")) != null) this.lockedFluid = new FluidStack( - FluidRegistry.getFluid(aNBT.getString("mLockedFluidName")), - aNBT.getInteger("mLockedFluidAmount")); + FluidRegistry.getFluid(aNBT.getString("mLockedFluidName")), + aNBT.getInteger("mLockedFluidAmount")); else this.lockedFluid = null; super.loadNBTData(aNBT); } @@ -185,7 +190,10 @@ public class MultiNqGenerator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM aNBT.setLong("mLeftEnergy", this.leftEnergy); aNBT.setInteger("mbasicOutput", this.basicOutput); if (lockedFluid != null) { - aNBT.setString("mLockedFluidName", this.lockedFluid.getFluid().getName()); + aNBT.setString( + "mLockedFluidName", + this.lockedFluid.getFluid() + .getName()); aNBT.setInteger("mLockedFluidAmount", this.lockedFluid.amount); } super.saveNBTData(aNBT); @@ -219,15 +227,15 @@ public class MultiNqGenerator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM } GT_Recipe tRecipe = GoodGeneratorRecipeMaps.naquadahReactorFuels - .findRecipe(this.getBaseMetaTileEntity(), true, 1 << 30, tFluids.toArray(new FluidStack[0])); + .findRecipe(this.getBaseMetaTileEntity(), true, 1 << 30, tFluids.toArray(new FluidStack[0])); if (tRecipe != null) { Pair<FluidStack, Integer> excitedInfo = getExcited(tFluids.toArray(new FluidStack[0]), false); int pall = excitedInfo == null ? 1 : excitedInfo.getValue(); if (consumeFuel( - CrackRecipeAdder.copyFluidWithAmount(tRecipe.mFluidInputs[0], pall), - tFluids.toArray(new FluidStack[0]))) { + CrackRecipeAdder.copyFluidWithAmount(tRecipe.mFluidInputs[0], pall), + tFluids.toArray(new FluidStack[0]))) { mOutputFluids = new FluidStack[] { - CrackRecipeAdder.copyFluidWithAmount(tRecipe.mFluidOutputs[0], pall) }; + CrackRecipeAdder.copyFluidWithAmount(tRecipe.mFluidOutputs[0], pall) }; basicOutput = tRecipe.mSpecialValue; times = pall; lockedFluid = excitedInfo == null ? null : excitedInfo.getKey(); @@ -241,14 +249,15 @@ public class MultiNqGenerator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM @Override public boolean onRunningTick(ItemStack stack) { - if (this.getBaseMetaTileEntity().isServerSide()) { + if (this.getBaseMetaTileEntity() + .isServerSide()) { if (mMaxProgresstime != 0 && mProgresstime % 20 == 0) { // If there's no startRecipeProcessing, ME input hatch wouldn't work startRecipeProcessing(); FluidStack[] input = getStoredFluids().toArray(new FluidStack[0]); int time = 1; if (LiquidAirConsumptionPerSecond != 0 - && !consumeFuel(Materials.LiquidAir.getFluid(LiquidAirConsumptionPerSecond), input)) { + && !consumeFuel(Materials.LiquidAir.getFluid(LiquidAirConsumptionPerSecond), input)) { this.mEUt = 0; this.trueEff = 0; this.trueOutput = 0; @@ -271,17 +280,17 @@ public class MultiNqGenerator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM public String[] getInfoData() { String[] info = super.getInfoData(); info[4] = "Probably makes: " + EnumChatFormatting.RED - + GT_Utility.formatNumbers(Math.abs(this.trueOutput)) - + EnumChatFormatting.RESET - + " EU/t"; + + GT_Utility.formatNumbers(Math.abs(this.trueOutput)) + + EnumChatFormatting.RESET + + " EU/t"; info[6] = "Problems: " + EnumChatFormatting.RED - + (this.getIdealStatus() - this.getRepairStatus()) - + EnumChatFormatting.RESET - + " Efficiency: " - + EnumChatFormatting.YELLOW - + trueEff - + EnumChatFormatting.RESET - + " %"; + + (this.getIdealStatus() - this.getRepairStatus()) + + EnumChatFormatting.RESET + + " Efficiency: " + + EnumChatFormatting.YELLOW + + trueEff + + EnumChatFormatting.RESET + + " %"; return info; } @@ -362,7 +371,7 @@ public class MultiNqGenerator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM @Override public boolean checkMachine_EM(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { return structureCheck_EM(mName, 3, 7, 0) && mMaintenanceHatches.size() == 1 - && mDynamoHatches.size() + eDynamoMulti.size() == 1; + && mDynamoHatches.size() + eDynamoMulti.size() == 1; } @Override @@ -393,54 +402,63 @@ public class MultiNqGenerator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Naquadah Reactor").addInfo("Controller block for the Naquadah Reactor") - .addInfo("Environmentally Friendly!").addInfo("Generate power from high-energy liquids.") - .addInfo( - String.format( - "Consumes %d L/s Liquid Air to keep running, otherwise" + EnumChatFormatting.YELLOW - + " it will void your fuel" - + EnumChatFormatting.GRAY - + ".", - LiquidAirConsumptionPerSecond)) - .addInfo("Input liquid nuclear fuel or liquid naquadah fuel.") - .addInfo( - "The reactor will explode when there is more than" + EnumChatFormatting.RED - + " ONE" - + EnumChatFormatting.GRAY - + " type of fuel in hatches!") - .addInfo("Can consume 1000L/s of coolant to increase efficiency:") - .addInfo( - String.format( - "IC2 Coolant %d%%, Super Coolant %d%%, Cryotheum %d%%, Tachyon Rich Temporal Fluid %d%%", - CoolantEfficiency[3], - CoolantEfficiency[2], - CoolantEfficiency[1], - CoolantEfficiency[0])) - .addInfo("Can consume excited liquid to increase the output power and fuel usage:") - .addInfo(String.format("Molten Caesium | %dx power | 180 L/s ", ExcitedLiquidCoe[4])) - .addInfo(String.format("Molten Uranium-235 | %dx power | 180 L/s", ExcitedLiquidCoe[3])) - .addInfo(String.format("Molten Naquadah | %dx power | 20 L/s", ExcitedLiquidCoe[2])) - .addInfo(String.format("Molten Atomic Separation Catalyst | %dx power | 20 L/s", ExcitedLiquidCoe[1])) - .addInfo(String.format("Spatially Enlarged Fluid | %dx power | 20 L/s", ExcitedLiquidCoe[0])) - .addInfo("The structure is too complex!").addInfo(BLUE_PRINT_INFO).addSeparator() - .beginStructureBlock(7, 8, 7, true).addController("Front bottom") - .addDynamoHatch("Any bottom layer casing, only accept ONE!").addInputHatch("Any bottom layer casing") - .addOutputHatch("Any bottom layer casing").addMaintenanceHatch("Any bottom layer casing") - .toolTipFinisher("Good Generator"); + tt.addMachineType("Naquadah Reactor") + .addInfo("Controller block for the Naquadah Reactor") + .addInfo("Environmentally Friendly!") + .addInfo("Generate power from high-energy liquids.") + .addInfo( + String.format( + "Consumes %d L/s Liquid Air to keep running, otherwise" + EnumChatFormatting.YELLOW + + " it will void your fuel" + + EnumChatFormatting.GRAY + + ".", + LiquidAirConsumptionPerSecond)) + .addInfo("Input liquid nuclear fuel or liquid naquadah fuel.") + .addInfo( + "The reactor will explode when there is more than" + EnumChatFormatting.RED + + " ONE" + + EnumChatFormatting.GRAY + + " type of fuel in hatches!") + .addInfo("Can consume 1000L/s of coolant to increase efficiency:") + .addInfo( + String.format( + "IC2 Coolant %d%%, Super Coolant %d%%, Cryotheum %d%%, Tachyon Rich Temporal Fluid %d%%", + CoolantEfficiency[3], + CoolantEfficiency[2], + CoolantEfficiency[1], + CoolantEfficiency[0])) + .addInfo("Can consume excited liquid to increase the output power and fuel usage:") + .addInfo(String.format("Molten Caesium | %dx power | 180 L/s ", ExcitedLiquidCoe[4])) + .addInfo(String.format("Molten Uranium-235 | %dx power | 180 L/s", ExcitedLiquidCoe[3])) + .addInfo(String.format("Molten Naquadah | %dx power | 20 L/s", ExcitedLiquidCoe[2])) + .addInfo(String.format("Molten Atomic Separation Catalyst | %dx power | 20 L/s", ExcitedLiquidCoe[1])) + .addInfo(String.format("Spatially Enlarged Fluid | %dx power | 20 L/s", ExcitedLiquidCoe[0])) + .addInfo("The structure is too complex!") + .addInfo(BLUE_PRINT_INFO) + .addSeparator() + .beginStructureBlock(7, 8, 7, true) + .addController("Front bottom") + .addDynamoHatch("Any bottom layer casing, only accept ONE!") + .addInputHatch("Any bottom layer casing") + .addOutputHatch("Any bottom layer casing") + .addMaintenanceHatch("Any bottom layer casing") + .toolTipFinisher("Good Generator"); return tt; } @Override @SuppressWarnings("ALL") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean aActive, boolean aRedstone) { + int colorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(44), - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE), - TextureFactory.builder().addIcon(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE_GLOW) - .glow().build() }; + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE_GLOW) + .glow() + .build() }; return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(44), - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT) }; + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT) }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(44) }; } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/NeutronActivator.java b/src/main/java/goodgenerator/blocks/tileEntity/NeutronActivator.java index 690cc9ea98..f3a4fd7d3c 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/NeutronActivator.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/NeutronActivator.java @@ -60,7 +60,7 @@ import gregtech.api.util.GT_Utility; import gregtech.api.util.IGT_HatchAdder; public class NeutronActivator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM - implements IConstructable, ISurvivalConstructable { + implements IConstructable, ISurvivalConstructable { protected static IStructureDefinition<NeutronActivator> multiDefinition = null; protected final ArrayList<NeutronAccelerator> mNeutronAccelerator = new ArrayList<>(); @@ -79,11 +79,11 @@ public class NeutronActivator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM private static final IIconContainer textureFontOn = new Textures.BlockIcons.CustomIcon("icons/NeutronActivator_On"); private static final IIconContainer textureFontOn_Glow = new Textures.BlockIcons.CustomIcon( - "icons/NeutronActivator_On_GLOW"); + "icons/NeutronActivator_On_GLOW"); private static final IIconContainer textureFontOff = new Textures.BlockIcons.CustomIcon( - "icons/NeutronActivator_Off"); + "icons/NeutronActivator_Off"); private static final IIconContainer textureFontOff_Glow = new Textures.BlockIcons.CustomIcon( - "icons/NeutronActivator_Off_GLOW"); + "icons/NeutronActivator_Off_GLOW"); protected final String NA_BOTTOM = mName + "buttom"; protected final String NA_MID = mName + "mid"; @@ -105,8 +105,8 @@ public class NeutronActivator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM @Override protected GT_OverclockCalculator createOverclockCalculator(@NotNull GT_Recipe recipe) { return GT_OverclockCalculator.ofNoOverclock(recipe) - .setDuration((int) Math.ceil(recipe.mDuration * Math.pow(0.9f, height - 4))) - .setDurationUnderOneTickSupplier(() -> recipe.mDuration * Math.pow(0.9f, height - 4)); + .setDuration((int) Math.ceil(recipe.mDuration * Math.pow(0.9f, height - 4))) + .setDurationUnderOneTickSupplier(() -> recipe.mDuration * Math.pow(0.9f, height - 4)); } @NotNull @@ -138,7 +138,7 @@ public class NeutronActivator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ) { batchMode = !batchMode; if (batchMode) { GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); @@ -183,31 +183,39 @@ public class NeutronActivator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Neutron Activator").addInfo("Controller block for the Neutron Activator") - .addInfo("Superluminal-velocity Motion.") - .addInfo("The minimum height of the Speeding Pipe Casing is 4.") - .addInfo("Per extra Speeding Pipe Casing will give time discount.") - .addInfo("But it will reduce the Neutron Accelerator efficiency.") - .addInfo("You need to input energy to the Neutron Accelerator to get it running.") - .addInfo("It will output correct products with Specific Neutron Kinetic Energy.") - .addInfo("Otherwise it will output trash.") - .addInfo("The Neutron Kinetic Energy will decrease 72KeV/s when no Neutron Accelerator is running.") - .addInfo( - "It will explode when the Neutron Kinetic Energy is over" + EnumChatFormatting.RED - + " 1200MeV" - + EnumChatFormatting.GRAY - + ".") - .addInfo("Inputting Graphite/Beryllium dust can reduce 10MeV per dust immediately.") - .addInfo("The structure is too complex!").addInfo(BLUE_PRINT_INFO).addSeparator() - .addController("Front bottom").addInputHatch("Hint block with dot 1") - .addInputBus("Hint block with dot 1").addOutputHatch("Hint block with dot 2") - .addOutputBus("Hint block with dot 2").addMaintenanceHatch("Hint block with dot 2") - .addOtherStructurePart("Neutron Accelerator", "Hint block with dot 2") - .addOtherStructurePart("Neutron Sensor", "Hint block with dot 2") - .addCasingInfoRange("Clean Stainless Steel Machine Casing", 7, 31, false) - .addCasingInfoExactly("Processor Machine Casing", 18, false) - .addCasingInfoMin("Steel Frame Box", 16, false).addCasingInfoMin("Speeding Pipe Casing", 4, false) - .addCasingInfoMin("EV+ Glass", 32, false).toolTipFinisher("Good Generator"); + tt.addMachineType("Neutron Activator") + .addInfo("Controller block for the Neutron Activator") + .addInfo("Superluminal-velocity Motion.") + .addInfo("The minimum height of the Speeding Pipe Casing is 4.") + .addInfo("Per extra Speeding Pipe Casing will give time discount.") + .addInfo("But it will reduce the Neutron Accelerator efficiency.") + .addInfo("You need to input energy to the Neutron Accelerator to get it running.") + .addInfo("It will output correct products with Specific Neutron Kinetic Energy.") + .addInfo("Otherwise it will output trash.") + .addInfo("The Neutron Kinetic Energy will decrease 72KeV/s when no Neutron Accelerator is running.") + .addInfo( + "It will explode when the Neutron Kinetic Energy is over" + EnumChatFormatting.RED + + " 1200MeV" + + EnumChatFormatting.GRAY + + ".") + .addInfo("Inputting Graphite/Beryllium dust can reduce 10MeV per dust immediately.") + .addInfo("The structure is too complex!") + .addInfo(BLUE_PRINT_INFO) + .addSeparator() + .addController("Front bottom") + .addInputHatch("Hint block with dot 1") + .addInputBus("Hint block with dot 1") + .addOutputHatch("Hint block with dot 2") + .addOutputBus("Hint block with dot 2") + .addMaintenanceHatch("Hint block with dot 2") + .addOtherStructurePart("Neutron Accelerator", "Hint block with dot 2") + .addOtherStructurePart("Neutron Sensor", "Hint block with dot 2") + .addCasingInfoRange("Clean Stainless Steel Machine Casing", 7, 31, false) + .addCasingInfoExactly("Processor Machine Casing", 18, false) + .addCasingInfoMin("Steel Frame Box", 16, false) + .addCasingInfoMin("Speeding Pipe Casing", 4, false) + .addCasingInfoMin("EV+ Glass", 32, false) + .toolTipFinisher("Good Generator"); return tt; } @@ -215,36 +223,37 @@ public class NeutronActivator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM public IStructureDefinition<NeutronActivator> getStructure_EM() { if (multiDefinition == null) { multiDefinition = StructureDefinition.<NeutronActivator>builder() - .addShape(NA_TOP, transpose(new String[][] { { "CCCCC", "CDDDC", "CDDDC", "CDDDC", "CCCCC" } })) - .addShape(NA_MID, transpose(new String[][] { { "F F", " GGG ", " GPG ", " GGG ", "F F" } })) - .addShape(NA_BOTTOM, transpose(new String[][] { { "XX~XX", "XDDDX", "XDDDX", "XDDDX", "XXXXX" } })) - .addElement( - 'C', - ofChain( - buildHatchAdder(NeutronActivator.class).atLeast( - GT_HatchElement.InputHatch, - GT_HatchElement.InputBus, - GT_HatchElement.Maintenance).casingIndex(49).dot(1).build(), - onElementPass( - NeutronActivator::onCasingFound, - ofBlock(GregTech_API.sBlockCasings4, 1)))) - .addElement('D', ofBlock(GregTech_API.sBlockCasings2, 6)).addElement('F', ofFrame(Materials.Steel)) - .addElement('G', Glasses.chainAllGlasses()).addElement( - 'P', - ofBlock(Loaders.speedingPipe, 0)) - .addElement( - 'X', - ofChain( - buildHatchAdder(NeutronActivator.class).atLeast( - GT_HatchElement.OutputHatch, - GT_HatchElement.OutputBus, - GT_HatchElement.Maintenance, - NeutronHatchElement.NeutronAccelerator, - NeutronHatchElement.NeutronSensor).casingIndex(49).dot(2).build(), - onElementPass( - NeutronActivator::onCasingFound, - ofBlock(GregTech_API.sBlockCasings4, 1)))) - .build(); + .addShape(NA_TOP, transpose(new String[][] { { "CCCCC", "CDDDC", "CDDDC", "CDDDC", "CCCCC" } })) + .addShape(NA_MID, transpose(new String[][] { { "F F", " GGG ", " GPG ", " GGG ", "F F" } })) + .addShape(NA_BOTTOM, transpose(new String[][] { { "XX~XX", "XDDDX", "XDDDX", "XDDDX", "XXXXX" } })) + .addElement( + 'C', + ofChain( + buildHatchAdder(NeutronActivator.class) + .atLeast(GT_HatchElement.InputHatch, GT_HatchElement.InputBus, GT_HatchElement.Maintenance) + .casingIndex(49) + .dot(1) + .build(), + onElementPass(NeutronActivator::onCasingFound, ofBlock(GregTech_API.sBlockCasings4, 1)))) + .addElement('D', ofBlock(GregTech_API.sBlockCasings2, 6)) + .addElement('F', ofFrame(Materials.Steel)) + .addElement('G', Glasses.chainAllGlasses()) + .addElement('P', ofBlock(Loaders.speedingPipe, 0)) + .addElement( + 'X', + ofChain( + buildHatchAdder(NeutronActivator.class) + .atLeast( + GT_HatchElement.OutputHatch, + GT_HatchElement.OutputBus, + GT_HatchElement.Maintenance, + NeutronHatchElement.NeutronAccelerator, + NeutronHatchElement.NeutronSensor) + .casingIndex(49) + .dot(2) + .build(), + onElementPass(NeutronActivator::onCasingFound, ofBlock(GregTech_API.sBlockCasings4, 1)))) + .build(); } return multiDefinition; } @@ -327,12 +336,13 @@ public class NeutronActivator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM } for (NeutronAccelerator tHatch : mNeutronAccelerator) { - if (tHatch.getBaseMetaTileEntity().isActive() && this.getRepairStatus() == this.getIdealStatus()) { + if (tHatch.getBaseMetaTileEntity() + .isActive() && this.getRepairStatus() == this.getIdealStatus()) { anyWorking = true; this.eV += Math.max( - (R.nextInt(tHatch.getMaxEUConsume() + 1) + tHatch.getMaxEUConsume()) * 10 - * Math.pow(0.95, height - 4), - 10); + (R.nextInt(tHatch.getMaxEUConsume() + 1) + tHatch.getMaxEUConsume()) * 10 + * Math.pow(0.95, height - 4), + 10); } } if (!anyWorking) { @@ -389,42 +399,47 @@ public class NeutronActivator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM int currentNKEInput = 0; boolean anyWorking = false; for (NeutronAccelerator tHatch : mNeutronAccelerator) { - if (tHatch.getBaseMetaTileEntity().isActive()) { + if (tHatch.getBaseMetaTileEntity() + .isActive()) { currentNKEInput += (R.nextInt(tHatch.getMaxEUConsume() + 1) + tHatch.getMaxEUConsume()) * 10 - * Math.pow(0.95, height - 4); + * Math.pow(0.95, height - 4); anyWorking = true; } } if (!anyWorking) currentNKEInput = -72000; return new String[] { "Progress:", - EnumChatFormatting.GREEN + Integer.toString(this.mProgresstime / 20) - + EnumChatFormatting.RESET - + " s / " - + EnumChatFormatting.YELLOW - + this.mMaxProgresstime / 20 - + EnumChatFormatting.RESET - + " s", - "Current Neutron Kinetic Energy Input: " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(currentNKEInput) - + EnumChatFormatting.RESET - + "eV", - StatCollector.translateToLocal("scanner.info.NA") + " " - + EnumChatFormatting.LIGHT_PURPLE - + GT_Utility.formatNumbers(getCurrentNeutronKineticEnergy()) - + EnumChatFormatting.RESET - + "eV" }; + EnumChatFormatting.GREEN + Integer.toString(this.mProgresstime / 20) + + EnumChatFormatting.RESET + + " s / " + + EnumChatFormatting.YELLOW + + this.mMaxProgresstime / 20 + + EnumChatFormatting.RESET + + " s", + "Current Neutron Kinetic Energy Input: " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(currentNKEInput) + + EnumChatFormatting.RESET + + "eV", + StatCollector.translateToLocal("scanner.info.NA") + " " + + EnumChatFormatting.LIGHT_PURPLE + + GT_Utility.formatNumbers(getCurrentNeutronKineticEnergy()) + + EnumChatFormatting.RESET + + "eV" }; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean aActive, boolean aRedstone) { + int colorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { - if (aActive) - return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(49), TextureFactory.of(textureFontOn), - TextureFactory.builder().addIcon(textureFontOn_Glow).glow().build() }; + if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(49), + TextureFactory.of(textureFontOn), TextureFactory.builder() + .addIcon(textureFontOn_Glow) + .glow() + .build() }; else return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(49), - TextureFactory.of(textureFontOff), - TextureFactory.builder().addIcon(textureFontOff_Glow).glow().build() }; + TextureFactory.of(textureFontOff), TextureFactory.builder() + .addIcon(textureFontOff_Glow) + .glow() + .build() }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(49) }; } @@ -452,14 +467,14 @@ public class NeutronActivator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM super.drawTexts(screenElements, inventorySlot); screenElements - .widget( - new TextWidget(StatCollector.translateToLocal("gui.NeutronActivator.0")) - .setDefaultColor(COLOR_TEXT_WHITE.get())) - .widget( - new TextWidget().setStringSupplier(() -> numberFormat.format(eV / 1_000_000d) + " MeV") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) - .widget(new FakeSyncWidget.IntegerSyncer(() -> eV, val -> eV = val)); + .widget( + new TextWidget(StatCollector.translateToLocal("gui.NeutronActivator.0")) + .setDefaultColor(COLOR_TEXT_WHITE.get())) + .widget( + new TextWidget().setStringSupplier(() -> numberFormat.format(eV / 1_000_000d) + " MeV") + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) + .widget(new FakeSyncWidget.IntegerSyncer(() -> eV, val -> eV = val)); } private enum NeutronHatchElement implements IHatchElement<NeutronActivator> { diff --git a/src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java b/src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java index 53862bc766..610716fc8a 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/PreciseAssembler.java @@ -71,14 +71,14 @@ import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.IDualInputHatch; public class PreciseAssembler extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase<PreciseAssembler> - implements IConstructable, ISurvivalConstructable { + implements IConstructable, ISurvivalConstructable { private static final IIconContainer textureFontOn = new Textures.BlockIcons.CustomIcon("iconsets/OVERLAY_QTANK"); private static final IIconContainer textureFontOn_Glow = new Textures.BlockIcons.CustomIcon( - "iconsets/OVERLAY_QTANK_GLOW"); + "iconsets/OVERLAY_QTANK_GLOW"); private static final IIconContainer textureFontOff = new Textures.BlockIcons.CustomIcon("iconsets/OVERLAY_QCHEST"); private static final IIconContainer textureFontOff_Glow = new Textures.BlockIcons.CustomIcon( - "iconsets/OVERLAY_QCHEST_GLOW"); + "iconsets/OVERLAY_QCHEST_GLOW"); protected IStructureDefinition<PreciseAssembler> multiDefinition = null; protected int casingAmount; @@ -98,53 +98,55 @@ public class PreciseAssembler extends GT_MetaTileEntity_ExtendedPowerMultiBlockB @Override public IStructureDefinition<PreciseAssembler> getStructureDefinition() { if (multiDefinition == null) { - multiDefinition = StructureDefinition.<PreciseAssembler>builder().addShape( + multiDefinition = StructureDefinition.<PreciseAssembler>builder() + .addShape( mName, transpose( - new String[][] { { "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC" }, - { "F F", "CGGGGGGGC", "C-------C", "CGGGGGGGC", "F F" }, - { "F F", "CGGGGGGGC", "C-------C", "CGGGGGGGC", "F F" }, - { "F F", "CGGGGGGGC", "C-------C", "CGGGGGGGC", "F F" }, - { "CCCC~CCCC", "CMMMMMMMC", "CMMMMMMMC", "CMMMMMMMC", "CCCCCCCCC" } })) - .addElement( - 'C', - GT_HatchElementBuilder.<PreciseAssembler>builder() - .atLeast( - InputBus, - InputHatch, - OutputHatch, - OutputBus, - Maintenance, - Muffler, - ExoticEnergy.or(Energy)) - .adder(PreciseAssembler::addToPAssList).casingIndex(1539).dot(1).buildAndChain( - onElementPass( - x -> x.casingAmount++, - StructureUtility.ofBlocksTiered( - (block, meta) -> block == Loaders.preciseUnitCasing ? meta - : -2, - IntStream.range(0, 3).mapToObj( - meta -> org.apache.commons.lang3.tuple.Pair - .of(Loaders.preciseUnitCasing, meta)) - .collect(Collectors.toList()), - -1, - PreciseAssembler::setCasingTier, - PreciseAssembler::getCasingTier)))) - .addElement('F', ofFrame(Materials.TungstenSteel)) - .addElement('G', ofGlassTieredMixed((byte) 4, (byte) 127, 2)) - .addElement( - 'M', - StructureUtility.ofBlocksTiered( - (block, meta) -> block == GregTech_API.sBlockCasings1 ? meta : -2, - IntStream.range(0, 10) - .mapToObj( - meta -> org.apache.commons.lang3.tuple.Pair - .of(GregTech_API.sBlockCasings1, meta)) - .collect(Collectors.toList()), + new String[][] { { "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC" }, + { "F F", "CGGGGGGGC", "C-------C", "CGGGGGGGC", "F F" }, + { "F F", "CGGGGGGGC", "C-------C", "CGGGGGGGC", "F F" }, + { "F F", "CGGGGGGGC", "C-------C", "CGGGGGGGC", "F F" }, + { "CCCC~CCCC", "CMMMMMMMC", "CMMMMMMMC", "CMMMMMMMC", "CCCCCCCCC" } })) + .addElement( + 'C', + GT_HatchElementBuilder.<PreciseAssembler>builder() + .atLeast( + InputBus, + InputHatch, + OutputHatch, + OutputBus, + Maintenance, + Muffler, + ExoticEnergy.or(Energy)) + .adder(PreciseAssembler::addToPAssList) + .casingIndex(1539) + .dot(1) + .buildAndChain( + onElementPass( + x -> x.casingAmount++, + StructureUtility.ofBlocksTiered( + (block, meta) -> block == Loaders.preciseUnitCasing ? meta : -2, + IntStream.range(0, 3) + .mapToObj( + meta -> org.apache.commons.lang3.tuple.Pair + .of(Loaders.preciseUnitCasing, meta)) + .collect(Collectors.toList()), -1, - PreciseAssembler::setMachineTier, - PreciseAssembler::getMachineTier)) - .build(); + PreciseAssembler::setCasingTier, + PreciseAssembler::getCasingTier)))) + .addElement('F', ofFrame(Materials.TungstenSteel)) + .addElement('G', ofGlassTieredMixed((byte) 4, (byte) 127, 2)) + .addElement( + 'M', + StructureUtility.ofBlocksTiered( + (block, meta) -> block == GregTech_API.sBlockCasings1 ? meta : -2, + IntStream.range(0, 10) + .mapToObj(meta -> org.apache.commons.lang3.tuple.Pair.of(GregTech_API.sBlockCasings1, meta)) + .collect(Collectors.toList()), + -1, + PreciseAssembler::setMachineTier, + PreciseAssembler::getMachineTier)) + .build(); } return multiDefinition; } @@ -298,9 +300,9 @@ public class PreciseAssembler extends GT_MetaTileEntity_ExtendedPowerMultiBlockB } getBaseMetaTileEntity().sendBlockEvent(GregTechTileClientEvents.CHANGE_CUSTOM_DATA, getUpdateData()); return casingAmount >= 42 && machineTier >= 0 - && casingTier >= 0 - && mMaintenanceHatches.size() == 1 - && !mMufflerHatches.isEmpty(); + && casingTier >= 0 + && mMaintenanceHatches.size() == 1 + && !mMufflerHatches.isEmpty(); } return false; } @@ -308,21 +310,35 @@ public class PreciseAssembler extends GT_MetaTileEntity_ExtendedPowerMultiBlockB @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Precise Assembler/Assembler").addInfo("Controller block for the Precise Assembler") - .addInfo("The error is no more than 7nm.").addInfo("Can assemble precise component in Precise Mode.") - .addInfo("Can work like a normal assembler in Normal Mode.").addInfo("Use screwdriver to change mode.") - .addInfo("Machine Casing and Energy Hatch limits the voltage tier the machine can work on.") - .addInfo("UHV Machine Casing will unlock all voltage, but you still need good Energy Hatch.") - .addInfo("Precise Electronic Unit Casing won't limit recipe in Normal Mode.") - .addInfo("But gives more parallel with more advanced one.").addInfo("It is 100% faster in Normal Mode.") - .addInfo("MK-I = 32x, MK-II = 64x, MK-III = 128x").addPollutionAmount(getPollutionPerSecond(null)) - .addInfo("The structure is too complex!").addInfo(BLUE_PRINT_INFO).addSeparator() - .beginStructureBlock(9, 5, 5, true).addController("Front bottom") - .addCasingInfoExactly("Machine Casing", 21, true).addCasingInfoExactly("Glass (EV+)", 42, false) - .addCasingInfoRange("Precise Electronic Unit Casing", 42, 86, true).addInputHatch("Any Casing") - .addInputBus("Any Casing").addOutputHatch("Any Casing").addOutputBus("Any Casing") - .addEnergyHatch("Any Casing").addMufflerHatch("Any Casing").addMaintenanceHatch("Any Casing") - .toolTipFinisher("Good Generator"); + tt.addMachineType("Precise Assembler/Assembler") + .addInfo("Controller block for the Precise Assembler") + .addInfo("The error is no more than 7nm.") + .addInfo("Can assemble precise component in Precise Mode.") + .addInfo("Can work like a normal assembler in Normal Mode.") + .addInfo("Use screwdriver to change mode.") + .addInfo("Machine Casing and Energy Hatch limits the voltage tier the machine can work on.") + .addInfo("UHV Machine Casing will unlock all voltage, but you still need good Energy Hatch.") + .addInfo("Precise Electronic Unit Casing won't limit recipe in Normal Mode.") + .addInfo("But gives more parallel with more advanced one.") + .addInfo("It is 100% faster in Normal Mode.") + .addInfo("MK-I = 32x, MK-II = 64x, MK-III = 128x") + .addPollutionAmount(getPollutionPerSecond(null)) + .addInfo("The structure is too complex!") + .addInfo(BLUE_PRINT_INFO) + .addSeparator() + .beginStructureBlock(9, 5, 5, true) + .addController("Front bottom") + .addCasingInfoExactly("Machine Casing", 21, true) + .addCasingInfoExactly("Glass (EV+)", 42, false) + .addCasingInfoRange("Precise Electronic Unit Casing", 42, 86, true) + .addInputHatch("Any Casing") + .addInputBus("Any Casing") + .addOutputHatch("Any Casing") + .addOutputBus("Any Casing") + .addEnergyHatch("Any Casing") + .addMufflerHatch("Any Casing") + .addMaintenanceHatch("Any Casing") + .toolTipFinisher("Good Generator"); return tt; } @@ -425,15 +441,19 @@ public class PreciseAssembler extends GT_MetaTileEntity_ExtendedPowerMultiBlockB @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean aActive, boolean aRedstone) { + int colorIndex, boolean aActive, boolean aRedstone) { int t = Math.max(getCasingTier(), 0); if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(1539 + t), - TextureFactory.of(textureFontOn), - TextureFactory.builder().addIcon(textureFontOn_Glow).glow().build() }; + TextureFactory.of(textureFontOn), TextureFactory.builder() + .addIcon(textureFontOn_Glow) + .glow() + .build() }; else return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(1539 + t), - TextureFactory.of(textureFontOff), - TextureFactory.builder().addIcon(textureFontOff_Glow).glow().build() }; + TextureFactory.of(textureFontOff), TextureFactory.builder() + .addIcon(textureFontOff_Glow) + .glow() + .build() }; } else return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(1539 + t) }; } @@ -441,15 +461,17 @@ public class PreciseAssembler extends GT_MetaTileEntity_ExtendedPowerMultiBlockB public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { super.addUIWidgets(builder, buildContext); builder.widget( - new CycleButtonWidget().setToggle(() -> mode == 1, val -> mode = val ? 1 : 0) - .setTextureGetter( - state -> state == 1 ? GG_UITextures.OVERLAY_BUTTON_ASSEMBLER_MODE - : GG_UITextures.OVERLAY_BUTTON_PRECISE_MODE) - .setBackground(GT_UITextures.BUTTON_STANDARD).setPos(80, 91).setSize(16, 16) - .dynamicTooltip( - () -> Collections - .singletonList(StatCollector.translateToLocal("preciseassembler.chat." + mode))) - .setUpdateTooltipEveryTick(true).setTooltipShowUpDelay(TOOLTIP_DELAY)); + new CycleButtonWidget().setToggle(() -> mode == 1, val -> mode = val ? 1 : 0) + .setTextureGetter( + state -> state == 1 ? GG_UITextures.OVERLAY_BUTTON_ASSEMBLER_MODE + : GG_UITextures.OVERLAY_BUTTON_PRECISE_MODE) + .setBackground(GT_UITextures.BUTTON_STANDARD) + .setPos(80, 91) + .setSize(16, 16) + .dynamicTooltip( + () -> Collections.singletonList(StatCollector.translateToLocal("preciseassembler.chat." + mode))) + .setUpdateTooltipEveryTick(true) + .setTooltipShowUpDelay(TOOLTIP_DELAY)); } @Override diff --git a/src/main/java/goodgenerator/blocks/tileEntity/SupercriticalFluidTurbine.java b/src/main/java/goodgenerator/blocks/tileEntity/SupercriticalFluidTurbine.java index ba581d53fb..7c8d9ee154 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/SupercriticalFluidTurbine.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/SupercriticalFluidTurbine.java @@ -99,9 +99,9 @@ public class SupercriticalFluidTurbine extends GT_MetaTileEntity_LargeTurbineBas if (side == getBaseMetaTileEntity().getFrontFacing()) { looseFit ^= true; GT_Utility.sendChatToPlayer( - aPlayer, - looseFit ? trans("500", "Fitting: Loose - More Flow") - : trans("501", "Fitting: Tight - More Efficiency")); + aPlayer, + looseFit ? trans("500", "Fitting: Loose - More Flow") + : trans("501", "Fitting: Tight - More Efficiency")); } } @@ -147,16 +147,23 @@ public class SupercriticalFluidTurbine extends GT_MetaTileEntity_LargeTurbineBas @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Supercritical Steam Turbine").addInfo("Controller block for Supercritical Fluid Turbine") - .addInfo("Needs a Turbine, place inside controller") - .addInfo("Use Supercritical Steam to generate power.") - .addInfo("Outputs Steam as well as producing power").addInfo("1L Supercritical Steam = 100 EU") - .addInfo("Extreme Heated Steam will cause more damage to the turbine.") - .addInfo("Power output depends on turbine and fitting") - .addInfo("Use screwdriver to adjust fitting of turbine").addSeparator() - .beginStructureBlock(3, 3, 4, true).addController("Front center").addCasingInfo("SC Turbine Casing", 24) - .addDynamoHatch("Back center", 1).addMaintenanceHatch("Side centered", 2) - .addInputHatch("Supercritical Fluid, Side centered", 2).toolTipFinisher("Good Generator"); + tt.addMachineType("Supercritical Steam Turbine") + .addInfo("Controller block for Supercritical Fluid Turbine") + .addInfo("Needs a Turbine, place inside controller") + .addInfo("Use Supercritical Steam to generate power.") + .addInfo("Outputs Steam as well as producing power") + .addInfo("1L Supercritical Steam = 100 EU") + .addInfo("Extreme Heated Steam will cause more damage to the turbine.") + .addInfo("Power output depends on turbine and fitting") + .addInfo("Use screwdriver to adjust fitting of turbine") + .addSeparator() + .beginStructureBlock(3, 3, 4, true) + .addController("Front center") + .addCasingInfo("SC Turbine Casing", 24) + .addDynamoHatch("Back center", 1) + .addMaintenanceHatch("Side centered", 2) + .addInputHatch("Supercritical Fluid, Side centered", 2) + .toolTipFinisher("Good Generator"); return tt; } @@ -167,11 +174,11 @@ public class SupercriticalFluidTurbine extends GT_MetaTileEntity_LargeTurbineBas @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean aActive, boolean aRedstone) { + int colorIndex, boolean aActive, boolean aRedstone) { return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(1538), - facing == side - ? (aActive ? TextureFactory.of(turbineOn) - : hasTurbine() ? TextureFactory.of(turbineOff) : TextureFactory.of(turbineEmpty)) - : Textures.BlockIcons.getCasingTextureForId(1538) }; + facing == side + ? (aActive ? TextureFactory.of(turbineOn) + : hasTurbine() ? TextureFactory.of(turbineOff) : TextureFactory.of(turbineEmpty)) + : Textures.BlockIcons.getCasingTextureForId(1538) }; } } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/UniversalChemicalFuelEngine.java b/src/main/java/goodgenerator/blocks/tileEntity/UniversalChemicalFuelEngine.java index c325256d45..6c8ce62539 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/UniversalChemicalFuelEngine.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/UniversalChemicalFuelEngine.java @@ -50,7 +50,7 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.api.recipe.GTPPRecipeMaps; public class UniversalChemicalFuelEngine extends GT_MetaTileEntity_TooltipMultiBlockBase_EM - implements IConstructable, ISurvivalConstructable { + implements IConstructable, ISurvivalConstructable { protected final double DIESEL_EFFICIENCY_COEFFICIENT = 0.04D; protected final double GAS_EFFICIENCY_COEFFICIENT = 0.04D; @@ -132,26 +132,25 @@ public class UniversalChemicalFuelEngine extends GT_MetaTileEntity_TooltipMultiB @Override public IStructureDefinition<UniversalChemicalFuelEngine> getStructure_EM() { if (multiDefinition == null) { - multiDefinition = StructureDefinition.<UniversalChemicalFuelEngine>builder().addShape( + multiDefinition = StructureDefinition.<UniversalChemicalFuelEngine>builder() + .addShape( mName, transpose( - new String[][] { - { "TTTTT", "TTMMT", "TTMMT", "TTMMT", "TTMMT", "TTMMT", "TTMMT", "TTMMT", "TTTTT" }, - { "TTTTT", "SPCCI-", "SPCCI-", "SPCCI-", "SPCCI-", "SPCCI-", "SPCCI-", "SPCCI-", - "TTTTT" }, - { "TT~TT", "SPGGI-", "SPGGI-", "SPGGI-", "SPGGI-", "SPGGI-", "SPGGI-", "SPGGI-", - "TTETT" }, - { "TTWTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", - "TTTTT" } })) - .addElement('T', ofBlock(GregTech_API.sBlockCasings4, 2)) - .addElement('W', GT_HatchElement.Maintenance.newAny(50, 1)) - .addElement('M', GT_HatchElement.Muffler.newAny(50, 2)) - .addElement('S', GT_HatchElement.InputHatch.newAny(50, 3)) - .addElement('E', GT_HatchElement.Dynamo.newAny(50, 4)) - .addElement('P', ofBlock(GregTech_API.sBlockCasings2, 14)) - .addElement('C', ofBlock(Loaders.titaniumPlatedCylinder, 0)) - .addElement('G', ofBlock(GregTech_API.sBlockCasings2, 4)) - .addElement('I', ofBlock(GregTech_API.sBlockCasings4, 13)).build(); + new String[][] { + { "TTTTT", "TTMMT", "TTMMT", "TTMMT", "TTMMT", "TTMMT", "TTMMT", "TTMMT", "TTTTT" }, + { "TTTTT", "SPCCI-", "SPCCI-", "SPCCI-", "SPCCI-", "SPCCI-", "SPCCI-", "SPCCI-", "TTTTT" }, + { "TT~TT", "SPGGI-", "SPGGI-", "SPGGI-", "SPGGI-", "SPGGI-", "SPGGI-", "SPGGI-", "TTETT" }, + { "TTWTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT" } })) + .addElement('T', ofBlock(GregTech_API.sBlockCasings4, 2)) + .addElement('W', GT_HatchElement.Maintenance.newAny(50, 1)) + .addElement('M', GT_HatchElement.Muffler.newAny(50, 2)) + .addElement('S', GT_HatchElement.InputHatch.newAny(50, 3)) + .addElement('E', GT_HatchElement.Dynamo.newAny(50, 4)) + .addElement('P', ofBlock(GregTech_API.sBlockCasings2, 14)) + .addElement('C', ofBlock(Loaders.titaniumPlatedCylinder, 0)) + .addElement('G', ofBlock(GregTech_API.sBlockCasings2, 4)) + .addElement('I', ofBlock(GregTech_API.sBlockCasings4, 13)) + .build(); } return multiDefinition; } @@ -184,29 +183,35 @@ public class UniversalChemicalFuelEngine extends GT_MetaTileEntity_TooltipMultiB @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Chemical Engine").addInfo("Controller block for the Chemical Engine") - .addInfo("BURNING BURNING BURNING").addInfo("Use combustible liquid to generate power.") - .addInfo("You need to supply Combustion Promoter to keep it running.") - .addInfo("It will consume all the fuel and promoter in the hatch every second.") - .addInfo("If the Dynamo Hatch's buffer fills up, the machine will stop.") - .addInfo("When turned on, there's 10-second period where the machine will not stop.") - .addInfo("Even if it doesn't stop, all the fuel in the hatch will be consumed.") - .addInfo("The efficiency is determined by the proportion of Combustion Promoter to fuel.") - .addInfo("The proportion is bigger, and the efficiency will be higher.") - .addInfo("Start machine with power button to force structure check.") - .addInfo("It creates sqrt(Current Output Power) pollution every second") - .addInfo( - "If you forget to supply Combustion Promoter, this engine will swallow all the fuel " - + EnumChatFormatting.YELLOW - + "without outputting energy" - + EnumChatFormatting.GRAY - + ".") - .addInfo("The efficiency is up to 150%.").addInfo("The structure is too complex!") - .addInfo(BLUE_PRINT_INFO).addSeparator().beginStructureBlock(5, 4, 9, false) - .addMaintenanceHatch("Hint block with dot 1") - .addMufflerHatch("Hint block with dot 2 (fill all slots with mufflers)") - .addInputHatch("Hint block with dot 3 (fill all slots with input hatches)") - .addDynamoHatch("Hint block with dot 4").toolTipFinisher("Good Generator"); + tt.addMachineType("Chemical Engine") + .addInfo("Controller block for the Chemical Engine") + .addInfo("BURNING BURNING BURNING") + .addInfo("Use combustible liquid to generate power.") + .addInfo("You need to supply Combustion Promoter to keep it running.") + .addInfo("It will consume all the fuel and promoter in the hatch every second.") + .addInfo("If the Dynamo Hatch's buffer fills up, the machine will stop.") + .addInfo("When turned on, there's 10-second period where the machine will not stop.") + .addInfo("Even if it doesn't stop, all the fuel in the hatch will be consumed.") + .addInfo("The efficiency is determined by the proportion of Combustion Promoter to fuel.") + .addInfo("The proportion is bigger, and the efficiency will be higher.") + .addInfo("Start machine with power button to force structure check.") + .addInfo("It creates sqrt(Current Output Power) pollution every second") + .addInfo( + "If you forget to supply Combustion Promoter, this engine will swallow all the fuel " + + EnumChatFormatting.YELLOW + + "without outputting energy" + + EnumChatFormatting.GRAY + + ".") + .addInfo("The efficiency is up to 150%.") + .addInfo("The structure is too complex!") + .addInfo(BLUE_PRINT_INFO) + .addSeparator() + .beginStructureBlock(5, 4, 9, false) + .addMaintenanceHatch("Hint block with dot 1") + .addMufflerHatch("Hint block with dot 2 (fill all slots with mufflers)") + .addInputHatch("Hint block with dot 3 (fill all slots with input hatches)") + .addDynamoHatch("Hint block with dot 4") + .toolTipFinisher("Good Generator"); return tt; } @@ -234,7 +239,7 @@ public class UniversalChemicalFuelEngine extends GT_MetaTileEntity_TooltipMultiB } protected CheckRecipeResult processFuel(ArrayList<FluidStack> tFluids, RecipeMap<FuelBackend> recipeMap, - long PromoterAmount, double efficiencyCoefficient, double FuelsValueBonus) { + long PromoterAmount, double efficiencyCoefficient, double FuelsValueBonus) { for (GT_Recipe recipe : recipeMap.getAllRecipes()) { FluidStack tFuel = findFuel(recipe); if (tFuel == null) continue; @@ -269,7 +274,8 @@ public class UniversalChemicalFuelEngine extends GT_MetaTileEntity_TooltipMultiB isStoppingSafe = true; } else if (isStoppingSafe) isStoppingSafe = false; - if (this.getBaseMetaTileEntity().isServerSide()) { + if (this.getBaseMetaTileEntity() + .isServerSide()) { addAutoEnergy(); } return true; @@ -279,17 +285,17 @@ public class UniversalChemicalFuelEngine extends GT_MetaTileEntity_TooltipMultiB public String[] getInfoData() { String[] info = super.getInfoData(); info[4] = "Probably makes: " + EnumChatFormatting.RED - + GT_Utility.formatNumbers(this.getPowerFlow()) - + EnumChatFormatting.RESET - + " EU/t"; + + GT_Utility.formatNumbers(this.getPowerFlow()) + + EnumChatFormatting.RESET + + " EU/t"; info[6] = "Problems: " + EnumChatFormatting.RED - + GT_Utility.formatNumbers(this.getIdealStatus() - this.getRepairStatus()) - + EnumChatFormatting.RESET - + " Efficiency: " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(tEff / 100D) - + EnumChatFormatting.RESET - + " %"; + + GT_Utility.formatNumbers(this.getIdealStatus() - this.getRepairStatus()) + + EnumChatFormatting.RESET + + " Efficiency: " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(tEff / 100D) + + EnumChatFormatting.RESET + + " %"; return info; } @@ -298,7 +304,11 @@ public class UniversalChemicalFuelEngine extends GT_MetaTileEntity_TooltipMultiB if (!mDynamoHatches.isEmpty()) { GT_MetaTileEntity_Hatch_Dynamo tHatch = mDynamoHatches.get(0); if (tHatch.maxEUOutput() * tHatch.maxAmperesOut() >= exEU) { - tHatch.setEUVar(Math.min(tHatch.maxEUStore(), tHatch.getBaseMetaTileEntity().getStoredEU() + exEU)); + tHatch.setEUVar( + Math.min( + tHatch.maxEUStore(), + tHatch.getBaseMetaTileEntity() + .getStoredEU() + exEU)); } else if (!isStoppingSafe) { stopMachine(); } @@ -306,7 +316,11 @@ public class UniversalChemicalFuelEngine extends GT_MetaTileEntity_TooltipMultiB if (!eDynamoMulti.isEmpty()) { GT_MetaTileEntity_Hatch_DynamoMulti tHatch = eDynamoMulti.get(0); if (tHatch.maxEUOutput() * tHatch.maxAmperesOut() >= exEU) { - tHatch.setEUVar(Math.min(tHatch.maxEUStore(), tHatch.getBaseMetaTileEntity().getStoredEU() + exEU)); + tHatch.setEUVar( + Math.min( + tHatch.maxEUStore(), + tHatch.getBaseMetaTileEntity() + .getStoredEU() + exEU)); } else if (!isStoppingSafe) { stopMachine(); } @@ -350,13 +364,18 @@ public class UniversalChemicalFuelEngine extends GT_MetaTileEntity_TooltipMultiB @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean aActive, boolean aRedstone) { + int colorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { if (aActive) return new ITexture[] { casingTexturePages[0][50], - TextureFactory.of(OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE_GLOW).glow().build() }; + TextureFactory.of(OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE_GLOW) + .glow() + .build() }; return new ITexture[] { casingTexturePages[0][50], TextureFactory.of(OVERLAY_FRONT_DIESEL_ENGINE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DIESEL_ENGINE_GLOW).glow().build() }; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DIESEL_ENGINE_GLOW) + .glow() + .build() }; } return new ITexture[] { casingTexturePages[0][50] }; } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/YottaFluidTank.java b/src/main/java/goodgenerator/blocks/tileEntity/YottaFluidTank.java index ca5d44fd32..f712fa12a7 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/YottaFluidTank.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/YottaFluidTank.java @@ -62,14 +62,14 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; public class YottaFluidTank extends GT_MetaTileEntity_TooltipMultiBlockBase_EM - implements IConstructable, ISurvivalConstructable { + implements IConstructable, ISurvivalConstructable { private static final IIconContainer textureFontOn = new Textures.BlockIcons.CustomIcon("iconsets/OVERLAY_QTANK"); private static final IIconContainer textureFontOn_Glow = new Textures.BlockIcons.CustomIcon( - "iconsets/OVERLAY_QTANK_GLOW"); + "iconsets/OVERLAY_QTANK_GLOW"); private static final IIconContainer textureFontOff = new Textures.BlockIcons.CustomIcon("iconsets/OVERLAY_QCHEST"); private static final IIconContainer textureFontOff_Glow = new Textures.BlockIcons.CustomIcon( - "iconsets/OVERLAY_QCHEST_GLOW"); + "iconsets/OVERLAY_QCHEST_GLOW"); protected IStructureDefinition<YottaFluidTank> multiDefinition = null; protected final ArrayList<YOTTAHatch> mYottaHatch = new ArrayList<>(); @@ -158,8 +158,16 @@ public class YottaFluidTank extends GT_MetaTileEntity_TooltipMultiBlockBase_EM public void saveNBTData(NBTTagCompound aNBT) { aNBT.setString("mStorage", mStorage.toString(10)); aNBT.setString("mStorageCurrent", mStorageCurrent.toString(10)); - aNBT.setString("mFluidName", mFluid == null ? "" : mFluid.getFluid().getName()); - aNBT.setString("mLockedFluidName", mLockedFluid == null ? "" : mLockedFluid.getFluid().getName()); + aNBT.setString( + "mFluidName", + mFluid == null ? "" + : mFluid.getFluid() + .getName()); + aNBT.setString( + "mLockedFluidName", + mLockedFluid == null ? "" + : mLockedFluid.getFluid() + .getName()); aNBT.setBoolean("voidExcessEnabled", voidExcessEnabled); aNBT.setBoolean("isFluidLocked", isFluidLocked); super.saveNBTData(aNBT); @@ -277,45 +285,50 @@ public class YottaFluidTank extends GT_MetaTileEntity_TooltipMultiBlockBase_EM public IStructureDefinition<YottaFluidTank> getStructure_EM() { if (multiDefinition == null) { multiDefinition = StructureDefinition.<YottaFluidTank>builder() - .addShape( - YOTTANK_BOTTOM, - transpose( - new String[][] { { "MM~MM", "MCCCM", "MCCCM", "MCCCM", "MMMMM" }, - { " ", " OOO ", " OOO ", " OOO ", " " } })) - .addShape( - YOTTANK_MID, - transpose(new String[][] { { "GGGGG", "GRRRG", "GRRRG", "GRRRG", "GGGGG" } })) - .addShape( - YOTTANK_TOP, - transpose( - new String[][] { { "FFFFF", "F F", "F F", "F F", "FFFFF" }, - { "CCCCC", "CIIIC", "CIIIC", "CIIIC", "CCCCC" } })) - .addElement('C', ofBlock(Loaders.yottaFluidTankCasing, 0)) - .addElement( - 'G', - withChannel( - "glass", - BorosilicateGlass.ofBoroGlass( - (byte) 0, - (byte) 1, - Byte.MAX_VALUE, - YottaFluidTank::setMeta, - te -> (byte) te.getMeta()))) - .addElement('R', ofChain(cells(10))).addElement('F', ofFrame(Materials.Steel)) - .addElement( - 'I', - buildHatchAdder(YottaFluidTank.class).atLeast(GT_HatchElement.InputHatch).casingIndex(1537) - .dot(1).buildAndChain(Loaders.yottaFluidTankCasing, 0)) - .addElement( - 'M', - buildHatchAdder(YottaFluidTank.class).atLeast(GT_HatchElement.Maintenance).casingIndex(1537) - .dot(2).buildAndChain(Loaders.yottaFluidTankCasing, 0)) - .addElement( - 'O', - buildHatchAdder(YottaFluidTank.class).atLeast(GT_HatchElement.OutputHatch) - .adder(YottaFluidTank::addOutput).casingIndex(1537).dot(1) - .buildAndChain(Loaders.yottaFluidTankCasing, 0)) - .build(); + .addShape( + YOTTANK_BOTTOM, + transpose( + new String[][] { { "MM~MM", "MCCCM", "MCCCM", "MCCCM", "MMMMM" }, + { " ", " OOO ", " OOO ", " OOO ", " " } })) + .addShape(YOTTANK_MID, transpose(new String[][] { { "GGGGG", "GRRRG", "GRRRG", "GRRRG", "GGGGG" } })) + .addShape( + YOTTANK_TOP, + transpose( + new String[][] { { "FFFFF", "F F", "F F", "F F", "FFFFF" }, + { "CCCCC", "CIIIC", "CIIIC", "CIIIC", "CCCCC" } })) + .addElement('C', ofBlock(Loaders.yottaFluidTankCasing, 0)) + .addElement( + 'G', + withChannel( + "glass", + BorosilicateGlass.ofBoroGlass( + (byte) 0, + (byte) 1, + Byte.MAX_VALUE, + YottaFluidTank::setMeta, + te -> (byte) te.getMeta()))) + .addElement('R', ofChain(cells(10))) + .addElement('F', ofFrame(Materials.Steel)) + .addElement( + 'I', + buildHatchAdder(YottaFluidTank.class).atLeast(GT_HatchElement.InputHatch) + .casingIndex(1537) + .dot(1) + .buildAndChain(Loaders.yottaFluidTankCasing, 0)) + .addElement( + 'M', + buildHatchAdder(YottaFluidTank.class).atLeast(GT_HatchElement.Maintenance) + .casingIndex(1537) + .dot(2) + .buildAndChain(Loaders.yottaFluidTankCasing, 0)) + .addElement( + 'O', + buildHatchAdder(YottaFluidTank.class).atLeast(GT_HatchElement.OutputHatch) + .adder(YottaFluidTank::addOutput) + .casingIndex(1537) + .dot(1) + .buildAndChain(Loaders.yottaFluidTankCasing, 0)) + .build(); } return multiDefinition; } @@ -357,51 +370,60 @@ public class YottaFluidTank extends GT_MetaTileEntity_TooltipMultiBlockBase_EM @Override public String[] getInfoData() { - return new String[] { StatCollector.translateToLocal("scanner.info.YOTTank.1"), StatCollector.translateToLocal( + return new String[] { StatCollector.translateToLocal("scanner.info.YOTTank.1"), + StatCollector.translateToLocal( EnumChatFormatting.YELLOW + CharExchanger.formatNumber(getFluidName() + EnumChatFormatting.RESET)), - StatCollector.translateToLocal("scanner.info.YOTTank.0"), - StatCollector.translateToLocal( - EnumChatFormatting.GREEN + CharExchanger.formatNumber(getCap()) - + EnumChatFormatting.RESET - + " L"), - - StatCollector.translateToLocal("scanner.info.YOTTank.2"), - StatCollector.translateToLocal( - EnumChatFormatting.GREEN + CharExchanger.formatNumber(getStored()) - + EnumChatFormatting.RESET - + " L" - + " (" - + EnumChatFormatting.GREEN - + getPercent() - + "%" - + EnumChatFormatting.RESET - + ")"), - - StatCollector.translateToLocal("scanner.info.YOTTank.3"), - StatCollector.translateToLocal( - EnumChatFormatting.YELLOW + CharExchanger.formatNumber(getLockedFluidName()) - + EnumChatFormatting.RESET) }; + StatCollector.translateToLocal("scanner.info.YOTTank.0"), + StatCollector.translateToLocal( + EnumChatFormatting.GREEN + CharExchanger.formatNumber(getCap()) + EnumChatFormatting.RESET + " L"), + + StatCollector.translateToLocal("scanner.info.YOTTank.2"), + StatCollector.translateToLocal( + EnumChatFormatting.GREEN + CharExchanger.formatNumber(getStored()) + + EnumChatFormatting.RESET + + " L" + + " (" + + EnumChatFormatting.GREEN + + getPercent() + + "%" + + EnumChatFormatting.RESET + + ")"), + + StatCollector.translateToLocal("scanner.info.YOTTank.3"), + StatCollector.translateToLocal( + EnumChatFormatting.YELLOW + CharExchanger.formatNumber(getLockedFluidName()) + + EnumChatFormatting.RESET) }; } private String getPercent() { if (mStorage.signum() == 0) return "0"; - return mStorageCurrent.multiply(ONE_HUNDRED).divide(mStorage).toString(); + return mStorageCurrent.multiply(ONE_HUNDRED) + .divide(mStorage) + .toString(); } @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Fluid Tank").addInfo("Controller block for the YOTTank.").addInfo( - "The max output speed is decided by the amount of stored liquid and the output hatch's capacity.") - .addInfo("The max fluid cell tier is limited by the glass tier.") - .addInfo("HV glass for T1, EV glass for T2, IV glass for T3. . .") - .addInfo("The max height of the cell blocks is 15.").addInfo("The structure is too complex!") - .addInfo(BLUE_PRINT_INFO).addSeparator().beginVariableStructureBlock(5, 5, 1, 15, 5, 5, false) - .addController("Front of the second layer").addCasingInfoExactly("Steel Frame Box", 16, false) - .addCasingInfoRange("Glass (HV+)", 16, 240, true).addCasingInfoRange("Fluid Cell Block", 9, 135, true) - .addCasingInfoRange("YOTTank Casing", 25, 43, false).addInputHatch("Hint block with dot 1") - .addOutputHatch("Hint block with dot 3").toolTipFinisher("Good Generator"); + tt.addMachineType("Fluid Tank") + .addInfo("Controller block for the YOTTank.") + .addInfo("The max output speed is decided by the amount of stored liquid and the output hatch's capacity.") + .addInfo("The max fluid cell tier is limited by the glass tier.") + .addInfo("HV glass for T1, EV glass for T2, IV glass for T3. . .") + .addInfo("The max height of the cell blocks is 15.") + .addInfo("The structure is too complex!") + .addInfo(BLUE_PRINT_INFO) + .addSeparator() + .beginVariableStructureBlock(5, 5, 1, 15, 5, 5, false) + .addController("Front of the second layer") + .addCasingInfoExactly("Steel Frame Box", 16, false) + .addCasingInfoRange("Glass (HV+)", 16, 240, true) + .addCasingInfoRange("Fluid Cell Block", 9, 135, true) + .addCasingInfoRange("YOTTank Casing", 25, 43, false) + .addInputHatch("Hint block with dot 1") + .addOutputHatch("Hint block with dot 3") + .toolTipFinisher("Good Generator"); return tt; } @@ -425,7 +447,8 @@ public class YottaFluidTank extends GT_MetaTileEntity_TooltipMultiBlockBase_EM @Override public boolean onRunningTick(ItemStack aStack) { super.onRunningTick(aStack); - if (this.getBaseMetaTileEntity().isServerSide()) { + if (this.getBaseMetaTileEntity() + .isServerSide()) { ++workTickCounter; if (workTickCounter < 20) { return true; @@ -468,7 +491,10 @@ public class YottaFluidTank extends GT_MetaTileEntity_TooltipMultiBlockBase_EM if (mFluid != null) { // Try to drain 1% of the tank per tick, so 20% per second aka 1/5 - int outputAmount = mStorageCurrent.divide(FIVE).min(MAX_INT_BIGINT).max(BigInteger.ONE).intValueExact(); + int outputAmount = mStorageCurrent.divide(FIVE) + .min(MAX_INT_BIGINT) + .max(BigInteger.ONE) + .intValueExact(); final int originalOutputAmount = outputAmount; for (final GT_MetaTileEntity_Hatch outputHatch : mOutputHatches) { @@ -500,7 +526,7 @@ public class YottaFluidTank extends GT_MetaTileEntity_TooltipMultiBlockBase_EM mStorageCurrent = mStorageCurrent.subtract(BigInteger.valueOf(totalDrainedAmount)); if (mStorageCurrent.signum() < 0) { throw new IllegalStateException( - "YOTTank drained beyond its fluid amount, indicating logic bug: " + mStorageCurrent); + "YOTTank drained beyond its fluid amount, indicating logic bug: " + mStorageCurrent); } } } @@ -522,12 +548,12 @@ public class YottaFluidTank extends GT_MetaTileEntity_TooltipMultiBlockBase_EM @Override public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ, ItemStack toolStack) { + float aX, float aY, float aZ, ItemStack toolStack) { if (side == getBaseMetaTileEntity().getFrontFacing()) { voidExcessEnabled ^= true; aPlayer.addChatMessage( - new ChatComponentTranslation( - voidExcessEnabled ? "yottank.chat.voidExcessEnabled" : "yottank.chat.voidExcessDisabled")); + new ChatComponentTranslation( + voidExcessEnabled ? "yottank.chat.voidExcessEnabled" : "yottank.chat.voidExcessDisabled")); return true; } return false; @@ -535,7 +561,7 @@ public class YottaFluidTank extends GT_MetaTileEntity_TooltipMultiBlockBase_EM @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ, ItemStack toolStack) { + float aX, float aY, float aZ, ItemStack toolStack) { if (side == getBaseMetaTileEntity().getFrontFacing()) { if (mLockedFluid == null) { if (mFluid != null) { @@ -567,14 +593,18 @@ public class YottaFluidTank extends GT_MetaTileEntity_TooltipMultiBlockBase_EM @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean aActive, boolean aRedstone) { + int colorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(1537), - TextureFactory.of(textureFontOn), - TextureFactory.builder().addIcon(textureFontOn_Glow).glow().build() }; + TextureFactory.of(textureFontOn), TextureFactory.builder() + .addIcon(textureFontOn_Glow) + .glow() + .build() }; else return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(1537), - TextureFactory.of(textureFontOff), - TextureFactory.builder().addIcon(textureFontOff_Glow).glow().build() }; + TextureFactory.of(textureFontOff), TextureFactory.builder() + .addIcon(textureFontOff_Glow) + .glow() + .build() }; } else return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(1537) }; } @@ -603,39 +633,36 @@ public class YottaFluidTank extends GT_MetaTileEntity_TooltipMultiBlockBase_EM super.drawTexts(screenElements, inventorySlot); screenElements - .widget( - new TextWidget() - .setStringSupplier( - () -> StatCollector.translateToLocal("gui.YOTTank.0") + " " - + numberFormat.format(mStorage) - + " L") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) - .widget(new FakeSyncWidget.BigIntegerSyncer(() -> mStorage, val -> mStorage = val)) - .widget( - new TextWidget() - .setStringSupplier( - () -> StatCollector.translateToLocal("gui.YOTTank.1") + " " + getFluidName()) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) - .widget(new FakeSyncWidget.FluidStackSyncer(() -> mFluid, val -> mFluid = val)) - .widget( - new TextWidget() - .setStringSupplier( - () -> StatCollector.translateToLocal("gui.YOTTank.2") + " " - + numberFormat.format(mStorageCurrent) - + " L") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) - .widget(new FakeSyncWidget.BigIntegerSyncer(() -> mStorageCurrent, val -> mStorageCurrent = val)) - .widget( - new TextWidget().setStringSupplier( - () -> StatCollector.translateToLocal("gui.YOTTank.3") + " " + getLockedFluidName()) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) - .widget(new FakeSyncWidget.FluidStackSyncer(() -> mLockedFluid, val -> mLockedFluid = val)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> isFluidLocked, val -> isFluidLocked = val)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> voidExcessEnabled, val -> voidExcessEnabled = val)); + .widget( + new TextWidget().setStringSupplier( + () -> StatCollector.translateToLocal("gui.YOTTank.0") + " " + numberFormat.format(mStorage) + " L") + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) + .widget(new FakeSyncWidget.BigIntegerSyncer(() -> mStorage, val -> mStorage = val)) + .widget( + new TextWidget() + .setStringSupplier(() -> StatCollector.translateToLocal("gui.YOTTank.1") + " " + getFluidName()) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) + .widget(new FakeSyncWidget.FluidStackSyncer(() -> mFluid, val -> mFluid = val)) + .widget( + new TextWidget() + .setStringSupplier( + () -> StatCollector.translateToLocal("gui.YOTTank.2") + " " + + numberFormat.format(mStorageCurrent) + + " L") + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) + .widget(new FakeSyncWidget.BigIntegerSyncer(() -> mStorageCurrent, val -> mStorageCurrent = val)) + .widget( + new TextWidget() + .setStringSupplier( + () -> StatCollector.translateToLocal("gui.YOTTank.3") + " " + getLockedFluidName()) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) + .widget(new FakeSyncWidget.FluidStackSyncer(() -> mLockedFluid, val -> mLockedFluid = val)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> isFluidLocked, val -> isFluidLocked = val)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> voidExcessEnabled, val -> voidExcessEnabled = val)); } @Override @@ -643,16 +670,20 @@ public class YottaFluidTank extends GT_MetaTileEntity_TooltipMultiBlockBase_EM return (ButtonWidget) new ButtonWidget().setOnClick((clickData, widget) -> { TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); voidExcessEnabled = !voidExcessEnabled; - }).setPlayClickSound(false).setBackground(() -> { - List<UITexture> ret = new ArrayList<>(); - ret.add(TecTechUITextures.BUTTON_STANDARD_16x16); - ret.add( + }) + .setPlayClickSound(false) + .setBackground(() -> { + List<UITexture> ret = new ArrayList<>(); + ret.add(TecTechUITextures.BUTTON_STANDARD_16x16); + ret.add( voidExcessEnabled ? TecTechUITextures.OVERLAY_BUTTON_SAFE_VOID_ON - : TecTechUITextures.OVERLAY_BUTTON_SAFE_VOID_OFF); - return ret.toArray(new IDrawable[0]); - }).setPos(174, doesBindPlayerInventory() ? 132 : 156).setSize(16, 16) - .addTooltip(StatCollector.translateToLocal("gui.YOTTank.button.void")) - .setTooltipShowUpDelay(TOOLTIP_DELAY); + : TecTechUITextures.OVERLAY_BUTTON_SAFE_VOID_OFF); + return ret.toArray(new IDrawable[0]); + }) + .setPos(174, doesBindPlayerInventory() ? 132 : 156) + .setSize(16, 16) + .addTooltip(StatCollector.translateToLocal("gui.YOTTank.button.void")) + .setTooltipShowUpDelay(TOOLTIP_DELAY); } @Override @@ -660,14 +691,19 @@ public class YottaFluidTank extends GT_MetaTileEntity_TooltipMultiBlockBase_EM return (ButtonWidget) new ButtonWidget().setOnClick((clickData, widget) -> { TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); isFluidLocked = !isFluidLocked; - if (!widget.getContext().isClient()) mLockedFluid = isFluidLocked ? mFluid : null; - }).setPlayClickSound(false).setBackground(() -> { - List<UITexture> ret = new ArrayList<>(); - ret.add(TecTechUITextures.BUTTON_STANDARD_16x16); - ret.add(isFluidLocked ? GG_UITextures.OVERLAY_BUTTON_LOCK_ON : GG_UITextures.OVERLAY_BUTTON_LOCK_OFF); - return ret.toArray(new IDrawable[0]); - }).setPos(174, doesBindPlayerInventory() ? 116 : 140).setSize(16, 16) - .addTooltip(StatCollector.translateToLocal("gui.YOTTank.button.locking")) - .setTooltipShowUpDelay(TOOLTIP_DELAY); + if (!widget.getContext() + .isClient()) mLockedFluid = isFluidLocked ? mFluid : null; + }) + .setPlayClickSound(false) + .setBackground(() -> { + List<UITexture> ret = new ArrayList<>(); + ret.add(TecTechUITextures.BUTTON_STANDARD_16x16); + ret.add(isFluidLocked ? GG_UITextures.OVERLAY_BUTTON_LOCK_ON : GG_UITextures.OVERLAY_BUTTON_LOCK_OFF); + return ret.toArray(new IDrawable[0]); + }) + .setPos(174, doesBindPlayerInventory() ? 116 : 140) + .setSize(16, 16) + .addTooltip(StatCollector.translateToLocal("gui.YOTTank.button.locking")) + .setTooltipShowUpDelay(TOOLTIP_DELAY); } } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_LargeTurbineBase.java b/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_LargeTurbineBase.java index 0ccd83d059..3df71aa25a 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_LargeTurbineBase.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_LargeTurbineBase.java @@ -38,7 +38,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Tool_01; public abstract class GT_MetaTileEntity_LargeTurbineBase extends - GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeTurbineBase> implements ISurvivalConstructable { + GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeTurbineBase> implements ISurvivalConstructable { private static final String STRUCTURE_PIECE_MAIN = "main"; private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeTurbineBase>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeTurbineBase>>() { @@ -46,32 +46,32 @@ public abstract class GT_MetaTileEntity_LargeTurbineBase extends @Override protected IStructureDefinition<GT_MetaTileEntity_LargeTurbineBase> computeValue(Class<?> type) { return StructureDefinition.<GT_MetaTileEntity_LargeTurbineBase>builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { { " ", "xxxxx", "xxxxx", "xxxxx", "xxxxx", }, - { " --- ", "xcccx", "xchcx", "xchcx", "xcccx", }, - { " --- ", "xc~cx", "xh-hx", "xh-hx", "xcdcx", }, - { " --- ", "xcccx", "xchcx", "xchcx", "xcccx", }, - { " ", "xxxxx", "xxxxx", "xxxxx", "xxxxx", }, })) - .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) - .addElement('d', lazy(t -> Dynamo.newAny(t.getCasingTextureIndex(), 1))) - .addElement( - 'h', - lazy( - t -> buildHatchAdder(GT_MetaTileEntity_LargeTurbineBase.class) - .atLeast(Maintenance, InputHatch, OutputHatch, OutputBus, InputBus, Muffler) - .casingIndex(t.getCasingTextureIndex()).dot(2) - .buildAndChain(t.getCasingBlock(), t.getCasingMeta()))) - .addElement( - 'x', - (IStructureElementCheckOnly<GT_MetaTileEntity_LargeTurbineBase>) (aContext, aWorld, aX, aY, - aZ) -> { - TileEntity tTile = aWorld.getTileEntity(aX, aY, aZ); - return !(tTile instanceof IGregTechTileEntity) || !(((IGregTechTileEntity) tTile) - .getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbineBase); - }) - .build(); + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { { " ", "xxxxx", "xxxxx", "xxxxx", "xxxxx", }, + { " --- ", "xcccx", "xchcx", "xchcx", "xcccx", }, + { " --- ", "xc~cx", "xh-hx", "xh-hx", "xcdcx", }, + { " --- ", "xcccx", "xchcx", "xchcx", "xcccx", }, + { " ", "xxxxx", "xxxxx", "xxxxx", "xxxxx", }, })) + .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) + .addElement('d', lazy(t -> Dynamo.newAny(t.getCasingTextureIndex(), 1))) + .addElement( + 'h', + lazy( + t -> buildHatchAdder(GT_MetaTileEntity_LargeTurbineBase.class) + .atLeast(Maintenance, InputHatch, OutputHatch, OutputBus, InputBus, Muffler) + .casingIndex(t.getCasingTextureIndex()) + .dot(2) + .buildAndChain(t.getCasingBlock(), t.getCasingMeta()))) + .addElement( + 'x', + (IStructureElementCheckOnly<GT_MetaTileEntity_LargeTurbineBase>) (aContext, aWorld, aX, aY, aZ) -> { + TileEntity tTile = aWorld.getTileEntity(aX, aY, aZ); + return !(tTile instanceof IGregTechTileEntity) || !(((IGregTechTileEntity) tTile) + .getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbineBase); + }) + .build(); } }; @@ -105,7 +105,7 @@ public abstract class GT_MetaTileEntity_LargeTurbineBase extends public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { maxPower = 0; if (checkPiece(STRUCTURE_PIECE_MAIN, 2, 2, 1) && mMaintenanceHatches.size() == 1 - && mMufflerHatches.isEmpty() == (getPollutionPerTick(null) == 0)) { + && mMufflerHatches.isEmpty() == (getPollutionPerTick(null) == 0)) { maxPower = getMaximumOutput(); return true; } @@ -121,9 +121,9 @@ public abstract class GT_MetaTileEntity_LargeTurbineBase extends @Override public boolean addToMachineList(IGregTechTileEntity tTileEntity, int aBaseCasingIndex) { return addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex()) - || addInputToMachineList(tTileEntity, getCasingTextureIndex()) - || addOutputToMachineList(tTileEntity, getCasingTextureIndex()) - || addMufflerToMachineList(tTileEntity, getCasingTextureIndex()); + || addInputToMachineList(tTileEntity, getCasingTextureIndex()) + || addOutputToMachineList(tTileEntity, getCasingTextureIndex()) + || addMufflerToMachineList(tTileEntity, getCasingTextureIndex()); } @Override @@ -140,29 +140,31 @@ public abstract class GT_MetaTileEntity_LargeTurbineBase extends public @NotNull CheckRecipeResult checkProcessing() { ItemStack controllerSlot = getControllerSlot(); if ((counter & 7) == 0 - && (controllerSlot == null || !(controllerSlot.getItem() instanceof GT_MetaGenerated_Tool) - || controllerSlot.getItemDamage() < 170 - || controllerSlot.getItemDamage() > 179)) { + && (controllerSlot == null || !(controllerSlot.getItem() instanceof GT_MetaGenerated_Tool) + || controllerSlot.getItemDamage() < 170 + || controllerSlot.getItemDamage() > 179)) { stopMachine(); return CheckRecipeResultRegistry.NO_TURBINE_FOUND; } ArrayList<FluidStack> tFluids = getStoredFluids(); if (tFluids.size() > 0) { if (baseEff == 0 || optFlow == 0 - || counter >= 512 - || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled() - || this.getBaseMetaTileEntity().hasInventoryBeenModified()) { + || counter >= 512 + || this.getBaseMetaTileEntity() + .hasWorkJustBeenEnabled() + || this.getBaseMetaTileEntity() + .hasInventoryBeenModified()) { counter = 0; baseEff = GT_Utility.safeInt( - (long) ((5F + ((GT_MetaGenerated_Tool) controllerSlot.getItem()) - .getToolCombatDamage(controllerSlot)) * 1000F)); + (long) ((5F + + ((GT_MetaGenerated_Tool) controllerSlot.getItem()).getToolCombatDamage(controllerSlot)) + * 1000F)); optFlow = GT_Utility.safeInt( - (long) Math.max( - Float.MIN_NORMAL, - ((GT_MetaGenerated_Tool) controllerSlot.getItem()).getToolStats(controllerSlot) - .getSpeedMultiplier() - * GT_MetaGenerated_Tool.getPrimaryMaterial(controllerSlot).mToolSpeed - * 50)); + (long) Math.max( + Float.MIN_NORMAL, + ((GT_MetaGenerated_Tool) controllerSlot.getItem()).getToolStats(controllerSlot) + .getSpeedMultiplier() * GT_MetaGenerated_Tool.getPrimaryMaterial(controllerSlot).mToolSpeed + * 50)); if (optFlow <= 0 || baseEff <= 0) { stopMachine(); // in case the turbine got removed return CheckRecipeResultRegistry.NO_FUEL_FOUND; @@ -240,83 +242,84 @@ public abstract class GT_MetaTileEntity_LargeTurbineBase extends } String tRunning = mMaxProgresstime > 0 - ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.running.true") - + EnumChatFormatting.RESET - : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.running.false") - + EnumChatFormatting.RESET; + ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.running.true") + + EnumChatFormatting.RESET + : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.running.false") + + EnumChatFormatting.RESET; String tMaintainance = getIdealStatus() == getRepairStatus() - ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.maintenance.false") - + EnumChatFormatting.RESET - : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.maintenance.true") - + EnumChatFormatting.RESET; + ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.maintenance.false") + + EnumChatFormatting.RESET + : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.maintenance.true") + + EnumChatFormatting.RESET; int tDura = 0; if (mInventory[1] != null && mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { tDura = GT_Utility.safeInt( - (long) (100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) - * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1])) + 1)); + (long) (100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) + * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1])) + 1)); } long storedEnergy = 0; long maxEnergy = 0; for (GT_MetaTileEntity_Hatch_Dynamo tHatch : filterValidMTEs(mDynamoHatches)) { - storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); + storedEnergy += tHatch.getBaseMetaTileEntity() + .getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity() + .getEUCapacity(); } String[] ret = new String[] { - // 8 Lines available for information panels - tRunning + ": " - + EnumChatFormatting.RED - + GT_Utility.formatNumbers(mEUt) - + EnumChatFormatting.RESET - + " EU/t", /* 1 */ - tMaintainance, /* 2 */ - StatCollector.translateToLocal("GT5U.turbine.efficiency") + ": " - + EnumChatFormatting.YELLOW - + (mEfficiency / 100F) - + EnumChatFormatting.RESET - + "%", /* 2 */ - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(storedEnergy) - + EnumChatFormatting.RESET - + " EU / " - + /* 3 */ EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEnergy) - + EnumChatFormatting.RESET - + " EU", - StatCollector.translateToLocal("GT5U.turbine.flow") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(GT_Utility.safeInt((long) realOptFlow)) - + EnumChatFormatting.RESET - + " L/t" - + /* 4 */ EnumChatFormatting.YELLOW - + " (" - + (looseFit ? StatCollector.translateToLocal("GT5U.turbine.loose") - : StatCollector.translateToLocal("GT5U.turbine.tight")) - + ")", /* 5 */ - StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " - + EnumChatFormatting.GOLD - + GT_Utility.formatNumbers(storedFluid) - + EnumChatFormatting.RESET - + "L", /* 6 */ - StatCollector.translateToLocal("GT5U.turbine.dmg") + ": " - + EnumChatFormatting.RED - + tDura - + EnumChatFormatting.RESET - + "%", /* 7 */ - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " - + EnumChatFormatting.GREEN - + mPollutionReduction - + EnumChatFormatting.RESET - + " %" /* 8 */ + // 8 Lines available for information panels + tRunning + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(mEUt) + + EnumChatFormatting.RESET + + " EU/t", /* 1 */ + tMaintainance, /* 2 */ + StatCollector.translateToLocal("GT5U.turbine.efficiency") + ": " + + EnumChatFormatting.YELLOW + + (mEfficiency / 100F) + + EnumChatFormatting.RESET + + "%", /* 2 */ + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + /* 3 */ EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(GT_Utility.safeInt((long) realOptFlow)) + + EnumChatFormatting.RESET + + " L/t" + + /* 4 */ EnumChatFormatting.YELLOW + + " (" + + (looseFit ? StatCollector.translateToLocal("GT5U.turbine.loose") + : StatCollector.translateToLocal("GT5U.turbine.tight")) + + ")", /* 5 */ + StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " + + EnumChatFormatting.GOLD + + GT_Utility.formatNumbers(storedFluid) + + EnumChatFormatting.RESET + + "L", /* 6 */ + StatCollector.translateToLocal( + "GT5U.turbine.dmg") + ": " + EnumChatFormatting.RED + tDura + EnumChatFormatting.RESET + "%", /* 7 */ + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + + EnumChatFormatting.GREEN + + mPollutionReduction + + EnumChatFormatting.RESET + + " %" /* 8 */ }; - if (!this.getClass().getName().contains("Steam")) + if (!this.getClass() + .getName() + .contains("Steam")) ret[4] = StatCollector.translateToLocal("GT5U.turbine.flow") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.safeInt((long) realOptFlow) - + EnumChatFormatting.RESET - + " L/t"; + + EnumChatFormatting.YELLOW + + GT_Utility.safeInt((long) realOptFlow) + + EnumChatFormatting.RESET + + " L/t"; return ret; } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_TooltipMultiBlockBase_EM.java b/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_TooltipMultiBlockBase_EM.java index 70d92540e4..010dc1db88 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_TooltipMultiBlockBase_EM.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/base/GT_MetaTileEntity_TooltipMultiBlockBase_EM.java @@ -13,7 +13,7 @@ import gregtech.api.interfaces.ISecondaryDescribable; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; public abstract class GT_MetaTileEntity_TooltipMultiBlockBase_EM extends GT_MetaTileEntity_MultiblockBase_EM - implements ISecondaryDescribable { + implements ISecondaryDescribable { private static final Map<Integer, GT_Multiblock_Tooltip_Builder> tooltips = new ConcurrentHashMap<>(); diff --git a/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java b/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java index 5d90368122..5608d19ae4 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java @@ -66,7 +66,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.IDualInputHatch; public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMultiBlockBase_EM - implements IConstructable, ISurvivalConstructable, IOverclockDescriptionProvider { + implements IConstructable, ISurvivalConstructable, IOverclockDescriptionProvider { public static final String MAIN_NAME = "largeFusion"; public static final int M = 1_000_000; @@ -79,41 +79,50 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti @Override protected IStructureDefinition<LargeFusionComputer> computeValue(Class<?> type) { return StructureDefinition.<LargeFusionComputer>builder() - .addShape(MAIN_NAME, transpose(new String[][] { L0, L1, L2, L3, L2, L1, L0 })) - .addElement('H', lazy(x -> ofBlock(x.getCoilBlock(), x.getCoilMeta()))) - .addElement('C', lazy(x -> ofBlock(x.getCasingBlock(), x.getCasingMeta()))) - .addElement('B', lazy(x -> ofBlock(x.getGlassBlock(), x.getGlassMeta()))) - .addElement( - 'I', - lazy( - x -> GT_HatchElementBuilder.<LargeFusionComputer>builder() - .atLeast( - GT_HatchElement.InputHatch.or(GT_HatchElement.InputBus), - GT_HatchElement.OutputHatch) - .adder(LargeFusionComputer::addFluidIO).casingIndex(x.textureIndex()).dot(1) - .hatchItemFilterAnd( - x2 -> filterByMTETier(x2.hatchTier(), Integer.MAX_VALUE)) - .buildAndChain(x.getGlassBlock(), x.getGlassMeta()))) - .addElement( - 'E', - lazy( - x -> GT_HatchElementBuilder.<LargeFusionComputer>builder() - .anyOf(HatchElement.EnergyMulti.or(GT_HatchElement.Energy)) - .adder(LargeFusionComputer::addEnergyInjector).casingIndex(x.textureIndex()) - .hatchItemFilterAnd( - x2 -> filterByMTETier(x2.hatchTier(), Integer.MAX_VALUE)) - .dot(2).buildAndChain(x.getCasingBlock(), x.getCasingMeta()))) - .addElement('F', lazy(x -> ofFrame(x.getFrameBox()))).build(); + .addShape(MAIN_NAME, transpose(new String[][] { L0, L1, L2, L3, L2, L1, L0 })) + .addElement('H', lazy(x -> ofBlock(x.getCoilBlock(), x.getCoilMeta()))) + .addElement('C', lazy(x -> ofBlock(x.getCasingBlock(), x.getCasingMeta()))) + .addElement('B', lazy(x -> ofBlock(x.getGlassBlock(), x.getGlassMeta()))) + .addElement( + 'I', + lazy( + x -> GT_HatchElementBuilder.<LargeFusionComputer>builder() + .atLeast( + GT_HatchElement.InputHatch.or(GT_HatchElement.InputBus), + GT_HatchElement.OutputHatch) + .adder(LargeFusionComputer::addFluidIO) + .casingIndex(x.textureIndex()) + .dot(1) + .hatchItemFilterAnd(x2 -> filterByMTETier(x2.hatchTier(), Integer.MAX_VALUE)) + .buildAndChain(x.getGlassBlock(), x.getGlassMeta()))) + .addElement( + 'E', + lazy( + x -> GT_HatchElementBuilder.<LargeFusionComputer>builder() + .anyOf(HatchElement.EnergyMulti.or(GT_HatchElement.Energy)) + .adder(LargeFusionComputer::addEnergyInjector) + .casingIndex(x.textureIndex()) + .hatchItemFilterAnd(x2 -> filterByMTETier(x2.hatchTier(), Integer.MAX_VALUE)) + .dot(2) + .buildAndChain(x.getCasingBlock(), x.getCasingMeta()))) + .addElement('F', lazy(x -> ofFrame(x.getFrameBox()))) + .build(); } }; static { Textures.BlockIcons.setCasingTextureForId( - 52, - TextureFactory.of( - TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW).extFacing().build(), - TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).extFacing().glow() - .build())); + 52, + TextureFactory.of( + TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) + .extFacing() + .glow() + .build())); } public LargeFusionComputer(String name) { @@ -195,8 +204,8 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti public boolean checkMachine_EM(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { this.eEnergyMulti.clear(); if (structureCheck_EM(MAIN_NAME, 23, 3, 40) && mInputHatches.size() + mDualInputHatches.size() != 0 - && !mOutputHatches.isEmpty() - && (mEnergyHatches.size() + eEnergyMulti.size()) != 0) { + && !mOutputHatches.isEmpty() + && (mEnergyHatches.size() + eEnergyMulti.size()) != 0) { fixAllIssue(); return true; } @@ -236,32 +245,32 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti int offX = aBaseMetaTileEntity.getFrontFacing().offsetX; int offZ = aBaseMetaTileEntity.getFrontFacing().offsetZ; GT_ChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(getChunkX() + offX, getChunkZ() + offZ)); + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(getChunkX() + offX, getChunkZ() + offZ)); GT_ChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(getChunkX() + 1 + offX, getChunkZ() + 1 + offZ)); + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(getChunkX() + 1 + offX, getChunkZ() + 1 + offZ)); GT_ChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(getChunkX() + 1 + offX, getChunkZ() + offZ)); + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(getChunkX() + 1 + offX, getChunkZ() + offZ)); GT_ChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(getChunkX() + 1 + offX, getChunkZ() - 1 + offZ)); + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(getChunkX() + 1 + offX, getChunkZ() - 1 + offZ)); GT_ChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(getChunkX() - 1 + offX, getChunkZ() + 1 + offZ)); + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(getChunkX() - 1 + offX, getChunkZ() + 1 + offZ)); GT_ChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(getChunkX() - 1 + offX, getChunkZ() + offZ)); + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(getChunkX() - 1 + offX, getChunkZ() + offZ)); GT_ChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(getChunkX() - 1 + offX, getChunkZ() - 1 + offZ)); + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(getChunkX() - 1 + offX, getChunkZ() - 1 + offZ)); GT_ChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(getChunkX() + offX, getChunkZ() + 1 + offZ)); + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(getChunkX() + offX, getChunkZ() + 1 + offZ)); GT_ChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(getChunkX() + offX, getChunkZ() - 1 + offZ)); + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(getChunkX() + offX, getChunkZ() - 1 + offZ)); this.isLoadedChunk = true; } @@ -276,8 +285,8 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti mUpdated = false; } if (--mUpdate == 0 || --mStartUpCheck == 0 - || cyclicUpdate_EM() - || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) { + || cyclicUpdate_EM() + || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) { if (mUpdate <= -1000) { mUpdate = 5000; } @@ -294,23 +303,24 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti for (GT_MetaTileEntity_Hatch hatch : filterValidMTEs(hatches)) { long consumableEnergy = Math.min(hatch.getEUVar(), energyLimit); long receivedEnergy = Math - .min(consumableEnergy, maxEUStore() - aBaseMetaTileEntity.getStoredEU()); + .min(consumableEnergy, maxEUStore() - aBaseMetaTileEntity.getStoredEU()); if (receivedEnergy > 0) { - hatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(receivedEnergy, false); + hatch.getBaseMetaTileEntity() + .decreaseStoredEnergyUnits(receivedEnergy, false); aBaseMetaTileEntity.increaseStoredEnergyUnits(receivedEnergy, true); } } if (mMaxProgresstime > 0) { - this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(-lEUt, true); + this.getBaseMetaTileEntity() + .decreaseStoredEnergyUnits(-lEUt, true); if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) { if (mOutputItems != null) for (ItemStack tStack : mOutputItems) if (tStack != null) addOutput(tStack); if (mOutputFluids != null) for (FluidStack tStack : mOutputFluids) if (tStack != null) addOutput(tStack); - mEfficiency = Math.max( - 0, - Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]))); + mEfficiency = Math + .max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]))); mOutputItems = null; mOutputFluids = null; mProgresstime = 0; @@ -321,19 +331,18 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti } } else { if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() - || aBaseMetaTileEntity.hasInventoryBeenModified()) { + || aBaseMetaTileEntity.hasInventoryBeenModified()) { turnCasingActive(mMaxProgresstime > 0); if (aBaseMetaTileEntity.isAllowedToWork()) { if (checkRecipe()) { if (aBaseMetaTileEntity.getStoredEU() - < this.mLastRecipe.mSpecialValue + this.lEUt) { + < this.mLastRecipe.mSpecialValue + this.lEUt) { mMaxProgresstime = 0; turnCasingActive(false); criticalStopMachine(); } - getBaseMetaTileEntity().decreaseStoredEnergyUnits( - this.mLastRecipe.mSpecialValue + this.lEUt, - false); + getBaseMetaTileEntity() + .decreaseStoredEnergyUnits(this.mLastRecipe.mSpecialValue + this.lEUt, false); } } if (mMaxProgresstime <= 0) mEfficiency = Math.max(0, mEfficiency - 1000); @@ -346,7 +355,7 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti } } aBaseMetaTileEntity - .setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mMachine ? 0 : 64)); + .setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mMachine ? 0 : 64)); aBaseMetaTileEntity.setActive(mMaxProgresstime > 0); } else { soundMagic(getActivitySound()); @@ -391,12 +400,16 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean aActive, boolean aRedstone) { - if (side == facing) - return new ITexture[] { TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS).extFacing().build(), - getTextureOverlay() }; + int colorIndex, boolean aActive, boolean aRedstone) { + if (side == facing) return new ITexture[] { TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS) + .extFacing() + .build(), getTextureOverlay() }; if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(52) }; - return new ITexture[] { TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS).extFacing().build() }; + return new ITexture[] { TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS) + .extFacing() + .build() }; } @Override @@ -565,29 +578,29 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti if (mMaxProgresstime > 0) plasmaOut = (double) mOutputFluids[0].amount / mMaxProgresstime; return new String[] { EnumChatFormatting.BLUE + "Fusion Reactor MK " + EnumChatFormatting.RESET + tier, - StatCollector.translateToLocal("scanner.info.UX.0") + ": " - + EnumChatFormatting.LIGHT_PURPLE - + GT_Utility.formatNumbers(this.para) - + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.fusion.req") + ": " - + EnumChatFormatting.RED - + GT_Utility.formatNumbers(-lEUt) - + EnumChatFormatting.RESET - + "EU/t", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(baseMetaTileEntity != null ? baseMetaTileEntity.getStoredEU() : 0) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEUStore()) - + EnumChatFormatting.RESET - + " EU", - StatCollector.translateToLocal("GT5U.fusion.plasma") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(plasmaOut) - + EnumChatFormatting.RESET - + "L/t" }; + StatCollector.translateToLocal("scanner.info.UX.0") + ": " + + EnumChatFormatting.LIGHT_PURPLE + + GT_Utility.formatNumbers(this.para) + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.fusion.req") + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(-lEUt) + + EnumChatFormatting.RESET + + "EU/t", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(baseMetaTileEntity != null ? baseMetaTileEntity.getStoredEU() : 0) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEUStore()) + + EnumChatFormatting.RESET + + " EU", + StatCollector.translateToLocal("GT5U.fusion.plasma") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(plasmaOut) + + EnumChatFormatting.RESET + + "L/t" }; } protected long energyStorageCache; @@ -598,123 +611,123 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti super.drawTexts(screenElements, inventorySlot); screenElements - .widget( - new TextWidget() - .setStringSupplier( - () -> StatCollector.translateToLocal("gui.LargeFusion.0") + " " - + numberFormat.format(energyStorageCache) - + " EU") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) - .widget(new FakeSyncWidget.LongSyncer(this::maxEUStore, val -> energyStorageCache = val)) - .widget( - new TextWidget() - .setStringSupplier( - () -> StatCollector.translateToLocal("gui.LargeFusion.1") + " " - + numberFormat.format(getEUVar()) - + " EU") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) - .widget(new FakeSyncWidget.LongSyncer(this::getEUVar, this::setEUVar)); + .widget( + new TextWidget() + .setStringSupplier( + () -> StatCollector.translateToLocal("gui.LargeFusion.0") + " " + + numberFormat.format(energyStorageCache) + + " EU") + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) + .widget(new FakeSyncWidget.LongSyncer(this::maxEUStore, val -> energyStorageCache = val)) + .widget( + new TextWidget() + .setStringSupplier( + () -> StatCollector.translateToLocal("gui.LargeFusion.1") + " " + + numberFormat.format(getEUVar()) + + " EU") + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) + .widget(new FakeSyncWidget.LongSyncer(this::getEUVar, this::setEUVar)); } public static final String[] L0 = { " ", - " ", " FCCCCCF ", - " FCIBICF ", " FCCCCCF ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " FFF FFF ", - " CCC CCC ", " CIC CIC ", - " CBC CBC ", " CIC CIC ", - " CCC CCC ", " FFF FFF ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " FCCCCCF ", - " FCIBICF ", " FCCCCCF ", - " ", " ", }; + " ", " FCCCCCF ", + " FCIBICF ", " FCCCCCF ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " FFF FFF ", + " CCC CCC ", " CIC CIC ", + " CBC CBC ", " CIC CIC ", + " CCC CCC ", " FFF FFF ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " FCCCCCF ", + " FCIBICF ", " FCCCCCF ", + " ", " ", }; public static final String[] L1 = { " ", - " FCBBBCF ", " CC CC ", - " CCCCC CCCCC ", " CCCCCCC CCCCCCC ", - " CCCCCCC FCBBBCF CCCCCCC ", " CCCCC CCCCC ", - " CCCC CCCC ", " CCC CCC ", - " CCC CCC ", " CCC CCC ", - " CCC CCC ", " CCC CCC ", - " CCC CCC ", " CCC CCC ", - " CCC CCC ", " CCC CCC ", - " CCC CCC ", " CCC CCC ", - " CCC CCC ", " FCCCF FCCCF ", - " C C C C ", " B B B B ", - " B B B B ", " B B B B ", - " C C C C ", " FCCCF FCCCF ", - " CCC CCC ", " CCC CCC ", - " CCC CCC ", " CCC CCC ", - " CCC CCC ", " CCC CCC ", - " CCC CCC ", " CCC CCC ", - " CCC CCC ", " CCC CCC ", - " CCC CCC ", " CCC CCC ", - " CCCC CCCC ", " CCCCC CCCCC ", - " CCCCCCC FCBBBCF CCCCCCC ", " CCCCCCC CCCCCCC ", - " CCCCC CCCCC ", " CC CC ", - " FCBBBCF ", " ", }; + " FCBBBCF ", " CC CC ", + " CCCCC CCCCC ", " CCCCCCC CCCCCCC ", + " CCCCCCC FCBBBCF CCCCCCC ", " CCCCC CCCCC ", + " CCCC CCCC ", " CCC CCC ", + " CCC CCC ", " CCC CCC ", + " CCC CCC ", " CCC CCC ", + " CCC CCC ", " CCC CCC ", + " CCC CCC ", " CCC CCC ", + " CCC CCC ", " CCC CCC ", + " CCC CCC ", " FCCCF FCCCF ", + " C C C C ", " B B B B ", + " B B B B ", " B B B B ", + " C C C C ", " FCCCF FCCCF ", + " CCC CCC ", " CCC CCC ", + " CCC CCC ", " CCC CCC ", + " CCC CCC ", " CCC CCC ", + " CCC CCC ", " CCC CCC ", + " CCC CCC ", " CCC CCC ", + " CCC CCC ", " CCC CCC ", + " CCCC CCCC ", " CCCCC CCCCC ", + " CCCCCCC FCBBBCF CCCCCCC ", " CCCCCCC CCCCCCC ", + " CCCCC CCCCC ", " CC CC ", + " FCBBBCF ", " ", }; public static final String[] L2 = { " FCCCCCF ", - " CC CC ", " CCCCC CCCCC ", - " CCCCCHHHHHHHHHCCCCC ", " CCCCHHHCC CCHHHCCCC ", - " CCCHHCCCCC CCCCCHHCCC ", " ECHHCCCCC FCCCCCF CCCCCHHCE ", - " CCHCCCC CCCCHCC ", " CCHCCC CCCHCC ", - " CCHCE ECHCC ", " ECHCC CCHCE ", - " CCHCE ECHCC ", " CCHCC CCHCC ", - " CCHCC CCHCC ", " CCHCC CCHCC ", - " CCHCC CCHCC ", " CCHCC CCHCC ", - " CCHCC CCHCC ", " CCHCC CCHCC ", - " CCHCC CCHCC ", "FCCHCCF FCCHCCF", - "C H C C H C", "C H C C H C", - "C H C C H C", "C H C C H C", - "C H C C H C", "FCCHCCF FCCHCCF", - " CCHCC CCHCC ", " CCHCC CCHCC ", - " CCHCC CCHCC ", " CCHCC CCHCC ", - " CCHCC CCHCC ", " CCHCC CCHCC ", - " CCHCC CCHCC ", " CCHCC CCHCC ", - " CCHCE ECHCC ", " ECHCC CCHCE ", - " CCHCE ECHCC ", " CCHCCC CCCHCC ", - " CCHCCCC CCCCHCC ", " ECHHCCCCC FCCCCCF CCCCCHHCE ", - " CCCHHCCCCC CCCCCHHCCC ", " CCCCHHHCC CCHHHCCCC ", - " CCCCCHHHHHHHHHCCCCC ", " CCCCC CCCCC ", - " CC CC ", " FCCCCCF ", }; + " CC CC ", " CCCCC CCCCC ", + " CCCCCHHHHHHHHHCCCCC ", " CCCCHHHCC CCHHHCCCC ", + " CCCHHCCCCC CCCCCHHCCC ", " ECHHCCCCC FCCCCCF CCCCCHHCE ", + " CCHCCCC CCCCHCC ", " CCHCCC CCCHCC ", + " CCHCE ECHCC ", " ECHCC CCHCE ", + " CCHCE ECHCC ", " CCHCC CCHCC ", + " CCHCC CCHCC ", " CCHCC CCHCC ", + " CCHCC CCHCC ", " CCHCC CCHCC ", + " CCHCC CCHCC ", " CCHCC CCHCC ", + " CCHCC CCHCC ", "FCCHCCF FCCHCCF", + "C H C C H C", "C H C C H C", + "C H C C H C", "C H C C H C", + "C H C C H C", "FCCHCCF FCCHCCF", + " CCHCC CCHCC ", " CCHCC CCHCC ", + " CCHCC CCHCC ", " CCHCC CCHCC ", + " CCHCC CCHCC ", " CCHCC CCHCC ", + " CCHCC CCHCC ", " CCHCC CCHCC ", + " CCHCE ECHCC ", " ECHCC CCHCE ", + " CCHCE ECHCC ", " CCHCCC CCCHCC ", + " CCHCCCC CCCCHCC ", " ECHHCCCCC FCCCCCF CCCCCHHCE ", + " CCCHHCCCCC CCCCCHHCCC ", " CCCCHHHCC CCHHHCCCC ", + " CCCCCHHHHHHHHHCCCCC ", " CCCCC CCCCC ", + " CC CC ", " FCCCCCF ", }; public static final String[] L3 = { " FCIBICF ", - " CC CC ", " CCCHHHHHHHHHCCC ", - " CCHHHHHHHHHHHHHHHCC ", " CCHHHHHHHHHHHHHHHHHHHCC ", - " CHHHHHHHCC CCHHHHHHHC ", " CHHHHHCCC FCIBICF CCCHHHHHC ", - " CHHHHCC CCHHHHC ", " CHHHCC CCHHHC ", - " CHHHC CHHHC ", " CHHHC CHHHC ", - " CHHHC CHHHC ", " CHHHC CHHHC ", - " CHHHC CHHHC ", " CHHHC CHHHC ", - " CHHHC CHHHC ", " CHHHC CHHHC ", - " CHHHC CHHHC ", " CHHHC CHHHC ", - " CHHHC CHHHC ", "FCHHHCF FCHHHCF", - "C HHH C C HHH C", "I HHH I I HHH I", - "B HHH B B HHH B", "I HHH I I HHH I", - "C HHH C C HHH C", "FCHHHCF FCHHHCF", - " CHHHC CHHHC ", " CHHHC CHHHC ", - " CHHHC CHHHC ", " CHHHC CHHHC ", - " CHHHC CHHHC ", " CHHHC CHHHC ", - " CHHHC CHHHC ", " CHHHC CHHHC ", - " CHHHC CHHHC ", " CHHHC CHHHC ", - " CHHHC CHHHC ", " CHHHCC CCHHHC ", - " CHHHHCC CCHHHHC ", " CHHHHHCCC FCI~ICF CCCHHHHHC ", - " CHHHHHHHCC CCHHHHHHHC ", " CCHHHHHHHHHHHHHHHHHHHCC ", - " CCHHHHHHHHHHHHHHHCC ", " CCCHHHHHHHHHCCC ", - " CC CC ", " FCIBICF ", }; + " CC CC ", " CCCHHHHHHHHHCCC ", + " CCHHHHHHHHHHHHHHHCC ", " CCHHHHHHHHHHHHHHHHHHHCC ", + " CHHHHHHHCC CCHHHHHHHC ", " CHHHHHCCC FCIBICF CCCHHHHHC ", + " CHHHHCC CCHHHHC ", " CHHHCC CCHHHC ", + " CHHHC CHHHC ", " CHHHC CHHHC ", + " CHHHC CHHHC ", " CHHHC CHHHC ", + " CHHHC CHHHC ", " CHHHC CHHHC ", + " CHHHC CHHHC ", " CHHHC CHHHC ", + " CHHHC CHHHC ", " CHHHC CHHHC ", + " CHHHC CHHHC ", "FCHHHCF FCHHHCF", + "C HHH C C HHH C", "I HHH I I HHH I", + "B HHH B B HHH B", "I HHH I I HHH I", + "C HHH C C HHH C", "FCHHHCF FCHHHCF", + " CHHHC CHHHC ", " CHHHC CHHHC ", + " CHHHC CHHHC ", " CHHHC CHHHC ", + " CHHHC CHHHC ", " CHHHC CHHHC ", + " CHHHC CHHHC ", " CHHHC CHHHC ", + " CHHHC CHHHC ", " CHHHC CHHHC ", + " CHHHC CHHHC ", " CHHHCC CCHHHC ", + " CHHHHCC CCHHHHC ", " CHHHHHCCC FCI~ICF CCCHHHHHC ", + " CHHHHHHHCC CCHHHHHHHC ", " CCHHHHHHHHHHHHHHHHHHHCC ", + " CCHHHHHHHHHHHHHHHCC ", " CCCHHHHHHHHHCCC ", + " CC CC ", " FCIBICF ", }; } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputerPP.java b/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputerPP.java index 86ba84c5fb..7d87e6fdd1 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputerPP.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputerPP.java @@ -16,10 +16,10 @@ public abstract class LargeFusionComputerPP extends LargeFusionComputer { /** Name of the batch setting */ private static final INameFunction<LargeFusionComputerPP> BATCH_SETTING_NAME = (base, - p) -> translateToLocal("gt.blockmachines.LargeFusionComputerPP.cfgi.0"); // Batch size + p) -> translateToLocal("gt.blockmachines.LargeFusionComputerPP.cfgi.0"); // Batch size /** Status of the batch setting */ private static final IStatusFunction<LargeFusionComputerPP> BATCH_STATUS = (base, p) -> LedStatus - .fromLimitsInclusiveOuterBoundary(p.get(), 1, 0, 32, 128); + .fromLimitsInclusiveOuterBoundary(p.get(), 1, 0, 32, 128); public LargeFusionComputerPP(String name) { super(name); @@ -36,7 +36,8 @@ public abstract class LargeFusionComputerPP extends LargeFusionComputer { @Override protected void parametersInstantiation_EM() { - batchSetting = parametrization.getGroup(9, false).makeInParameter(1, 1, BATCH_SETTING_NAME, BATCH_STATUS); + batchSetting = parametrization.getGroup(9, false) + .makeInParameter(1, 1, BATCH_SETTING_NAME, BATCH_STATUS); } @Override |