diff options
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common')
117 files changed, 6651 insertions, 5728 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java index 71f809ae99..c53e217560 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java @@ -48,21 +48,26 @@ public class Meta_GT_Proxy { try { String aNewHeatedWaterName = "Heated Water"; Logger.INFO("Renaming [IC2 Hotspring Water] --> [" + aNewHeatedWaterName + "]."); - LanguageRegistry.instance().addStringLocalization("fluidHotWater", "Heated Water"); - LanguageRegistry.instance().addStringLocalization("fluidHotWater", aNewHeatedWaterName); - LanguageRegistry.instance().addStringLocalization("ic2.fluidHotWater", aNewHeatedWaterName); + LanguageRegistry.instance() + .addStringLocalization("fluidHotWater", "Heated Water"); + LanguageRegistry.instance() + .addStringLocalization("fluidHotWater", aNewHeatedWaterName); + LanguageRegistry.instance() + .addStringLocalization("ic2.fluidHotWater", aNewHeatedWaterName); GT_LanguageManager.addStringLocalization("fluidHotWater", aNewHeatedWaterName); GT_LanguageManager.addStringLocalization("ic2.fluidHotWater", aNewHeatedWaterName); Block b = BlocksItems.getFluidBlock(InternalName.fluidHotWater); if (b != null) { LanguageRegistry.addName(ItemUtils.getSimpleStack(b), aNewHeatedWaterName); - LanguageRegistry.instance().addStringLocalization(b.getUnlocalizedName(), aNewHeatedWaterName); + LanguageRegistry.instance() + .addStringLocalization(b.getUnlocalizedName(), aNewHeatedWaterName); GT_LanguageManager.addStringLocalization(b.getUnlocalizedName(), aNewHeatedWaterName); } Fluid f = BlocksItems.getFluid(InternalName.fluidHotWater); if (f != null) { - LanguageRegistry.instance().addStringLocalization(f.getUnlocalizedName(), aNewHeatedWaterName); + LanguageRegistry.instance() + .addStringLocalization(f.getUnlocalizedName(), aNewHeatedWaterName); GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), aNewHeatedWaterName); int aDam = FluidRegistry.getFluidID(f); ItemStack s = ItemList.Display_Fluid.getWithDamage(1, aDam); @@ -72,15 +77,15 @@ public class Meta_GT_Proxy { } String[] aLangs = new String[] { "de_DE", "en_US", "en_GB", "en_IC", "es_AR", "es_ES", "es_MX", "es_UY", - "es_VE", "fr_CA", "fr_FR", "it_IT", "ko_KR", "pt_BR", "pt_PT", "ru_RU", "sv_SE", "tr_TR", "zh_CN", - "zh_TW", }; + "es_VE", "fr_CA", "fr_FR", "it_IT", "ko_KR", "pt_BR", "pt_PT", "ru_RU", "sv_SE", "tr_TR", "zh_CN", + "zh_TW", }; String[] aLangValues = new String[] { "Erhitztes Wasser", "Heated Water", "Heated Water", "Heated Water", - "Agua caliente", "Agua caliente", "Agua caliente", "Agua caliente", "Agua caliente", "Eau chauffée", - "Eau chauffée", "Acqua riscaldata", "온수", "Água aquecida", "Água aquecida", "Вода с подогревом", - "Uppvärmt vatten", "Isıtılmış Su", "热水", "热水", }; + "Agua caliente", "Agua caliente", "Agua caliente", "Agua caliente", "Agua caliente", "Eau chauffée", + "Eau chauffée", "Acqua riscaldata", "온수", "Água aquecida", "Água aquecida", "Вода с подогревом", + "Uppvärmt vatten", "Isıtılmış Su", "热水", "热水", }; for (int i = 0; i < aLangs.length; i++) { - Logger.REFLECTION( - "Trying to inject new lang data for " + aLangs[i] + ", using value: " + aLangValues[i]); + Logger + .REFLECTION("Trying to inject new lang data for " + aLangs[i] + ", using value: " + aLangValues[i]); LangUtils.rewriteEntryForLanguageRegistry(aLangs[i], "fluidHotWater", aLangValues[i]); LangUtils.rewriteEntryForLanguageRegistry(aLangs[i], "ic2.fluidHotWater", aLangValues[i]); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java index 64185ca239..ee0d040394 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java @@ -29,10 +29,10 @@ public class GregtechMetaCasingBlocks extends GregtechMetaCasingBlocksAbstract { GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Centrifuge Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Structural Coke Oven Casing"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".2.name", "Heat Resistant Coke Oven Casing"); + .addStringLocalization(this.getUnlocalizedName() + ".2.name", "Heat Resistant Coke Oven Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Heat Proof Coke Oven Casing"); // 60 GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".4.name", "Material Press Machine Casing"); + .addStringLocalization(this.getUnlocalizedName() + ".4.name", "Material Press Machine Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Electrolyzer Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Wire Factory Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Maceration Stack Casing"); @@ -43,7 +43,7 @@ public class GregtechMetaCasingBlocks extends GregtechMetaCasingBlocksAbstract { GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Hastelloy-N Reactor Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Zeron-100 Reactor Shielding"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".14.name", "Blast Smelter Heat Containment Coil "); + .addStringLocalization(this.getUnlocalizedName() + ".14.name", "Blast Smelter Heat Containment Coil "); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Blast Smelter Casing Block"); GregtechItemList.Casing_Centrifuge1.set(new ItemStack(this, 1, 0)); GregtechItemList.Casing_CokeOven.set(new ItemStack(this, 1, 1)); @@ -71,9 +71,9 @@ public class GregtechMetaCasingBlocks extends GregtechMetaCasingBlocksAbstract { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, - final int ordinalSide) { + final int ordinalSide) { final GregtechMetaCasingBlocks i = this; return CasingTextureHandler - .handleCasingsGT(aWorld, xCoord, yCoord, zCoord, ForgeDirection.getOrientation(ordinalSide), i); + .handleCasingsGT(aWorld, xCoord, yCoord, zCoord, ForgeDirection.getOrientation(ordinalSide), i); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java index 9a82ecf93b..9d53c281a2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java @@ -71,12 +71,12 @@ public class GregtechMetaCasingBlocks2 extends GregtechMetaCasingBlocksAbstract GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Hastelloy-N Sealant Block"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Hastelloy-X Structural Block"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".3.name", "Incoloy-DS Fluid Containment Block"); + .addStringLocalization(this.getUnlocalizedName() + ".3.name", "Incoloy-DS Fluid Containment Block"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Wash Plant Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Industrial Sieve Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Large Sieve Grate"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell (EV)"); + .addStringLocalization(this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell (EV)"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Sub-Station External Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Cyclotron Coil"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Cyclotron Outer Casing"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java index 5a16d0a20d..76fb077de1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java @@ -57,20 +57,20 @@ public class GregtechMetaCasingBlocks3 extends GregtechMetaCasingBlocksAbstract GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Multi-Use Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Trinium Plated Casing"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".4.name", "Vanadium Redox Power Cell (IV)"); + .addStringLocalization(this.getUnlocalizedName() + ".4.name", "Vanadium Redox Power Cell (IV)"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".5.name", "Vanadium Redox Power Cell (LuV)"); + .addStringLocalization(this.getUnlocalizedName() + ".5.name", "Vanadium Redox Power Cell (LuV)"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".6.name", "Vanadium Redox Power Cell (ZPM)"); + .addStringLocalization(this.getUnlocalizedName() + ".6.name", "Vanadium Redox Power Cell (ZPM)"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell (UV)"); + .addStringLocalization(this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell (UV)"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".8.name", "Vanadium Redox Power Cell (UHV)"); + .addStringLocalization(this.getUnlocalizedName() + ".8.name", "Vanadium Redox Power Cell (UHV)"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Supply Depot Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Advanced Cryogenic Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Volcanus Casing"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".12.name", "Fusion Machine Casing MK III"); + .addStringLocalization(this.getUnlocalizedName() + ".12.name", "Fusion Machine Casing MK III"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Advanced Fusion Coil"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "Unnamed"); // Can Use, don't // change texture @@ -102,7 +102,7 @@ public class GregtechMetaCasingBlocks3 extends GregtechMetaCasingBlocksAbstract @SideOnly(Side.CLIENT) @Override public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, - final int ordinalSide) { + final int ordinalSide) { final Block thisBlock = aWorld.getBlock(xCoord, yCoord, zCoord); final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); if ((tMeta != 12) || !GregtechMetaCasingBlocks3.mConnectedMachineTextures) { @@ -111,18 +111,18 @@ public class GregtechMetaCasingBlocks3 extends GregtechMetaCasingBlocksAbstract final int tStartIndex = 0; if (tMeta == 12) { final boolean[] tConnectedSides = { - aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock - && aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta, - aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock - && aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta, - aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock - && aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta, - aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock - && aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta, - aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock - && aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta, - aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock - && aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta }; + aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock + && aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta, + aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock + && aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta, + aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock + && aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta, + aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock + && aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta, + aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock + && aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta, + aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock + && aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta }; switch (ordinalSide) { case 0: { if (tConnectedSides[0]) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java index cf9d272398..a150d7e828 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java @@ -30,7 +30,7 @@ public class GregtechMetaCasingBlocks4 extends GregtechMetaCasingBlocksAbstract GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Naquadah Containment Chamber"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Tempered Arc Furnace Casing"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".4.name", "Quantum Force Transformer Coil Casings"); + .addStringLocalization(this.getUnlocalizedName() + ".4.name", "Quantum Force Transformer Coil Casings"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Vacuum Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Turbodyne Casing"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java index 26c747e50e..cc573cd188 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java @@ -49,9 +49,9 @@ public class GregtechMetaCasingBlocks5 extends GregtechMetaCasingBlocksAbstract GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "SpaceTime Continuum Ripper"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Neutron Shielding Core"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".12.name", "Cosmic Fabric Shielding Core"); + .addStringLocalization(this.getUnlocalizedName() + ".12.name", "Cosmic Fabric Shielding Core"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".13.name", "Infinity Infused Shielding Core"); + .addStringLocalization(this.getUnlocalizedName() + ".13.name", "Infinity Infused Shielding Core"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "SpaceTime Bending Core"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Force Field Glass"); @@ -152,7 +152,7 @@ public class GregtechMetaCasingBlocks5 extends GregtechMetaCasingBlocksAbstract @Override @SideOnly(Side.CLIENT) public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, - final int ordinalSide) { + final int ordinalSide) { final GregtechMetaCasingBlocks5 i = this; return mGrinderOverlayHandler.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, ordinalSide, i); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks6.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks6.java index a1b97bf341..d257078461 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks6.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks6.java @@ -64,7 +64,7 @@ public class GregtechMetaCasingBlocks6 extends GregtechMetaCasingBlocksAbstract @SideOnly(Side.CLIENT) @Override public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, - final int ordinalSide) { + final int ordinalSide) { final Block thisBlock = aWorld.getBlock(xCoord, yCoord, zCoord); final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); if ((tMeta != 0) || !GregtechMetaCasingBlocks6.mConnectedMachineTextures) { @@ -73,18 +73,18 @@ public class GregtechMetaCasingBlocks6 extends GregtechMetaCasingBlocksAbstract final int tStartIndex = 0; if (tMeta == 0) { final boolean[] tConnectedSides = { - aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock - && aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta, - aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock - && aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta, - aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock - && aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta, - aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock - && aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta, - aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock - && aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta, - aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock - && aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta }; + aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock + && aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta, + aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock + && aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta, + aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock + && aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta, + aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock + && aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta, + aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock + && aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta, + aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock + && aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta }; switch (ordinalSide) { case 0: { if (tConnectedSides[0]) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java index 2d4973aa9f..a87f6c92b3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java @@ -27,13 +27,13 @@ import gtPlusPlus.core.creative.AddToCreativeTab; public abstract class GregtechMetaCasingBlocksAbstract extends GT_Block_Casings_Abstract { public GregtechMetaCasingBlocksAbstract(final Class<? extends ItemBlock> aItemClass, final String aName, - final Material aMaterial) { + final Material aMaterial) { super(aItemClass, aName, aMaterial); this.setStepSound(soundTypeMetal); this.setCreativeTab(AddToCreativeTab.tabMachines); GregTech_API.registerMachineBlock(this, -1); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this"); + .addStringLocalization(this.getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this"); } @Override @@ -105,7 +105,7 @@ public abstract class GregtechMetaCasingBlocksAbstract extends GT_Block_Casings_ @Override public void breakBlock(final World aWorld, final int aX, final int aY, final int aZ, final Block aBlock, - final int aMetaData) { + final int aMetaData) { if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } @@ -113,7 +113,7 @@ public abstract class GregtechMetaCasingBlocksAbstract extends GT_Block_Casings_ @Override public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, - final int z) { + final int z) { return false; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java index 17b5507416..ad2b11f924 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java @@ -22,7 +22,7 @@ public class GregtechMetaCasingBlocksPipeGearbox extends GregtechMetaCasingBlock GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Eglin Steel Gear Box Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Inconel-792 Gear Box Casing"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".2.name", "Incoloy MA956 Gear Box Casing"); + .addStringLocalization(this.getUnlocalizedName() + ".2.name", "Incoloy MA956 Gear Box Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Nitinol-60 Gear Box Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Zeron-100 Gear Box Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Pikyonium Gear Box Casing"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java index d6ebda4199..23d9ab5007 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java @@ -12,17 +12,17 @@ import gregtech.api.util.GT_LanguageManager; public abstract class GregtechMetaItemCasingsAbstract extends ItemBlock { protected final String mCasing_Centrifuge = GT_LanguageManager - .addStringLocalization("mu.centrifugecasing", "Warning! Standing in the Centrifuge not recommended"); + .addStringLocalization("mu.centrifugecasing", "Warning! Standing in the Centrifuge not recommended"); protected final String mCasing_CokeOven = GT_LanguageManager - .addStringLocalization("mu.cokeoven", "Sturdy and Strong"); + .addStringLocalization("mu.cokeoven", "Sturdy and Strong"); protected final String mCasing_CokeCoil1 = GT_LanguageManager - .addStringLocalization("mu.coil01tooltip", "Base Heating Capacity = 1350 Kelvin"); + .addStringLocalization("mu.coil01tooltip", "Base Heating Capacity = 1350 Kelvin"); protected final String mCasing_CokeCoil2 = GT_LanguageManager - .addStringLocalization("mu.coil02tooltip", "Base Heating Capacity = 2275 Kelvin"); + .addStringLocalization("mu.coil02tooltip", "Base Heating Capacity = 2275 Kelvin"); protected final String mNoMobsToolTip = GT_LanguageManager - .addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + .addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); protected final String mNoTileEntityToolTip = GT_LanguageManager - .addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); + .addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); public GregtechMetaItemCasingsAbstract(final Block par1) { super(par1); @@ -43,7 +43,7 @@ public abstract class GregtechMetaItemCasingsAbstract extends ItemBlock { @Override public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, - final boolean aF3_H) { + final boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); switch (this.getDamage(aStack)) { case 0: diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java index a8ea05ddbc..473c13f3da 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java @@ -50,12 +50,12 @@ public class GregtechMetaSpecialMachineCasings extends GregtechMetaCasingBlocksA } GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Strong Bronze Machine Casing"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".1.name", "Sturdy Aluminium Machine Casing"); + .addStringLocalization(this.getUnlocalizedName() + ".1.name", "Sturdy Aluminium Machine Casing"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".2.name", "Vigorous Laurenium Machine Casing"); + .addStringLocalization(this.getUnlocalizedName() + ".2.name", "Vigorous Laurenium Machine Casing"); TAE.registerTexture(84, new GTPP_CopiedBlockTexture(this, 6, 2)); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".3.name", "Rugged Botmium Machine Casing"); + .addStringLocalization(this.getUnlocalizedName() + ".3.name", "Rugged Botmium Machine Casing"); GregtechItemList.Casing_Machine_Custom_1.set(new ItemStack(this, 1, 0)); GregtechItemList.Casing_Machine_Custom_2.set(new ItemStack(this, 1, 1)); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java index 411fef65d3..1d7c853e71 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java @@ -42,13 +42,13 @@ public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbs super(SpecialCasingItemBlock.class, "gtplusplus.blockspecialcasings.1", GT_Material_Casings.INSTANCE); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Turbine Shaft"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".1.name", "Reinforced Steam Turbine Casing"); + .addStringLocalization(this.getUnlocalizedName() + ".1.name", "Reinforced Steam Turbine Casing"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".2.name", "Reinforced HP Steam Turbine Casing"); + .addStringLocalization(this.getUnlocalizedName() + ".2.name", "Reinforced HP Steam Turbine Casing"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".3.name", "Reinforced Gas Turbine Casing"); + .addStringLocalization(this.getUnlocalizedName() + ".3.name", "Reinforced Gas Turbine Casing"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".4.name", "Reinforced Plasma Turbine Casing"); + .addStringLocalization(this.getUnlocalizedName() + ".4.name", "Reinforced Plasma Turbine Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Tesla Containment Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Structural Solar Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Salt Containment Casing"); @@ -56,14 +56,14 @@ public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbs GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Flotation Cell Casings"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Reinforced Engine Casing"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".11.name", "Molecular Containment Casing"); + .addStringLocalization(this.getUnlocalizedName() + ".11.name", "Molecular Containment Casing"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".12.name", "High Voltage Current Capacitor"); + .addStringLocalization(this.getUnlocalizedName() + ".12.name", "High Voltage Current Capacitor"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Particle Containment Casing"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".14.name", "Reinforced Heat Exchanger Casing"); + .addStringLocalization(this.getUnlocalizedName() + ".14.name", "Reinforced Heat Exchanger Casing"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".15.name", "Reinforced SC Turbine Casing"); + .addStringLocalization(this.getUnlocalizedName() + ".15.name", "Reinforced SC Turbine Casing"); TAE.registerTexture(1, 12, new GTPP_CopiedBlockTexture(this, 6, 14)); GregtechItemList.Casing_Turbine_Shaft.set(new ItemStack(this, 1, 0)); @@ -86,9 +86,9 @@ public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbs @Override @SideOnly(Side.CLIENT) public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, - final int ordinalSide) { + final int ordinalSide) { return LargeTurbineTextureHandler - .handleCasingsGT(aWorld, xCoord, yCoord, zCoord, ForgeDirection.getOrientation(ordinalSide), this); + .handleCasingsGT(aWorld, xCoord, yCoord, zCoord, ForgeDirection.getOrientation(ordinalSide), this); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java index d9ae7fc1c6..9a2912c2c5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java @@ -74,7 +74,7 @@ public class GregtechMetaSpecialMultiCasings2 extends GregtechMetaCasingBlocksAb @Override @SideOnly(Side.CLIENT) public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, - final int ordinalSide) { + final int ordinalSide) { return getStaticIcon((byte) ordinalSide, (byte) aWorld.getBlockMetadata(xCoord, yCoord, zCoord)); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java index 7ad9faae2b..e478bf5c18 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java @@ -23,118 +23,118 @@ public class GregtechFluidHandler { Logger.INFO("Adding in our own GT versions of Thermal Foundation Fluids if they do not already exist."); if (!FluidRegistry.isFluidRegistered("cryotheum")) { FluidUtils.addGtFluid( - "cryotheum", - "Gelid Cryotheum", - GT_Materials.Cryotheum, - 4, - -1200, - GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Cryotheum, 1L), - ItemUtils.getEmptyCell(), - 1000); + "cryotheum", + "Gelid Cryotheum", + GT_Materials.Cryotheum, + 4, + -1200, + GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Cryotheum, 1L), + ItemUtils.getEmptyCell(), + 1000); } if (!FluidRegistry.isFluidRegistered("pyrotheum")) { FluidUtils.addGtFluid( - "pyrotheum", - "Blazing Pyrotheum", - GT_Materials.Pyrotheum, - 4, - 4000, - GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Pyrotheum, 1L), - ItemUtils.getEmptyCell(), - 1000); + "pyrotheum", + "Blazing Pyrotheum", + GT_Materials.Pyrotheum, + 4, + 4000, + GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Pyrotheum, 1L), + ItemUtils.getEmptyCell(), + 1000); } if (!FluidRegistry.isFluidRegistered("ender")) { FluidUtils.addGtFluid( - "ender", - "Resonant Ender", - GT_Materials.Ender, - 4, - 4000, - GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Ender, 1L), - ItemUtils.getEmptyCell(), - 1000); + "ender", + "Resonant Ender", + GT_Materials.Ender, + 4, + 4000, + GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Ender, 1L), + ItemUtils.getEmptyCell(), + 1000); } Logger.INFO("Adding in GT Fluids for various nuclear related content."); FluidUtils.addGtFluid( - "hydrofluoricAcid", - "Industrial Strength Hydrofluoric Acid", - GT_Materials.HydrofluoricAcid, - 1, - 120, - GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrofluoricAcid, 1L), - ItemUtils.getEmptyCell(), - 1000, - false); + "hydrofluoricAcid", + "Industrial Strength Hydrofluoric Acid", + GT_Materials.HydrofluoricAcid, + 1, + 120, + GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrofluoricAcid, 1L), + ItemUtils.getEmptyCell(), + 1000, + false); generateIC2FluidCell("HydrofluoricAcid"); FluidUtils.generateFluidNoPrefix( - "SulfurDioxide", - "High Quality Sulfur Dioxide", - 263, - GT_Materials.SulfurDioxide.mRGBa); + "SulfurDioxide", + "High Quality Sulfur Dioxide", + 263, + GT_Materials.SulfurDioxide.mRGBa); FluidUtils.addGtFluid( - "sulfurousAcid", - "Sulfurous Acid", - GT_Materials.SulfurousAcid, - 4, - 75, - GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfurousAcid, 1L), - ItemUtils.getEmptyCell(), - 1000, - false); + "sulfurousAcid", + "Sulfurous Acid", + GT_Materials.SulfurousAcid, + 4, + 75, + GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfurousAcid, 1L), + ItemUtils.getEmptyCell(), + 1000, + false); generateIC2FluidCell("SulfurousAcid"); FluidUtils.addGtFluid( - "sulfuricApatite", - "Sulfuric Apatite Mix", - GT_Materials.SulfuricApatite, - 4, - 500, - GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricApatite, 1L), - ItemUtils.getEmptyCell(), - 1000, - false); + "sulfuricApatite", + "Sulfuric Apatite Mix", + GT_Materials.SulfuricApatite, + 4, + 500, + GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricApatite, 1L), + ItemUtils.getEmptyCell(), + 1000, + false); generateIC2FluidCell("SulfuricApatite"); // Check for Hydrogen Chloride if (FluidUtils.getFluidStack("hydrogenchloride", 1) == null) { FluidUtils.addGtFluid( - "hydrogenChloride", - "Industrial Strength Hydrogen Chloride", - GT_Materials.HydrogenChloride, - 4, - 75, - GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrogenChloride, 1L), - ItemUtils.getEmptyCell(), - 1000, - false); - generateIC2FluidCell("HydrogenChloride"); - } - - FluidUtils.addGtFluid( - "sulfuricLithium", - "Sulfuric Lithium Mix", - GT_Materials.SulfuricLithium, + "hydrogenChloride", + "Industrial Strength Hydrogen Chloride", + GT_Materials.HydrogenChloride, 4, - 280, - GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricLithium, 1L), + 75, + GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrogenChloride, 1L), ItemUtils.getEmptyCell(), 1000, false); + generateIC2FluidCell("HydrogenChloride"); + } + + FluidUtils.addGtFluid( + "sulfuricLithium", + "Sulfuric Lithium Mix", + GT_Materials.SulfuricLithium, + 4, + 280, + GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricLithium, 1L), + ItemUtils.getEmptyCell(), + 1000, + false); generateIC2FluidCell("SulfuricLithium"); FluidUtils.addGtFluid( - "lithiumHydroxide", - "Lithium Hydroxide", - GT_Materials.LithiumHydroxide, - 4, - 500, - GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.LithiumHydroxide, 1L), - ItemUtils.getEmptyCell(), - 1000, - false); + "lithiumHydroxide", + "Lithium Hydroxide", + GT_Materials.LithiumHydroxide, + 4, + 500, + GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.LithiumHydroxide, 1L), + ItemUtils.getEmptyCell(), + 1000, + false); generateIC2FluidCell("LithiumHydroxide"); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java index 3409277f91..c85bac7115 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java @@ -51,7 +51,7 @@ public class CasingTextureHandler { } public static IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, - final ForgeDirection side, final GregtechMetaCasingBlocks thisBlock) { + final ForgeDirection side, final GregtechMetaCasingBlocks thisBlock) { return gregtechX.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, side, thisBlock); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java index f4d0ec0608..058d2a7f1e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java @@ -52,29 +52,28 @@ public class TexturesCentrifugeMultiblock { private static CustomIcon frontFaceActive_8 = (GT8_9_Active); CustomIcon[] CENTRIFUGE = new CustomIcon[] { frontFace_0, frontFace_1, frontFace_2, frontFace_3, frontFace_4, - frontFace_5, frontFace_6, frontFace_7, frontFace_8 }; + frontFace_5, frontFace_6, frontFace_7, frontFace_8 }; CustomIcon[] CENTRIFUGE_ACTIVE = new CustomIcon[] { frontFaceActive_0, frontFaceActive_1, frontFaceActive_2, - frontFaceActive_3, frontFaceActive_4, frontFaceActive_5, frontFaceActive_6, frontFaceActive_7, - frontFaceActive_8 }; + frontFaceActive_3, frontFaceActive_4, frontFaceActive_5, frontFaceActive_6, frontFaceActive_7, + frontFaceActive_8 }; public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, - final ForgeDirection side, final GregtechMetaCasingBlocks thisBlock) { + final ForgeDirection side, final GregtechMetaCasingBlocks thisBlock) { return this.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, side, thisBlock); } private static int isCentrifugeControllerWithSide(IBlockAccess aWorld, int aX, int aY, int aZ, - ForgeDirection side) { + ForgeDirection side) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (!(tTileEntity instanceof IGregTechTileEntity tTile)) return 0; if (tTile.getMetaTileEntity() instanceof GregtechMetaTileEntity_IndustrialCentrifuge - && tTile.getFrontFacing() == side) - return tTile.isActive() ? 1 : 2; + && tTile.getFrontFacing() == side) return tTile.isActive() ? 1 : 2; return 0; } public IIcon handleCasingsGT58(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, - final ForgeDirection side, final GregtechMetaCasingBlocks thisBlock) { + final ForgeDirection side, final GregtechMetaCasingBlocks thisBlock) { final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); final int ordinalSide = side.ordinal(); if (tMeta != 0) { @@ -89,7 +88,7 @@ public class TexturesCentrifugeMultiblock { if (i == 0 && j == 0) continue; if (isCentrifugeControllerWithSide(aWorld, xCoord + j, yCoord, zCoord + i, side) != 0) { IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld - .getTileEntity(xCoord + j, yCoord, zCoord + i)).getMetaTileEntity(); + .getTileEntity(xCoord + j, yCoord, zCoord + i)).getMetaTileEntity(); return getIconByIndex(tMetaTileEntity, 4 - i * 3 - j); } } @@ -101,7 +100,7 @@ public class TexturesCentrifugeMultiblock { if (i == 0 && j == 0) continue; if (isCentrifugeControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, side) != 0) { IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld - .getTileEntity(xCoord + j, yCoord + i, zCoord)).getMetaTileEntity(); + .getTileEntity(xCoord + j, yCoord + i, zCoord)).getMetaTileEntity(); return getIconByIndex(tMetaTileEntity, 4 + i * 3 - j * tInvertLeftRightMod); } } @@ -113,7 +112,7 @@ public class TexturesCentrifugeMultiblock { if (i == 0 && j == 0) continue; if (isCentrifugeControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, side) != 0) { IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld - .getTileEntity(xCoord, yCoord + i, zCoord + j)).getMetaTileEntity(); + .getTileEntity(xCoord, yCoord + i, zCoord + j)).getMetaTileEntity(); return getIconByIndex(tMetaTileEntity, 4 + i * 3 + j * tInvertLeftRightMod); } } @@ -127,7 +126,8 @@ public class TexturesCentrifugeMultiblock { if (aTile == null) { return false; } else { - return aTile.getBaseMetaTileEntity().isActive(); + return aTile.getBaseMetaTileEntity() + .isActive(); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java index fab36fbcea..e7d09bd308 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java @@ -52,11 +52,11 @@ public class TexturesGrinderMultiblock { private static CustomIcon frontFaceActive_8 = (GT8_9_Active); CustomIcon[] GRINDER = new CustomIcon[] { frontFace_0, frontFace_1, frontFace_2, frontFace_3, frontFace_4, - frontFace_5, frontFace_6, frontFace_7, frontFace_8 }; + frontFace_5, frontFace_6, frontFace_7, frontFace_8 }; CustomIcon[] GRINDER_ACTIVE = new CustomIcon[] { frontFaceActive_0, frontFaceActive_1, frontFaceActive_2, - frontFaceActive_3, frontFaceActive_4, frontFaceActive_5, frontFaceActive_6, frontFaceActive_7, - frontFaceActive_8 }; + frontFaceActive_3, frontFaceActive_4, frontFaceActive_5, frontFaceActive_6, frontFaceActive_7, + frontFaceActive_8 }; private static int isIsaControllerWithSide(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection side) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); @@ -67,7 +67,7 @@ public class TexturesGrinderMultiblock { } public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, - final int ordinalSide, final GregtechMetaCasingBlocks5 ii) { + final int ordinalSide, final GregtechMetaCasingBlocks5 ii) { final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); final ForgeDirection side = ForgeDirection.getOrientation(ordinalSide); if (tMeta != 1) { @@ -81,7 +81,7 @@ public class TexturesGrinderMultiblock { if (i == 0 && j == 0) continue; if (isIsaControllerWithSide(aWorld, xCoord + j, yCoord, zCoord + i, side) != 0) { IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld - .getTileEntity(xCoord + j, yCoord, zCoord + i)).getMetaTileEntity(); + .getTileEntity(xCoord + j, yCoord, zCoord + i)).getMetaTileEntity(); return getIconByIndex(tMetaTileEntity, 4 - i * 3 - j); } } @@ -93,7 +93,7 @@ public class TexturesGrinderMultiblock { if (i == 0 && j == 0) continue; if (isIsaControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, side) != 0) { IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld - .getTileEntity(xCoord + j, yCoord + i, zCoord)).getMetaTileEntity(); + .getTileEntity(xCoord + j, yCoord + i, zCoord)).getMetaTileEntity(); return getIconByIndex(tMetaTileEntity, 4 + i * 3 - j * tInvertLeftRightMod); } } @@ -105,7 +105,7 @@ public class TexturesGrinderMultiblock { if (i == 0 && j == 0) continue; if (isIsaControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, side) != 0) { IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld - .getTileEntity(xCoord, yCoord + i, zCoord + j)).getMetaTileEntity(); + .getTileEntity(xCoord, yCoord + i, zCoord + j)).getMetaTileEntity(); return getIconByIndex(tMetaTileEntity, 4 + i * 3 + j * tInvertLeftRightMod); } } @@ -119,7 +119,8 @@ public class TexturesGrinderMultiblock { if (aTile == null) { return false; } else { - return aTile.getBaseMetaTileEntity().isActive(); + return aTile.getBaseMetaTileEntity() + .isActive(); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index 47101dad12..743cd0b85b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -55,7 +55,9 @@ public class TexturesGtBlock { @Override public void run() { this.mIcon = GregTech_API.sBlockIcons.registerIcon(this.mModID + ":" + this.mIconName); - Logger.WARNING("FIND ME _ Processing texture: " + this.getTextureFile().getResourcePath()); + Logger.WARNING( + "FIND ME _ Processing texture: " + this.getTextureFile() + .getResourcePath()); } @Override @@ -74,14 +76,14 @@ public class TexturesGtBlock { public static final CustomIcon _PlaceHolder = Internal_PlaceHolder; public static final CustomIcon OVERLAY_ENERGY_OUT_MULTI_BUFFER = new CustomIcon( - "iconsets/OVERLAY_ENERGY_OUT_MULTI_BUFFER"); + "iconsets/OVERLAY_ENERGY_OUT_MULTI_BUFFER"); // Machine Casings // Simple private static final CustomIcon Internal_Casing_Machine_Simple_Top = new CustomIcon("TileEntities/machine_top"); public static final CustomIcon Casing_Machine_Simple_Top = Internal_Casing_Machine_Simple_Top; private static final CustomIcon Internal_Casing_Machine_Simple_Bottom = new CustomIcon( - "TileEntities/machine_bottom"); + "TileEntities/machine_bottom"); public static final CustomIcon Casing_Machine_Simple_Bottom = Internal_Casing_Machine_Simple_Bottom; // Advanced and Ultra private static final CustomIcon Internal_Casing_Machine_Advanced = new CustomIcon("TileEntities/high_adv_machine"); @@ -90,51 +92,51 @@ public class TexturesGtBlock { public static final CustomIcon Casing_Machine_Ultra = Internal_Casing_Machine_Ultra; // Dimensional - Non Overlay private static final CustomIcon Internal_Casing_Machine_Dimensional = new CustomIcon( - "TileEntities/adv_machine_dimensional"); + "TileEntities/adv_machine_dimensional"); public static final CustomIcon Casing_Machine_Dimensional = Internal_Casing_Machine_Dimensional; // Material Casings private static final CustomIcon Internal_Casing_Tantalloy61 = new CustomIcon( - "TileEntities/MACHINE_CASING_STABLE_TANTALLOY61"); + "TileEntities/MACHINE_CASING_STABLE_TANTALLOY61"); public static final CustomIcon Casing_Material_Tantalloy61 = Internal_Casing_Tantalloy61; private static final CustomIcon Internal_Casing_MaragingSteel = new CustomIcon( - "TileEntities/MACHINE_CASING_STABLE_MARAGINGSTEEL"); + "TileEntities/MACHINE_CASING_STABLE_MARAGINGSTEEL"); public static final CustomIcon Casing_Material_MaragingSteel = Internal_Casing_MaragingSteel; private static final CustomIcon Internal_Casing_Stellite = new CustomIcon( - "TileEntities/MACHINE_CASING_STABLE_STELLITE"); + "TileEntities/MACHINE_CASING_STABLE_STELLITE"); public static final CustomIcon Casing_Material_Stellite = Internal_Casing_Stellite; private static final CustomIcon Internal_Casing_Talonite = new CustomIcon( - "TileEntities/MACHINE_CASING_STABLE_TALONITE"); + "TileEntities/MACHINE_CASING_STABLE_TALONITE"); public static final CustomIcon Casing_Material_Talonite = Internal_Casing_Talonite; private static final CustomIcon Internal_Turbine_SC_Casing = new TexturesGtBlock.CustomIcon("iconsets/SC_TURBINE"); public static final CustomIcon Turbine_SC_Material_Casing = Internal_Turbine_SC_Casing; private static final CustomIcon Internal_Casing_Tumbaga = new CustomIcon( - "TileEntities/MACHINE_CASING_STABLE_TUMBAGA"); + "TileEntities/MACHINE_CASING_STABLE_TUMBAGA"); public static final CustomIcon Casing_Material_Tumbaga = Internal_Casing_Tumbaga; private static final CustomIcon Internal_Casing_Zeron100 = new CustomIcon( - "TileEntities/MACHINE_CASING_STABLE_ZERON100"); + "TileEntities/MACHINE_CASING_STABLE_ZERON100"); public static final CustomIcon Casing_Material_Zeron100 = Internal_Casing_Zeron100; private static final CustomIcon Internal_Casing_Potin = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_POTIN"); public static final CustomIcon Casing_Material_Potin = Internal_Casing_Potin; private static final CustomIcon Internal_Casing_Grisium = new CustomIcon( - "TileEntities/MACHINE_CASING_STABLE_GRISIUM"); + "TileEntities/MACHINE_CASING_STABLE_GRISIUM"); public static final CustomIcon Casing_Material_Grisium = Internal_Casing_Grisium; private static final CustomIcon Internal_Casing_RedSteel = new CustomIcon( - "TileEntities/MACHINE_CASING_STABLE_RED_STEEL"); + "TileEntities/MACHINE_CASING_STABLE_RED_STEEL"); public static final CustomIcon Casing_Material_RedSteel = Internal_Casing_RedSteel; private static final CustomIcon Internal_Casing_ZirconiumCarbide = new CustomIcon( - "TileEntities/MACHINE_CASING_STABLE_ZIRCONIUM_CARBIDE"); + "TileEntities/MACHINE_CASING_STABLE_ZIRCONIUM_CARBIDE"); public static final CustomIcon Casing_Material_ZirconiumCarbide = Internal_Casing_ZirconiumCarbide; private static final CustomIcon Internal_Casing_HastelloyX = new CustomIcon( - "TileEntities/MACHINE_CASING_STABLE_HASTELLOY_X"); + "TileEntities/MACHINE_CASING_STABLE_HASTELLOY_X"); public static final CustomIcon Casing_Material_HastelloyX = Internal_Casing_HastelloyX; private static final CustomIcon Internal_Casing_HastelloyN = new CustomIcon( - "TileEntities/MACHINE_CASING_STABLE_HASTELLOY_N"); + "TileEntities/MACHINE_CASING_STABLE_HASTELLOY_N"); public static final CustomIcon Casing_Material_HastelloyN = Internal_Casing_HastelloyN; private static final CustomIcon Internal_Casing_Fluid_IncoloyDS = new CustomIcon( - "TileEntities/MACHINE_CASING_FLUID_INCOLOY_DS"); + "TileEntities/MACHINE_CASING_FLUID_INCOLOY_DS"); public static final CustomIcon Casing_Material_Fluid_IncoloyDS = Internal_Casing_Fluid_IncoloyDS; private static final CustomIcon Internal_Casing_Laurenium = new CustomIcon("TileEntities/MACHINE_CASING_LAURENIUM"); @@ -142,21 +144,21 @@ public class TexturesGtBlock { // Trinium Alloys public static final CustomIcon Casing_Trinium_Titanium = new CustomIcon( - "TileEntities/MACHINE_CASING_STABLE_TRINIUM_TITANIUM"); + "TileEntities/MACHINE_CASING_STABLE_TRINIUM_TITANIUM"); public static final CustomIcon Casing_Trinium_Naquadah_Vent = new CustomIcon( - "TileEntities/MACHINE_CASING_STABLE_TRINIUM_NAQUADAH_VENT"); + "TileEntities/MACHINE_CASING_STABLE_TRINIUM_NAQUADAH_VENT"); // Material Machine/Firebox Casings private static final CustomIcon Internal_Casing_Staballoy_Firebox = new CustomIcon( - "TileEntities/MACHINE_CASING_FIREBOX_STABALLOY"); + "TileEntities/MACHINE_CASING_FIREBOX_STABALLOY"); public static final CustomIcon Casing_Staballoy_Firebox = Internal_Casing_Staballoy_Firebox; // Misc Casings private static final CustomIcon Internal_Casing_Machine_Redstone_Off = new CustomIcon( - "TileEntities/cover_redstone_conductor"); + "TileEntities/cover_redstone_conductor"); public static final CustomIcon Casing_Machine_Redstone_Off = Internal_Casing_Machine_Redstone_Off; private static final CustomIcon Internal_Casing_Machine_Redstone_On = new CustomIcon( - "TileEntities/cover_redstone_emitter"); + "TileEntities/cover_redstone_emitter"); public static final CustomIcon Casing_Machine_Redstone_On = Internal_Casing_Machine_Redstone_On; // Redox Cells @@ -179,7 +181,7 @@ public class TexturesGtBlock { // Centrifuge Casing private static final CustomIcon Internal_Casing_Centrifuge = new CustomIcon( - "TileEntities/MACHINE_CASING_CENTRIFUGE"); + "TileEntities/MACHINE_CASING_CENTRIFUGE"); public static final CustomIcon Casing_Material_Centrifuge = Internal_Casing_Centrifuge; // Quantum Force Transformer Casing @@ -203,7 +205,7 @@ public class TexturesGtBlock { // MACHINE_CASING_FARM_MANAGER_STRUCTURAL // Farm Manager Casings private static final CustomIcon Internal_Casing_Machine_Farm_Manager = new CustomIcon( - "TileEntities/MACHINE_CASING_FARM_MANAGER_STRUCTURAL"); + "TileEntities/MACHINE_CASING_FARM_MANAGER_STRUCTURAL"); public static final CustomIcon Casing_Machine_Farm_Manager = Internal_Casing_Machine_Farm_Manager; // Acacia_Log private static final CustomIcon Internal_Casing_Machine_Acacia_Log = new CustomIcon("TileEntities/log_acacia_top"); @@ -229,12 +231,12 @@ public class TexturesGtBlock { public static final CustomIcon TEXTURE_CASING_AMAZON = new CustomIcon("TileEntities/CASING_AMAZON"); public static final CustomIcon TEXTURE_CASING_ADVANCED_CRYOGENIC = new CustomIcon( - "TileEntities/MACHINE_CASING_ADVANCED_CRYOGENIC"); + "TileEntities/MACHINE_CASING_ADVANCED_CRYOGENIC"); public static final CustomIcon TEXTURE_CASING_ADVANCED_VOLCNUS = new CustomIcon( - "TileEntities/MACHINE_CASING_ADVANCED_VOLCANUS"); + "TileEntities/MACHINE_CASING_ADVANCED_VOLCANUS"); public static final CustomIcon TEXTURE_CASING_ROCKETDYNE = new CustomIcon("TileEntities/MACHINE_CASING_ROCKETDYNE"); public static final CustomIcon TEXTURE_CASING_GRINDING_MILL = new CustomIcon( - "TileEntities/MACHINE_CASING_GRINDING_FACTORY"); + "TileEntities/MACHINE_CASING_GRINDING_FACTORY"); public static final CustomIcon TEXTURE_CASING_FLOTATION = new CustomIcon("TileEntities/MACHINE_CASING_FLOTATION"); // Custom Pipes @@ -243,20 +245,20 @@ public class TexturesGtBlock { // Custom Gearboxes public static final CustomIcon TEXTURE_GEARBOX_GRINDING_MILL = new CustomIcon( - "TileEntities/MACHINE_CASING_GEARBOX_T1"); + "TileEntities/MACHINE_CASING_GEARBOX_T1"); public static final CustomIcon TEXTURE_GEARBOX_GENERIC = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_GENERIC"); public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II = new CustomIcon("iconsets/MACHINE_CASING_FUSION_3"); public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_INNER = new CustomIcon( - "iconsets/MACHINE_CASING_FUSION_COIL_II"); + "iconsets/MACHINE_CASING_FUSION_COIL_II"); public static final CustomIcon TEXTURE_CASING_FUSION_CASING_ULTRA = new CustomIcon( - "iconsets/MACHINE_CASING_FUSION_GLASS_ULTRA"); + "iconsets/MACHINE_CASING_FUSION_GLASS_ULTRA"); public static final CustomIcon TEXTURE_CASING_FUSION_COIL_III = new CustomIcon("iconsets/MACHINE_CASING_FUSION_4"); public static final CustomIcon TEXTURE_CASING_FUSION_COIL_III_INNER = new CustomIcon( - "iconsets/MACHINE_CASING_FUSION_COIL_III"); + "iconsets/MACHINE_CASING_FUSION_COIL_III"); public static final CustomIcon TEXTURE_CASING_FUSION_CASING_HYPER = new CustomIcon( - "iconsets/MACHINE_CASING_FUSION_GLASS_HYPER"); + "iconsets/MACHINE_CASING_FUSION_GLASS_HYPER"); // public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_1 = new CustomIcon("iconsets/FUSIONIII_1"); public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_2 = new CustomIcon("iconsets/FUSIONIII_2"); @@ -288,65 +290,65 @@ public class TexturesGtBlock { // Overlays // Fan Textures private static final CustomIcon Internal_Overlay_Machine_Vent = new CustomIcon( - "TileEntities/machine_top_vent_rotating"); + "TileEntities/machine_top_vent_rotating"); public static final CustomIcon Overlay_Machine_Vent = Internal_Overlay_Machine_Vent; private static final CustomIcon Internal_Overlay_Machine_Vent_Fast = new CustomIcon( - "TileEntities/machine_top_vent_rotating_fast"); + "TileEntities/machine_top_vent_rotating_fast"); public static final CustomIcon Overlay_Machine_Vent_Fast = Internal_Overlay_Machine_Vent_Fast; private static final CustomIcon Internal_Overlay_Machine_Vent_Adv = new CustomIcon( - "TileEntities/adv_machine_vent_rotating"); + "TileEntities/adv_machine_vent_rotating"); // Diesel Engines private static final CustomIcon Internal_Overlay_Machine_Diesel_Vertical = new CustomIcon( - "TileEntities/machine_top_dieselmotor"); + "TileEntities/machine_top_dieselmotor"); public static final CustomIcon Overlay_Machine_Diesel_Vertical = Internal_Overlay_Machine_Diesel_Vertical; private static final CustomIcon Internal_Overlay_Machine_Diesel_Horizontal = new CustomIcon( - "TileEntities/machine_top_dieselmotor2"); + "TileEntities/machine_top_dieselmotor2"); public static final CustomIcon Overlay_Machine_Diesel_Horizontal = Internal_Overlay_Machine_Diesel_Horizontal; private static final CustomIcon Internal_Overlay_Machine_Diesel_Vertical_Active = new CustomIcon( - "TileEntities/machine_top_dieselmotor_active"); + "TileEntities/machine_top_dieselmotor_active"); public static final CustomIcon Overlay_Machine_Diesel_Vertical_Active = Internal_Overlay_Machine_Diesel_Vertical_Active; private static final CustomIcon Internal_Overlay_Machine_Diesel_Horizontal_Active = new CustomIcon( - "TileEntities/machine_top_dieselmotor2_active"); + "TileEntities/machine_top_dieselmotor2_active"); public static final CustomIcon Overlay_Machine_Diesel_Horizontal_Active = Internal_Overlay_Machine_Diesel_Horizontal_Active; // Computer Screens private static final CustomIcon Internal_Casing_Machine_Screen_1 = new CustomIcon( - "TileEntities/adv_machine_screen_random1"); + "TileEntities/adv_machine_screen_random1"); public static final CustomIcon Casing_Machine_Screen_1 = Internal_Casing_Machine_Screen_1; private static final CustomIcon Internal_Casing_Machine_Screen_2 = new CustomIcon( - "TileEntities/adv_machine_screen_random2"); + "TileEntities/adv_machine_screen_random2"); public static final CustomIcon Casing_Machine_Screen_2 = Internal_Casing_Machine_Screen_2; private static final CustomIcon Internal_Casing_Machine_Screen_3 = new CustomIcon( - "TileEntities/adv_machine_screen_random3"); + "TileEntities/adv_machine_screen_random3"); public static final CustomIcon Casing_Machine_Screen_3 = Internal_Casing_Machine_Screen_3; private static final CustomIcon Internal_Casing_Machine_Screen_Rainbow = new CustomIcon( - "TileEntities/overlay_rainbowscreen"); + "TileEntities/overlay_rainbowscreen"); public static final CustomIcon Casing_Machine_Screen_Rainbow = Internal_Casing_Machine_Screen_Rainbow; private static final CustomIcon Internal_Casing_Machine_Screen_Frequency = new CustomIcon( - "TileEntities/adv_machine_screen_frequency"); + "TileEntities/adv_machine_screen_frequency"); public static final CustomIcon Casing_Machine_Screen_Frequency = Internal_Casing_Machine_Screen_Frequency; private static final CustomIcon Internal_Overlay_Machine_Screen_Logo = new CustomIcon( - "TileEntities/adv_machine_screen_logo"); + "TileEntities/adv_machine_screen_logo"); public static final CustomIcon Overlay_Machine_Screen_Logo = Internal_Overlay_Machine_Screen_Logo; // Machine Controller Overlays private static final CustomIcon Internal_Overlay_Machine_Controller_Default = new CustomIcon( - "iconsets/OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ANIMATED"); + "iconsets/OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ANIMATED"); public static final CustomIcon Overlay_Machine_Controller_Default = Internal_Overlay_Machine_Controller_Default; private static final CustomIcon Internal_Overlay_Machine_Controller_Default_Active = new CustomIcon( - "iconsets/OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ANIMATED_ACTIVE"); + "iconsets/OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ANIMATED_ACTIVE"); public static final CustomIcon Overlay_Machine_Controller_Default_Active = Internal_Overlay_Machine_Controller_Default_Active; private static final CustomIcon Internal_Overlay_Machine_Controller_Advanced = new CustomIcon( - "iconsets/OVERLAY_FRONT_ADVANCED_MULTIBLOCK_ANIMATED"); + "iconsets/OVERLAY_FRONT_ADVANCED_MULTIBLOCK_ANIMATED"); public static final CustomIcon Overlay_Machine_Controller_Advanced = Internal_Overlay_Machine_Controller_Advanced; private static final CustomIcon Internal_Overlay_Machine_Controller_Advanced_Active = new CustomIcon( - "iconsets/OVERLAY_FRONT_ADVANCED_MULTIBLOCK_ANIMATED_ACTIVE"); + "iconsets/OVERLAY_FRONT_ADVANCED_MULTIBLOCK_ANIMATED_ACTIVE"); public static final CustomIcon Overlay_Machine_Controller_Advanced_Active = Internal_Overlay_Machine_Controller_Advanced_Active; // Crafting Overlays public static final CustomIcon Casing_Adv_Workbench_Crafting_Overlay = new CustomIcon( - "TileEntities/gt4/machine_top_crafting"); + "TileEntities/gt4/machine_top_crafting"); public static final CustomIcon Casing_CropHarvester_Cutter = new CustomIcon("TileEntities/gt4/OVERLAY_CROP"); public static final CustomIcon Casing_CropHarvester_Boxes = new CustomIcon("TileEntities/gt4/OVERLAY_BOXES"); @@ -367,7 +369,7 @@ public class TexturesGtBlock { public static final CustomIcon Overlay_Hatch_Muffler_Adv = Internal_Overlay_Hatch_Muffler_Adv; // Milling Ball Bus private static final CustomIcon Internal_Overlay_Bus_Milling_Balls = new CustomIcon( - "iconsets/OVERLAY_MILLING_BALL_BUS"); + "iconsets/OVERLAY_MILLING_BALL_BUS"); public static final CustomIcon Overlay_Bus_Milling_Balls = Internal_Overlay_Bus_Milling_Balls; // Catalyst Bus private static final CustomIcon Internal_Overlay_Bus_Catalyst = new CustomIcon("iconsets/OVERLAY_CATALYSTS"); @@ -378,20 +380,20 @@ public class TexturesGtBlock { // Dimensional private static final CustomIcon Internal_Overlay_Machine_Dimensional_Orange = new CustomIcon( - "TileEntities/adv_machine_dimensional_cover_orange"); + "TileEntities/adv_machine_dimensional_cover_orange"); public static final CustomIcon Overlay_Machine_Dimensional_Orange = Internal_Overlay_Machine_Dimensional_Orange; // Icons private static final CustomIcon Internal_Overlay_MatterFab = new CustomIcon("TileEntities/adv_machine_matterfab"); public static final CustomIcon Overlay_MatterFab = Internal_Overlay_MatterFab; private static final CustomIcon Internal_Overlay_MatterFab_Active = new CustomIcon( - "TileEntities/adv_machine_matterfab_active"); + "TileEntities/adv_machine_matterfab_active"); public static final CustomIcon Overlay_MatterFab_Active = Internal_Overlay_MatterFab_Active; private static final CustomIcon Internal_Overlay_MatterFab_Animated = new CustomIcon( - "TileEntities/adv_machine_matterfab_animated"); + "TileEntities/adv_machine_matterfab_animated"); public static final CustomIcon Overlay_MatterFab_Animated = Internal_Overlay_MatterFab_Animated; private static final CustomIcon Internal_Overlay_MatterFab_Active_Animated = new CustomIcon( - "TileEntities/adv_machine_matterfab_active_animated"); + "TileEntities/adv_machine_matterfab_active_animated"); public static final CustomIcon Overlay_MatterFab_Active_Animated = Internal_Overlay_MatterFab_Active_Animated; private static final CustomIcon Internal_Overlay_Water = new CustomIcon("TileEntities/adv_machine_water"); @@ -422,7 +424,7 @@ public class TexturesGtBlock { public static final CustomIcon TEXTURE_MAGIC_PANEL_B = new CustomIcon("metro/TEXTURE_MAGIC_B"); public static final CustomIcon TEXTURE_ORGANIC_PANEL_A_GLOWING = new CustomIcon( - "metro/TEXTURE_ORGANIC_PANEL_A_GLOWING"); + "metro/TEXTURE_ORGANIC_PANEL_A_GLOWING"); public static final CustomIcon TEXTURE_STONE_RED_A = new CustomIcon("metro/TEXTURE_STONE_RED_A"); public static final CustomIcon TEXTURE_STONE_RED_B = new CustomIcon("metro/TEXTURE_STONE_RED_B"); @@ -454,31 +456,31 @@ public class TexturesGtBlock { public static final CustomIcon TEXTURE_TECH_PANEL_H = new CustomIcon("metro/TEXTURE_TECH_PANEL_H"); public static ITexture[] OVERLAYS_ENERGY_OUT_MULTI_BUFFER = new ITexture[] { - new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 220, 220, 220, 0 }), - new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 220, 220, 220, 0 }), - new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 255, 100, 0, 0 }), - new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 255, 255, 30, 0 }), - new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 128, 128, 128, 0 }), - new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 240, 240, 245, 0 }), - new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 240, 240, 245, 0 }), - new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 240, 240, 245, 0 }), - new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 240, 240, 245, 0 }), - new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 240, 240, 245, 0 }) }; + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 220, 220, 220, 0 }), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 220, 220, 220, 0 }), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 255, 100, 0, 0 }), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 255, 255, 30, 0 }), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 128, 128, 128, 0 }), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 240, 240, 245, 0 }), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 240, 240, 245, 0 }), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 240, 240, 245, 0 }), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 240, 240, 245, 0 }), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 240, 240, 245, 0 }) }; public static IIconContainer[] CONNECTED_FUSION_HULLS = new IIconContainer[] { TEXTURE_CASING_FUSION_COIL_II_1, - TEXTURE_CASING_FUSION_COIL_II_2, TEXTURE_CASING_FUSION_COIL_II_3, TEXTURE_CASING_FUSION_COIL_II_4, - TEXTURE_CASING_FUSION_COIL_II_5, TEXTURE_CASING_FUSION_COIL_II_6, TEXTURE_CASING_FUSION_COIL_II_7, - TEXTURE_CASING_FUSION_COIL_II_8, TEXTURE_CASING_FUSION_COIL_II_9, TEXTURE_CASING_FUSION_COIL_II_10, - TEXTURE_CASING_FUSION_COIL_II_11, TEXTURE_CASING_FUSION_COIL_II_12 }; + TEXTURE_CASING_FUSION_COIL_II_2, TEXTURE_CASING_FUSION_COIL_II_3, TEXTURE_CASING_FUSION_COIL_II_4, + TEXTURE_CASING_FUSION_COIL_II_5, TEXTURE_CASING_FUSION_COIL_II_6, TEXTURE_CASING_FUSION_COIL_II_7, + TEXTURE_CASING_FUSION_COIL_II_8, TEXTURE_CASING_FUSION_COIL_II_9, TEXTURE_CASING_FUSION_COIL_II_10, + TEXTURE_CASING_FUSION_COIL_II_11, TEXTURE_CASING_FUSION_COIL_II_12 }; public static IIconContainer[] CONNECTED_FUSION_HULLS_MK4 = new IIconContainer[] { TEXTURE_CASING_FUSION_COIL_III_1, - TEXTURE_CASING_FUSION_COIL_III_2, TEXTURE_CASING_FUSION_COIL_III_3, TEXTURE_CASING_FUSION_COIL_III_4, - TEXTURE_CASING_FUSION_COIL_III_5, TEXTURE_CASING_FUSION_COIL_III_6, TEXTURE_CASING_FUSION_COIL_III_7, - TEXTURE_CASING_FUSION_COIL_III_8, TEXTURE_CASING_FUSION_COIL_III_9, TEXTURE_CASING_FUSION_COIL_III_10, - TEXTURE_CASING_FUSION_COIL_III_11, TEXTURE_CASING_FUSION_COIL_III_12 }; + TEXTURE_CASING_FUSION_COIL_III_2, TEXTURE_CASING_FUSION_COIL_III_3, TEXTURE_CASING_FUSION_COIL_III_4, + TEXTURE_CASING_FUSION_COIL_III_5, TEXTURE_CASING_FUSION_COIL_III_6, TEXTURE_CASING_FUSION_COIL_III_7, + TEXTURE_CASING_FUSION_COIL_III_8, TEXTURE_CASING_FUSION_COIL_III_9, TEXTURE_CASING_FUSION_COIL_III_10, + TEXTURE_CASING_FUSION_COIL_III_11, TEXTURE_CASING_FUSION_COIL_III_12 }; public static IIconContainer[] TIERED_MACHINE_HULLS = new IIconContainer[] { TEXTURE_CASING_TIERED_ULV, - TEXTURE_CASING_TIERED_LV, TEXTURE_CASING_TIERED_MV, TEXTURE_CASING_TIERED_HV, TEXTURE_CASING_TIERED_EV, - TEXTURE_CASING_TIERED_IV, TEXTURE_CASING_TIERED_LuV, TEXTURE_CASING_TIERED_ZPM, TEXTURE_CASING_TIERED_UV, - TEXTURE_CASING_TIERED_MAX }; + TEXTURE_CASING_TIERED_LV, TEXTURE_CASING_TIERED_MV, TEXTURE_CASING_TIERED_HV, TEXTURE_CASING_TIERED_EV, + TEXTURE_CASING_TIERED_IV, TEXTURE_CASING_TIERED_LuV, TEXTURE_CASING_TIERED_ZPM, TEXTURE_CASING_TIERED_UV, + TEXTURE_CASING_TIERED_MAX }; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java index 4e77e5d664..c983044319 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java @@ -107,67 +107,63 @@ public class LargeTurbineTextureHandler { * LP Turbines */ public static IIcon[] OVERLAY_LP_TURBINE = new IIcon[] { LARGETURBINE_ST1.getIcon(), LARGETURBINE_ST2.getIcon(), - LARGETURBINE_ST3.getIcon(), LARGETURBINE_ST4.getIcon(), LARGETURBINE_ST5.getIcon(), - LARGETURBINE_ST6.getIcon(), LARGETURBINE_ST7.getIcon(), LARGETURBINE_ST8.getIcon(), - LARGETURBINE_ST9.getIcon(), }; + LARGETURBINE_ST3.getIcon(), LARGETURBINE_ST4.getIcon(), LARGETURBINE_ST5.getIcon(), LARGETURBINE_ST6.getIcon(), + LARGETURBINE_ST7.getIcon(), LARGETURBINE_ST8.getIcon(), LARGETURBINE_ST9.getIcon(), }; public static IIcon[] OVERLAY_LP_TURBINE_ACTIVE = new IIcon[] { LARGETURBINE_ST_ACTIVE1.getIcon(), - LARGETURBINE_ST_ACTIVE2.getIcon(), LARGETURBINE_ST_ACTIVE3.getIcon(), LARGETURBINE_ST_ACTIVE4.getIcon(), - LARGETURBINE_ST_ACTIVE5.getIcon(), LARGETURBINE_ST_ACTIVE6.getIcon(), LARGETURBINE_ST_ACTIVE7.getIcon(), - LARGETURBINE_ST_ACTIVE8.getIcon(), LARGETURBINE_ST_ACTIVE9.getIcon(), }; + LARGETURBINE_ST_ACTIVE2.getIcon(), LARGETURBINE_ST_ACTIVE3.getIcon(), LARGETURBINE_ST_ACTIVE4.getIcon(), + LARGETURBINE_ST_ACTIVE5.getIcon(), LARGETURBINE_ST_ACTIVE6.getIcon(), LARGETURBINE_ST_ACTIVE7.getIcon(), + LARGETURBINE_ST_ACTIVE8.getIcon(), LARGETURBINE_ST_ACTIVE9.getIcon(), }; /** * HP Turbines */ public static IIcon[] OVERLAY_HP_TURBINE = new IIcon[] { LARGETURBINE_TI1.getIcon(), LARGETURBINE_TI2.getIcon(), - LARGETURBINE_TI3.getIcon(), LARGETURBINE_TI4.getIcon(), LARGETURBINE_TI5.getIcon(), - LARGETURBINE_TI6.getIcon(), LARGETURBINE_TI7.getIcon(), LARGETURBINE_TI8.getIcon(), - LARGETURBINE_TI9.getIcon(), }; + LARGETURBINE_TI3.getIcon(), LARGETURBINE_TI4.getIcon(), LARGETURBINE_TI5.getIcon(), LARGETURBINE_TI6.getIcon(), + LARGETURBINE_TI7.getIcon(), LARGETURBINE_TI8.getIcon(), LARGETURBINE_TI9.getIcon(), }; public static IIcon[] OVERLAY_HP_TURBINE_ACTIVE = new IIcon[] { LARGETURBINE_TI_ACTIVE1.getIcon(), - LARGETURBINE_TI_ACTIVE2.getIcon(), LARGETURBINE_TI_ACTIVE3.getIcon(), LARGETURBINE_TI_ACTIVE4.getIcon(), - LARGETURBINE_TI_ACTIVE5.getIcon(), LARGETURBINE_TI_ACTIVE6.getIcon(), LARGETURBINE_TI_ACTIVE7.getIcon(), - LARGETURBINE_TI_ACTIVE8.getIcon(), LARGETURBINE_TI_ACTIVE9.getIcon(), }; + LARGETURBINE_TI_ACTIVE2.getIcon(), LARGETURBINE_TI_ACTIVE3.getIcon(), LARGETURBINE_TI_ACTIVE4.getIcon(), + LARGETURBINE_TI_ACTIVE5.getIcon(), LARGETURBINE_TI_ACTIVE6.getIcon(), LARGETURBINE_TI_ACTIVE7.getIcon(), + LARGETURBINE_TI_ACTIVE8.getIcon(), LARGETURBINE_TI_ACTIVE9.getIcon(), }; /** * Gas Turbines */ public static IIcon[] OVERLAY_GAS_TURBINE = new IIcon[] { LARGETURBINE_SS1.getIcon(), LARGETURBINE_SS2.getIcon(), - LARGETURBINE_SS3.getIcon(), LARGETURBINE_SS4.getIcon(), LARGETURBINE_SS5.getIcon(), - LARGETURBINE_SS6.getIcon(), LARGETURBINE_SS7.getIcon(), LARGETURBINE_SS8.getIcon(), - LARGETURBINE_SS9.getIcon(), }; + LARGETURBINE_SS3.getIcon(), LARGETURBINE_SS4.getIcon(), LARGETURBINE_SS5.getIcon(), LARGETURBINE_SS6.getIcon(), + LARGETURBINE_SS7.getIcon(), LARGETURBINE_SS8.getIcon(), LARGETURBINE_SS9.getIcon(), }; public static IIcon[] OVERLAY_GAS_TURBINE_ACTIVE = new IIcon[] { LARGETURBINE_SS_ACTIVE1.getIcon(), - LARGETURBINE_SS_ACTIVE2.getIcon(), LARGETURBINE_SS_ACTIVE3.getIcon(), LARGETURBINE_SS_ACTIVE4.getIcon(), - LARGETURBINE_SS_ACTIVE5.getIcon(), LARGETURBINE_SS_ACTIVE6.getIcon(), LARGETURBINE_SS_ACTIVE7.getIcon(), - LARGETURBINE_SS_ACTIVE8.getIcon(), LARGETURBINE_SS_ACTIVE9.getIcon(), }; + LARGETURBINE_SS_ACTIVE2.getIcon(), LARGETURBINE_SS_ACTIVE3.getIcon(), LARGETURBINE_SS_ACTIVE4.getIcon(), + LARGETURBINE_SS_ACTIVE5.getIcon(), LARGETURBINE_SS_ACTIVE6.getIcon(), LARGETURBINE_SS_ACTIVE7.getIcon(), + LARGETURBINE_SS_ACTIVE8.getIcon(), LARGETURBINE_SS_ACTIVE9.getIcon(), }; /** * Plasma Turbines */ public static IIcon[] OVERLAY_PLASMA_TURBINE = new IIcon[] { LARGETURBINE_TU1.getIcon(), LARGETURBINE_TU2.getIcon(), - LARGETURBINE_TU3.getIcon(), LARGETURBINE_TU4.getIcon(), LARGETURBINE_TU5.getIcon(), - LARGETURBINE_TU6.getIcon(), LARGETURBINE_TU7.getIcon(), LARGETURBINE_TU8.getIcon(), - LARGETURBINE_TU9.getIcon(), }; + LARGETURBINE_TU3.getIcon(), LARGETURBINE_TU4.getIcon(), LARGETURBINE_TU5.getIcon(), LARGETURBINE_TU6.getIcon(), + LARGETURBINE_TU7.getIcon(), LARGETURBINE_TU8.getIcon(), LARGETURBINE_TU9.getIcon(), }; public static IIcon[] OVERLAY_PLASMA_TURBINE_ACTIVE = new IIcon[] { LARGETURBINE_TU_ACTIVE1.getIcon(), - LARGETURBINE_TU_ACTIVE2.getIcon(), LARGETURBINE_TU_ACTIVE3.getIcon(), LARGETURBINE_TU_ACTIVE4.getIcon(), - LARGETURBINE_TU_ACTIVE5.getIcon(), LARGETURBINE_TU_ACTIVE6.getIcon(), LARGETURBINE_TU_ACTIVE7.getIcon(), - LARGETURBINE_TU_ACTIVE8.getIcon(), LARGETURBINE_TU_ACTIVE9.getIcon(), }; + LARGETURBINE_TU_ACTIVE2.getIcon(), LARGETURBINE_TU_ACTIVE3.getIcon(), LARGETURBINE_TU_ACTIVE4.getIcon(), + LARGETURBINE_TU_ACTIVE5.getIcon(), LARGETURBINE_TU_ACTIVE6.getIcon(), LARGETURBINE_TU_ACTIVE7.getIcon(), + LARGETURBINE_TU_ACTIVE8.getIcon(), LARGETURBINE_TU_ACTIVE9.getIcon(), }; public static IIcon[] OVERLAY_SC_TURBINE = new IIcon[] { OVERLAY_SC_TURBINE1.getIcon(), - OVERLAY_SC_TURBINE2.getIcon(), OVERLAY_SC_TURBINE3.getIcon(), OVERLAY_SC_TURBINE4.getIcon(), - OVERLAY_SC_TURBINE5.getIcon(), OVERLAY_SC_TURBINE6.getIcon(), OVERLAY_SC_TURBINE7.getIcon(), - OVERLAY_SC_TURBINE8.getIcon(), OVERLAY_SC_TURBINE9.getIcon(), }; + OVERLAY_SC_TURBINE2.getIcon(), OVERLAY_SC_TURBINE3.getIcon(), OVERLAY_SC_TURBINE4.getIcon(), + OVERLAY_SC_TURBINE5.getIcon(), OVERLAY_SC_TURBINE6.getIcon(), OVERLAY_SC_TURBINE7.getIcon(), + OVERLAY_SC_TURBINE8.getIcon(), OVERLAY_SC_TURBINE9.getIcon(), }; public static IIcon[] OVERLAY_SC_TURBINE_ACTIVE = new IIcon[] { OVERLAY_SC_TURBINE1_ACTIVE.getIcon(), - OVERLAY_SC_TURBINE2_ACTIVE.getIcon(), OVERLAY_SC_TURBINE3_ACTIVE.getIcon(), - OVERLAY_SC_TURBINE4_ACTIVE.getIcon(), OVERLAY_SC_TURBINE5_ACTIVE.getIcon(), - OVERLAY_SC_TURBINE6_ACTIVE.getIcon(), OVERLAY_SC_TURBINE7_ACTIVE.getIcon(), - OVERLAY_SC_TURBINE8_ACTIVE.getIcon(), OVERLAY_SC_TURBINE9_ACTIVE.getIcon(), }; + OVERLAY_SC_TURBINE2_ACTIVE.getIcon(), OVERLAY_SC_TURBINE3_ACTIVE.getIcon(), + OVERLAY_SC_TURBINE4_ACTIVE.getIcon(), OVERLAY_SC_TURBINE5_ACTIVE.getIcon(), + OVERLAY_SC_TURBINE6_ACTIVE.getIcon(), OVERLAY_SC_TURBINE7_ACTIVE.getIcon(), + OVERLAY_SC_TURBINE8_ACTIVE.getIcon(), OVERLAY_SC_TURBINE9_ACTIVE.getIcon(), }; public static IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, - final ForgeDirection side, final GregtechMetaSpecialMultiCasings i) { + final ForgeDirection side, final GregtechMetaSpecialMultiCasings i) { final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); // 0 shaft @@ -206,86 +202,86 @@ public class LargeTurbineTextureHandler { TileEntity tTileEntity; IMetaTileEntity tMetaTileEntity; if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.SOUTH ? 1 : -1), yCoord - 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + .getTileEntity(xCoord + (side == ForgeDirection.SOUTH ? 1 : -1), yCoord - 1, zCoord))) + && ((tTileEntity instanceof IGregTechTileEntity)) + && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) + && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) + && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { if (isUsingAnimatedTexture(tTileEntity)) { return mGetCurrentTextureSet_ACTIVE[0]; } return mGetCurrentTextureSet[0]; } if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.SOUTH ? 1 : -1), yCoord, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + .getTileEntity(xCoord + (side == ForgeDirection.SOUTH ? 1 : -1), yCoord, zCoord))) + && ((tTileEntity instanceof IGregTechTileEntity)) + && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) + && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) + && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { if (isUsingAnimatedTexture(tTileEntity)) { return mGetCurrentTextureSet_ACTIVE[3]; } return mGetCurrentTextureSet[3]; } if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.SOUTH ? 1 : -1), yCoord + 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + .getTileEntity(xCoord + (side == ForgeDirection.SOUTH ? 1 : -1), yCoord + 1, zCoord))) + && ((tTileEntity instanceof IGregTechTileEntity)) + && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) + && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) + && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { if (isUsingAnimatedTexture(tTileEntity)) { return mGetCurrentTextureSet_ACTIVE[6]; } return mGetCurrentTextureSet[6]; } if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + && ((tTileEntity instanceof IGregTechTileEntity)) + && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) + && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) + && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { if (isUsingAnimatedTexture(tTileEntity)) { return mGetCurrentTextureSet_ACTIVE[1]; } return mGetCurrentTextureSet[1]; } if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + && ((tTileEntity instanceof IGregTechTileEntity)) + && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) + && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) + && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { if (isUsingAnimatedTexture(tTileEntity)) { return mGetCurrentTextureSet_ACTIVE[7]; } return mGetCurrentTextureSet[7]; } if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.NORTH ? 1 : -1), yCoord + 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + .getTileEntity(xCoord + (side == ForgeDirection.NORTH ? 1 : -1), yCoord + 1, zCoord))) + && ((tTileEntity instanceof IGregTechTileEntity)) + && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) + && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) + && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { if (isUsingAnimatedTexture(tTileEntity)) { return mGetCurrentTextureSet_ACTIVE[8]; } return mGetCurrentTextureSet[8]; } if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.NORTH ? 1 : -1), yCoord, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + .getTileEntity(xCoord + (side == ForgeDirection.NORTH ? 1 : -1), yCoord, zCoord))) + && ((tTileEntity instanceof IGregTechTileEntity)) + && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) + && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) + && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { if (isUsingAnimatedTexture(tTileEntity)) { return mGetCurrentTextureSet_ACTIVE[5]; } return mGetCurrentTextureSet[5]; } if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.NORTH ? 1 : -1), yCoord - 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + .getTileEntity(xCoord + (side == ForgeDirection.NORTH ? 1 : -1), yCoord - 1, zCoord))) + && ((tTileEntity instanceof IGregTechTileEntity)) + && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) + && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) + && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { if (isUsingAnimatedTexture(tTileEntity)) { return mGetCurrentTextureSet_ACTIVE[2]; } @@ -295,86 +291,86 @@ public class LargeTurbineTextureHandler { TileEntity tTileEntity; Object tMetaTileEntity; if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord - 1, zCoord + (side == ForgeDirection.WEST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + .getTileEntity(xCoord, yCoord - 1, zCoord + (side == ForgeDirection.WEST ? 1 : -1)))) + && ((tTileEntity instanceof IGregTechTileEntity)) + && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) + && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) + && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { if (isUsingAnimatedTexture(tTileEntity)) { return mGetCurrentTextureSet_ACTIVE[0]; } return mGetCurrentTextureSet[0]; } if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord, zCoord + (side == ForgeDirection.WEST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + .getTileEntity(xCoord, yCoord, zCoord + (side == ForgeDirection.WEST ? 1 : -1)))) + && ((tTileEntity instanceof IGregTechTileEntity)) + && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) + && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) + && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { if (isUsingAnimatedTexture(tTileEntity)) { return mGetCurrentTextureSet_ACTIVE[3]; } return mGetCurrentTextureSet[3]; } if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord + 1, zCoord + (side == ForgeDirection.WEST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + .getTileEntity(xCoord, yCoord + 1, zCoord + (side == ForgeDirection.WEST ? 1 : -1)))) + && ((tTileEntity instanceof IGregTechTileEntity)) + && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) + && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) + && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { if (isUsingAnimatedTexture(tTileEntity)) { return mGetCurrentTextureSet_ACTIVE[6]; } return mGetCurrentTextureSet[6]; } if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + && ((tTileEntity instanceof IGregTechTileEntity)) + && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) + && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) + && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { if (isUsingAnimatedTexture(tTileEntity)) { return mGetCurrentTextureSet_ACTIVE[1]; } return mGetCurrentTextureSet[1]; } if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + && ((tTileEntity instanceof IGregTechTileEntity)) + && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) + && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) + && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { if (isUsingAnimatedTexture(tTileEntity)) { return mGetCurrentTextureSet_ACTIVE[7]; } return mGetCurrentTextureSet[7]; } if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord + 1, zCoord + (side == ForgeDirection.EAST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + .getTileEntity(xCoord, yCoord + 1, zCoord + (side == ForgeDirection.EAST ? 1 : -1)))) + && ((tTileEntity instanceof IGregTechTileEntity)) + && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) + && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) + && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { if (isUsingAnimatedTexture(tTileEntity)) { return mGetCurrentTextureSet_ACTIVE[8]; } return mGetCurrentTextureSet[8]; } if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord, zCoord + (side == ForgeDirection.EAST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + .getTileEntity(xCoord, yCoord, zCoord + (side == ForgeDirection.EAST ? 1 : -1)))) + && ((tTileEntity instanceof IGregTechTileEntity)) + && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) + && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) + && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { if (isUsingAnimatedTexture(tTileEntity)) { return mGetCurrentTextureSet_ACTIVE[5]; } return mGetCurrentTextureSet[5]; } if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord - 1, zCoord + (side == ForgeDirection.EAST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + .getTileEntity(xCoord, yCoord - 1, zCoord + (side == ForgeDirection.EAST ? 1 : -1)))) + && ((tTileEntity instanceof IGregTechTileEntity)) + && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) + && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) + && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { if (isUsingAnimatedTexture(tTileEntity)) { return mGetCurrentTextureSet_ACTIVE[2]; } @@ -393,7 +389,8 @@ public class LargeTurbineTextureHandler { if (aTile != null) { final IMetaTileEntity aMetaTileEntity = aTile.getMetaTileEntity(); if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) { - aVal = ((GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity).getBaseMetaTileEntity().isActive(); + aVal = ((GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity).getBaseMetaTileEntity() + .isActive(); // Logger.INFO("Returning "+aVal+" as Rotor Assembly controller status"); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java index c92d223eb3..8b75f4f156 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java @@ -32,7 +32,7 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { } public int doCoverThings(ForgeDirection side, byte aInputRedstone, int aCoverID, int aCoverVariable, - ICoverable aTileEntity, long aTimer) { + ICoverable aTileEntity, long aTimer) { if (aCoverVariable == 0) { return aCoverVariable; } @@ -66,7 +66,7 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { } public int onCoverScrewdriverclick(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { + EntityPlayer aPlayer, float aX, float aY, float aZ) { if (GT_Utility.getClickedFacingCoords(side, aX, aY, aZ)[0] >= 0.5F) { aCoverVariable += (mMaxTransferRate * (aPlayer.isSneaking() ? 0.1f : 0.01f)); } else { @@ -79,13 +79,13 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { aCoverVariable = mMaxTransferRate; } GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans("322", "Overflow point: ") + aCoverVariable + GT_Utility.trans("323", "L")); + aPlayer, + GT_Utility.trans("322", "Overflow point: ") + aCoverVariable + GT_Utility.trans("323", "L")); return aCoverVariable; } public boolean onCoverRightclick(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { + EntityPlayer aPlayer, float aX, float aY, float aZ) { boolean aShift = aPlayer.isSneaking(); int aAmount = aShift ? 128 : 8; if (GT_Utility.getClickedFacingCoords(side, aX, aY, aZ)[0] >= 0.5F) { @@ -100,8 +100,8 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { aCoverVariable = mMaxTransferRate; } GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans("322", "Overflow point: ") + aCoverVariable + GT_Utility.trans("323", "L")); + aPlayer, + GT_Utility.trans("322", "Overflow point: ") + aCoverVariable + GT_Utility.trans("323", "L")); aTileEntity.setCoverDataAtSide(side, new ISerializableObject.LegacyCoverData(aCoverVariable)); return true; } @@ -123,22 +123,22 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { } public boolean letsItemsIn(ForgeDirection side, int aCoverID, int aCoverVariable, int aSlot, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return true; } public boolean letsItemsOut(ForgeDirection side, int aCoverID, int aCoverVariable, int aSlot, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return true; } public boolean letsFluidIn(ForgeDirection side, int aCoverID, int aCoverVariable, Fluid aFluid, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return false; } public boolean letsFluidOut(ForgeDirection side, int aCoverID, int aCoverVariable, Fluid aFluid, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return true; } @@ -183,20 +183,21 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { protected void addUIWidgets(ModularWindow.Builder builder) { AtomicBoolean warn = new AtomicBoolean(false); - builder.widget( + builder + .widget( new CoverDataControllerWidget<>(this::getCoverData, this::setCoverData, GTPP_Cover_Overflow.this) - .addFollower( - new CoverDataFollower_NumericWidget<>(), - coverData -> (double) convert(coverData), - (coverData, state) -> new ISerializableObject.LegacyCoverData(state.intValue()), - widget -> widget.setBounds(0, mMaxTransferRate).setScrollValues(1000, 144, 100000) - .setFocusOnGuiOpen(true) - .setPos(startX + spaceX * 0, startY + spaceY * 1 + 8) - .setSize(spaceX * 4 - 3, 12))) - .widget( - new TextWidget(GT_Utility.trans("322", "Overflow point: ")) - .setDefaultColor(COLOR_TEXT_GRAY.get()) - .setPos(startX, 4 + startY + spaceY * 0 + 8)); + .addFollower( + new CoverDataFollower_NumericWidget<>(), + coverData -> (double) convert(coverData), + (coverData, state) -> new ISerializableObject.LegacyCoverData(state.intValue()), + widget -> widget.setBounds(0, mMaxTransferRate) + .setScrollValues(1000, 144, 100000) + .setFocusOnGuiOpen(true) + .setPos(startX + spaceX * 0, startY + spaceY * 1 + 8) + .setSize(spaceX * 4 - 3, 12))) + .widget( + new TextWidget(GT_Utility.trans("322", "Overflow point: ")).setDefaultColor(COLOR_TEXT_GRAY.get()) + .setPos(startX, 4 + startY + spaceY * 0 + 8)); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java index cea96cefea..42ab793c9c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java @@ -29,7 +29,7 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { public static String generateUniqueKey(ForgeDirection side, ICoverable aEntity) { try { BlockPos aPos = new BlockPos( - aEntity.getIGregTechTileEntity(aEntity.getXCoord(), aEntity.getYCoord(), aEntity.getZCoord())); + aEntity.getIGregTechTileEntity(aEntity.getXCoord(), aEntity.getYCoord(), aEntity.getZCoord())); String s = aEntity.getInventoryName() + "." + aPos.getUniqueIdentifier() + side.name(); return s; @@ -39,14 +39,14 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { } public boolean onCoverRightclick(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { + EntityPlayer aPlayer, float aX, float aY, float aZ) { PlayerUtils - .messagePlayer(aPlayer, GT_Utility.trans("756", "Connectable: ") + getConnectionState(aCoverVariable)); + .messagePlayer(aPlayer, GT_Utility.trans("756", "Connectable: ") + getConnectionState(aCoverVariable)); return super.onCoverRightclick(side, aCoverID, aCoverVariable, aTileEntity, aPlayer, aX, aY, aZ); } public int onCoverScrewdriverclick(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { + EntityPlayer aPlayer, float aX, float aY, float aZ) { return super.onCoverScrewdriverclick(side, aCoverID, aCoverVariable, aTileEntity, aPlayer, aX, aY, aZ); } @@ -59,22 +59,22 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { } public boolean letsFluidIn(ForgeDirection side, int aCoverID, int aCoverVariable, Fluid aFluid, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getConnectionState(aCoverVariable); } public boolean letsFluidOut(ForgeDirection side, int aCoverID, int aCoverVariable, Fluid aFluid, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getConnectionState(aCoverVariable); } public boolean letsItemsIn(ForgeDirection side, int aCoverID, int aCoverVariable, int aSlot, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getConnectionState(aCoverVariable); } public boolean letsItemsOut(ForgeDirection side, int aCoverID, int aCoverVariable, int aSlot, - ICoverable aTileEntity) { + ICoverable aTileEntity) { return getConnectionState(aCoverVariable); } @@ -84,7 +84,7 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { @Override public int doCoverThings(ForgeDirection side, byte aInputRedstone, int aCoverID, int aCoverVariable, - ICoverable aTileEntity, long aTimer) { + ICoverable aTileEntity, long aTimer) { try { String aKey = generateUniqueKey(side, aTileEntity); Integer b = sConnectionStateForEntityMap.get(aKey); @@ -120,7 +120,7 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { @Override public byte getRedstoneInput(ForgeDirection side, byte aInputRedstone, int aCoverID, int aCoverVariable, - ICoverable aTileEntity) { + ICoverable aTileEntity) { if (!getConnectionState(aCoverVariable)) { return 0; } @@ -142,7 +142,7 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { @Override public boolean onCoverRemoval(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - boolean aForced) { + boolean aForced) { String aKey = generateUniqueKey(side, aTileEntity); sConnectionStateForEntityMap.remove(aKey); // Logger.INFO("Unmapping key "+aKey+"."); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java index 0551f66aa3..924484e098 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java @@ -77,9 +77,8 @@ public class ChargingHelper { for (GregtechMetaWirelessCharger mEntityTemp : mChargerMap.values()) { if (mEntityTemp != null) { - if (mEntityTemp.getBaseMetaTileEntity() == null - || !mEntityTemp.getBaseMetaTileEntity().isAllowedToWork()) - continue; + if (mEntityTemp.getBaseMetaTileEntity() == null || !mEntityTemp.getBaseMetaTileEntity() + .isAllowedToWork()) continue; if (mPlayerMan.getEntityWorld().provider.dimensionId == mEntityTemp.getDimensionID()) { mVoltage = mEntityTemp.maxEUInput(); mEuStored = mEntityTemp.getEUVar(); @@ -123,7 +122,8 @@ public class ChargingHelper { if (!mChargerMap.isEmpty()) { for (BlockPos aPos : mChargerMap.keySet()) { GregtechMetaWirelessCharger r = mChargerMap.get(aPos); - if (r == null || r.getBaseMetaTileEntity().isInvalidTileEntity()) { + if (r == null || r.getBaseMetaTileEntity() + .isInvalidTileEntity()) { mChargerMap.remove(aPos); } } @@ -179,7 +179,7 @@ public class ChargingHelper { } private boolean canCharge(GregtechMetaWirelessCharger charger, EntityPlayer chargeablePlayer, - Map<String, UUID> longRangeChargers, Map<String, UUID> shortRangeChargers) { + Map<String, UUID> longRangeChargers, Map<String, UUID> shortRangeChargers) { if (charger.getMode() == 0) { return !longRangeChargers.isEmpty() && longRangeChargers.containsKey(chargeablePlayer.getDisplayName()); } else if (charger.getMode() == 1) { @@ -197,8 +197,8 @@ public class ChargingHelper { return 0; } return mEntityTemp.getDistanceBetweenTwoPositions( - mEntityTemp.getTileEntityPosition(), - mEntityTemp.getPositionOfEntity(mPlayerMan)); + mEntityTemp.getTileEntityPosition(), + mEntityTemp.getPositionOfEntity(mPlayerMan)); } private void chargeItems(@Nonnull GregtechMetaWirelessCharger mEntity, ItemStack[] mItems) { @@ -235,13 +235,17 @@ public class ChargingHelper { // Try to get charge direct from NBT for GT and IC2 stacks if (mTemp.getItem() instanceof GT_MetaGenerated_Tool_01 - || mTemp.getItem() instanceof GT_MetaGenerated_Item_01 - || mTemp.getItem() instanceof GT_MetaGenerated_Item_02 - || mTemp.getItem() instanceof GT_MetaGenerated_Item_03 - || mTemp.getItem().getClass().getName() - .equalsIgnoreCase(GT_MetaGenerated_Tool_01.class.getName())) { + || mTemp.getItem() instanceof GT_MetaGenerated_Item_01 + || mTemp.getItem() instanceof GT_MetaGenerated_Item_02 + || mTemp.getItem() instanceof GT_MetaGenerated_Item_03 + || mTemp.getItem() + .getClass() + .getName() + .equalsIgnoreCase(GT_MetaGenerated_Tool_01.class.getName())) { if (!NBTUtils.hasKey(mTemp, "GT.ItemCharge")) { - if (!mTemp.getDisplayName().toLowerCase().contains("battery")) { + if (!mTemp.getDisplayName() + .toLowerCase() + .contains("battery")) { if (!GT_ModHandler.isElectricItem(mTemp)) { continue; } @@ -268,21 +272,20 @@ public class ChargingHelper { if ((mitemCurrentCharge + (mVoltageIncrease * 20)) <= (mItemMaxCharge - (mVoltageIncrease * 20))) { mMulti = 20; } else if ((mitemCurrentCharge + (mVoltageIncrease * 10)) - <= (mItemMaxCharge - (mVoltageIncrease * 10))) { - mMulti = 10; - } else - if ((mitemCurrentCharge + (mVoltageIncrease * 5)) - <= (mItemMaxCharge - (mVoltageIncrease * 5))) { - mMulti = 5; - } else { - mMulti = 1; - } + <= (mItemMaxCharge - (mVoltageIncrease * 10))) { + mMulti = 10; + } else if ((mitemCurrentCharge + (mVoltageIncrease * 5)) + <= (mItemMaxCharge - (mVoltageIncrease * 5))) { + mMulti = 5; + } else { + mMulti = 1; + } int mMultiVoltage = (int) (mMulti * mVoltageIncrease); if ((mitemCurrentCharge + mMultiVoltage) <= mItemMaxCharge) { if (GT_ModHandler.chargeElectricItem(mTemp, mMultiVoltage, Integer.MAX_VALUE, true, false) - > 0) { + > 0) { for (int i = 0; i < mMulti; i++) { ElectricItem.manager.charge(mTemp, mVoltageIncrease, Integer.MAX_VALUE, false, false); } @@ -310,12 +313,12 @@ public class ChargingHelper { IEnergyContainerItem rfItem = (IEnergyContainerItem) mTemp.getItem(); if (rfItem != null) { long chargedPower = Math.min( - rfItem.getMaxEnergyStored(mTemp) - rfItem.getEnergyStored(mTemp), - mEntity.getEUVar() * mEUtoRF / 100L); + rfItem.getMaxEnergyStored(mTemp) - rfItem.getEnergyStored(mTemp), + mEntity.getEUVar() * mEUtoRF / 100L); chargedPower = rfItem.receiveEnergy( - mTemp, - chargedPower > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) chargedPower, - false); + mTemp, + chargedPower > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) chargedPower, + false); chargedPower = chargedPower * 100L / mEUtoRF; mEntity.setEUVar(Math.max(mEntity.getEUVar() - chargedPower, 0)); mEuStored = mEntity.getEUVar(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java index a526e61107..3717f17554 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java @@ -26,7 +26,7 @@ public class TesseractHelper { // Checks if a Generator is owned by a player. public static final boolean isGeneratorOwnedByPlayer(EntityPlayer player, - GT_MetaTileEntity_TesseractGenerator generator) { + GT_MetaTileEntity_TesseractGenerator generator) { if (player == null) { Logger.WARNING("Failed. [isGeneratorOwnedByPlayer]"); return false; @@ -39,7 +39,8 @@ public class TesseractHelper { Set<Entry<Integer, GT_MetaTileEntity_TesseractGenerator>> players = generators.entrySet(); for (Entry<Integer, GT_MetaTileEntity_TesseractGenerator> current : players) { // Utils.LOG_WARNING("Success. [isGeneratorOwnedByPlayer] 3"); - if (current.getValue().equals(generator)) { + if (current.getValue() + .equals(generator)) { // Utils.LOG_WARNING("Success. [isGeneratorOwnedByPlayer] 4"); return true; } @@ -51,7 +52,7 @@ public class TesseractHelper { // Saves A Generator to the Players UUID map along with the Freq. public static final boolean setGeneratorOwnershipByPlayer(EntityPlayer player, int freq, - GT_MetaTileEntity_TesseractGenerator generator) { + GT_MetaTileEntity_TesseractGenerator generator) { if (player == null) { return false; } @@ -59,7 +60,7 @@ public class TesseractHelper { Logger.WARNING("Setting Generator on " + freq + " for " + player.getDisplayName() + "."); if (playerIdentifier != null) { Map<Integer, GT_MetaTileEntity_TesseractGenerator> playerOwned = sTesseractGeneratorOwnershipMap - .get(playerIdentifier); + .get(playerIdentifier); if (playerOwned == null || playerOwned.isEmpty()) { Map<Integer, GT_MetaTileEntity_TesseractGenerator> newOwnershipMap = new HashMap<>(); newOwnershipMap.put(freq, generator); @@ -68,7 +69,7 @@ public class TesseractHelper { return true; } else if (sTesseractGeneratorOwnershipMap.containsKey(playerIdentifier)) { Map<Integer, GT_MetaTileEntity_TesseractGenerator> ownershipMap = sTesseractGeneratorOwnershipMap - .get(playerIdentifier); + .get(playerIdentifier); if (!ownershipMap.containsKey(freq)) { ownershipMap.put(freq, generator); } @@ -95,7 +96,8 @@ public class TesseractHelper { Set<Entry<Integer, GT_MetaTileEntity_TesseractGenerator>> players = generators.entrySet(); for (Entry<Integer, GT_MetaTileEntity_TesseractGenerator> current : players) { // Utils.LOG_WARNING("Success. [getGeneratorByFrequency] 2"); - if (current.getKey().equals(freq)) { + if (current.getKey() + .equals(freq)) { // Utils.LOG_WARNING("Success. [getGeneratorByFrequency] 3"); Logger.WARNING("Success!"); return current.getValue(); @@ -113,7 +115,8 @@ public class TesseractHelper { } UUID playerIdentifier = player.getUniqueID(); if (!sTesseractGeneratorOwnershipMap.isEmpty() && playerIdentifier != null) { - sTesseractGeneratorOwnershipMap.get(playerIdentifier).remove(frequency); + sTesseractGeneratorOwnershipMap.get(playerIdentifier) + .remove(frequency); return true; } return false; @@ -129,7 +132,7 @@ public class TesseractHelper { // Checks if a Terminal is owned by a player. public static final boolean isTerminalOwnedByPlayer(EntityPlayer player, - GT_MetaTileEntity_TesseractTerminal generator) { + GT_MetaTileEntity_TesseractTerminal generator) { if (player == null) { return false; } @@ -138,7 +141,8 @@ public class TesseractHelper { Map<Integer, GT_MetaTileEntity_TesseractTerminal> generators = getTerminalOwnershipByPlayer(player); Set<Entry<Integer, GT_MetaTileEntity_TesseractTerminal>> players = generators.entrySet(); for (Entry<Integer, GT_MetaTileEntity_TesseractTerminal> current : players) { - if (current.getValue().equals(generator)) { + if (current.getValue() + .equals(generator)) { return true; } } @@ -148,7 +152,7 @@ public class TesseractHelper { // Saves A Terminal to the Players UUID map along with the Freq. public static final boolean setTerminalOwnershipByPlayer(EntityPlayer player, int freq, - GT_MetaTileEntity_TesseractTerminal generator) { + GT_MetaTileEntity_TesseractTerminal generator) { if (player == null) { return false; } @@ -156,7 +160,7 @@ public class TesseractHelper { if (playerIdentifier != null) { Logger.WARNING("Setting Terminal on " + freq + " for " + player.getDisplayName() + "."); Map<Integer, GT_MetaTileEntity_TesseractTerminal> playerOwned = sTesseractTerminalOwnershipMap - .get(playerIdentifier); + .get(playerIdentifier); if (playerOwned == null || playerOwned.isEmpty()) { Map<Integer, GT_MetaTileEntity_TesseractTerminal> newOwnershipMap = new HashMap<>(); newOwnershipMap.put(freq, generator); @@ -165,7 +169,7 @@ public class TesseractHelper { return true; } else if (sTesseractTerminalOwnershipMap.containsKey(playerIdentifier)) { Map<Integer, GT_MetaTileEntity_TesseractTerminal> ownershipMap = sTesseractTerminalOwnershipMap - .get(playerIdentifier); + .get(playerIdentifier); if (!ownershipMap.containsKey(freq)) { ownershipMap.put(freq, generator); } @@ -189,7 +193,8 @@ public class TesseractHelper { Map<Integer, GT_MetaTileEntity_TesseractTerminal> generators = getTerminalOwnershipByPlayer(player); Set<Entry<Integer, GT_MetaTileEntity_TesseractTerminal>> players = generators.entrySet(); for (Entry<Integer, GT_MetaTileEntity_TesseractTerminal> current : players) { - if (current.getKey().equals(freq)) { + if (current.getKey() + .equals(freq)) { Logger.WARNING("Success!"); return current.getValue(); } @@ -206,7 +211,8 @@ public class TesseractHelper { } UUID playerIdentifier = player.getUniqueID(); if (!sTesseractTerminalOwnershipMap.isEmpty() && playerIdentifier != null) { - sTesseractTerminalOwnershipMap.get(playerIdentifier).remove(frequency); + sTesseractTerminalOwnershipMap.get(playerIdentifier) + .remove(frequency); return true; } return false; @@ -218,13 +224,14 @@ public class TesseractHelper { * */ private static Map<Integer, GT_MetaTileEntity_TesseractGenerator> getGeneratorOwnershipByPlayer( - EntityPlayer player) { + EntityPlayer player) { UUID playerIdentifier = player.getUniqueID(); if (!sTesseractGeneratorOwnershipMap.isEmpty() && playerIdentifier != null) { Set<Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractGenerator>>> players = sTesseractGeneratorOwnershipMap - .entrySet(); + .entrySet(); for (Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractGenerator>> current : players) { - if (current.getKey().compareTo(playerIdentifier) == 0) { + if (current.getKey() + .compareTo(playerIdentifier) == 0) { return current.getValue(); } } @@ -236,9 +243,10 @@ public class TesseractHelper { UUID playerIdentifier = player.getUniqueID(); if (!sTesseractTerminalOwnershipMap.isEmpty() && playerIdentifier != null) { Set<Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractTerminal>>> players = sTesseractTerminalOwnershipMap - .entrySet(); + .entrySet(); for (Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractTerminal>> current : players) { - if (current.getKey().compareTo(playerIdentifier) == 0) { + if (current.getKey() + .compareTo(playerIdentifier) == 0) { return current.getValue(); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java index 7126cb2480..8edb8c2cf9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java @@ -37,7 +37,7 @@ public class MetaCustomCoverItem extends Item { private final short[][] mRGB; public MetaCustomCoverItem(String aModId, int aTextureCount, String aTextureSetName, IIconContainer[] aTextures, - short[][] aRGB) { + short[][] aRGB) { super(); icons = new IIcon[aTextureCount]; mModID = aModId; @@ -53,12 +53,12 @@ public class MetaCustomCoverItem extends Item { GameRegistry.registerItem(this, unlocalizedName); registerCover(); Logger.INFO( - "[Covers] Generated Custom covers for " + mModID - + " using " - + aTextureCount - + " textures from " - + mTextureSetName - + "."); + "[Covers] Generated Custom covers for " + mModID + + " using " + + aTextureCount + + " textures from " + + mTextureSetName + + "."); } public boolean hide() { @@ -73,9 +73,9 @@ public class MetaCustomCoverItem extends Item { ItemUtils.hideItemFromNEI(thisStack); } GregTech_API.registerCover( - thisStack, - new GT_MultiTexture(new ITexture[] { new GT_RenderedTexture(mTextures[i]) }), - new GTPP_Cover_ToggleVisual()); + thisStack, + new GT_MultiTexture(new ITexture[] { new GT_RenderedTexture(mTextures[i]) }), + new GTPP_Cover_ToggleVisual()); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java index 204e05394d..8173a868aa 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java @@ -37,39 +37,39 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { // Extruder Shape GregtechItemList.Shape_Extruder_WindmillShaft - .set(this.addItem(40, "Extruder Shape (Shaft)", "Extruder Shape for making Windmill Shafts")); + .set(this.addItem(40, "Extruder Shape (Shaft)", "Extruder Shape for making Windmill Shafts")); // Batteries GregtechItemList.Battery_RE_EV_Sodium.set( - this.addItem( - tLastID = 50, - "Quad Cell Sodium Battery", - "Reusable", - getTcAspectStack(TC_Aspects.ELECTRUM, 2L), - getTcAspectStack(TC_Aspects.METALLUM, 2L), - getTcAspectStack(TC_Aspects.POTENTIA, 2L))); + this.addItem( + tLastID = 50, + "Quad Cell Sodium Battery", + "Reusable", + getTcAspectStack(TC_Aspects.ELECTRUM, 2L), + getTcAspectStack(TC_Aspects.METALLUM, 2L), + getTcAspectStack(TC_Aspects.POTENTIA, 2L))); this.setElectricStats(32000 + tLastID, 3200000L, GT_Values.V[4], 4L, -3L, true); registerTieredTooltip(GregtechItemList.Battery_RE_EV_Sodium.get(1), EV); GregtechItemList.Battery_RE_EV_Cadmium.set( - this.addItem( - tLastID = 52, - "Quad Cell Cadmium Battery", - "Reusable", - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.METALLUM, 1L), - getTcAspectStack(TC_Aspects.POTENTIA, 1L))); + this.addItem( + tLastID = 52, + "Quad Cell Cadmium Battery", + "Reusable", + getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.METALLUM, 1L), + getTcAspectStack(TC_Aspects.POTENTIA, 1L))); this.setElectricStats(32000 + tLastID, 4800000L, GT_Values.V[4], 4L, -3L, true); registerTieredTooltip(GregtechItemList.Battery_RE_EV_Cadmium.get(1), EV); GregtechItemList.Battery_RE_EV_Lithium.set( - this.addItem( - tLastID = 54, - "Quad Cell Lithium Battery", - "Reusable", - getTcAspectStack(TC_Aspects.ELECTRUM, 3L), - getTcAspectStack(TC_Aspects.METALLUM, 3L), - getTcAspectStack(TC_Aspects.POTENTIA, 3L))); + this.addItem( + tLastID = 54, + "Quad Cell Lithium Battery", + "Reusable", + getTcAspectStack(TC_Aspects.ELECTRUM, 3L), + getTcAspectStack(TC_Aspects.METALLUM, 3L), + getTcAspectStack(TC_Aspects.POTENTIA, 3L))); this.setElectricStats(32000 + tLastID, 6400000L, GT_Values.V[4], 4L, -3L, true); registerTieredTooltip(GregtechItemList.Battery_RE_EV_Lithium.get(1), EV); @@ -77,66 +77,66 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { * Power Gems */ GregtechItemList.Battery_Gem_1.set( - this.addItem( - tLastID = 66, - "Proton Cell", - "Reusable", - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.METALLUM, 24L), - getTcAspectStack(TC_Aspects.POTENTIA, 16L))); + this.addItem( + tLastID = 66, + "Proton Cell", + "Reusable", + getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.METALLUM, 24L), + getTcAspectStack(TC_Aspects.POTENTIA, 16L))); this.setElectricStats(32000 + tLastID, GT_Values.V[6] * 20 * 300 / 4, GT_Values.V[6], 6L, -3L, false); GregtechItemList.Battery_Gem_2.set( - this.addItem( - tLastID = 68, - "Electron Cell", - "Reusable", - getTcAspectStack(TC_Aspects.ELECTRUM, 16L), - getTcAspectStack(TC_Aspects.METALLUM, 32L), - getTcAspectStack(TC_Aspects.POTENTIA, 32L))); + this.addItem( + tLastID = 68, + "Electron Cell", + "Reusable", + getTcAspectStack(TC_Aspects.ELECTRUM, 16L), + getTcAspectStack(TC_Aspects.METALLUM, 32L), + getTcAspectStack(TC_Aspects.POTENTIA, 32L))); this.setElectricStats(32000 + tLastID, GT_Values.V[7] * 20 * 300 / 4, GT_Values.V[7], 7L, -3L, false); GregtechItemList.Battery_Gem_3.set( - this.addItem( - tLastID = 70, - "Quark Entanglement", - "Reusable", - getTcAspectStack(TC_Aspects.ELECTRUM, 32L), - getTcAspectStack(TC_Aspects.METALLUM, 48L), - getTcAspectStack(TC_Aspects.POTENTIA, 64L))); + this.addItem( + tLastID = 70, + "Quark Entanglement", + "Reusable", + getTcAspectStack(TC_Aspects.ELECTRUM, 32L), + getTcAspectStack(TC_Aspects.METALLUM, 48L), + getTcAspectStack(TC_Aspects.POTENTIA, 64L))); this.setElectricStats(32000 + tLastID, GT_Values.V[8] * 20 * 300 / 4, GT_Values.V[8], 8L, -3L, false); // RTG Pellet GregtechItemList.Pellet_RTG_PU238.set( - this.addItem( - 41, - StringUtils.superscript("238") + "Pu Pellet", - "", - getTcAspectStack(TC_Aspects.RADIO, 4L), - getTcAspectStack(TC_Aspects.POTENTIA, 2L), - getTcAspectStack(TC_Aspects.METALLUM, 2L))); + this.addItem( + 41, + StringUtils.superscript("238") + "Pu Pellet", + "", + getTcAspectStack(TC_Aspects.RADIO, 4L), + getTcAspectStack(TC_Aspects.POTENTIA, 2L), + getTcAspectStack(TC_Aspects.METALLUM, 2L))); GregtechItemList.Pellet_RTG_SR90.set( - this.addItem( - 42, - StringUtils.superscript("90") + "Sr Pellet", - "", - getTcAspectStack(TC_Aspects.RADIO, 4L), - getTcAspectStack(TC_Aspects.POTENTIA, 2L), - getTcAspectStack(TC_Aspects.METALLUM, 2L))); + this.addItem( + 42, + StringUtils.superscript("90") + "Sr Pellet", + "", + getTcAspectStack(TC_Aspects.RADIO, 4L), + getTcAspectStack(TC_Aspects.POTENTIA, 2L), + getTcAspectStack(TC_Aspects.METALLUM, 2L))); GregtechItemList.Pellet_RTG_PO210.set( - this.addItem( - 43, - StringUtils.superscript("210") + "Po Pellet", - "", - getTcAspectStack(TC_Aspects.RADIO, 4L), - getTcAspectStack(TC_Aspects.POTENTIA, 2L), - getTcAspectStack(TC_Aspects.METALLUM, 2L))); + this.addItem( + 43, + StringUtils.superscript("210") + "Po Pellet", + "", + getTcAspectStack(TC_Aspects.RADIO, 4L), + getTcAspectStack(TC_Aspects.POTENTIA, 2L), + getTcAspectStack(TC_Aspects.METALLUM, 2L))); GregtechItemList.Pellet_RTG_AM241.set( - this.addItem( - 44, - StringUtils.superscript("241") + "Am Pellet", - "", - getTcAspectStack(TC_Aspects.RADIO, 4L), - getTcAspectStack(TC_Aspects.POTENTIA, 2L), - getTcAspectStack(TC_Aspects.METALLUM, 2L))); + this.addItem( + 44, + StringUtils.superscript("241") + "Am Pellet", + "", + getTcAspectStack(TC_Aspects.RADIO, 4L), + getTcAspectStack(TC_Aspects.POTENTIA, 2L), + getTcAspectStack(TC_Aspects.METALLUM, 2L))); CORE.RA.addFuelForRTG(GregtechItemList.Pellet_RTG_PU238.get(1), MathUtils.roundToClosestInt(87.7f), 64); CORE.RA.addFuelForRTG(GregtechItemList.Pellet_RTG_SR90.get(1), MathUtils.roundToClosestInt(28.8f), 32); @@ -146,101 +146,101 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { // Computer Cube GregtechItemList.Gregtech_Computer_Cube.set( - this.addItem( - tLastID = 55, - "Gregtech Computer Cube", - "Reusable", - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.METALLUM, 8L), - getTcAspectStack(TC_Aspects.POTENTIA, 8L))); + this.addItem( + tLastID = 55, + "Gregtech Computer Cube", + "Reusable", + getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.METALLUM, 8L), + getTcAspectStack(TC_Aspects.POTENTIA, 8L))); this.setElectricStats(32000 + tLastID, GT_Values.V[6] * 10 * 60 * 20, GT_Values.V[5], 5L, -3L, false); GregtechItemList.Cover_Overflow_LV.set( - this.addItem( - 72, - "Overflow Valve (LV)", - "Maximum void amount: 64,000", - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.ITER, 1L), - getTcAspectStack(TC_Aspects.AQUA, 1L))); + this.addItem( + 72, + "Overflow Valve (LV)", + "Maximum void amount: 64,000", + getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), + getTcAspectStack(TC_Aspects.ITER, 1L), + getTcAspectStack(TC_Aspects.AQUA, 1L))); GregtechItemList.Cover_Overflow_MV.set( - this.addItem( - 73, - "Overflow Valve (MV)", - "Maximum void amount: 512,000", - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.ITER, 1L), - getTcAspectStack(TC_Aspects.AQUA, 1L))); + this.addItem( + 73, + "Overflow Valve (MV)", + "Maximum void amount: 512,000", + getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), + getTcAspectStack(TC_Aspects.ITER, 1L), + getTcAspectStack(TC_Aspects.AQUA, 1L))); GregtechItemList.Cover_Overflow_HV.set( - this.addItem( - 74, - "Overflow Valve (HV)", - "Maximum void amount: 4,096,000", - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.ITER, 1L), - getTcAspectStack(TC_Aspects.AQUA, 1L))); + this.addItem( + 74, + "Overflow Valve (HV)", + "Maximum void amount: 4,096,000", + getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), + getTcAspectStack(TC_Aspects.ITER, 1L), + getTcAspectStack(TC_Aspects.AQUA, 1L))); GregtechItemList.Cover_Overflow_EV.set( - this.addItem( - 75, - "Overflow Valve (EV)", - "Maximum void amount: 32,768,000", - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.ITER, 1L), - getTcAspectStack(TC_Aspects.AQUA, 1L))); + this.addItem( + 75, + "Overflow Valve (EV)", + "Maximum void amount: 32,768,000", + getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), + getTcAspectStack(TC_Aspects.ITER, 1L), + getTcAspectStack(TC_Aspects.AQUA, 1L))); GregtechItemList.Cover_Overflow_IV.set( - this.addItem( - 76, - "Overflow Valve (IV)", - "Maximum void amount: 262,144,000", - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.ITER, 1L), - getTcAspectStack(TC_Aspects.AQUA, 1L))); + this.addItem( + 76, + "Overflow Valve (IV)", + "Maximum void amount: 262,144,000", + getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), + getTcAspectStack(TC_Aspects.ITER, 1L), + getTcAspectStack(TC_Aspects.AQUA, 1L))); GregTech_API.registerCover( - GregtechItemList.Cover_Overflow_LV.get(1L), - new GT_MultiTexture( - Textures.BlockIcons.MACHINE_CASINGS[4][0], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)), - new GTPP_Cover_Overflow(64)); + GregtechItemList.Cover_Overflow_LV.get(1L), + new GT_MultiTexture( + Textures.BlockIcons.MACHINE_CASINGS[4][0], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)), + new GTPP_Cover_Overflow(64)); GregTech_API.registerCover( - GregtechItemList.Cover_Overflow_MV.get(1L), - new GT_MultiTexture( - Textures.BlockIcons.MACHINE_CASINGS[5][0], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)), - new GTPP_Cover_Overflow(512)); + GregtechItemList.Cover_Overflow_MV.get(1L), + new GT_MultiTexture( + Textures.BlockIcons.MACHINE_CASINGS[5][0], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)), + new GTPP_Cover_Overflow(512)); GregTech_API.registerCover( - GregtechItemList.Cover_Overflow_HV.get(1L), - new GT_MultiTexture( - Textures.BlockIcons.MACHINE_CASINGS[5][0], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)), - new GTPP_Cover_Overflow(4096)); + GregtechItemList.Cover_Overflow_HV.get(1L), + new GT_MultiTexture( + Textures.BlockIcons.MACHINE_CASINGS[5][0], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)), + new GTPP_Cover_Overflow(4096)); GregTech_API.registerCover( - GregtechItemList.Cover_Overflow_EV.get(1L), - new GT_MultiTexture( - Textures.BlockIcons.MACHINE_CASINGS[8][0], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)), - new GTPP_Cover_Overflow(32768)); + GregtechItemList.Cover_Overflow_EV.get(1L), + new GT_MultiTexture( + Textures.BlockIcons.MACHINE_CASINGS[8][0], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)), + new GTPP_Cover_Overflow(32768)); GregTech_API.registerCover( - GregtechItemList.Cover_Overflow_IV.get(1L), - new GT_MultiTexture( - Textures.BlockIcons.MACHINE_CASINGS[8][0], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)), - new GTPP_Cover_Overflow(262144)); + GregtechItemList.Cover_Overflow_IV.get(1L), + new GT_MultiTexture( + Textures.BlockIcons.MACHINE_CASINGS[8][0], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)), + new GTPP_Cover_Overflow(262144)); // Fusion Reactor MK4 Singularity GregtechItemList.Compressed_Fusion_Reactor.set( - this.addItem( - 100, - "Hypervisor Matrix (Fusion)", - "A memory unit containing an RI (Restricted Intelligence)")); + this.addItem( + 100, + "Hypervisor Matrix (Fusion)", + "A memory unit containing an RI (Restricted Intelligence)")); GregtechItemList.Laser_Lens_Special - .set(this.addItem(105, "Quantum Anomaly", "Probably should shoot it with lasers")); + .set(this.addItem(105, "Quantum Anomaly", "Probably should shoot it with lasers")); GregtechItemList.Battery_Casing_Gem_1.set(this.addItem(106, "Containment Unit I", "Used in crafting")); GregtechItemList.Battery_Casing_Gem_2.set(this.addItem(107, "Containment Unit II", "Used in crafting")); @@ -248,13 +248,13 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { GregtechItemList.Battery_Casing_Gem_4.set(this.addItem(109, "Exotic Containment Unit", "Used in crafting")); GregtechItemList.Battery_Gem_4.set( - this.addItem( - tLastID = 110, - "Graviton Anomaly", - "Reusable", - getTcAspectStack(TC_Aspects.ELECTRUM, 64L), - getTcAspectStack(TC_Aspects.METALLUM, 64L), - getTcAspectStack(TC_Aspects.POTENTIA, 64L))); + this.addItem( + tLastID = 110, + "Graviton Anomaly", + "Reusable", + getTcAspectStack(TC_Aspects.ELECTRUM, 64L), + getTcAspectStack(TC_Aspects.METALLUM, 64L), + getTcAspectStack(TC_Aspects.POTENTIA, 64L))); this.setElectricStats(32000 + tLastID, (64000000000L * 16), GT_Values.V[9], 9L, -3L, false); /* @@ -262,34 +262,31 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { */ GregtechItemList.Laser_Lens_WoodsGlass.set( - this.addItem( - 140, - "Wood's Glass Lens", - "Allows UV & IF to pass through, blocks visible light spectrums")); + this.addItem(140, "Wood's Glass Lens", "Allows UV & IF to pass through, blocks visible light spectrums")); // 141 now unused, was the ulv transmission component int aStartID = 142; GregtechItemList[] aTransParts = new GregtechItemList[] { GregtechItemList.TransmissionComponent_LV, - GregtechItemList.TransmissionComponent_MV, GregtechItemList.TransmissionComponent_HV, - GregtechItemList.TransmissionComponent_EV, GregtechItemList.TransmissionComponent_IV, - GregtechItemList.TransmissionComponent_LuV, GregtechItemList.TransmissionComponent_ZPM, - GregtechItemList.TransmissionComponent_UV, GregtechItemList.TransmissionComponent_UHV, }; + GregtechItemList.TransmissionComponent_MV, GregtechItemList.TransmissionComponent_HV, + GregtechItemList.TransmissionComponent_EV, GregtechItemList.TransmissionComponent_IV, + GregtechItemList.TransmissionComponent_LuV, GregtechItemList.TransmissionComponent_ZPM, + GregtechItemList.TransmissionComponent_UV, GregtechItemList.TransmissionComponent_UHV, }; for (int tier = 1; tier < aTransParts.length + 1; tier++) { aTransParts[tier - 1].set( - this.addItem( - aStartID++, - "Transmission Component (" + GT_Values.VN[tier] + ")", - "", - getTcAspectStack(TC_Aspects.ELECTRUM, tier), - getTcAspectStack(TC_Aspects.MACHINA, tier), - getTcAspectStack(TC_Aspects.MAGNETO, tier))); + this.addItem( + aStartID++, + "Transmission Component (" + GT_Values.VN[tier] + ")", + "", + getTcAspectStack(TC_Aspects.ELECTRUM, tier), + getTcAspectStack(TC_Aspects.MACHINA, tier), + getTcAspectStack(TC_Aspects.MAGNETO, tier))); } // Distillus Chip GregtechItemList.Distillus_Upgrade_Chip - .set(this.addItem(151, "Distillus Upgrade Chip", "Used to upgrade Distillus to Tier 2")); + .set(this.addItem(151, "Distillus Upgrade Chip", "Used to upgrade Distillus to Tier 2")); GregtechItemList.Maceration_Upgrade_Chip - .set(this.addItem(152, "Maceration Upgrade Chip", "Used to upgrade Maceration Stack to Tier 2")); + .set(this.addItem(152, "Maceration Upgrade Chip", "Used to upgrade Maceration Stack to Tier 2")); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java index 5f39209178..30250a46f3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java @@ -27,28 +27,28 @@ public class MetaGeneratedGregtechTools extends GT_MetaGenerated_Tool { // Electric File this.addTool( - ANGLE_GRINDER, - "Angle Grinder", - "Hand-held electric filing device", - new TOOL_Gregtech_AngleGrinder(), - GregtechToolDictNames.craftingToolAngleGrinder, - ToolDictNames.craftingToolFile, - new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), - new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), - new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)); + ANGLE_GRINDER, + "Angle Grinder", + "Hand-held electric filing device", + new TOOL_Gregtech_AngleGrinder(), + GregtechToolDictNames.craftingToolAngleGrinder, + ToolDictNames.craftingToolFile, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)); // Electric Wire Cutter GregTech_API.registerWireCutter( - this.addTool( - ELECTRIC_SNIPS, - "Automatic Snips", - "Hand-held electric wire cutter", - new TOOL_Gregtech_ElectricSnips(), - GregtechToolDictNames.craftingToolElectricSnips, - ToolDictNames.craftingToolWireCutter, - new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 4L), - new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 4L), - new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 4L))); + this.addTool( + ELECTRIC_SNIPS, + "Automatic Snips", + "Hand-held electric wire cutter", + new TOOL_Gregtech_ElectricSnips(), + GregtechToolDictNames.craftingToolElectricSnips, + ToolDictNames.craftingToolWireCutter, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 4L))); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java index 6a5bfb7838..f85822750d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java @@ -20,20 +20,20 @@ public class Behaviour_Choocher extends Behaviour_None { private final Behaviour_Wrench wrench = new Behaviour_Wrench(150); private final Behaviour_Prospecting_Ex prospecting = new Behaviour_Prospecting_Ex(10, 1250); private final String mTooltip1 = GT_LanguageManager - .addStringLocalization("gt.behaviour.choochering1", "Current tool mode: "); + .addStringLocalization("gt.behaviour.choochering1", "Current tool mode: "); private final String mTooltip2 = GT_LanguageManager - .addStringLocalization("gt.behaviour.choochering2", "Change tool mode using Shift+Rightclick."); + .addStringLocalization("gt.behaviour.choochering2", "Change tool mode using Shift+Rightclick."); private final String mTooltipH = GT_LanguageManager - .addStringLocalization("gt.behaviour.prospectingEx", "Usable for Prospecting large areas."); + .addStringLocalization("gt.behaviour.prospectingEx", "Usable for Prospecting large areas."); private final String mTooltipW = GT_LanguageManager - .addStringLocalization("gt.behaviour.wrench", "Rotates Blocks on Rightclick."); + .addStringLocalization("gt.behaviour.wrench", "Rotates Blocks on Rightclick."); public Behaviour_Choocher() {} @Override public boolean onItemUseFirst(final GT_MetaBase_Item aItem, final ItemStack aStack, final EntityPlayer aPlayer, - final World aWorld, final int aX, final int aY, final int aZ, final ForgeDirection side, final float hitX, - final float hitY, final float hitZ) { + final World aWorld, final int aX, final int aY, final int aZ, final ForgeDirection side, final float hitX, + final float hitY, final float hitZ) { if (aWorld.isRemote) { return false; } @@ -42,13 +42,15 @@ public class Behaviour_Choocher extends Behaviour_None { if (NBTUtils.hasKey(aStack, "aMode")) { inWrenchMode = NBTUtils.getBoolean(aStack, "aMode"); } else { - aStack.getTagCompound().setBoolean("aMode", true); + aStack.getTagCompound() + .setBoolean("aMode", true); inWrenchMode = true; } if (aPlayer.isSneaking()) { boolean aModeNew = !inWrenchMode; - aStack.getTagCompound().setBoolean("aMode", aModeNew); + aStack.getTagCompound() + .setBoolean("aMode", aModeNew); PlayerUtils.messagePlayer(aPlayer, "Mode: " + (aModeNew ? "Wrench" : "Hammer")); return true; } else { @@ -56,21 +58,22 @@ public class Behaviour_Choocher extends Behaviour_None { return this.wrench.onItemUseFirst(aItem, aStack, aPlayer, aWorld, aX, aY, aZ, side, hitZ, hitZ, hitZ); } else { return this.prospecting - .onItemUseFirst(aItem, aStack, aPlayer, aWorld, aX, aY, aZ, side, hitX, hitY, hitZ); + .onItemUseFirst(aItem, aStack, aPlayer, aWorld, aX, aY, aZ, side, hitX, hitY, hitZ); } } } @Override public List<String> getAdditionalToolTips(final GT_MetaBase_Item aItem, final List<String> aList, - final ItemStack aStack) { + final ItemStack aStack) { boolean inWrenchMode; if (NBTUtils.hasKey(aStack, "aMode")) { inWrenchMode = NBTUtils.getBoolean(aStack, "aMode"); } else { NBTUtils.setBoolean(aStack, "aMode", true); - aStack.getTagCompound().setBoolean("aMode", true); + aStack.getTagCompound() + .setBoolean("aMode", true); inWrenchMode = true; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java index 6a4bd010fb..f3d7f87a86 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java @@ -29,11 +29,11 @@ import ic2.api.item.IElectricItemManager; public class Behaviour_Electric_Lighter extends Behaviour_None { private final String mTooltip = GT_LanguageManager - .addStringLocalization("gt.behaviour.lighter.tooltip", "Can light things on Fire"); + .addStringLocalization("gt.behaviour.lighter.tooltip", "Can light things on Fire"); private final String mTooltipUses = GT_LanguageManager - .addStringLocalization("gt.behaviour.lighter.uses", "Remaining Uses:"); + .addStringLocalization("gt.behaviour.lighter.uses", "Remaining Uses:"); private final String mTooltipUnstackable = GT_LanguageManager - .addStringLocalization("gt.behaviour.unstackable", "Not usable when stacked!"); + .addStringLocalization("gt.behaviour.unstackable", "Not usable when stacked!"); public Behaviour_Electric_Lighter() {} @@ -44,13 +44,13 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { if (aEntity instanceof EntityCreeper) { if (this.prepare(aStack) || aPlayer.capabilities.isCreativeMode) { GT_Utility.sendSoundToPlayers( - aPlayer.worldObj, - SoundResource.FIRE_IGNITE, - 1.0F, - 1.0F, - MathHelper.floor_double(aEntity.posX), - MathHelper.floor_double(aEntity.posY), - MathHelper.floor_double(aEntity.posZ)); + aPlayer.worldObj, + SoundResource.FIRE_IGNITE, + 1.0F, + 1.0F, + MathHelper.floor_double(aEntity.posX), + MathHelper.floor_double(aEntity.posY), + MathHelper.floor_double(aEntity.posZ)); ((EntityCreeper) aEntity).func_146079_cb(); rOutput = true; } @@ -63,7 +63,7 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { @Override public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int ordinalSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int ordinalSide, float hitX, float hitY, float hitZ) { if (!aWorld.isRemote && aStack != null && aStack.stackSize == 1) { if (aPlayer.isSneaking()) { Logger.INFO("Changing Mode"); @@ -71,20 +71,18 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { Logger.INFO("Is currently in Fireball mode? " + aCurrentMode); boolean aNewMode = !aCurrentMode; Logger.INFO("Is now set to Fireball mode? " + aNewMode); - aStack.getTagCompound().setBoolean("aFireballMod", aNewMode); + aStack.getTagCompound() + .setBoolean("aFireballMod", aNewMode); // NBTUtils.setBoolean(aStack, "aFireballMode", aNewMode); PlayerUtils.messagePlayer( - aPlayer, - "Current Mode: " + EnumChatFormatting.RED + (aNewMode ? "Projectile" : "Fire Starter")); + aPlayer, + "Current Mode: " + EnumChatFormatting.RED + (aNewMode ? "Projectile" : "Fire Starter")); } else { boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode"); if (aCurrentMode) { // Shoot Lightning Attack - aWorld.playSoundAtEntity( - aPlayer, - "random.bow", - 0.5F, - 0.4F / (CORE.RANDOM.nextFloat() * 0.4F + 0.8F)); + aWorld + .playSoundAtEntity(aPlayer, "random.bow", 0.5F, 0.4F / (CORE.RANDOM.nextFloat() * 0.4F + 0.8F)); if (!aWorld.isRemote) { aWorld.spawnEntityInWorld(new EntityLightningAttack(aWorld, aPlayer, hitX, hitY, hitZ)); } @@ -97,7 +95,7 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { aY += tDirection.offsetY; aZ += tDirection.offsetZ; if (GT_Utility.isBlockAir(aWorld, aX, aY, aZ) - && aPlayer.canPlayerEdit(aX, aY, aZ, ordinalSide, aStack)) { + && aPlayer.canPlayerEdit(aX, aY, aZ, ordinalSide, aStack)) { Logger.WARNING("Preparing Lighter b"); if (this.prepare(aStack) || aPlayer.capabilities.isCreativeMode) { Logger.WARNING("Preparing Lighter c"); @@ -116,7 +114,7 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { } public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, - int aY, int aZ, int ordinalSide, float hitX, float hitY, float hitZ) { + int aY, int aZ, int ordinalSide, float hitX, float hitY, float hitZ) { if (!aWorld.isRemote && aStack != null && aStack.stackSize == 1) { if (aPlayer.isSneaking()) { Logger.INFO("Changing Mode"); @@ -124,20 +122,18 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { Logger.INFO("Is currently in Fireball mode? " + aCurrentMode); boolean aNewMode = !aCurrentMode; Logger.INFO("Is now set to Fireball mode? " + aNewMode); - aStack.getTagCompound().setBoolean("aFireballMode", aNewMode); + aStack.getTagCompound() + .setBoolean("aFireballMode", aNewMode); // NBTUtils.setBoolean(aStack, "aFireballMode", aNewMode); PlayerUtils.messagePlayer( - aPlayer, - "Current Mode: " + EnumChatFormatting.RED + (aNewMode ? "Projectile" : "Fire Starter")); + aPlayer, + "Current Mode: " + EnumChatFormatting.RED + (aNewMode ? "Projectile" : "Fire Starter")); } else { boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode"); if (aCurrentMode) { // Shoot Lightning Attack - aWorld.playSoundAtEntity( - aPlayer, - "random.bow", - 0.5F, - 0.4F / (CORE.RANDOM.nextFloat() * 0.4F + 0.8F)); + aWorld + .playSoundAtEntity(aPlayer, "random.bow", 0.5F, 0.4F / (CORE.RANDOM.nextFloat() * 0.4F + 0.8F)); if (!aWorld.isRemote) { aWorld.spawnEntityInWorld(new EntityLightningAttack(aWorld, aPlayer, hitX, hitY, hitZ)); } @@ -150,7 +146,7 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { aY += tDirection.offsetY; aZ += tDirection.offsetZ; if (GT_Utility.isBlockAir(aWorld, aX, aY, aZ) - && aPlayer.canPlayerEdit(aX, aY, aZ, ordinalSide, aStack)) { + && aPlayer.canPlayerEdit(aX, aY, aZ, ordinalSide, aStack)) { Logger.WARNING("Preparing Lighter b"); if (this.prepare(aStack) || aPlayer.capabilities.isCreativeMode) { Logger.WARNING("Preparing Lighter c"); @@ -214,7 +210,8 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { if (NBTUtils.hasKey(aStack, "aFireballMode")) { aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode"); } else { - aStack.getTagCompound().setBoolean("aFireballMode", false); + aStack.getTagCompound() + .setBoolean("aFireballMode", false); aCurrentMode = false; } aList.add("Current Mode: " + EnumChatFormatting.RED + (aCurrentMode ? "Projectile" : "Fire Starter")); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java index 7fd7de322c..5749204296 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java @@ -37,8 +37,8 @@ public class Behaviour_Prospecting_Ex extends Behaviour_Prospecting { @Override public boolean onItemUseFirst(final GT_MetaBase_Item aItem, final ItemStack aStack, final EntityPlayer aPlayer, - final World aWorld, final int aX, final int aY, final int aZ, final ForgeDirection side, final float hitX, - final float hitY, final float hitZ) { + final World aWorld, final int aX, final int aY, final int aZ, final ForgeDirection side, final float hitX, + final float hitY, final float hitZ) { if (aWorld.isRemote) { return false; } @@ -49,19 +49,19 @@ public class Behaviour_Prospecting_Ex extends Behaviour_Prospecting { final byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ); ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(aBlock, 1, aMeta)); - if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) { - GT_Utility.sendChatToPlayer( - aPlayer, - "This is " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore."); + if ((tAssotiation != null) && (tAssotiation.mPrefix.toString() + .startsWith("ore"))) { + GT_Utility + .sendChatToPlayer(aPlayer, "This is " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore."); GT_Utility.sendSoundToPlayers(aWorld, SoundResource.RANDOM_ANVIL_USE, 1.0F, -1.0F, aX, aY, aZ); return true; } if ((aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) - || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites)) - || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack)) - || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone)) - || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.dirt)) - || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.grass))) { + || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites)) + || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack)) + || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone)) + || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.dirt)) + || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.grass))) { if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) { GT_Utility.sendSoundToPlayers(aWorld, SoundResource.RANDOM_ANVIL_USE, 1.0F, -1.0F, aX, aY, aZ); int tX = aX; @@ -69,8 +69,8 @@ public class Behaviour_Prospecting_Ex extends Behaviour_Prospecting { int tZ = aZ; int tMetaID = 0; final int tQuality = ((aItem instanceof GT_MetaGenerated_Tool) - ? ((GT_MetaGenerated_Tool) aItem).getHarvestLevel(aStack, "") - : 0) * 3; + ? ((GT_MetaGenerated_Tool) aItem).getHarvestLevel(aStack, "") + : 0) * 3; int i = 0; for (final int j = 6 + tQuality; i < j; i++) { @@ -84,7 +84,7 @@ public class Behaviour_Prospecting_Ex extends Behaviour_Prospecting { break; } if ((tBlock == Blocks.water) || (tBlock == Blocks.flowing_water) - || ((tBlock instanceof IFluidBlock))) { + || ((tBlock instanceof IFluidBlock))) { GT_Utility.sendChatToPlayer(aPlayer, "There is a Liquid behind this Block."); break; } @@ -111,21 +111,22 @@ public class Behaviour_Prospecting_Ex extends Behaviour_Prospecting { final TileEntity tTileEntity = aWorld.getTileEntity(tX, tY, tZ); if ((tTileEntity instanceof GT_TileEntity_Ores)) { final Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData - % 1000)]; + % 1000)]; if ((tMaterial != null) && (tMaterial != Materials._NULL)) { GT_Utility.sendChatToPlayer( - aPlayer, - "Found traces of " + tMaterial.mDefaultLocalName + " Ore."); + aPlayer, + "Found traces of " + tMaterial.mDefaultLocalName + " Ore."); return true; } } } else { tMetaID = aWorld.getBlockMetadata(tX, tY, tZ); tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID)); - if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) { + if ((tAssotiation != null) && (tAssotiation.mPrefix.toString() + .startsWith("ore"))) { GT_Utility.sendChatToPlayer( - aPlayer, - "Found traces of " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore."); + aPlayer, + "Found traces of " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore."); return true; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/covers/MetaItemCoverCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/covers/MetaItemCoverCasings.java index a660362461..987924952a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/covers/MetaItemCoverCasings.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/covers/MetaItemCoverCasings.java @@ -17,11 +17,11 @@ public class MetaItemCoverCasings extends MetaCustomCoverItem { public MetaItemCoverCasings() { super( - GTPlusPlus.ID, - Textures.BlockIcons.MACHINECASINGS_SIDE.length, - "Gt Machine Casings", - Textures.BlockIcons.MACHINECASINGS_SIDE, - null); + GTPlusPlus.ID, + Textures.BlockIcons.MACHINECASINGS_SIDE.length, + "Gt Machine Casings", + Textures.BlockIcons.MACHINECASINGS_SIDE, + null); } @Override @@ -44,8 +44,7 @@ public class MetaItemCoverCasings extends MetaCustomCoverItem { @Override public String getItemStackDisplayName(final ItemStack tItem) { return EnumChatFormatting.LIGHT_PURPLE + StatCollector.translateToLocalFormatted( - "item.itemCustomMetaCover.miscutils.GtMachineCasings", - GT_Values.VOLTAGE_NAMES[MathUtils - .balance(tItem.getItemDamage(), 0, GT_Values.VOLTAGE_NAMES.length - 1)]); // super.getItemStackDisplayName(tItem); + "item.itemCustomMetaCover.miscutils.GtMachineCasings", + GT_Values.VOLTAGE_NAMES[MathUtils.balance(tItem.getItemDamage(), 0, GT_Values.VOLTAGE_NAMES.length - 1)]); // super.getItemStackDisplayName(tItem); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java index 1e097f910b..a281a205d2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java @@ -35,10 +35,10 @@ import gtPlusPlus.core.util.math.MathUtils; public class GTPP_CapeRenderer extends RenderPlayer { private static final ResourceLocation[] mCapes = { new ResourceLocation("miscutils:textures/OrangeHD.png"), - new ResourceLocation("miscutils:textures/FancyCapeHD.png"), - new ResourceLocation("miscutils:textures/TesterCapeHD.png"), - new ResourceLocation("miscutils:textures/PatreonCapeHD.png"), - new ResourceLocation("miscutils:textures/DevCapeHD.png"), }; + new ResourceLocation("miscutils:textures/FancyCapeHD.png"), + new ResourceLocation("miscutils:textures/TesterCapeHD.png"), + new ResourceLocation("miscutils:textures/PatreonCapeHD.png"), + new ResourceLocation("miscutils:textures/DevCapeHD.png"), }; private final boolean mInit; @@ -103,7 +103,9 @@ public class GTPP_CapeRenderer extends RenderPlayer { if (!hasResourceChecked) { // Get players UUID - String aPlayerUUID = aPlayer != null ? aPlayer.getGameProfile().getId().toString() : "BAD"; + String aPlayerUUID = aPlayer != null ? aPlayer.getGameProfile() + .getId() + .toString() : "BAD"; // If for whatever reason this fails, we just exit early. if (aPlayerUUID.equals("BAD")) { @@ -121,7 +123,8 @@ public class GTPP_CapeRenderer extends RenderPlayer { // Check cape lists for the cape this player owns. if (!hasCape) { for (Pair<String, String> aData : CapeUtils.mOrangeCapes) { - if (aData.getKey().equals(aPlayerUUID) || aPlayerName.equals(aData.getValue())) { + if (aData.getKey() + .equals(aPlayerUUID) || aPlayerName.equals(aData.getValue())) { tResource = mCapes[0]; hasCape = true; break; @@ -130,7 +133,8 @@ public class GTPP_CapeRenderer extends RenderPlayer { } if (!hasCape) { for (Pair<String, String> aData : CapeUtils.mMiscCapes) { - if (aData.getKey().equals(aPlayerUUID) || aPlayerName.equals(aData.getValue())) { + if (aData.getKey() + .equals(aPlayerUUID) || aPlayerName.equals(aData.getValue())) { tResource = mCapes[1]; hasCape = true; break; @@ -139,7 +143,8 @@ public class GTPP_CapeRenderer extends RenderPlayer { } if (!hasCape) { for (Pair<String, String> aData : CapeUtils.mBetaTestCapes) { - if (aData.getKey().equals(aPlayerUUID) || aPlayerName.equals(aData.getValue())) { + if (aData.getKey() + .equals(aPlayerUUID) || aPlayerName.equals(aData.getValue())) { tResource = mCapes[2]; hasCape = true; break; @@ -148,7 +153,8 @@ public class GTPP_CapeRenderer extends RenderPlayer { } if (!hasCape) { for (Pair<String, String> aData : CapeUtils.mPatreonCapes) { - if (aData.getKey().equals(aPlayerUUID) || aPlayerName.equals(aData.getValue())) { + if (aData.getKey() + .equals(aPlayerUUID) || aPlayerName.equals(aData.getValue())) { tResource = mCapes[3]; hasCape = true; break; @@ -157,7 +163,8 @@ public class GTPP_CapeRenderer extends RenderPlayer { } if (!hasCape) { for (Pair<String, String> aData : CapeUtils.mDevCapes) { - if (aData.getKey().equals(aPlayerUUID) || aPlayerName.equals(aData.getValue())) { + if (aData.getKey() + .equals(aPlayerUUID) || aPlayerName.equals(aData.getValue())) { tResource = mCapes[4]; hasCape = true; break; @@ -183,7 +190,7 @@ public class GTPP_CapeRenderer extends RenderPlayer { // If player is invisible, don't render. if (GT_Utility.getFullInvisibility(aPlayer) || aPlayer.isInvisible() - || GT_Utility.getPotion(aPlayer, Integer.valueOf(Potion.invisibility.id))) { + || GT_Utility.getPotion(aPlayer, Integer.valueOf(Potion.invisibility.id))) { aEvent.setCanceled(true); return false; } @@ -193,13 +200,13 @@ public class GTPP_CapeRenderer extends RenderPlayer { GL11.glPushMatrix(); GL11.glTranslatef(0.0F, 0.0F, 0.125F); double d0 = aPlayer.field_71091_bM + (aPlayer.field_71094_bP - aPlayer.field_71091_bM) * aPartialTicks - - (aPlayer.prevPosX + (aPlayer.posX - aPlayer.prevPosX) * aPartialTicks); + - (aPlayer.prevPosX + (aPlayer.posX - aPlayer.prevPosX) * aPartialTicks); double d1 = aPlayer.field_71096_bN + (aPlayer.field_71095_bQ - aPlayer.field_71096_bN) * aPartialTicks - - (aPlayer.prevPosY + (aPlayer.posY - aPlayer.prevPosY) * aPartialTicks); + - (aPlayer.prevPosY + (aPlayer.posY - aPlayer.prevPosY) * aPartialTicks); double d2 = aPlayer.field_71097_bO + (aPlayer.field_71085_bR - aPlayer.field_71097_bO) * aPartialTicks - - (aPlayer.prevPosZ + (aPlayer.posZ - aPlayer.prevPosZ) * aPartialTicks); + - (aPlayer.prevPosZ + (aPlayer.posZ - aPlayer.prevPosZ) * aPartialTicks); float f6 = aPlayer.prevRenderYawOffset - + (aPlayer.renderYawOffset - aPlayer.prevRenderYawOffset) * aPartialTicks; + + (aPlayer.renderYawOffset - aPlayer.prevRenderYawOffset) * aPartialTicks; double d3 = MathHelper.sin(f6 * CORE.PI / 180.0F); double d4 = -MathHelper.cos(f6 * CORE.PI / 180.0F); float f7 = (float) d1 * 10.0F; @@ -216,11 +223,10 @@ public class GTPP_CapeRenderer extends RenderPlayer { } float f10 = aPlayer.prevCameraYaw + (aPlayer.cameraYaw - aPlayer.prevCameraYaw) * aPartialTicks; f7 += MathHelper.sin( - (aPlayer.prevDistanceWalkedModified - + (aPlayer.distanceWalkedModified - aPlayer.prevDistanceWalkedModified) * aPartialTicks) - * 6.0F) - * 32.0F - * f10; + (aPlayer.prevDistanceWalkedModified + + (aPlayer.distanceWalkedModified - aPlayer.prevDistanceWalkedModified) * aPartialTicks) * 6.0F) + * 32.0F + * f10; if (aPlayer.isSneaking()) { f7 += 25.0F; } @@ -257,14 +263,15 @@ public class GTPP_CapeRenderer extends RenderPlayer { if (CORE.DEVENV) { return true; } - ForkJoinPool.commonPool().execute(() -> { - try { - if (shouldDownloadCapeList()) { - downloadCapeList(); - } - } catch (Exception ignored) {} - cacheReady = true; - }); + ForkJoinPool.commonPool() + .execute(() -> { + try { + if (shouldDownloadCapeList()) { + downloadCapeList(); + } + } catch (Exception ignored) {} + cacheReady = true; + }); return true; } @@ -358,7 +365,7 @@ public class GTPP_CapeRenderer extends RenderPlayer { } if (tempFile == null) { tempFile = FileUtils - .createFile("", "gtpp-" + MathUtils.randInt(Short.MAX_VALUE, (Integer.MAX_VALUE / 2)), "tmp"); + .createFile("", "gtpp-" + MathUtils.randInt(Short.MAX_VALUE, (Integer.MAX_VALUE / 2)), "tmp"); } tempFile.deleteOnExit(); return tempFile; @@ -390,51 +397,51 @@ public class GTPP_CapeRenderer extends RenderPlayer { if (aCapeTypeID2 != null) { int aCapeTypeID = aCapeTypeID2; Pair<String, String> aFinalString = new Pair<>( - "UUID: " + aSplitData[1], - "Username: " + (aSplitData[2] != null && aSplitData[0].length() > 0 - ? aSplitData[2] - : "Not Specified")); + "UUID: " + aSplitData[1], + "Username: " + + (aSplitData[2] != null && aSplitData[0].length() > 0 ? aSplitData[2] + : "Not Specified")); Logger.INFO("Cape Type: " + aCapeTypeID); switch (aCapeTypeID) { case 0 -> { aCapeType1.add(aFinalString); Logger.INFO( - "Added user to map " + aCapeTypeID - + ", map now holds " - + aCapeType1.size() - + " users."); + "Added user to map " + aCapeTypeID + + ", map now holds " + + aCapeType1.size() + + " users."); } case 1 -> { aCapeType2.add(aFinalString); Logger.INFO( - "Added user to map " + aCapeTypeID - + ", map now holds " - + aCapeType2.size() - + " users."); + "Added user to map " + aCapeTypeID + + ", map now holds " + + aCapeType2.size() + + " users."); } case 2 -> { aCapeType3.add(aFinalString); Logger.INFO( - "Added user to map " + aCapeTypeID - + ", map now holds " - + aCapeType3.size() - + " users."); + "Added user to map " + aCapeTypeID + + ", map now holds " + + aCapeType3.size() + + " users."); } case 3 -> { aCapeType4.add(aFinalString); Logger.INFO( - "Added user to map " + aCapeTypeID - + ", map now holds " - + aCapeType4.size() - + " users."); + "Added user to map " + aCapeTypeID + + ", map now holds " + + aCapeType4.size() + + " users."); } case 4 -> { aCapeType5.add(aFinalString); Logger.INFO( - "Added user to map " + aCapeTypeID - + ", map now holds " - + aCapeType5.size() - + " users."); + "Added user to map " + aCapeTypeID + + ", map now holds " + + aCapeType5.size() + + " users."); } default -> {} } @@ -443,9 +450,9 @@ public class GTPP_CapeRenderer extends RenderPlayer { } } if (!aCapeType1.isEmpty() || !aCapeType2.isEmpty() - || !aCapeType3.isEmpty() - || !aCapeType4.isEmpty() - || !aCapeType5.isEmpty()) { + || !aCapeType3.isEmpty() + || !aCapeType4.isEmpty() + || !aCapeType5.isEmpty()) { didProcessStringData = true; } else { // did not process any data diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_FlaskRenderer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_FlaskRenderer.java index 93e139ef66..0c9e59e2f2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_FlaskRenderer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_FlaskRenderer.java @@ -58,8 +58,10 @@ public final class GTPP_FlaskRenderer implements net.minecraftforge.client.IItem FluidStack fs = cell.getFluid(item); if (fs != null) { IIcon iconWindow = cell.iconWindow; - IIcon fluidicon = fs.getFluid().getIcon(fs); - int fluidColor = fs.getFluid().getColor(fs); + IIcon fluidicon = fs.getFluid() + .getIcon(fs); + int fluidColor = fs.getFluid() + .getColor(fs); Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); GL11.glBlendFunc(0, 1); if (type.equals(ItemRenderType.INVENTORY)) { @@ -90,14 +92,14 @@ public final class GTPP_FlaskRenderer implements net.minecraftforge.client.IItem DrawUtil.renderIcon(icon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); } else { ItemRenderer.renderItemIn2D( - Tessellator.instance, - icon.getMaxU(), - icon.getMinV(), - icon.getMinU(), - icon.getMaxV(), - icon.getIconWidth(), - icon.getIconHeight(), - 0.0625F); + Tessellator.instance, + icon.getMaxU(), + icon.getMinV(), + icon.getMinU(), + icon.getMaxV(), + icon.getIconWidth(), + icon.getIconHeight(), + 0.0625F); } GL11.glDisable(3008); GL11.glDisable(3042); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java index 4c51b1ff09..bfd16b4cc5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java @@ -50,13 +50,13 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { } private static ITexture[] getTexture(IMetaTileEntity tile, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean active, boolean arg5) { + int colorIndex, boolean active, boolean arg5) { final IGregTechTileEntity gtTile = tile.getBaseMetaTileEntity(); return tile.getTexture(gtTile, side, facing, (byte) colorIndex, active, arg5); } private static ITexture[] getTexture(IMetaTileEntity tile, ForgeDirection side, int facingMask, int colorIndex, - boolean active, boolean arg5) { + boolean active, boolean arg5) { final MetaPipeEntity gtTile = (MetaPipeEntity) tile.getBaseMetaTileEntity(); return gtTile.getTexture((IGregTechTileEntity) tile, side, facingMask, colorIndex, active, arg5); } @@ -77,147 +77,147 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F); renderNegativeYFacing( - null, - aRenderer, - aBlock, - 0, - 0, - 0, - getTexture(tMetaTileEntity, DOWN, 0b001001, -1, false, false), - true); + null, + aRenderer, + aBlock, + 0, + 0, + 0, + getTexture(tMetaTileEntity, DOWN, 0b001001, -1, false, false), + true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F); renderPositiveYFacing( - null, - aRenderer, - aBlock, - 0, - 0, - 0, - getTexture(tMetaTileEntity, UP, 0b001001, -1, false, false), - true); + null, + aRenderer, + aBlock, + 0, + 0, + 0, + getTexture(tMetaTileEntity, UP, 0b001001, -1, false, false), + true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F); renderNegativeZFacing( - null, - aRenderer, - aBlock, - 0, - 0, - 0, - getTexture(tMetaTileEntity, ForgeDirection.NORTH, 0b001001, -1, false, false), - true); + null, + aRenderer, + aBlock, + 0, + 0, + 0, + getTexture(tMetaTileEntity, ForgeDirection.NORTH, 0b001001, -1, false, false), + true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F); renderPositiveZFacing( - null, - aRenderer, - aBlock, - 0, - 0, - 0, - getTexture(tMetaTileEntity, ForgeDirection.SOUTH, 0b001001, -1, false, false), - true); + null, + aRenderer, + aBlock, + 0, + 0, + 0, + getTexture(tMetaTileEntity, ForgeDirection.SOUTH, 0b001001, -1, false, false), + true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F); renderNegativeXFacing( - null, - aRenderer, - aBlock, - 0, - 0, - 0, - getTexture(tMetaTileEntity, ForgeDirection.WEST, 0b001001, -1, true, false), - true); + null, + aRenderer, + aBlock, + 0, + 0, + 0, + getTexture(tMetaTileEntity, ForgeDirection.WEST, 0b001001, -1, true, false), + true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F); renderPositiveXFacing( - null, - aRenderer, - aBlock, - 0, - 0, - 0, - getTexture(tMetaTileEntity, ForgeDirection.EAST, 0b001001, -1, true, false), - true); + null, + aRenderer, + aBlock, + 0, + 0, + 0, + getTexture(tMetaTileEntity, ForgeDirection.EAST, 0b001001, -1, true, false), + true); Tessellator.instance.draw(); } else { Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F); renderNegativeYFacing( - null, - aRenderer, - aBlock, - 0, - 0, - 0, - getTexture(tMetaTileEntity, DOWN, ForgeDirection.WEST, -1, true, false), - true); + null, + aRenderer, + aBlock, + 0, + 0, + 0, + getTexture(tMetaTileEntity, DOWN, ForgeDirection.WEST, -1, true, false), + true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F); renderPositiveYFacing( - null, - aRenderer, - aBlock, - 0, - 0, - 0, - getTexture(tMetaTileEntity, UP, ForgeDirection.WEST, -1, true, false), - true); + null, + aRenderer, + aBlock, + 0, + 0, + 0, + getTexture(tMetaTileEntity, UP, ForgeDirection.WEST, -1, true, false), + true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F); renderNegativeZFacing( - null, - aRenderer, - aBlock, - 0, - 0, - 0, - getTexture(tMetaTileEntity, ForgeDirection.NORTH, ForgeDirection.WEST, -1, true, false), - true); + null, + aRenderer, + aBlock, + 0, + 0, + 0, + getTexture(tMetaTileEntity, ForgeDirection.NORTH, ForgeDirection.WEST, -1, true, false), + true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F); renderPositiveZFacing( - null, - aRenderer, - aBlock, - 0, - 0, - 0, - getTexture(tMetaTileEntity, ForgeDirection.SOUTH, ForgeDirection.WEST, -1, true, false), - true); + null, + aRenderer, + aBlock, + 0, + 0, + 0, + getTexture(tMetaTileEntity, ForgeDirection.SOUTH, ForgeDirection.WEST, -1, true, false), + true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F); renderNegativeXFacing( - null, - aRenderer, - aBlock, - 0, - 0, - 0, - getTexture(tMetaTileEntity, ForgeDirection.WEST, ForgeDirection.WEST, -1, true, false), - true); + null, + aRenderer, + aBlock, + 0, + 0, + 0, + getTexture(tMetaTileEntity, ForgeDirection.WEST, ForgeDirection.WEST, -1, true, false), + true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F); renderPositiveXFacing( - null, - aRenderer, - aBlock, - 0, - 0, - 0, - getTexture(tMetaTileEntity, ForgeDirection.EAST, ForgeDirection.WEST, -1, true, false), - true); + null, + aRenderer, + aBlock, + 0, + 0, + 0, + getTexture(tMetaTileEntity, ForgeDirection.EAST, ForgeDirection.WEST, -1, true, false), + true); Tessellator.instance.draw(); } @@ -229,28 +229,28 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { } public boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, - RenderBlocks aRenderer) { + RenderBlocks aRenderer) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); return tTileEntity instanceof ITexturedTileEntity - ? renderStandardBlock( - aWorld, - aX, - aY, - aZ, - aBlock, - aRenderer, - new ITexture[][] { GT_MethodHelper.getTexture(tTileEntity, aBlock, DOWN), - GT_MethodHelper.getTexture(tTileEntity, aBlock, UP), - GT_MethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.NORTH), - GT_MethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.SOUTH), - GT_MethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.WEST), - GT_MethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.EAST) }) - : false; + ? renderStandardBlock( + aWorld, + aX, + aY, + aZ, + aBlock, + aRenderer, + new ITexture[][] { GT_MethodHelper.getTexture(tTileEntity, aBlock, DOWN), + GT_MethodHelper.getTexture(tTileEntity, aBlock, UP), + GT_MethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.NORTH), + GT_MethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.SOUTH), + GT_MethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.WEST), + GT_MethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.EAST) }) + : false; } public boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, - RenderBlocks aRenderer, ITexture[][] aTextures) { + RenderBlocks aRenderer, ITexture[][] aTextures) { aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); aRenderer.setRenderBoundsFromBlock(aBlock); renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[DOWN.ordinal()], true); @@ -263,7 +263,7 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { } public boolean renderPipeBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, - IPipeRenderedTileEntity aTileEntity, RenderBlocks aRenderer) { + IPipeRenderedTileEntity aTileEntity, RenderBlocks aRenderer) { final int aConnections = aTileEntity.getConnections(); if ((aConnections & HAS_FOAM) != 0) { return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer); @@ -303,64 +303,263 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness); aRenderer.setRenderBoundsFromBlock(aBlock); renderNegativeYFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(DOWN), + false); + renderPositiveYFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(UP), + false); + renderNegativeZFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(NORTH), + false); + renderPositiveZFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(SOUTH), + false); + renderNegativeXFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(WEST), + false); + renderPositiveXFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(EAST), + false); + } + case (CONNECTED_DOWN | CONNECTED_UP) -> { + aBlock.setBlockBounds(0.0F, sp, sp, 1.0F, sp + tThickness, sp + tThickness); + aRenderer.setRenderBoundsFromBlock(aBlock); + renderNegativeYFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(DOWN), + false); + renderPositiveYFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(UP), + false); + renderNegativeZFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(NORTH), + false); + renderPositiveZFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(SOUTH), + false); + if (!coveredSides.contains(WEST)) { + renderNegativeXFacing( aWorld, aRenderer, aBlock, aX, aY, aZ, - textureUncovered.get(DOWN), + textureUncovered.get(WEST), false); - renderPositiveYFacing( + } + if (!coveredSides.contains(EAST)) { + renderPositiveXFacing( aWorld, aRenderer, aBlock, aX, aY, aZ, - textureUncovered.get(UP), + textureUncovered.get(EAST), false); + } + } + case (CONNECTED_NORTH | CONNECTED_SOUTH) -> { + aBlock.setBlockBounds(sp, 0.0F, sp, sp + tThickness, 1.0F, sp + tThickness); + aRenderer.setRenderBoundsFromBlock(aBlock); renderNegativeZFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(NORTH), + false); + renderPositiveZFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(SOUTH), + false); + renderNegativeXFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(WEST), + false); + renderPositiveXFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(EAST), + false); + if (!coveredSides.contains(DOWN)) { + renderNegativeYFacing( aWorld, aRenderer, aBlock, aX, aY, aZ, - textureUncovered.get(NORTH), + textureUncovered.get(DOWN), false); - renderPositiveZFacing( + } + if (!coveredSides.contains(UP)) { + renderPositiveYFacing( aWorld, aRenderer, aBlock, aX, aY, aZ, - textureUncovered.get(SOUTH), + textureUncovered.get(UP), false); + } + } + case (CONNECTED_WEST | CONNECTED_EAST) -> { + aBlock.setBlockBounds(sp, sp, 0.0F, sp + tThickness, sp + tThickness, 1.0F); + aRenderer.setRenderBoundsFromBlock(aBlock); + renderNegativeYFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(DOWN), + false); + renderPositiveYFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(UP), + false); renderNegativeXFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(WEST), + false); + renderPositiveXFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(EAST), + false); + if (!coveredSides.contains(NORTH)) { + renderNegativeZFacing( aWorld, aRenderer, aBlock, aX, aY, aZ, - textureUncovered.get(WEST), + textureUncovered.get(NORTH), false); - renderPositiveXFacing( + } + if (!coveredSides.contains(SOUTH)) { + renderPositiveZFacing( aWorld, aRenderer, aBlock, aX, aY, aZ, - textureUncovered.get(EAST), + textureUncovered.get(SOUTH), false); + } } - case (CONNECTED_DOWN | CONNECTED_UP) -> { - aBlock.setBlockBounds(0.0F, sp, sp, 1.0F, sp + tThickness, sp + tThickness); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing( + default -> { + if ((connexionSidesBits & CONNECTED_DOWN) == 0) { + aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness); + aRenderer.setRenderBoundsFromBlock(aBlock); + renderNegativeXFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(WEST), + false); + } else { + aBlock.setBlockBounds(0.0F, sp, sp, sp, sp + tThickness, sp + tThickness); + aRenderer.setRenderBoundsFromBlock(aBlock); + renderNegativeYFacing( aWorld, aRenderer, aBlock, @@ -369,7 +568,7 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { aZ, textureUncovered.get(DOWN), false); - renderPositiveYFacing( + renderPositiveYFacing( aWorld, aRenderer, aBlock, @@ -378,7 +577,7 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { aZ, textureUncovered.get(UP), false); - renderNegativeZFacing( + renderNegativeZFacing( aWorld, aRenderer, aBlock, @@ -387,7 +586,7 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { aZ, textureUncovered.get(NORTH), false); - renderPositiveZFacing( + renderPositiveZFacing( aWorld, aRenderer, aBlock, @@ -396,8 +595,8 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { aZ, textureUncovered.get(SOUTH), false); - if (!coveredSides.contains(WEST)) { - renderNegativeXFacing( + if (!coveredSides.contains(WEST)) { + renderNegativeXFacing( aWorld, aRenderer, aBlock, @@ -406,85 +605,75 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { aZ, textureUncovered.get(WEST), false); + } } - if (!coveredSides.contains(EAST)) { + if ((connexionSidesBits & CONNECTED_UP) == 0) { + aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness); + aRenderer.setRenderBoundsFromBlock(aBlock); renderPositiveXFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(EAST), - false); - } - } - case (CONNECTED_NORTH | CONNECTED_SOUTH) -> { - aBlock.setBlockBounds(sp, 0.0F, sp, sp + tThickness, 1.0F, sp + tThickness); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeZFacing( aWorld, aRenderer, aBlock, aX, aY, aZ, - textureUncovered.get(NORTH), + textureUncovered.get(EAST), false); - renderPositiveZFacing( + } else { + aBlock.setBlockBounds(sp + tThickness, sp, sp, 1.0F, sp + tThickness, sp + tThickness); + aRenderer.setRenderBoundsFromBlock(aBlock); + renderNegativeYFacing( aWorld, aRenderer, aBlock, aX, aY, aZ, - textureUncovered.get(SOUTH), + textureUncovered.get(DOWN), false); - renderNegativeXFacing( + renderPositiveYFacing( aWorld, aRenderer, aBlock, aX, aY, aZ, - textureUncovered.get(WEST), + textureUncovered.get(UP), false); - renderPositiveXFacing( + renderNegativeZFacing( aWorld, aRenderer, aBlock, aX, aY, aZ, - textureUncovered.get(EAST), + textureUncovered.get(NORTH), false); - if (!coveredSides.contains(DOWN)) { - renderNegativeYFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(DOWN), - false); - } - if (!coveredSides.contains(UP)) { - renderPositiveYFacing( + renderPositiveZFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(SOUTH), + false); + if (!coveredSides.contains(EAST)) { + renderPositiveXFacing( aWorld, aRenderer, aBlock, aX, aY, aZ, - textureUncovered.get(UP), + textureUncovered.get(EAST), false); + } } - } - case (CONNECTED_WEST | CONNECTED_EAST) -> { - aBlock.setBlockBounds(sp, sp, 0.0F, sp + tThickness, sp + tThickness, 1.0F); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing( + if ((connexionSidesBits & CONNECTED_NORTH) == 0) { + aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness); + aRenderer.setRenderBoundsFromBlock(aBlock); + renderNegativeYFacing( aWorld, aRenderer, aBlock, @@ -493,16 +682,28 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { aZ, textureUncovered.get(DOWN), false); - renderPositiveYFacing( + } else { + aBlock.setBlockBounds(sp, 0.0F, sp, sp + tThickness, sp, sp + tThickness); + aRenderer.setRenderBoundsFromBlock(aBlock); + renderNegativeZFacing( aWorld, aRenderer, aBlock, aX, aY, aZ, - textureUncovered.get(UP), + textureUncovered.get(NORTH), false); - renderNegativeXFacing( + renderPositiveZFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(SOUTH), + false); + renderNegativeXFacing( aWorld, aRenderer, aBlock, @@ -511,7 +712,7 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { aZ, textureUncovered.get(WEST), false); - renderPositiveXFacing( + renderPositiveXFacing( aWorld, aRenderer, aBlock, @@ -520,160 +721,8 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { aZ, textureUncovered.get(EAST), false); - if (!coveredSides.contains(NORTH)) { - renderNegativeZFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(NORTH), - false); - } - if (!coveredSides.contains(SOUTH)) { - renderPositiveZFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(SOUTH), - false); - } - } - default -> { - if ((connexionSidesBits & CONNECTED_DOWN) == 0) { - aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeXFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(WEST), - false); - } else { - aBlock.setBlockBounds(0.0F, sp, sp, sp, sp + tThickness, sp + tThickness); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(DOWN), - false); - renderPositiveYFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(UP), - false); - renderNegativeZFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(NORTH), - false); - renderPositiveZFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(SOUTH), - false); - if (!coveredSides.contains(WEST)) { - renderNegativeXFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(WEST), - false); - } - } - if ((connexionSidesBits & CONNECTED_UP) == 0) { - aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderPositiveXFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(EAST), - false); - } else { - aBlock.setBlockBounds(sp + tThickness, sp, sp, 1.0F, sp + tThickness, sp + tThickness); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(DOWN), - false); - renderPositiveYFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(UP), - false); - renderNegativeZFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(NORTH), - false); - renderPositiveZFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(SOUTH), - false); - if (!coveredSides.contains(EAST)) { - renderPositiveXFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(EAST), - false); - } - } - if ((connexionSidesBits & CONNECTED_NORTH) == 0) { - aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeYFacing( + if (!coveredSides.contains(DOWN)) { + renderNegativeYFacing( aWorld, aRenderer, aBlock, @@ -682,244 +731,195 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { aZ, textureUncovered.get(DOWN), false); - } else { - aBlock.setBlockBounds(sp, 0.0F, sp, sp + tThickness, sp, sp + tThickness); - aRenderer.setRenderBoundsFromBlock(aBlock); - renderNegativeZFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(NORTH), - false); - renderPositiveZFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(SOUTH), - false); - renderNegativeXFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(WEST), - false); - renderPositiveXFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(EAST), - false); - if (!coveredSides.contains(DOWN)) { - renderNegativeYFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(DOWN), - false); } } if ((connexionSidesBits & CONNECTED_SOUTH) == 0) { aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness); aRenderer.setRenderBoundsFromBlock(aBlock); renderPositiveYFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(UP), - false); + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(UP), + false); } else { aBlock.setBlockBounds(sp, sp + tThickness, sp, sp + tThickness, 1.0F, sp + tThickness); aRenderer.setRenderBoundsFromBlock(aBlock); renderNegativeZFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(NORTH), - false); + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(NORTH), + false); renderPositiveZFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(SOUTH), - false); + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(SOUTH), + false); renderNegativeXFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(WEST), - false); + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(WEST), + false); renderPositiveXFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(EAST), + false); + if (!coveredSides.contains(UP)) { + renderPositiveYFacing( aWorld, aRenderer, aBlock, aX, aY, aZ, - textureUncovered.get(EAST), + textureUncovered.get(UP), false); - if (!coveredSides.contains(UP)) { - renderPositiveYFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(UP), - false); } } if ((connexionSidesBits & CONNECTED_WEST) == 0) { aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness); aRenderer.setRenderBoundsFromBlock(aBlock); renderNegativeZFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(NORTH), - false); + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(NORTH), + false); } else { aBlock.setBlockBounds(sp, sp, 0.0F, sp + tThickness, sp + tThickness, sp); aRenderer.setRenderBoundsFromBlock(aBlock); renderNegativeYFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(DOWN), - false); + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(DOWN), + false); renderPositiveYFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(UP), - false); + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(UP), + false); renderNegativeXFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(WEST), - false); + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(WEST), + false); renderPositiveXFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(EAST), + false); + if (!coveredSides.contains(NORTH)) { + renderNegativeZFacing( aWorld, aRenderer, aBlock, aX, aY, aZ, - textureUncovered.get(EAST), + textureUncovered.get(NORTH), false); - if (!coveredSides.contains(NORTH)) { - renderNegativeZFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(NORTH), - false); } } if ((connexionSidesBits & CONNECTED_EAST) == 0) { aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness); aRenderer.setRenderBoundsFromBlock(aBlock); renderPositiveZFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(SOUTH), - false); + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(SOUTH), + false); } else { aBlock.setBlockBounds(sp, sp, sp + tThickness, sp + tThickness, sp + tThickness, 1.0F); aRenderer.setRenderBoundsFromBlock(aBlock); renderNegativeYFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(DOWN), - false); + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(DOWN), + false); renderPositiveYFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(UP), - false); + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(UP), + false); renderNegativeXFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(WEST), - false); + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(WEST), + false); renderPositiveXFacing( + aWorld, + aRenderer, + aBlock, + aX, + aY, + aZ, + textureUncovered.get(EAST), + false); + if (!coveredSides.contains(SOUTH)) { + renderPositiveZFacing( aWorld, aRenderer, aBlock, aX, aY, aZ, - textureUncovered.get(EAST), + textureUncovered.get(SOUTH), false); - if (!coveredSides.contains(SOUTH)) { - renderPositiveZFacing( - aWorld, - aRenderer, - aBlock, - aX, - aY, - aZ, - textureUncovered.get(SOUTH), - false); } } } @@ -1068,14 +1068,14 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { } public static void renderNegativeYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, - int aZ, ITexture[] aIcon, boolean aFullBlock) { + int aZ, ITexture[] aIcon, boolean aFullBlock) { if (aWorld != null) { if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX, aY - 1, aZ, 0)) { return; } Tessellator.instance - .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY - 1 : aY, aZ)); + .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY - 1 : aY, aZ)); } if (aIcon != null) { @@ -1090,14 +1090,14 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { } public static void renderPositiveYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, - int aZ, ITexture[] aIcon, boolean aFullBlock) { + int aZ, ITexture[] aIcon, boolean aFullBlock) { if (aWorld != null) { if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX, aY + 1, aZ, 1)) { return; } Tessellator.instance - .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY + 1 : aY, aZ)); + .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY + 1 : aY, aZ)); } if (aIcon != null) { @@ -1112,14 +1112,14 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { } public static void renderNegativeZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, - int aZ, ITexture[] aIcon, boolean aFullBlock) { + int aZ, ITexture[] aIcon, boolean aFullBlock) { if (aWorld != null) { if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ - 1, 2)) { return; } Tessellator.instance - .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ - 1 : aZ)); + .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ - 1 : aZ)); } aRenderer.flipTexture = !aFullBlock; @@ -1135,14 +1135,14 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { } public static void renderPositiveZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, - int aZ, ITexture[] aIcon, boolean aFullBlock) { + int aZ, ITexture[] aIcon, boolean aFullBlock) { if (aWorld != null) { if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ + 1, 3)) { return; } Tessellator.instance - .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ + 1 : aZ)); + .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ + 1 : aZ)); } if (aIcon != null) { @@ -1157,14 +1157,14 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { } public static void renderNegativeXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, - int aZ, ITexture[] aIcon, boolean aFullBlock) { + int aZ, ITexture[] aIcon, boolean aFullBlock) { if (aWorld != null) { if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX - 1, aY, aZ, 4)) { return; } Tessellator.instance - .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX - 1 : aX, aY, aZ)); + .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX - 1 : aX, aY, aZ)); } if (aIcon != null) { @@ -1179,14 +1179,14 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { } public static void renderPositiveXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, - int aZ, ITexture[] aIcon, boolean aFullBlock) { + int aZ, ITexture[] aIcon, boolean aFullBlock) { if (aWorld != null) { if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX + 1, aY, aZ, 5)) { return; } Tessellator.instance - .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX + 1 : aX, aY, aZ)); + .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX + 1 : aX, aY, aZ)); } aRenderer.flipTexture = !aFullBlock; @@ -1206,8 +1206,8 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { aMeta += 30400; if (aBlock instanceof GT_Block_Machines) { if (aMeta > 0 && aMeta < GregTech_API.METATILEENTITIES.length - && GregTech_API.METATILEENTITIES[aMeta] != null - && !GregTech_API.METATILEENTITIES[aMeta].renderInInventory(aBlock, aMeta, aRenderer)) { + && GregTech_API.METATILEENTITIES[aMeta] != null + && !GregTech_API.METATILEENTITIES[aMeta].renderInInventory(aBlock, aMeta, aRenderer)) { renderNormalInventoryMetaTileEntity(aBlock, aMeta, aRenderer); } } @@ -1218,24 +1218,24 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { @Override public boolean renderWorldBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int aModelID, - RenderBlocks aRenderer) { + RenderBlocks aRenderer) { TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); return aTileEntity == null ? false - : (aTileEntity instanceof IGregTechTileEntity - && ((IGregTechTileEntity) aTileEntity).getMetaTileEntity() != null - && ((IGregTechTileEntity) aTileEntity).getMetaTileEntity() - .renderInWorld(aWorld, aX, aY, aZ, aBlock, aRenderer) - ? true - : (aTileEntity instanceof IPipeRenderedTileEntity - ? renderPipeBlock( - aWorld, - aX, - aY, - aZ, - aBlock, - (IPipeRenderedTileEntity) aTileEntity, - aRenderer) - : renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer))); + : (aTileEntity instanceof IGregTechTileEntity + && ((IGregTechTileEntity) aTileEntity).getMetaTileEntity() != null + && ((IGregTechTileEntity) aTileEntity).getMetaTileEntity() + .renderInWorld(aWorld, aX, aY, aZ, aBlock, aRenderer) + ? true + : (aTileEntity instanceof IPipeRenderedTileEntity + ? renderPipeBlock( + aWorld, + aX, + aY, + aZ, + aBlock, + (IPipeRenderedTileEntity) aTileEntity, + aRenderer) + : renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer))); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java index 886500457b..87ae66b2ad 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java @@ -46,17 +46,17 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B public GT_MetaTileEntity_ElectricAutoWorkbench(final int aID, final int aTier, final String aDescription) { super( - aID, - "basicmachine.automation.autoworkbench.0" + aTier, - "Auto Workbench (" + GT_Values.VN[aTier] + ")", - aTier, - 30, - aDescription); + aID, + "basicmachine.automation.autoworkbench.0" + aTier, + "Auto Workbench (" + GT_Values.VN[aTier] + ")", + aTier, + 30, + aDescription); mLocalName = "Auto Workbench (" + GT_Values.VN[aTier] + ")"; } public GT_MetaTileEntity_ElectricAutoWorkbench(final String aName, final int aTier, final String[] aDescription, - final ITexture[][][] aTextures) { + final ITexture[][][] aTextures) { super(aName, aTier, 30, aDescription, aTextures); } @@ -149,10 +149,10 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_ElectricAutoWorkbench( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } @Override @@ -212,13 +212,14 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if (getBaseMetaTileEntity().isAllowedToWork() && getBaseMetaTileEntity().isServerSide() - && getBaseMetaTileEntity().getUniversalEnergyStored() >= (mMode == 5 || mMode == 6 ? 128 : 2048) - && (getBaseMetaTileEntity().hasWorkJustBeenEnabled() || --mTicksUntilNextUpdate < 1)) { + && getBaseMetaTileEntity().getUniversalEnergyStored() >= (mMode == 5 || mMode == 6 ? 128 : 2048) + && (getBaseMetaTileEntity().hasWorkJustBeenEnabled() || --mTicksUntilNextUpdate < 1)) { mTicksUntilNextUpdate = 32; for (byte i = 19; i < 28; i++) { if (mInventory[i] != null && mInventory[i].isItemStackDamageable() - && mInventory[i].getItem().hasContainerItem(mInventory[i])) { + && mInventory[i].getItem() + .hasContainerItem(mInventory[i])) { mInventory[i].setItemDamage(OreDictionary.WILDCARD_VALUE); } } @@ -229,9 +230,9 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B if (tOutput != null) { for (byte j = 0; j < 9; j++) { if (mInventory[j] == null || (GT_Utility.areStacksEqual(tOutput, mInventory[j]) - && mInventory[j].stackSize + tOutput.stackSize <= tOutput.getMaxStackSize())) { + && mInventory[j].stackSize + tOutput.stackSize <= tOutput.getMaxStackSize())) { mFluid.amount -= GT_Utility.getFluidForFilledItem(tOutput, true).amount - * tOutput.stackSize; + * tOutput.stackSize; getBaseMetaTileEntity().decrStackSize(i, 1); if (mInventory[j] == null) { mInventory[j] = tOutput; @@ -262,7 +263,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B switch (mMode) { case 0 -> { if (mInventory[mCurrentSlot] != null - && !isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) { + && !isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) { if (mInventory[18] == null && mThroughPut < 2 && mCurrentSlot < 8) { mInventory[18] = mInventory[mCurrentSlot]; mInventory[mCurrentSlot] = null; @@ -419,7 +420,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B tRecipe[3] = tTempStack; tRecipe[4] = tTempStack; if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) - == null) { + == null) { if (mInventory[18] == null) { mInventory[18] = mInventory[mCurrentSlot]; mInventory[mCurrentSlot] = null; @@ -439,7 +440,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B tRecipe[7] = tTempStack; tRecipe[8] = tTempStack; if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) - == null) { + == null) { if (mInventory[18] == null) { mInventory[18] = mInventory[mCurrentSlot]; mInventory[mCurrentSlot] = null; @@ -456,7 +457,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B } case 7 -> { if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot]) - || !OrePrefixes.nugget.contains(mInventory[mCurrentSlot])) { + || !OrePrefixes.nugget.contains(mInventory[mCurrentSlot])) { if (mInventory[18] == null && mThroughPut < 2) { mInventory[18] = mInventory[mCurrentSlot]; mInventory[mCurrentSlot] = null; @@ -485,8 +486,9 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B } case 8 -> { if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot]) - || mInventory[mCurrentSlot].getItemDamage() <= 0 - || !mInventory[mCurrentSlot].getItem().isRepairable()) { + || mInventory[mCurrentSlot].getItemDamage() <= 0 + || !mInventory[mCurrentSlot].getItem() + .isRepairable()) { if (mInventory[18] == null && mThroughPut < 2) { mInventory[18] = mInventory[mCurrentSlot]; mInventory[mCurrentSlot] = null; @@ -498,12 +500,12 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B tTempStack.stackSize = 1; for (int i = mCurrentSlot + 1; i < 18; i++) { if (mInventory[i] != null && mInventory[i].getItem() == tTempStack.getItem() - && mInventory[mCurrentSlot].getItemDamage() + mInventory[i].getItemDamage() - > tTempStack.getMaxDamage()) { + && mInventory[mCurrentSlot].getItemDamage() + mInventory[i].getItemDamage() + > tTempStack.getMaxDamage()) { tRecipe[0] = tTempStack; tRecipe[1] = GT_Utility.copy(mInventory[i]); if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) - == null) { + == null) { if (mInventory[18] == null) { mInventory[18] = mInventory[mCurrentSlot]; mInventory[mCurrentSlot] = null; @@ -524,9 +526,9 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B break; } for (byte i = 0, j = 0; i < 18 && j < 9 - && (j < 2 || GT_ModHandler - .getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) - == null); i++) { + && (j < 2 + || GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) + == null); i++) { tRecipe[j] = mInventory[(mCurrentSlot + i) % 18]; if (tRecipe[j] != null) { tRecipe[j] = GT_Utility.copy(tRecipe[j]); @@ -579,17 +581,17 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B if (tStack != null) { getBaseMetaTileEntity().decrStackSize(j, 1); if (!tStack.isItemStackDamageable() - || tStack.getItemDamage() < tStack.getMaxDamage()) { + || tStack.getItemDamage() < tStack.getMaxDamage()) { for (byte k = 9; k < 18; k++) { if (mInventory[k] == null) { mInventory[k] = GT_Utility.copy(tStack); break; } else if (GT_Utility.areStacksEqual(mInventory[k], tStack) - && mInventory[k].stackSize + tStack.stackSize - <= tStack.getMaxStackSize()) { - mInventory[k].stackSize += tStack.stackSize; - break; - } + && mInventory[k].stackSize + tStack.stackSize + <= tStack.getMaxStackSize()) { + mInventory[k].stackSize += tStack.stackSize; + break; + } } } } else { @@ -602,9 +604,8 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B } mInventory[18] = GT_Utility.copy(tOutput); - getBaseMetaTileEntity().decreaseStoredEnergyUnits( - mMode == 5 || mMode == 6 || mMode == 7 ? 128 : 2048, - true); + getBaseMetaTileEntity() + .decreaseStoredEnergyUnits(mMode == 5 || mMode == 6 || mMode == 7 ? 128 : 2048, true); mTicksUntilNextUpdate = 1; } else { mLastCraftSuccessful = false; @@ -620,7 +621,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B for (byte i = 0; i < 8; i++) { for (byte j = i; ++j < 9;) { if (GT_Utility.areStacksEqual(mInventory[i], mInventory[j]) - && mInventory[i].getMaxStackSize() > 8) { + && mInventory[i].getMaxStackSize() > 8) { mInventory[18] = mInventory[j]; mInventory[j] = null; mTicksUntilNextUpdate = 1; @@ -633,21 +634,19 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B } if (mThroughPut < 2) { - getBaseMetaTileEntity() - .decreaseStoredEnergyUnits( - GT_Utility.moveOneItemStack( - getBaseMetaTileEntity(), - getBaseMetaTileEntity() - .getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing()), - getBaseMetaTileEntity().getBackFacing(), - getBaseMetaTileEntity().getFrontFacing(), - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1) * 10, - true); + getBaseMetaTileEntity().decreaseStoredEnergyUnits( + GT_Utility.moveOneItemStack( + getBaseMetaTileEntity(), + getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing()), + getBaseMetaTileEntity().getBackFacing(), + getBaseMetaTileEntity().getFrontFacing(), + null, + false, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1) * 10, + true); } } } @@ -702,13 +701,13 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { + ItemStack aStack) { return mMode == 0 ? aIndex >= 10 : aIndex >= 18; } @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { + ItemStack aStack) { return mMode == 0 ? aIndex < 9 : aIndex < 18; } @@ -730,8 +729,8 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B @Override public String[] getDescription() { return new String[] { "Automatic Crafting Table Mk III", - // this.mDescription, - CORE.GT_Tooltip.get() }; + // this.mDescription, + CORE.GT_Tooltip.get() }; } @Override @@ -754,7 +753,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { + final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { if (side == facing) { return this.mTextures[0][aColorIndex + 1]; } else if (side.getOpposite() == facing) { @@ -766,12 +765,12 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B public ITexture[] getFront(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay) }; } public ITexture[] getBack(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(BlockIcons.OVERLAY_PIPE) }; + new GT_RenderedTexture(BlockIcons.OVERLAY_PIPE) }; } public ITexture[] getBottom(final byte aColor) { @@ -780,12 +779,12 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B public ITexture[] getTop(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay) }; } public ITexture[] getSides(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay) }; } @Override @@ -796,49 +795,79 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B @Override public void addGregTechLogo(ModularWindow.Builder builder) { builder.widget( - new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17).setPos(118, 22)); + new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) + .setSize(17, 17) + .setPos(118, 22)); } @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 3).endAtSlot(8).build().setPos(7, 4)) - .widget( - SlotGroup.ofItemHandler(inventoryHandler, 9).startFromSlot(9).endAtSlot(17).canInsert(false) - .background(GT_UITextures.SLOT_DARK_GRAY).applyForWidget(SlotWidget::disableShiftInsert) - .build().setPos(7, 59)) - .widget( - new SlotWidget(inventoryHandler, 18).setAccess(true, false) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT) - .setPos(151, 40)) - .widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SLOTS_HOLO_3BY3).setPos(62, 4) - .setSize(54, 54)) - .widget( - SlotGroup.ofItemHandler(inventoryHandler, 3).startFromSlot(19).endAtSlot(27).phantom(true) - .background(GT_UITextures.TRANSPARENT).build().setPos(62, 4)) - .widget( - SlotWidget.phantom(inventoryHandler, 28).disableInteraction() - .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_ARROW_4) - .setPos(151, 4)); builder.widget( - new CycleButtonWidget().setGetter(() -> mThroughPut).setSetter(val -> mThroughPut = val) - .setLength(MAX_THROUGHPUT).setTextureGetter(i -> GTPP_UITextures.OVERLAY_BUTTON_THROUGHPUT[i]) - .setBackground(GT_UITextures.BUTTON_STANDARD).setPos(120, 4).setSize(18, 18)); + SlotGroup.ofItemHandler(inventoryHandler, 3) + .endAtSlot(8) + .build() + .setPos(7, 4)) + .widget( + SlotGroup.ofItemHandler(inventoryHandler, 9) + .startFromSlot(9) + .endAtSlot(17) + .canInsert(false) + .background(GT_UITextures.SLOT_DARK_GRAY) + .applyForWidget(SlotWidget::disableShiftInsert) + .build() + .setPos(7, 59)) + .widget( + new SlotWidget(inventoryHandler, 18).setAccess(true, false) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT) + .setPos(151, 40)) + .widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SLOTS_HOLO_3BY3) + .setPos(62, 4) + .setSize(54, 54)) + .widget( + SlotGroup.ofItemHandler(inventoryHandler, 3) + .startFromSlot(19) + .endAtSlot(27) + .phantom(true) + .background(GT_UITextures.TRANSPARENT) + .build() + .setPos(62, 4)) + .widget( + SlotWidget.phantom(inventoryHandler, 28) + .disableInteraction() + .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_ARROW_4) + .setPos(151, 4)); + builder.widget( + new CycleButtonWidget().setGetter(() -> mThroughPut) + .setSetter(val -> mThroughPut = val) + .setLength(MAX_THROUGHPUT) + .setTextureGetter(i -> GTPP_UITextures.OVERLAY_BUTTON_THROUGHPUT[i]) + .setBackground(GT_UITextures.BUTTON_STANDARD) + .setPos(120, 4) + .setSize(18, 18)); String[] mModeText = new String[] { "Normal Crafting Table", "???", "1x1", "2x2", "3x3", "Unifier", "Dust", - "???", "Hammer?", "Circle" }; - CycleButtonWidget modeButton = new CycleButtonWidget().setGetter(() -> mMode).setSetter(val -> { - mMode = val; - switchMode(); - }).setLength(MAX_MODES).setTextureGetter(i -> GTPP_UITextures.OVERLAY_BUTTON_MODE[i]); + "???", "Hammer?", "Circle" }; + CycleButtonWidget modeButton = new CycleButtonWidget().setGetter(() -> mMode) + .setSetter(val -> { + mMode = val; + switchMode(); + }) + .setLength(MAX_MODES) + .setTextureGetter(i -> GTPP_UITextures.OVERLAY_BUTTON_MODE[i]); for (int i = 0; i < MAX_MODES; i++) { modeButton.addTooltip(i, "Mode: " + mModeText[i]); } - builder.widget(modeButton.setBackground(GT_UITextures.BUTTON_STANDARD).setPos(120, 40).setSize(18, 18)); builder.widget( - new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_WORKBENCH_CIRCLE).setPos(136, 23) - .setSize(16, 16)) - .widget( - new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_ARROW_WHITE_DOWN).setPos(155, 23) - .setSize(10, 16)); + modeButton.setBackground(GT_UITextures.BUTTON_STANDARD) + .setPos(120, 40) + .setSize(18, 18)); + builder.widget( + new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_WORKBENCH_CIRCLE) + .setPos(136, 23) + .setSize(16, 16)) + .widget( + new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_ARROW_WHITE_DOWN) + .setPos(155, 23) + .setSize(10, 16)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java index 25609343d3..7fc2b50f68 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java @@ -48,12 +48,12 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi public UUID mOwner; public GT_MetaTileEntity_TesseractGenerator(final int aID, final String aName, final String aNameRegional, - final int aTier) { + final int aTier) { super(aID, aName, aNameRegional, aTier, 3, ""); } public GT_MetaTileEntity_TesseractGenerator(final String aName, final int aTier, final String[] aDescription, - final ITexture[][][] aTextures) { + final ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } @@ -99,7 +99,8 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public boolean isOutputFacing(final ForgeDirection side) { - return side == this.getBaseMetaTileEntity().getBackFacing(); + return side == this.getBaseMetaTileEntity() + .getBackFacing(); } @Override @@ -109,7 +110,8 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public long getMinimumStoredEU() { - return this.getBaseMetaTileEntity().getEUCapacity() / 2; + return this.getBaseMetaTileEntity() + .getEUCapacity() / 2; } @Override @@ -145,7 +147,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public int getProgresstime() { return (TesseractHelper.getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency) - == this) && (this.isWorking >= 20) ? 999 : 0; + == this) && (this.isWorking >= 20) ? 999 : 0; } @Override @@ -189,26 +191,38 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer, - final ForgeDirection side, final float aX, final float aY, final float aZ) { + final ForgeDirection side, final float aX, final float aY, final float aZ) { if (this.mOwner == null) { - if (this.getBaseMetaTileEntity().getOwnerName() != null - && !this.getBaseMetaTileEntity().getOwnerName().equals("")) { - if (this.getBaseMetaTileEntity().getOwnerName().toLowerCase() - .equals(aPlayer.getDisplayName().toLowerCase())) { - this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()); + if (this.getBaseMetaTileEntity() + .getOwnerName() != null + && !this.getBaseMetaTileEntity() + .getOwnerName() + .equals("")) { + if (this.getBaseMetaTileEntity() + .getOwnerName() + .toLowerCase() + .equals( + aPlayer.getDisplayName() + .toLowerCase())) { + this.mOwner = PlayerUtils.getPlayersUUIDByName( + this.getBaseMetaTileEntity() + .getOwnerName()); } } } - if (side == this.getBaseMetaTileEntity().getFrontFacing()) { - if (aPlayer.getUniqueID().compareTo(this.mOwner) == 0) { + if (side == this.getBaseMetaTileEntity() + .getFrontFacing()) { + if (aPlayer.getUniqueID() + .compareTo(this.mOwner) == 0) { final float[] tCoords = GT_Utility.getClickedFacingCoords(side, aX, aY, aZ); switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) { case 0: Logger.WARNING("Freq. -1 | " + this.mFrequency); try { - CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); + CORE.sTesseractGeneratorOwnershipMap.get(mOwner) + .remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency -= 1; @@ -216,7 +230,8 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi case 1: Logger.WARNING("Freq. +1 | " + this.mFrequency); try { - CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); + CORE.sTesseractGeneratorOwnershipMap.get(mOwner) + .remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency += 1; default: @@ -225,14 +240,15 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi } if (getGeneratorEntity(this.mFrequency) != null && getGeneratorEntity(this.mFrequency) != this) { GT_Utility.sendChatToPlayer( - aPlayer, - "Frequency: " + this.mFrequency + EnumChatFormatting.RED + " (Occupied)"); + aPlayer, + "Frequency: " + this.mFrequency + EnumChatFormatting.RED + " (Occupied)"); } else { GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency); } - } else if (aPlayer.getUniqueID().compareTo(this.mOwner) != 0) { - GT_Utility.sendChatToPlayer(aPlayer, "This is not your Tesseract Generator to configure."); - } + } else if (aPlayer.getUniqueID() + .compareTo(this.mOwner) != 0) { + GT_Utility.sendChatToPlayer(aPlayer, "This is not your Tesseract Generator to configure."); + } } return true; @@ -240,40 +256,46 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public void onScrewdriverRightClick(final ForgeDirection side, final EntityPlayer aPlayer, final float aX, - final float aY, final float aZ) { - if (aPlayer.getUniqueID().compareTo(this.mOwner) == 0) { - if (side == this.getBaseMetaTileEntity().getFrontFacing()) { + final float aY, final float aZ) { + if (aPlayer.getUniqueID() + .compareTo(this.mOwner) == 0) { + if (side == this.getBaseMetaTileEntity() + .getFrontFacing()) { final float[] tCoords = GT_Utility.getClickedFacingCoords(side, aX, aY, aZ); switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) { case 0 -> { try { - CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); + CORE.sTesseractGeneratorOwnershipMap.get(mOwner) + .remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency -= 64; } case 1 -> { try { - CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); + CORE.sTesseractGeneratorOwnershipMap.get(mOwner) + .remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency += 64; } case 2 -> { try { - CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); + CORE.sTesseractGeneratorOwnershipMap.get(mOwner) + .remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency -= 512; } case 3 -> { try { - CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); + CORE.sTesseractGeneratorOwnershipMap.get(mOwner) + .remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency += 512; } } if (getGeneratorEntity(this.mFrequency) != null && getGeneratorEntity(this.mFrequency) != this) { GT_Utility.sendChatToPlayer( - aPlayer, - "Frequency: " + this.mFrequency + EnumChatFormatting.RED + " (Occupied)"); + aPlayer, + "Frequency: " + this.mFrequency + EnumChatFormatting.RED + " (Occupied)"); } else { GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency); } @@ -284,20 +306,24 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi } public boolean allowCoverOnSide(final ForgeDirection side, final int aCoverID) { - return side != this.getBaseMetaTileEntity().getFrontFacing(); + return side != this.getBaseMetaTileEntity() + .getFrontFacing(); } @Override public String[] getInfoData() { final TileEntity tTileEntity = this.getBaseMetaTileEntity() - .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork()) - && ((tTileEntity instanceof IGregTechDeviceInformation)) - && (((IGregTechDeviceInformation) tTileEntity).isGivingInformation())) { + .getTileEntityAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity != null) && (this.getBaseMetaTileEntity() + .isAllowedToWork()) + && ((tTileEntity instanceof IGregTechDeviceInformation)) + && (((IGregTechDeviceInformation) tTileEntity).isGivingInformation())) { return ((IGregTechDeviceInformation) tTileEntity).getInfoData(); } return new String[] { "Tesseract Generator", "Freqency:", "" + this.mFrequency, - (getGeneratorEntity() == this) && (this.isWorking >= 20) ? "Active" : "Inactive" }; + (getGeneratorEntity() == this) && (this.isWorking >= 20) ? "Active" : "Inactive" }; } @Override @@ -307,9 +333,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi public boolean isSendingInformation() { final TileEntity tTileEntity = this.getBaseMetaTileEntity() - .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork()) - && ((tTileEntity instanceof IGregTechDeviceInformation))) { + .getTileEntityAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity != null) && (this.getBaseMetaTileEntity() + .isAllowedToWork()) && ((tTileEntity instanceof IGregTechDeviceInformation))) { return ((IGregTechDeviceInformation) tTileEntity).isGivingInformation(); } return false; @@ -318,9 +346,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public boolean isDigitalChest() { final TileEntity tTileEntity = this.getBaseMetaTileEntity() - .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork()) - && ((tTileEntity instanceof IDigitalChest))) { + .getTileEntityAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity != null) && (this.getBaseMetaTileEntity() + .isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) { return ((IDigitalChest) tTileEntity).isDigitalChest(); } return false; @@ -329,9 +359,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public ItemStack[] getStoredItemData() { final TileEntity tTileEntity = this.getBaseMetaTileEntity() - .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork()) - && ((tTileEntity instanceof IDigitalChest))) { + .getTileEntityAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity != null) && (this.getBaseMetaTileEntity() + .isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) { return ((IDigitalChest) tTileEntity).getStoredItemData(); } return new ItemStack[] {}; @@ -340,9 +372,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public void setItemCount(final int aCount) { final TileEntity tTileEntity = this.getBaseMetaTileEntity() - .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork()) - && ((tTileEntity instanceof IDigitalChest))) { + .getTileEntityAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity != null) && (this.getBaseMetaTileEntity() + .isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) { ((IDigitalChest) tTileEntity).setItemCount(aCount); } } @@ -350,9 +384,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public int getMaxItemCount() { final TileEntity tTileEntity = this.getBaseMetaTileEntity() - .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork()) - && ((tTileEntity instanceof IDigitalChest))) { + .getTileEntityAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity != null) && (this.getBaseMetaTileEntity() + .isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) { return ((IDigitalChest) tTileEntity).getMaxItemCount(); } return 0; @@ -361,8 +397,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public boolean isItemValidForSlot(final int aIndex, final ItemStack aStack) { final IInventory tTileEntity = this.getBaseMetaTileEntity() - .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + .getIInventoryAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return false; } return tTileEntity.isItemValidForSlot(aIndex, aStack); @@ -371,8 +410,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public int[] getAccessibleSlotsFromSide(final int ordinalSide) { final IInventory tTileEntity = this.getBaseMetaTileEntity() - .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + .getIInventoryAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return new int[0]; } if ((tTileEntity instanceof ISidedInventory)) { @@ -388,8 +430,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public boolean canInsertItem(final int aIndex, final ItemStack aStack, final int ordinalSide) { final IInventory tTileEntity = this.getBaseMetaTileEntity() - .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + .getIInventoryAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return false; } if ((tTileEntity instanceof ISidedInventory)) { @@ -401,8 +446,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public boolean canExtractItem(final int aIndex, final ItemStack aStack, final int ordinalSide) { final IInventory tTileEntity = this.getBaseMetaTileEntity() - .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + .getIInventoryAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return false; } if ((tTileEntity instanceof ISidedInventory)) { @@ -414,8 +462,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public int getSizeInventory() { final IInventory tTileEntity = this.getBaseMetaTileEntity() - .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + .getIInventoryAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return 0; } return tTileEntity.getSizeInventory(); @@ -424,8 +475,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public ItemStack getStackInSlot(final int aIndex) { final IInventory tTileEntity = this.getBaseMetaTileEntity() - .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + .getIInventoryAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return null; } return tTileEntity.getStackInSlot(aIndex); @@ -434,8 +488,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public void setInventorySlotContents(final int aIndex, final ItemStack aStack) { final IInventory tTileEntity = this.getBaseMetaTileEntity() - .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + .getIInventoryAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return; } tTileEntity.setInventorySlotContents(aIndex, aStack); @@ -444,8 +501,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public ItemStack decrStackSize(final int aIndex, final int aAmount) { final IInventory tTileEntity = this.getBaseMetaTileEntity() - .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + .getIInventoryAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return null; } return tTileEntity.decrStackSize(aIndex, aAmount); @@ -454,8 +514,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public String getInventoryName() { final IInventory tTileEntity = this.getBaseMetaTileEntity() - .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + .getIInventoryAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return ""; } return tTileEntity.getInventoryName(); @@ -464,8 +527,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public int getInventoryStackLimit() { final IInventory tTileEntity = this.getBaseMetaTileEntity() - .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + .getIInventoryAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return 0; } return tTileEntity.getInventoryStackLimit(); @@ -474,8 +540,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public boolean canFill(final ForgeDirection aSide, final Fluid aFluid) { final IFluidHandler tTileEntity = this.getBaseMetaTileEntity() - .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + .getITankContainerAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return false; } return tTileEntity.canFill(aSide, aFluid); @@ -484,8 +553,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public boolean canDrain(final ForgeDirection aSide, final Fluid aFluid) { final IFluidHandler tTileEntity = this.getBaseMetaTileEntity() - .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + .getITankContainerAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return false; } return tTileEntity.canDrain(aSide, aFluid); @@ -494,8 +566,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public FluidTankInfo[] getTankInfo(final ForgeDirection aSide) { final IFluidHandler tTileEntity = this.getBaseMetaTileEntity() - .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + .getITankContainerAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return new FluidTankInfo[0]; } return tTileEntity.getTankInfo(aSide); @@ -504,8 +579,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public int fill_default(final ForgeDirection aDirection, final FluidStack aFluid, final boolean doFill) { final IFluidHandler tTileEntity = this.getBaseMetaTileEntity() - .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + .getITankContainerAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return 0; } return tTileEntity.fill(aDirection, aFluid, doFill); @@ -514,8 +592,11 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public FluidStack drain(final ForgeDirection aDirection, final int maxDrain, final boolean doDrain) { final IFluidHandler tTileEntity = this.getBaseMetaTileEntity() - .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + .getITankContainerAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return null; } return tTileEntity.drain(aDirection, maxDrain, doDrain); @@ -524,20 +605,25 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public FluidStack drain(final ForgeDirection aSide, final FluidStack aFluid, final boolean doDrain) { final IFluidHandler tTileEntity = this.getBaseMetaTileEntity() - .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + .getITankContainerAtSide( + this.getBaseMetaTileEntity() + .getBackFacing()); + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return null; } return tTileEntity.drain(aSide, aFluid, doDrain); } public boolean addEnergyConsumption(final GT_MetaTileEntity_TesseractTerminal aTerminal) { - if (!this.getBaseMetaTileEntity().isAllowedToWork()) { + if (!this.getBaseMetaTileEntity() + .isAllowedToWork()) { return false; } - int J = (aTerminal.getBaseMetaTileEntity().getWorld() == this.getBaseMetaTileEntity().getWorld() - ? TESSERACT_ENERGY_COST - : TESSERACT_ENERGY_COST_DIMENSIONAL); + int J = (aTerminal.getBaseMetaTileEntity() + .getWorld() + == this.getBaseMetaTileEntity() + .getWorld() ? TESSERACT_ENERGY_COST : TESSERACT_ENERGY_COST_DIMENSIONAL); J *= 4; @@ -547,10 +633,14 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi } public boolean isValidTesseractGenerator(final String aOwnerName, final boolean aWorkIrrelevant) { - return (this.getBaseMetaTileEntity() != null) && (!this.getBaseMetaTileEntity().isInvalidTileEntity()) - && (this.getBaseMetaTileEntity().isAllowedToWork()) - && ((aOwnerName == null) || (this.getBaseMetaTileEntity().getOwnerName().equals(aOwnerName))) - && ((aWorkIrrelevant) || (this.isWorking >= 20)); + return (this.getBaseMetaTileEntity() != null) && (!this.getBaseMetaTileEntity() + .isInvalidTileEntity()) + && (this.getBaseMetaTileEntity() + .isAllowedToWork()) + && ((aOwnerName == null) || (this.getBaseMetaTileEntity() + .getOwnerName() + .equals(aOwnerName))) + && ((aWorkIrrelevant) || (this.isWorking >= 20)); } @Override @@ -562,13 +652,19 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { // Utils.LOG_WARNING("Ticking Generator. 0"); - if (this.getBaseMetaTileEntity().isServerSide()) { + if (this.getBaseMetaTileEntity() + .isServerSide()) { // Utils.LOG_WARNING("Ticking Generator."); // Set owner - if (PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()) != null) { + if (PlayerUtils.getPlayersUUIDByName( + this.getBaseMetaTileEntity() + .getOwnerName()) + != null) { if (this.mOwner == null) { Logger.WARNING("Setting Generators Owner. 1"); - this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()); + this.mOwner = PlayerUtils.getPlayersUUIDByName( + this.getBaseMetaTileEntity() + .getOwnerName()); } } @@ -578,29 +674,32 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi if (getGeneratorEntity() == this) { getGeneratorEntity(this.oFrequency); - this.getBaseMetaTileEntity().issueBlockUpdate(); + this.getBaseMetaTileEntity() + .issueBlockUpdate(); Logger.WARNING("this Gen == oFreq on map - do block update"); } Logger.WARNING("mFreq will be set to oFreq"); this.oFrequency = this.mFrequency; } - if ((this.getBaseMetaTileEntity().isAllowedToWork()) - && (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(this.mNeededEnergy, false))) { + if ((this.getBaseMetaTileEntity() + .isAllowedToWork()) + && (this.getBaseMetaTileEntity() + .decreaseStoredEnergyUnits(this.mNeededEnergy, false))) { // Utils.LOG_WARNING("Can Work & Has Energy"); if ((getGeneratorEntity(Integer.valueOf(this.mFrequency)) == null) - || (!getGeneratorEntity(Integer.valueOf(this.mFrequency)) - .isValidTesseractGenerator(null, true))) { + || (!getGeneratorEntity(Integer.valueOf(this.mFrequency)).isValidTesseractGenerator(null, true))) { // Utils.LOG_WARNING("storing TE I think to mFreq map?"); TesseractHelper.setGeneratorOwnershipByPlayer( - PlayerUtils.getPlayerOnServerFromUUID(mOwner), - this.mFrequency, - this); + PlayerUtils.getPlayerOnServerFromUUID(mOwner), + this.mFrequency, + this); } } else { if (getGeneratorEntity(Integer.valueOf(this.mFrequency)) == this) { Logger.WARNING("this gen == mFreq on map - do block update"); TesseractHelper.removeGenerator(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency); - this.getBaseMetaTileEntity().issueBlockUpdate(); + this.getBaseMetaTileEntity() + .issueBlockUpdate(); } this.isWorking = 0; } @@ -610,7 +709,8 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi this.isWorking = ((byte) (this.isWorking + 1)); } if (this.isWorking == 20) { - this.getBaseMetaTileEntity().issueBlockUpdate(); + this.getBaseMetaTileEntity() + .issueBlockUpdate(); this.isWorking = ((byte) (this.isWorking + 1)); } } else { @@ -624,23 +724,23 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public String[] getDescription() { return ArrayUtils.addAll( - this.mDescriptionArray, - "Generates a Tesseract for the attached Inventory", - "Connect with pipes to insert items", - "Consumes " + TESSERACT_ENERGY_COST + "EU/t for same dimension transfers", - "Consumes " + TESSERACT_ENERGY_COST_DIMENSIONAL + "EU/t for cross dimensional transfers", - CORE.GT_Tooltip.get()); + this.mDescriptionArray, + "Generates a Tesseract for the attached Inventory", + "Connect with pipes to insert items", + "Consumes " + TESSERACT_ENERGY_COST + "EU/t for same dimension transfers", + "Consumes " + TESSERACT_ENERGY_COST_DIMENSIONAL + "EU/t for cross dimensional transfers", + CORE.GT_Tooltip.get()); } @Override public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { + final ForgeDirection side, final ItemStack aStack) { return false; } @Override public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { + final ForgeDirection side, final ItemStack aStack) { return false; } @@ -651,12 +751,12 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { + final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { return side == facing - ? new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency) } - : new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), - new GT_RenderedTexture(Textures.BlockIcons.VOID) }; + ? new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency) } + : new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), + new GT_RenderedTexture(Textures.BlockIcons.VOID) }; } // To-Do? @@ -692,7 +792,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi private GT_MetaTileEntity_TesseractGenerator getGeneratorEntity() { GT_MetaTileEntity_TesseractGenerator thisGenerator = TesseractHelper - .getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency); + .getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency); if (thisGenerator != null) { return thisGenerator; } @@ -701,7 +801,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi private GT_MetaTileEntity_TesseractGenerator getGeneratorEntity(int frequency) { GT_MetaTileEntity_TesseractGenerator thisGenerator = TesseractHelper - .getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), frequency); + .getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), frequency); if (thisGenerator != null) { return thisGenerator; } @@ -710,9 +810,14 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { - if (this.getBaseMetaTileEntity().getOwnerName() != null - && !this.getBaseMetaTileEntity().getOwnerName().equals("")) { - this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()); + if (this.getBaseMetaTileEntity() + .getOwnerName() != null + && !this.getBaseMetaTileEntity() + .getOwnerName() + .equals("")) { + this.mOwner = PlayerUtils.getPlayersUUIDByName( + this.getBaseMetaTileEntity() + .getOwnerName()); Logger.WARNING("Setting Generators Owner. 2"); } super.onCreated(aStack, aWorld, aPlayer); @@ -721,7 +826,8 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public void onRemoval() { try { - CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); + CORE.sTesseractGeneratorOwnershipMap.get(mOwner) + .remove(this.mFrequency); } catch (Throwable t) {} super.onRemoval(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java index 5b305950ff..659f34e0d8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java @@ -37,12 +37,12 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic private static int TESSERACT_ENERGY_COST_DIMENSIONAL = 512; public GT_MetaTileEntity_TesseractTerminal(final int aID, final String aName, final String aNameRegional, - final int aTier) { + final int aTier) { super(aID, aName, aNameRegional, aTier, 3, ""); } public GT_MetaTileEntity_TesseractTerminal(final String aName, final int aTier, final String[] aDescription, - final ITexture[][][] aTextures) { + final ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } @@ -73,7 +73,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public boolean isOutputFacing(final ForgeDirection side) { - return side == this.getBaseMetaTileEntity().getBackFacing(); + return side == this.getBaseMetaTileEntity() + .getBackFacing(); } @Override @@ -83,7 +84,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public long getMinimumStoredEU() { - return (this.getBaseMetaTileEntity().getEUCapacity() / 100); + return (this.getBaseMetaTileEntity() + .getEUCapacity() / 100); } @Override @@ -142,106 +144,132 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer, - final ForgeDirection side, final float aX, final float aY, final float aZ) { + final ForgeDirection side, final float aX, final float aY, final float aZ) { if (this.mOwner == null) { - if (this.getBaseMetaTileEntity().getOwnerName() != null - && !this.getBaseMetaTileEntity().getOwnerName().equals("")) { - if (this.getBaseMetaTileEntity().getOwnerName().toLowerCase() - .equals(aPlayer.getDisplayName().toLowerCase())) { - this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()); + if (this.getBaseMetaTileEntity() + .getOwnerName() != null + && !this.getBaseMetaTileEntity() + .getOwnerName() + .equals("")) { + if (this.getBaseMetaTileEntity() + .getOwnerName() + .toLowerCase() + .equals( + aPlayer.getDisplayName() + .toLowerCase())) { + this.mOwner = PlayerUtils.getPlayersUUIDByName( + this.getBaseMetaTileEntity() + .getOwnerName()); } } } - if (aPlayer.getUniqueID().compareTo(this.mOwner) == 0) { - if (side == this.getBaseMetaTileEntity().getFrontFacing()) { + if (aPlayer.getUniqueID() + .compareTo(this.mOwner) == 0) { + if (side == this.getBaseMetaTileEntity() + .getFrontFacing()) { final float[] tCoords = GT_Utility.getClickedFacingCoords(side, aX, aY, aZ); switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) { case 0: // Utils.LOG_WARNING("Freq. -1 | " + this.mFrequency); try { - CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); + CORE.sTesseractTerminalOwnershipMap.get(mOwner) + .remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency -= 1; break; case 1: // Utils.LOG_WARNING("Freq. +1 | " + this.mFrequency); try { - CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); + CORE.sTesseractTerminalOwnershipMap.get(mOwner) + .remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency += 1; default: // Utils.LOG_WARNING("Did not click the correct place."); try { - CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); + CORE.sTesseractTerminalOwnershipMap.get(mOwner) + .remove(this.mFrequency); } catch (Throwable t) {} break; } PlayerUtils.messagePlayer(aPlayer, "Frequency: " + this.mFrequency); if (this.getTesseract(this.mFrequency, false) != null) { PlayerUtils.messagePlayer( - aPlayer, - new StringBuilder().append(EnumChatFormatting.GREEN).append(" (Connected)").toString()); + aPlayer, + new StringBuilder().append(EnumChatFormatting.GREEN) + .append(" (Connected)") + .toString()); } } - } else if (aPlayer.getUniqueID().compareTo(this.mOwner) != 0) { - GT_Utility.sendChatToPlayer(aPlayer, "This is not your Tesseract Terminal to configure."); - } + } else if (aPlayer.getUniqueID() + .compareTo(this.mOwner) != 0) { + GT_Utility.sendChatToPlayer(aPlayer, "This is not your Tesseract Terminal to configure."); + } return true; } @Override public void onScrewdriverRightClick(final ForgeDirection side, final EntityPlayer aPlayer, final float aX, - final float aY, final float aZ) { - if (aPlayer.getUniqueID().compareTo(this.mOwner) == 0) { - if (side == this.getBaseMetaTileEntity().getFrontFacing()) { + final float aY, final float aZ) { + if (aPlayer.getUniqueID() + .compareTo(this.mOwner) == 0) { + if (side == this.getBaseMetaTileEntity() + .getFrontFacing()) { final float[] tCoords = GT_Utility.getClickedFacingCoords(side, aX, aY, aZ); switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) { case 0 -> { try { - CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); + CORE.sTesseractTerminalOwnershipMap.get(mOwner) + .remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency -= 64; } case 1 -> { try { - CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); + CORE.sTesseractTerminalOwnershipMap.get(mOwner) + .remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency += 64; } case 2 -> { try { - CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); + CORE.sTesseractTerminalOwnershipMap.get(mOwner) + .remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency -= 512; } case 3 -> { try { - CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); + CORE.sTesseractTerminalOwnershipMap.get(mOwner) + .remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency += 512; } } GT_Utility.sendChatToPlayer( - aPlayer, - "Frequency: " + this.mFrequency - + (this.getTesseract(this.mFrequency, false) == null ? "" - : new StringBuilder().append(EnumChatFormatting.GREEN).append(" (Connected)") - .toString())); + aPlayer, + "Frequency: " + this.mFrequency + + (this.getTesseract(this.mFrequency, false) == null ? "" + : new StringBuilder().append(EnumChatFormatting.GREEN) + .append(" (Connected)") + .toString())); + } + } else if (aPlayer.getUniqueID() + .compareTo(this.mOwner) != 0) { + GT_Utility.sendChatToPlayer(aPlayer, "This is not your Tesseract Terminal to configure."); } - } else if (aPlayer.getUniqueID().compareTo(this.mOwner) != 0) { - GT_Utility.sendChatToPlayer(aPlayer, "This is not your Tesseract Terminal to configure."); - } } public boolean allowCoverOnSide(final ForgeDirection side, final int aCoverID) { - return side != this.getBaseMetaTileEntity().getFrontFacing(); + return side != this.getBaseMetaTileEntity() + .getFrontFacing(); } public GT_MetaTileEntity_TesseractGenerator getTesseract(final int aFrequency, final boolean aWorkIrrelevant) { final GT_MetaTileEntity_TesseractGenerator rTesseract = TesseractHelper - .getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), aFrequency); + .getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), aFrequency); if (rTesseract == null) { return null; } @@ -250,16 +278,21 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic } if (rTesseract.mFrequency != aFrequency) { TesseractHelper.setTerminalOwnershipByPlayer( - PlayerUtils.getPlayerOnServerFromUUID(mOwner), - Integer.valueOf(aFrequency), - null); + PlayerUtils.getPlayerOnServerFromUUID(mOwner), + Integer.valueOf(aFrequency), + null); return null; } - if (!rTesseract.isValidTesseractGenerator(this.getBaseMetaTileEntity().getOwnerName(), aWorkIrrelevant)) { + if (!rTesseract.isValidTesseractGenerator( + this.getBaseMetaTileEntity() + .getOwnerName(), + aWorkIrrelevant)) { return null; } - if ((!sInterDimensionalTesseractAllowed) - && (rTesseract.getBaseMetaTileEntity().getWorld() != this.getBaseMetaTileEntity().getWorld())) { + if ((!sInterDimensionalTesseractAllowed) && (rTesseract.getBaseMetaTileEntity() + .getWorld() + != this.getBaseMetaTileEntity() + .getWorld())) { return null; } return rTesseract; @@ -268,12 +301,12 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public String[] getInfoData() { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork()) - && (tTileEntity.isSendingInformation())) { + if ((tTileEntity != null) && (this.getBaseMetaTileEntity() + .isAllowedToWork()) && (tTileEntity.isSendingInformation())) { return tTileEntity.getInfoData(); } return new String[] { "Tesseract Generator", "Freqency:", "" + this.mFrequency, - this.getTesseract(this.mFrequency, false) != null ? "Active" : "Inactive" }; + this.getTesseract(this.mFrequency, false) != null ? "Active" : "Inactive" }; } @Override @@ -284,7 +317,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public boolean isDigitalChest() { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return false; } return tTileEntity.isDigitalChest(); @@ -293,7 +327,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public ItemStack[] getStoredItemData() { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return null; } return tTileEntity.getStoredItemData(); @@ -302,7 +337,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public void setItemCount(final int aCount) { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return; } tTileEntity.setItemCount(aCount); @@ -311,7 +347,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public int getMaxItemCount() { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return 0; } return tTileEntity.getMaxItemCount(); @@ -320,7 +357,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public boolean isItemValidForSlot(final int aIndex, final ItemStack aStack) { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return false; } return tTileEntity.isItemValidForSlot(aIndex, aStack); @@ -329,7 +367,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public int[] getAccessibleSlotsFromSide(final int ordinalSide) { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return new int[0]; } return tTileEntity.getAccessibleSlotsFromSide(ordinalSide); @@ -338,7 +377,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public boolean canInsertItem(final int aIndex, final ItemStack aStack, final int ordinalSide) { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return false; } return tTileEntity.canInsertItem(aIndex, aStack, ordinalSide); @@ -347,7 +387,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public boolean canExtractItem(final int aIndex, final ItemStack aStack, final int ordinalSide) { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return false; } return tTileEntity.canExtractItem(aIndex, aStack, ordinalSide); @@ -356,7 +397,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public int getSizeInventory() { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return 0; } return tTileEntity.getSizeInventory(); @@ -365,7 +407,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public ItemStack getStackInSlot(final int aIndex) { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return null; } return tTileEntity.getStackInSlot(aIndex); @@ -374,7 +417,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public void setInventorySlotContents(final int aIndex, final ItemStack aStack) { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return; } tTileEntity.setInventorySlotContents(aIndex, aStack); @@ -383,7 +427,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public ItemStack decrStackSize(final int aIndex, final int aAmount) { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return null; } return tTileEntity.decrStackSize(aIndex, aAmount); @@ -392,7 +437,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public String getInventoryName() { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return ""; } return tTileEntity.getInventoryName(); @@ -401,7 +447,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public int getInventoryStackLimit() { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return 0; } return tTileEntity.getInventoryStackLimit(); @@ -410,7 +457,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public boolean canFill(final ForgeDirection aSide, final Fluid aFluid) { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return false; } return tTileEntity.canFill(aSide, aFluid); @@ -419,7 +467,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public boolean canDrain(final ForgeDirection aSide, final Fluid aFluid) { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return false; } return tTileEntity.canDrain(aSide, aFluid); @@ -428,7 +477,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public FluidTankInfo[] getTankInfo(final ForgeDirection aSide) { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return new FluidTankInfo[0]; } return tTileEntity.getTankInfo(aSide); @@ -437,7 +487,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public int fill_default(final ForgeDirection aDirection, final FluidStack aFluid, final boolean doFill) { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return 0; } return tTileEntity.fill(aDirection, aFluid, doFill); @@ -446,7 +497,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public FluidStack drain(final ForgeDirection aDirection, final int maxDrain, final boolean doDrain) { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return null; } return tTileEntity.drain(aDirection, maxDrain, doDrain); @@ -455,7 +507,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public FluidStack drain(final ForgeDirection aSide, final FluidStack aFluid, final boolean doDrain) { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity == null) || (!this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((tTileEntity == null) || (!this.getBaseMetaTileEntity() + .isAllowedToWork())) { return null; } return tTileEntity.drain(aSide, aFluid, doDrain); @@ -463,11 +516,19 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if ((this.getBaseMetaTileEntity().isServerSide()) && (this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((this.getBaseMetaTileEntity() + .isServerSide()) + && (this.getBaseMetaTileEntity() + .isAllowedToWork())) { // Set owner - if (PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()) != null) { + if (PlayerUtils.getPlayersUUIDByName( + this.getBaseMetaTileEntity() + .getOwnerName()) + != null) { if (this.mOwner == null) { - this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()); + this.mOwner = PlayerUtils.getPlayersUUIDByName( + this.getBaseMetaTileEntity() + .getOwnerName()); } } final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, true); @@ -475,12 +536,15 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic tTileEntity.addEnergyConsumption(this); if ((!this.mDidWork) && (this.getTesseract(this.mFrequency, false) != null)) { this.mDidWork = true; - this.getBaseMetaTileEntity().issueBlockUpdate(); - this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(128, false); + this.getBaseMetaTileEntity() + .issueBlockUpdate(); + this.getBaseMetaTileEntity() + .decreaseStoredEnergyUnits(128, false); } } else if (this.mDidWork == true) { this.mDidWork = false; - this.getBaseMetaTileEntity().issueBlockUpdate(); + this.getBaseMetaTileEntity() + .issueBlockUpdate(); } } } @@ -488,24 +552,24 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public String[] getDescription() { return ArrayUtils.addAll( - this.mDescriptionArray, - "Accesses Tesseract Generators remotely", - "Connect with pipes to extract items or fluids", - "Outputs from the back face", - "Consumes " + TESSERACT_ENERGY_COST + "EU/t for same dimension transfers", - "Consumes " + TESSERACT_ENERGY_COST_DIMENSIONAL + "EU/t for cross dimensional transfers", - CORE.GT_Tooltip.get()); + this.mDescriptionArray, + "Accesses Tesseract Generators remotely", + "Connect with pipes to extract items or fluids", + "Outputs from the back face", + "Consumes " + TESSERACT_ENERGY_COST + "EU/t for same dimension transfers", + "Consumes " + TESSERACT_ENERGY_COST_DIMENSIONAL + "EU/t for cross dimensional transfers", + CORE.GT_Tooltip.get()); } @Override public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { + final ForgeDirection side, final ItemStack aStack) { return false; } @Override public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { + final ForgeDirection side, final ItemStack aStack) { return false; } @@ -516,12 +580,12 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { + final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { return side == facing - ? new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency) } - : new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), - new GT_RenderedTexture(Textures.BlockIcons.VOID) }; + ? new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency) } + : new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), + new GT_RenderedTexture(Textures.BlockIcons.VOID) }; } // To-Do? @@ -557,9 +621,14 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { - if (this.getBaseMetaTileEntity().getOwnerName() != null - && !this.getBaseMetaTileEntity().getOwnerName().equals("")) { - this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()); + if (this.getBaseMetaTileEntity() + .getOwnerName() != null + && !this.getBaseMetaTileEntity() + .getOwnerName() + .equals("")) { + this.mOwner = PlayerUtils.getPlayersUUIDByName( + this.getBaseMetaTileEntity() + .getOwnerName()); } super.onCreated(aStack, aWorld, aPlayer); } @@ -567,7 +636,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public void onRemoval() { try { - CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); + CORE.sTesseractTerminalOwnershipMap.get(mOwner) + .remove(this.mFrequency); } catch (Throwable t) {} super.onRemoval(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java index 95c5a7eeaf..b27c1a759a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java @@ -33,10 +33,10 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { public GT_MetaTileEntity_Boiler_Base(int aID, String aNameRegional, int tier) { super( - aID, - "electricboiler." + tier + ".tier.single", - aNameRegional, - "Produces " + (CORE.ConfigSwitches.boilerSteamPerSecond * tier) + "L of Steam per second"); + aID, + "electricboiler." + tier + ".tier.single", + aNameRegional, + "Produces " + (CORE.ConfigSwitches.boilerSteamPerSecond * tier) + "L of Steam per second"); this.steamPerSecond = (CORE.ConfigSwitches.boilerSteamPerSecond * tier); this.tier = tier; } @@ -50,12 +50,12 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { @Override public String[] getDescription() { return ArrayUtils.addAll( - this.mDescriptionArray, - "Produces " + getPollution() + " pollution/sec", - "Consumes fuel only when temperature is less than 100C", - "Fuel with burn time greater than 500 is more efficient.", - "Doesn't explode if there's no water", - CORE.GT_Tooltip.get()); + this.mDescriptionArray, + "Produces " + getPollution() + " pollution/sec", + "Consumes fuel only when temperature is less than 100C", + "Fuel with burn time greater than 500 is more efficient.", + "Doesn't explode if there's no water", + CORE.GT_Tooltip.get()); } public ITexture getOverlayIcon() { @@ -92,12 +92,10 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { - return this.mTextures[(aActive ? 5 : 0) - + (side == facing ? 0 - : side == facing.getOpposite() ? 1 - : side == ForgeDirection.DOWN ? 2 : side == ForgeDirection.UP ? 3 : 4)][aColorIndex - + 1]; + final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (side == facing ? 0 + : side == facing.getOpposite() ? 1 + : side == ForgeDirection.DOWN ? 2 : side == ForgeDirection.UP ? 3 : 4)][aColorIndex + 1]; } public ITexture[] getFront(final byte aColor) { @@ -142,7 +140,8 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { @Override public boolean isOutputFacing(final ForgeDirection side) { - return side != this.getBaseMetaTileEntity().getFrontFacing(); + return side != this.getBaseMetaTileEntity() + .getFrontFacing(); } @Override @@ -216,25 +215,25 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { // support returning those different capacities. public FluidTankInfo[] getTankInfo(ForgeDirection aSide) { return new FluidTankInfo[] { new FluidTankInfo(this.mFluid, getCapacity()), - new FluidTankInfo(this.mSteam, getSteamCapacity()) }; + new FluidTankInfo(this.mSteam, getSteamCapacity()) }; } @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { + ItemStack aStack) { return aIndex == 1 || aIndex == 3; } @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { + ItemStack aStack) { return aIndex == 2; } @Override protected int getPollution() { return (int) (CORE.ConfigSwitches.basePollutionPerSecondBoiler - * CORE.ConfigSwitches.pollutionReleasedByTierBoiler[this.tier]); + * CORE.ConfigSwitches.pollutionReleasedByTierBoiler[this.tier]); } @Override @@ -265,8 +264,12 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { tile.decrStackSize(2, 1); if (tile.getRandomNumber(3) == 0) { - if (fuel.getDisplayName().toLowerCase().contains("charcoal") - || fuel.getDisplayName().toLowerCase().contains("coke")) { + if (fuel.getDisplayName() + .toLowerCase() + .contains("charcoal") + || fuel.getDisplayName() + .toLowerCase() + .contains("coke")) { tile.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L)); } else { tile.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); @@ -276,7 +279,8 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { @Override public boolean allowCoverOnSide(ForgeDirection side, GT_ItemStack aCover) { - if (side != this.getBaseMetaTileEntity().getFrontFacing()) { + if (side != this.getBaseMetaTileEntity() + .getFrontFacing()) { return true; } return super.allowCoverOnSide(side, aCover); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java index da6ef21dd3..e77915aa01 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java @@ -30,19 +30,19 @@ public class GT_MetaTileEntity_Boiler_HV extends GT_MetaTileEntity_Boiler_Base { @Override public ITexture[] getFront(final byte aColor) { return new ITexture[] { super.getFront(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) }; + new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) }; } @Override public ITexture[] getTop(final byte aColor) { return new ITexture[] { super.getTop(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Talonite) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Talonite) }; } @Override public ITexture[] getFrontActive(final byte aColor) { return new ITexture[] { super.getFrontActive(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE) }; + new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE) }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java index 13d3e6ae87..23abfe1e3f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java @@ -30,19 +30,19 @@ public class GT_MetaTileEntity_Boiler_LV extends GT_MetaTileEntity_Boiler_Base { @Override public ITexture[] getFront(final byte aColor) { return new ITexture[] { super.getFront(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) }; + new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) }; } @Override public ITexture[] getTop(final byte aColor) { return new ITexture[] { super.getTop(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Potin) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Potin) }; } @Override public ITexture[] getFrontActive(final byte aColor) { return new ITexture[] { super.getFrontActive(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE) }; + new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE) }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java index b8214b0bbd..379f67b55d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java @@ -30,19 +30,19 @@ public class GT_MetaTileEntity_Boiler_MV extends GT_MetaTileEntity_Boiler_Base { @Override public ITexture[] getFront(final byte aColor) { return new ITexture[] { super.getFront(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) }; + new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) }; } @Override public ITexture[] getTop(final byte aColor) { return new ITexture[] { super.getTop(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Tumbaga) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Tumbaga) }; } @Override public ITexture[] getFrontActive(final byte aColor) { return new ITexture[] { super.getFrontActive(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE) }; + new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE) }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java index 16aa8a977f..993b0e9035 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java @@ -33,7 +33,7 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi } public GT_MetaTileEntity_SemiFluidGenerator(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); onConfigLoad(); } @@ -41,7 +41,7 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi @Override public int getPollution() { return (int) (CORE.ConfigSwitches.basePollutionPerSecondSemiFluidGenerator - * CORE.ConfigSwitches.pollutionReleasedByTierSemiFluidGenerator[this.mTier]); + * CORE.ConfigSwitches.pollutionReleasedByTierSemiFluidGenerator[this.mTier]); } @Override @@ -51,9 +51,9 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi public void onConfigLoad() { this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "SemiFluidGenerator.efficiency.tier." + this.mTier, - 100 - (this.mTier * 5)); + ConfigCategories.machineconfig, + "SemiFluidGenerator.efficiency.tier." + this.mTier, + 100 - (this.mTier * 5)); } @Override @@ -70,10 +70,10 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi @Override public String[] getDescription() { return ArrayUtils.addAll( - this.mDescriptionArray, - "Produces " + (this.getPollution()) + " pollution/sec", - "Fuel Efficiency: " + this.getEfficiency() + "%", - CORE.GT_Tooltip.get()); + this.mDescriptionArray, + "Produces " + (this.getPollution()) + " pollution/sec", + "Fuel Efficiency: " + this.getEfficiency() + "%", + CORE.GT_Tooltip.get()); } @Override @@ -88,7 +88,8 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi @Override public boolean allowCoverOnSide(ForgeDirection side, GT_ItemStack aCover) { - if (side != this.getBaseMetaTileEntity().getFrontFacing()) { + if (side != this.getBaseMetaTileEntity() + .getFrontFacing()) { return true; } return super.allowCoverOnSide(side, aCover); @@ -111,62 +112,62 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi @Override public ITexture[] getFront(byte aColor) { return new ITexture[] { super.getFront(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBack(byte aColor) { return new ITexture[] { super.getBack(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP) }; } @Override public ITexture[] getBottom(byte aColor) { return new ITexture[] { super.getBottom(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM) }; } @Override public ITexture[] getTop(byte aColor) { return new ITexture[] { super.getTop(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE) }; } @Override public ITexture[] getSides(byte aColor) { return new ITexture[] { super.getSides(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP) }; } @Override public ITexture[] getFrontActive(byte aColor) { return new ITexture[] { super.getFrontActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT_ACTIVE), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT_ACTIVE), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBackActive(byte aColor) { return new ITexture[] { super.getBackActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE) }; } @Override public ITexture[] getBottomActive(byte aColor) { return new ITexture[] { super.getBottomActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE) }; } @Override public ITexture[] getTopActive(byte aColor) { return new ITexture[] { super.getTopActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE) }; } @Override public ITexture[] getSidesActive(byte aColor) { return new ITexture[] { super.getSidesActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE) }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java index 8a476fceee..e1f1c8a2e6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java @@ -28,13 +28,13 @@ public class GregtechMetaTileEntityGeothermalGenerator extends GT_MetaTileEntity public int mEfficiency; public GregtechMetaTileEntityGeothermalGenerator(final int aID, final String aName, final String aNameRegional, - final int aTier) { + final int aTier) { super(aID, aName, aNameRegional, aTier, "Requires Pahoehoe Lava or Normal Lava as Fuel", new ITexture[0]); this.onConfigLoad(); } public GregtechMetaTileEntityGeothermalGenerator(final String aName, final int aTier, final String[] aDescription, - final ITexture[][][] aTextures) { + final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); this.onConfigLoad(); } @@ -43,10 +43,10 @@ public class GregtechMetaTileEntityGeothermalGenerator extends GT_MetaTileEntity public String[] getDescription() { String aPollution = "Causes " + this.getPollution() + " Pollution per second"; return ArrayUtils.addAll( - this.mDescriptionArray, - "Generates power at " + this.getEfficiency() + "% Efficiency per tick", - aPollution, - CORE.GT_Tooltip.get()); + this.mDescriptionArray, + "Generates power at " + this.getEfficiency() + "% Efficiency per tick", + aPollution, + CORE.GT_Tooltip.get()); } @Override @@ -63,9 +63,9 @@ public class GregtechMetaTileEntityGeothermalGenerator extends GT_MetaTileEntity public void onConfigLoad() { this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "ThermalGenerator.efficiency.tier." + this.mTier, - (100 - (this.mTier * 7))); + ConfigCategories.machineconfig, + "ThermalGenerator.efficiency.tier." + this.mTier, + (100 - (this.mTier * 7))); } @Override @@ -84,82 +84,83 @@ public class GregtechMetaTileEntityGeothermalGenerator extends GT_MetaTileEntity @Override public boolean isOutputFacing(final ForgeDirection side) { - return side == this.getBaseMetaTileEntity().getFrontFacing(); + return side == this.getBaseMetaTileEntity() + .getFrontFacing(); } @Override public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMetaTileEntityGeothermalGenerator( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } @Override public ITexture[] getFront(final byte aColor) { return new ITexture[] { super.getFront(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; } @Override public ITexture[] getBack(final byte aColor) { return new ITexture[] { super.getBack(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Vertical) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Vertical) }; } @Override public ITexture[] getBottom(final byte aColor) { return new ITexture[] { super.getBottom(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM) }; } @Override public ITexture[] getTop(final byte aColor) { return new ITexture[] { super.getTop(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER) }; } @Override public ITexture[] getSides(final byte aColor) { return new ITexture[] { super.getSides(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT) }; + new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT) }; } @Override public ITexture[] getFrontActive(final byte aColor) { return new ITexture[] { super.getFrontActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; } @Override public ITexture[] getBackActive(final byte aColor) { return new ITexture[] { super.getBackActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Vertical_Active) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Vertical_Active) }; } @Override public ITexture[] getBottomActive(final byte aColor) { return new ITexture[] { super.getBottomActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE) }; } @Override public ITexture[] getTopActive(final byte aColor) { return new ITexture[] { super.getTopActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE) }; + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE) }; } @Override public ITexture[] getSidesActive(final byte aColor) { return new ITexture[] { super.getSidesActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE) }; + new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE) }; } @Override @@ -170,6 +171,6 @@ public class GregtechMetaTileEntityGeothermalGenerator extends GT_MetaTileEntity @Override public int getPollution() { return (int) (CORE.ConfigSwitches.basePollutionPerSecondGeothermalGenerator - * CORE.ConfigSwitches.pollutionReleasedByTierGeothermalGenerator[mTier]); + * CORE.ConfigSwitches.pollutionReleasedByTierGeothermalGenerator[mTier]); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java index 983e1d7881..45d4177709 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java @@ -23,29 +23,30 @@ public class GregtechMetaTileEntityRocketFuelGenerator extends GregtechRocketFue public int mEfficiency; public GregtechMetaTileEntityRocketFuelGenerator(final int aID, final String aName, final String aNameRegional, - final int aTier) { + final int aTier) { super(aID, aName, aNameRegional, aTier, "Requires GT++ Rocket Fuels", new ITexture[0]); this.onConfigLoad(); } public GregtechMetaTileEntityRocketFuelGenerator(final String aName, final int aTier, final String[] aDescription, - final ITexture[][][] aTextures) { + final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); this.onConfigLoad(); } @Override public boolean isOutputFacing(final ForgeDirection side) { - return side == this.getBaseMetaTileEntity().getFrontFacing(); + return side == this.getBaseMetaTileEntity() + .getFrontFacing(); } @Override public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMetaTileEntityRocketFuelGenerator( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } @Override @@ -60,9 +61,9 @@ public class GregtechMetaTileEntityRocketFuelGenerator extends GregtechRocketFue public void onConfigLoad() { this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "RocketEngine.efficiency.tier." + this.mTier, - 80 - (10 * (this.mTier - 4))); + ConfigCategories.machineconfig, + "RocketEngine.efficiency.tier." + this.mTier, + 80 - (10 * (this.mTier - 4))); } @Override @@ -96,60 +97,60 @@ public class GregtechMetaTileEntityRocketFuelGenerator extends GregtechRocketFue @Override public ITexture[] getFront(final byte aColor) { return new ITexture[] { super.getFront(aColor)[0], this.getCasingTexture(), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; } @Override public ITexture[] getBack(final byte aColor) { return new ITexture[] { super.getBack(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent) }; + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent) }; } @Override public ITexture[] getBottom(final byte aColor) { return new ITexture[] { super.getBottom(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } @Override public ITexture[] getTop(final byte aColor) { return new ITexture[] { super.getTop(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off) }; } @Override public ITexture[] getSides(final byte aColor) { return new ITexture[] { super.getSides(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal) }; + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal) }; } @Override public ITexture[] getFrontActive(final byte aColor) { return new ITexture[] { super.getFrontActive(aColor)[0], this.getCasingTexture(), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; } @Override public ITexture[] getBackActive(final byte aColor) { return new ITexture[] { super.getBackActive(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast) }; + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast) }; } @Override public ITexture[] getBottomActive(final byte aColor) { return new ITexture[] { super.getBottomActive(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } @Override public ITexture[] getTopActive(final byte aColor) { return new ITexture[] { super.getTopActive(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On) }; } @Override public ITexture[] getSidesActive(final byte aColor) { return new ITexture[] { super.getSidesActive(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal_Active) }; + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal_Active) }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java index 9ad42e350d..32cf3a92cc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java @@ -101,11 +101,11 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator ItemStack lastUsedFuel = ItemStack.loadItemStackFromNBT(data); if (lastUsedFuel != null) { this.mCurrentRecipe = getRecipeMap().findRecipe( - getBaseMetaTileEntity(), - false, - 9223372036854775807L, - null, - new ItemStack[] { lastUsedFuel }); + getBaseMetaTileEntity(), + false, + 9223372036854775807L, + null, + new ItemStack[] { lastUsedFuel }); } } @@ -129,20 +129,20 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator if (this.mInventory[getStackDisplaySlot()] == null) this.mInventory[getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1); this.mInventory[getStackDisplaySlot()].setStackDisplayName( - "Generating: " - + GT_Utility.formatNumbers( - aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU()) - + " EU"); + "Generating: " + + GT_Utility.formatNumbers( + aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU()) + + " EU"); } } else { int tFuelValue = getFuelValue(this.mFluid); int tConsumed = consumedFluidPerOperation(this.mFluid); if ((tFuelValue > 0) && (tConsumed > 0) && (this.mFluid.amount > tConsumed)) { long tFluidAmountToUse = Math.min( - this.mFluid.amount / tConsumed, - (maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue); + this.mFluid.amount / tConsumed, + (maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue); if ((tFluidAmountToUse > 0L) - && (aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true))) { + && (aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true))) { tProducedEU = tFluidAmountToUse * tFuelValue; FluidStack tmp260_257 = this.mFluid; tmp260_257.amount = (int) (tmp260_257.amount - (tFluidAmountToUse * tConsumed)); @@ -150,8 +150,8 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator } } if ((this.mInventory[getInputSlot()] != null) - && (aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() * 20L + getMinimumStoredEU()) - && (GT_Utility.getFluidForFilledItem(this.mInventory[getInputSlot()], true) == null)) { + && (aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() * 20L + getMinimumStoredEU()) + && (GT_Utility.getFluidForFilledItem(this.mInventory[getInputSlot()], true) == null)) { int tFuelValue = getFuelValue(this.mInventory[getInputSlot()]); if (tFuelValue > 0) { ItemStack tEmptyContainer = getEmptyContainer(this.mInventory[getInputSlot()]); @@ -163,26 +163,25 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator } } if ((tProducedEU > 0L) && (getPollution() > 0)) { - PollutionUtils.addPollution( - aBaseMetaTileEntity, - (int) (tProducedEU * getPollution() / 500 * this.mTier + 1L)); + PollutionUtils + .addPollution(aBaseMetaTileEntity, (int) (tProducedEU * getPollution() / 500 * this.mTier + 1L)); } } if (aBaseMetaTileEntity.isServerSide()) aBaseMetaTileEntity.setActive( - (aBaseMetaTileEntity.isAllowedToWork()) - && (aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU())); + (aBaseMetaTileEntity.isAllowedToWork()) + && (aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU())); } @Override public String[] getDescription() { return ArrayUtils.addAll( - this.mDescriptionArray, - "Fuel is measured in minecraft days (Check with Scanner)", - "RTG changes output voltage depending on fuel", - "Generates power at " + GT_Utility.formatNumbers(this.getEfficiency()) + "% Efficiency per tick", - "Output Voltage: " + GT_Utility.formatNumbers(this.getOutputTier()) + " EU/t", - CORE.GT_Tooltip.get()); + this.mDescriptionArray, + "Fuel is measured in minecraft days (Check with Scanner)", + "RTG changes output voltage depending on fuel", + "Generates power at " + GT_Utility.formatNumbers(this.getEfficiency()) + "% Efficiency per tick", + "Output Voltage: " + GT_Utility.formatNumbers(this.getOutputTier()) + " EU/t", + CORE.GT_Tooltip.get()); } public GregtechMetaTileEntity_RTG(int aID, String aName, String aNameRegional, int aTier) { @@ -210,7 +209,7 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator @Override public boolean isOutputFacing(ForgeDirection side) { return ((side.offsetY == 0) && (side != getBaseMetaTileEntity().getFrontFacing()) - && (side != getBaseMetaTileEntity().getBackFacing())); + && (side != getBaseMetaTileEntity().getBackFacing())); } @Override @@ -236,67 +235,67 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator @Override public ITexture[] getFront(byte aColor) { return new ITexture[] { super.getFront(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB) }; + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB) }; } @Override public ITexture[] getBack(byte aColor) { return new ITexture[] { super.getBack(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP) }; + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP) }; } @Override public ITexture[] getBottom(byte aColor) { return new ITexture[] { super.getBottom(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP) }; + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP) }; } @Override public ITexture[] getTop(byte aColor) { return new ITexture[] { super.getTop(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP), - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE) }; + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP), + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE) }; } @Override public ITexture[] getSides(byte aColor) { return new ITexture[] { gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(0)], - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), - gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[getTier()] }; + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), + gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[getTier()] }; } @Override public ITexture[] getFrontActive(byte aColor) { return new ITexture[] { super.getFrontActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB_ACTIVE) }; + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB_ACTIVE) }; } @Override public ITexture[] getBackActive(byte aColor) { return new ITexture[] { super.getBackActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE) }; + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE) }; } @Override public ITexture[] getBottomActive(byte aColor) { return new ITexture[] { super.getBottomActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE) }; + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE) }; } @Override public ITexture[] getTopActive(byte aColor) { return new ITexture[] { super.getTopActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE) }; + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE) }; } @Override public ITexture[] getSidesActive(byte aColor) { return new ITexture[] { gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(0)], - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), - gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[getTier()] }; + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), + gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[getTier()] }; } @Override @@ -308,7 +307,7 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator public int getFuelValue(ItemStack aStack) { if ((GT_Utility.isStackInvalid(aStack)) || (getRecipeMap() == null)) return 0; GT_Recipe tFuel = getRecipeMap() - .findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, new ItemStack[] { aStack }); + .findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, new ItemStack[] { aStack }); if (tFuel != null) { this.mCurrentRecipe = tFuel; int voltage = tFuel.mEUt; @@ -370,12 +369,11 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator @Override public String[] getInfoData() { - return new String[] { "RTG - Running at tier " + this.mTier, - "Active: " + this.getBaseMetaTileEntity().isActive(), - "Current Output: " + GT_Utility.formatNumbers(mVoltage) + " EU/t", - "Days of Fuel remaining: " + GT_Utility.formatNumbers(mTicksToBurnFor / 20 / 60 / 20), - "Hours of Fuel remaining: " + GT_Utility.formatNumbers(mTicksToBurnFor / 20 / 60 / 60), - "Ticks of " + this.mVoltage + "v remaining: " + mTicksToBurnFor, - this.mCurrentRecipe.mInputs[0].getDisplayName() + " x1" }; + return new String[] { "RTG - Running at tier " + this.mTier, "Active: " + this.getBaseMetaTileEntity() + .isActive(), "Current Output: " + GT_Utility.formatNumbers(mVoltage) + " EU/t", + "Days of Fuel remaining: " + GT_Utility.formatNumbers(mTicksToBurnFor / 20 / 60 / 20), + "Hours of Fuel remaining: " + GT_Utility.formatNumbers(mTicksToBurnFor / 20 / 60 / 60), + "Ticks of " + this.mVoltage + "v remaining: " + mTicksToBurnFor, + this.mCurrentRecipe.mInputs[0].getDisplayName() + " x1" }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java index 8696c97ee6..24770e9503 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java @@ -19,17 +19,17 @@ public class GT_MetaTileEntity_ULV_CombustionGenerator extends GT_MetaTileEntity } public GT_MetaTileEntity_ULV_CombustionGenerator(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @Override public String[] getDescription() { return ArrayUtils.addAll( - this.mDescriptionArray, - "Produces " + (this.getPollution() * 20) + " pollution/sec", - "Fuel Efficiency: " + this.getEfficiency() + "%", - CORE.GT_Tooltip.get()); + this.mDescriptionArray, + "Produces " + (this.getPollution() * 20) + " pollution/sec", + "Fuel Efficiency: " + this.getEfficiency() + "%", + CORE.GT_Tooltip.get()); } @Override @@ -40,10 +40,10 @@ public class GT_MetaTileEntity_ULV_CombustionGenerator extends GT_MetaTileEntity @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_ULV_CombustionGenerator( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } @Override @@ -54,6 +54,6 @@ public class GT_MetaTileEntity_ULV_CombustionGenerator extends GT_MetaTileEntity @Override public void onConfigLoad() { this.mEfficiency = GregTech_API.sMachineFile - .get(ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier." + this.mTier, 95); + .get(ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier." + this.mTier, 95); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java index 9c7667abcd..26429b1486 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java @@ -37,6 +37,6 @@ public class GT_MetaTileEntity_ULV_SteamTurbine extends GT_MetaTileEntity_SteamT @Override public void onConfigLoad() { this.mEfficiency = GregTech_API.sMachineFile - .get(ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier." + this.mTier, 6 + 1); + .get(ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier." + this.mTier, 6 + 1); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java index af430c4a27..c592a68a40 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java @@ -57,16 +57,16 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank public GT_MetaTileEntity_CropHarvestor(final int aID, final int aTier, final String aDescription) { super( - aID, - "basicmachine.cropharvester.0" + aTier, - "Crop Manager (" + GT_Values.VN[aTier] + ")", - aTier, - 21, - aDescription); + aID, + "basicmachine.cropharvester.0" + aTier, + "Crop Manager (" + GT_Values.VN[aTier] + ")", + aTier, + 21, + aDescription); } public GT_MetaTileEntity_CropHarvestor(final String aName, final int aTier, final String[] aDescription, - final ITexture[][][] aTextures) { + final ITexture[][][] aTextures) { super(aName, aTier, 21, aDescription, aTextures); } @@ -190,14 +190,17 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if (!getBaseMetaTileEntity().isServerSide() || !getBaseMetaTileEntity().isAllowedToWork() - || (!getBaseMetaTileEntity().hasWorkJustBeenEnabled() && aTick % 100 != 0)) - return; + || (!getBaseMetaTileEntity().hasWorkJustBeenEnabled() && aTick % 100 != 0)) return; - if (this.getBaseMetaTileEntity().getUniversalEnergyStored() < getMinimumStoredEU()) return; + if (this.getBaseMetaTileEntity() + .getUniversalEnergyStored() < getMinimumStoredEU()) return; - int aTileX = this.getBaseMetaTileEntity().getXCoord(); - int aTileY = this.getBaseMetaTileEntity().getXCoord(); - int aTileZ = this.getBaseMetaTileEntity().getXCoord(); + int aTileX = this.getBaseMetaTileEntity() + .getXCoord(); + int aTileY = this.getBaseMetaTileEntity() + .getXCoord(); + int aTileZ = this.getBaseMetaTileEntity() + .getXCoord(); int aRadius = 10 + getRange(this.mTier); int aSide = (aRadius - 1) / 2; @@ -257,11 +260,15 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank for (int i = SLOT_OUTPUT_START; i < this.getSizeInventory() && !aAllDrops.isEmpty(); i++) { ItemStack invStack = mInventory[i]; if (invStack == null || GT_Utility.isStackInvalid(invStack) || invStack.stackSize == 0) { - Iterator<Entry<ItemStack, Integer>> iter = aAllDrops.entrySet().iterator(); + Iterator<Entry<ItemStack, Integer>> iter = aAllDrops.entrySet() + .iterator(); if (!iter.hasNext()) return; Entry<ItemStack, Integer> e = iter.next(); int toAdd = e.getValue(); - int toAddThisSlot = Math.min(toAdd, e.getKey().getMaxStackSize()); + int toAddThisSlot = Math.min( + toAdd, + e.getKey() + .getMaxStackSize()); getBaseMetaTileEntity().setInventorySlotContents(i, GT_Utility.copyAmount(toAddThisSlot, e.getKey())); toAdd -= toAddThisSlot; if (toAdd <= toAddThisSlot) { @@ -333,22 +340,25 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank return; } if (hasFertilizer() && consumeFertilizer(true) - && this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU() - && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true) - && applyFertilizer(aCrop)) { + && this.getBaseMetaTileEntity() + .getUniversalEnergyStored() >= getMinimumStoredEU() + && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true) + && applyFertilizer(aCrop)) { if (consumeFertilizer(false)) { // Logger.INFO("Consumed Fert."); } } - if (this.getFluidAmount() > 0 && this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU() - && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true) - && applyHydration(aCrop)) { + if (this.getFluidAmount() > 0 && this.getBaseMetaTileEntity() + .getUniversalEnergyStored() >= getMinimumStoredEU() + && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true) + && applyHydration(aCrop)) { // Logger.INFO("Consumed Water."); } if (hasWeedEX() && consumeWeedEX(true) - && this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU() - && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true) - && applyWeedEx(aCrop)) { + && this.getBaseMetaTileEntity() + .getUniversalEnergyStored() >= getMinimumStoredEU() + && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true) + && applyWeedEx(aCrop)) { if (consumeWeedEX(false)) { // Logger.INFO("Consumed Weed-EX."); } @@ -360,9 +370,8 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank aCrop.setWeedExStorage(aCrop.getWeedExStorage() + 50); boolean triggerDecline; triggerDecline = aCrop.getWorld().rand.nextInt(3) == 0; - if (aCrop.getCrop() != null && aCrop.getCrop().isWeed(aCrop) - && aCrop.getWeedExStorage() >= 75 - && triggerDecline) { + if (aCrop.getCrop() != null && aCrop.getCrop() + .isWeed(aCrop) && aCrop.getWeedExStorage() >= 75 && triggerDecline) { switch (aCrop.getWorld().rand.nextInt(5)) { case 0: if (aCrop.getGrowth() > 0) { @@ -446,7 +455,7 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank ItemStack stack = this.mInventory[aSlot]; Item item = stack.getItem(); if (stack != null && item.isDamageable() - && (ret == null || stack.getItem() == ret.getItem() && ItemStack.areItemStackTagsEqual(stack, ret))) { + && (ret == null || stack.getItem() == ret.getItem() && ItemStack.areItemStackTagsEqual(stack, ret))) { if (simulate) { stack = stack.copy(); } @@ -480,19 +489,23 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { + ItemStack aStack) { return aStack != null && aIndex >= SLOT_OUTPUT_START && aIndex < this.getSizeInventory(); } @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { + ItemStack aStack) { if (aStack != null) { - if (aStack.getItem().getUnlocalizedName().equals("ic2.itemFertilizer")) { + if (aStack.getItem() + .getUnlocalizedName() + .equals("ic2.itemFertilizer")) { return aIndex >= SLOT_FERT_1 && aIndex <= SLOT_FERT_4; - } else if (aStack.getItem().getUnlocalizedName().equals("ic2.itemWeedEx")) { - return aIndex >= SLOT_WEEDEX_1 && aIndex <= SLOT_WEEDEX_2; - } + } else if (aStack.getItem() + .getUnlocalizedName() + .equals("ic2.itemWeedEx")) { + return aIndex >= SLOT_WEEDEX_1 && aIndex <= SLOT_WEEDEX_2; + } } return false; } @@ -502,15 +515,15 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank int aRadius = 10 + getRange(this.mTier); int aSide = (aRadius - 1) / 2; return ArrayUtils.addAll( - this.mDescriptionArray, - "Secondary mode can Hydrate/Fertilize/Weed-EX", - "Consumes " + powerUsage() + "eu per harvest", - "Consumes " + powerUsageSecondary() + "eu per secondary operation", - "Can harvest 1 block level above and below itself", - "Radius: " + aSide + " blocks each side (" + aRadius + "x3x" + aRadius + ")", - "Has " + (this.mTier * 5) + "% chance for extra drops", - "Holds " + this.getCapacity() + "L of Water", - CORE.GT_Tooltip.get()); + this.mDescriptionArray, + "Secondary mode can Hydrate/Fertilize/Weed-EX", + "Consumes " + powerUsage() + "eu per harvest", + "Consumes " + powerUsageSecondary() + "eu per secondary operation", + "Can harvest 1 block level above and below itself", + "Radius: " + aSide + " blocks each side (" + aRadius + "x3x" + aRadius + ")", + "Has " + (this.mTier * 5) + "% chance for extra drops", + "Holds " + this.getCapacity() + "L of Water", + CORE.GT_Tooltip.get()); } @Override @@ -550,7 +563,7 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { + final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { if (side == ForgeDirection.DOWN || side == ForgeDirection.UP) { return this.mTextures[3][aColorIndex + 1]; } else { @@ -564,27 +577,27 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank public ITexture[] getFront(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter) }; } public ITexture[] getBack(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter) }; } public ITexture[] getBottom(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Boxes) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Boxes) }; } public ITexture[] getTop(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Boxes) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Boxes) }; } public ITexture[] getSides(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter) }; } @Override @@ -641,56 +654,63 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new CycleButtonWidget().setToggle(() -> mModeAlternative, val -> mModeAlternative = val) - .setTexture(GTPP_UITextures.OVERLAY_BUTTON_HARVESTER_MODE) - .addTooltip(0, "Enable Hydration/Fertilizing/Weed-EX") - .addTooltip(1, "Disable Hydration/Fertilizing/Weed-EX") - .setBackground(GT_UITextures.BUTTON_STANDARD).setPos(47, 63).setSize(18, 18)); - builder.widget( - new CycleButtonWidget().setToggle(() -> mHarvestEnabled, val -> mHarvestEnabled = val) - .setTexture(GTPP_UITextures.OVERLAY_BUTTON_HARVESTER_TOGGLE).addTooltip(0, "Enable Harvest") - .addTooltip(1, "Disable Harvest").setBackground(GT_UITextures.BUTTON_STANDARD).setPos(67, 63) - .setSize(18, 18)); + new CycleButtonWidget().setToggle(() -> mModeAlternative, val -> mModeAlternative = val) + .setTexture(GTPP_UITextures.OVERLAY_BUTTON_HARVESTER_MODE) + .addTooltip(0, "Enable Hydration/Fertilizing/Weed-EX") + .addTooltip(1, "Disable Hydration/Fertilizing/Weed-EX") + .setBackground(GT_UITextures.BUTTON_STANDARD) + .setPos(47, 63) + .setSize(18, 18)); builder.widget( - SlotGroup - .ofItemHandler(inventoryHandler, 2).startFromSlot( - SLOT_WEEDEX_1) - .endAtSlot(SLOT_WEEDEX_2) - .applyForWidget( - widget -> widget.setFilter( - stack -> stack != null - && stack.getItem().getUnlocalizedName().equals("ic2.itemWeedEx")) - .setBackground( - getGUITextureSet().getItemSlot(), - GTPP_UITextures.OVERLAY_SLOT_WEED_EX)) - .build().setPos(7, 13)) - .widget( - SlotGroup - .ofItemHandler(inventoryHandler, 2).startFromSlot(SLOT_FERT_1).endAtSlot( - SLOT_FERT_4) - .applyForWidget( - widget -> widget.setFilter( - stack -> stack != null && stack.getItem().getUnlocalizedName() - .equals("ic2.itemFertilizer")) - .setBackground( - getGUITextureSet().getItemSlot(), - GTPP_UITextures.OVERLAY_SLOT_FERTILIZER)) - .build().setPos(7, 31)) - .widget( - SlotGroup.ofItemHandler(inventoryHandler, 6).startFromSlot(SLOT_OUTPUT_START) - .endAtSlot(SLOT_OUTPUT_START + 6 * 3).canInsert(false).build().setPos(61, 7)); + new CycleButtonWidget().setToggle(() -> mHarvestEnabled, val -> mHarvestEnabled = val) + .setTexture(GTPP_UITextures.OVERLAY_BUTTON_HARVESTER_TOGGLE) + .addTooltip(0, "Enable Harvest") + .addTooltip(1, "Disable Harvest") + .setBackground(GT_UITextures.BUTTON_STANDARD) + .setPos(67, 63) + .setSize(18, 18)); builder.widget( + SlotGroup.ofItemHandler(inventoryHandler, 2) + .startFromSlot(SLOT_WEEDEX_1) + .endAtSlot(SLOT_WEEDEX_2) + .applyForWidget( + widget -> widget.setFilter( + stack -> stack != null && stack.getItem() + .getUnlocalizedName() + .equals("ic2.itemWeedEx")) + .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_WEED_EX)) + .build() + .setPos(7, 13)) + .widget( + SlotGroup.ofItemHandler(inventoryHandler, 2) + .startFromSlot(SLOT_FERT_1) + .endAtSlot(SLOT_FERT_4) + .applyForWidget( + widget -> widget.setFilter( + stack -> stack != null && stack.getItem() + .getUnlocalizedName() + .equals("ic2.itemFertilizer")) + .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_FERTILIZER)) + .build() + .setPos(7, 31)) + .widget( + SlotGroup.ofItemHandler(inventoryHandler, 6) + .startFromSlot(SLOT_OUTPUT_START) + .endAtSlot(SLOT_OUTPUT_START + 6 * 3) + .canInsert(false) + .build() + .setPos(61, 7)); + builder + .widget( new ProgressBar() - .setTexture( - GTPP_UITextures.PROGRESSBAR_BOILER_EMPTY, - GT_UITextures.PROGRESSBAR_BOILER_WATER, - 54) - .setDirection(ProgressBar.Direction.UP) - .setProgress(() -> (float) getFluidAmount() / getCapacity()).setSynced(false, false) - .dynamicTooltip( - () -> Collections - .singletonList("Water: " + getFluidAmount() + "L / " + getCapacity() + "L")) - .setPos(47, 7).setSize(10, 54)) - .widget(new FakeSyncWidget.FluidStackSyncer(this::getDrainableStack, this::setDrainableStack)); + .setTexture(GTPP_UITextures.PROGRESSBAR_BOILER_EMPTY, GT_UITextures.PROGRESSBAR_BOILER_WATER, 54) + .setDirection(ProgressBar.Direction.UP) + .setProgress(() -> (float) getFluidAmount() / getCapacity()) + .setSynced(false, false) + .dynamicTooltip( + () -> Collections.singletonList("Water: " + getFluidAmount() + "L / " + getCapacity() + "L")) + .setPos(47, 7) + .setSize(10, 54)) + .widget(new FakeSyncWidget.FluidStackSyncer(this::getDrainableStack, this::setDrainableStack)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java index 03b0fe9b13..9f2789b520 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java @@ -57,27 +57,27 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi public GregtechMetaAtmosphericReconditioner(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 2, - "Making sure you don't live in Gwalior - Uses 2A", - 3, - 0, - new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB), - new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active), - new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB) }); + aID, + aName, + aNameRegional, + aTier, + 2, + "Making sure you don't live in Gwalior - Uses 2A", + 3, + 0, + new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB), + new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active), + new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB) }); mPollutionEnabled = PollutionUtils.isPollutionEnabled(); } public GregtechMetaAtmosphericReconditioner(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, 2, aDescription, aTextures, 2, 0); mPollutionEnabled = PollutionUtils.isPollutionEnabled(); } @@ -93,21 +93,21 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi boolean highTier = this.mTier >= 7; String[] A = ArrayUtils.addAll( - this.mDescriptionArray, - highTier ? "Will attempt to remove 1/4 pollution from 8 surrounding chunks" : "", - highTier ? "If these chunks are not loaded, they will be ignored" : "", - "Requires a turbine rotor and an Air Filter [T1/T2] to run.", - "The turbine rotor must be manually inserted/replaced", - "Can be configured with a soldering iron to change modes", - "Low Efficiency: Removes half pollution, Turbine takes 50% dmg", - "High Efficiency: Removes full pollution, Turbine takes 100% dmg", - "Turbine Rotor will not break in LE mode", - "Insert an equal tier Conveyor Module to enable automation"); + this.mDescriptionArray, + highTier ? "Will attempt to remove 1/4 pollution from 8 surrounding chunks" : "", + highTier ? "If these chunks are not loaded, they will be ignored" : "", + "Requires a turbine rotor and an Air Filter [T1/T2] to run.", + "The turbine rotor must be manually inserted/replaced", + "Can be configured with a soldering iron to change modes", + "Low Efficiency: Removes half pollution, Turbine takes 50% dmg", + "High Efficiency: Removes full pollution, Turbine takes 100% dmg", + "Turbine Rotor will not break in LE mode", + "Insert an equal tier Conveyor Module to enable automation"); if (!mPollutionEnabled) { String[] B = new String[] { "===============================================", - "Pollution is disabled, scrubbers will now have a bonus use", - "They are now able to remove ALL lingering pollution as GT ignores it", - "and it will linger forever!", "===============================================", }; + "Pollution is disabled, scrubbers will now have a bonus use", + "They are now able to remove ALL lingering pollution as GT ignores it", "and it will linger forever!", + "===============================================", }; A = ArrayUtils.addAll(A, B); } return A; @@ -210,21 +210,23 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi // Enable machine animation/graphic if (hasRotor(stackRotor) && hasAirFilter(stackFilter) && this.mHasPollution) { - if (!this.getBaseMetaTileEntity().isActive()) { + if (!this.getBaseMetaTileEntity() + .isActive()) { Logger.INFO("Set Active."); aBaseMetaTileEntity.setActive(true); } } else if (!this.mHasPollution || mCurrentPollution <= 0 - || stackRotor == null - || stackFilter == null - || !hasRotor(stackRotor) - || !hasAirFilter(stackFilter)) { - if (!this.getBaseMetaTileEntity().isActive()) { - Logger.INFO("Set Inactive."); - aBaseMetaTileEntity.setActive(false); - this.sendSound((byte) -122); - } + || stackRotor == null + || stackFilter == null + || !hasRotor(stackRotor) + || !hasAirFilter(stackFilter)) { + if (!this.getBaseMetaTileEntity() + .isActive()) { + Logger.INFO("Set Inactive."); + aBaseMetaTileEntity.setActive(false); + this.sendSound((byte) -122); } + } // If Active. if (aBaseMetaTileEntity.isActive()) { @@ -232,8 +234,8 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi // Do nothing if there is no pollution. if (this.mHasPollution && mCurrentPollution > 0) { - Logger.INFO( - "Has Pollution? " + mHasPollution + ", Current Pollution: " + mCurrentPollution); + Logger + .INFO("Has Pollution? " + mHasPollution + ", Current Pollution: " + mCurrentPollution); // Only check every 30s. if (!isIdle && aTick % (20L * 30) == 0L) { @@ -278,8 +280,8 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi // I stole this code reduction = (MathUtils.safeInt((long) reduction * this.mBaseEff) / 100000) - * mAirSides - * Math.max((tTier - 2), 1); + * mAirSides + * Math.max((tTier - 2), 1); Logger.INFO("reduction[2]:" + reduction); reduction = MathUtils.safeInt(((long) reduction / 100) * this.mOptimalAirFlow); Logger.INFO("reduction[3]:" + reduction); @@ -331,20 +333,21 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi else { if (hasRotor(stackRotor) && hasAirFilter(stackFilter) - && this.mHasPollution - && !isIdle - && aBaseMetaTileEntity.isAllowedToWork()) { + && this.mHasPollution + && !isIdle + && aBaseMetaTileEntity.isAllowedToWork()) { aBaseMetaTileEntity.setActive(true); } else if (isIdle || !this.mHasPollution - || mCurrentPollution <= 0 - || stackRotor == null - || stackFilter == null - || !hasRotor(stackRotor) - || !hasAirFilter(stackFilter)) { - aBaseMetaTileEntity.setActive(false); - } + || mCurrentPollution <= 0 + || stackRotor == null + || stackFilter == null + || !hasRotor(stackRotor) + || !hasAirFilter(stackFilter)) { + aBaseMetaTileEntity.setActive(false); + } } - if (this.getBaseMetaTileEntity().isActive()) { + if (this.getBaseMetaTileEntity() + .isActive()) { if (MathUtils.randInt(0, 5) <= 2) { this.sendSound((byte) -120); } @@ -358,9 +361,12 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi mCurrentChunkPollution = PollutionUtils.getPollution(getBaseMetaTileEntity()); } else { AutoMap<Chunk> aSurrounding = new AutoMap<>(); - World aWorld = this.getBaseMetaTileEntity().getWorld(); - int xPos = this.getBaseMetaTileEntity().getXCoord(); - int zPos = this.getBaseMetaTileEntity().getZCoord(); + World aWorld = this.getBaseMetaTileEntity() + .getWorld(); + int xPos = this.getBaseMetaTileEntity() + .getXCoord(); + int zPos = this.getBaseMetaTileEntity() + .getZCoord(); Chunk a1 = aWorld.getChunkFromBlockCoords(xPos - 32, zPos - 32); Chunk a2 = aWorld.getChunkFromBlockCoords(xPos - 32, zPos); Chunk a3 = aWorld.getChunkFromBlockCoords(xPos - 32, zPos + 32); @@ -407,12 +413,12 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi // Logger.INFO("Found Basic Turbine Rotor."); return true; } else if (rotorStack.getItem() instanceof GT_MetaGenerated_Tool && rotorStack.getItemDamage() >= 170 - && rotorStack.getItemDamage() <= 179) { - // Logger.INFO("Found Turbine Rotor."); - return true; - } else { - // Logger.INFO("Found: "+rotorStack.getDisplayName()+":"+rotorStack.getItemDamage()); - } + && rotorStack.getItemDamage() <= 179) { + // Logger.INFO("Found Turbine Rotor."); + return true; + } else { + // Logger.INFO("Found: "+rotorStack.getDisplayName()+":"+rotorStack.getItemDamage()); + } } // Logger.INFO("Found No Turbine Rotor."); return false; @@ -460,14 +466,14 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi } if (mInventory[SLOT_ROTOR].getItem() instanceof GT_MetaGenerated_Tool_01 - && ((GT_MetaGenerated_Tool) mInventory[SLOT_ROTOR].getItem()).getToolStats(mInventory[SLOT_ROTOR]) - .getSpeedMultiplier() > 0 - && GT_MetaGenerated_Tool.getPrimaryMaterial(mInventory[SLOT_ROTOR]).mToolSpeed > 0) { + && ((GT_MetaGenerated_Tool) mInventory[SLOT_ROTOR].getItem()).getToolStats(mInventory[SLOT_ROTOR]) + .getSpeedMultiplier() > 0 + && GT_MetaGenerated_Tool.getPrimaryMaterial(mInventory[SLOT_ROTOR]).mToolSpeed > 0) { long damageValue = (long) Math - .floor(Math.abs(MathUtils.randFloat(1, 2) - MathUtils.randFloat(1, 3)) * (1 + 3 - 1) + 1); - double fDam = Math.floor( - Math.abs(MathUtils.randFloat(1f, 2f) - MathUtils.randFloat(1f, 2f)) * (1f + 2f - 1f) + 1f); + .floor(Math.abs(MathUtils.randFloat(1, 2) - MathUtils.randFloat(1, 3)) * (1 + 3 - 1) + 1); + double fDam = Math + .floor(Math.abs(MathUtils.randFloat(1f, 2f) - MathUtils.randFloat(1f, 2f)) * (1f + 2f - 1f) + 1f); damageValue -= fDam; // Logger.INFO("Trying to do "+damageValue+" damage to the rotor. ["+fDam+"]"); @@ -480,24 +486,24 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi // Damage Rotor // int rotorDurability = this.mInventory[this.SLOT_ROTOR].getItemDamage(); long rotorDamage = creativeRotor ? 0 - : GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]); + : GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]); long rotorDurabilityMax = creativeRotor ? Integer.MAX_VALUE - : GT_MetaGenerated_Tool.getToolMaxDamage(this.mInventory[this.SLOT_ROTOR]); + : GT_MetaGenerated_Tool.getToolMaxDamage(this.mInventory[this.SLOT_ROTOR]); long rotorDurability = (rotorDurabilityMax - rotorDamage); Logger.INFO( - "Rotor Damage: " + rotorDamage - + " | Max Durability: " - + rotorDurabilityMax - + " | " - + " Remaining Durability: " - + rotorDurability); + "Rotor Damage: " + rotorDamage + + " | Max Durability: " + + rotorDurabilityMax + + " | " + + " Remaining Durability: " + + rotorDurability); if (rotorDurability >= damageValue) { if (!mSaveRotor) { Logger.INFO("Damaging Rotor."); if (!creativeRotor) GT_ModHandler - .damageOrDechargeItem(this.mInventory[this.SLOT_ROTOR], (int) damageValue, 0, null); + .damageOrDechargeItem(this.mInventory[this.SLOT_ROTOR], (int) damageValue, 0, null); long tempDur = GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]); if (tempDur < rotorDurabilityMax) { @@ -508,11 +514,8 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi } else { Logger.INFO("Damaging Rotor."); if (rotorDurability > 1000) { - if (!creativeRotor) GT_ModHandler.damageOrDechargeItem( - this.mInventory[this.SLOT_ROTOR], - (int) damageValue / 2, - 0, - null); + if (!creativeRotor) GT_ModHandler + .damageOrDechargeItem(this.mInventory[this.SLOT_ROTOR], (int) damageValue / 2, 0, null); long tempDur = GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]); if (tempDur < rotorDurabilityMax) { return true; @@ -568,7 +571,9 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi public boolean removePollution(int toRemove) { - if (this == null || this.getBaseMetaTileEntity() == null || this.getBaseMetaTileEntity().getWorld() == null) { + if (this == null || this.getBaseMetaTileEntity() == null + || this.getBaseMetaTileEntity() + .getWorld() == null) { return false; } @@ -583,15 +588,22 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi int chunksWithRemoval = 0; int totalRemoved = 0; AutoMap<Chunk> aSurrounding = new AutoMap<>(); - Chunk aThisChunk = this.getBaseMetaTileEntity().getWorld().getChunkFromBlockCoords( - this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getZCoord()); + Chunk aThisChunk = this.getBaseMetaTileEntity() + .getWorld() + .getChunkFromBlockCoords( + this.getBaseMetaTileEntity() + .getXCoord(), + this.getBaseMetaTileEntity() + .getZCoord()); int mainChunkX = aThisChunk.xPosition; int mainChunkZ = aThisChunk.zPosition; - World aWorld = this.getBaseMetaTileEntity().getWorld(); - int xPos = this.getBaseMetaTileEntity().getXCoord(); - int zPos = this.getBaseMetaTileEntity().getZCoord(); + World aWorld = this.getBaseMetaTileEntity() + .getWorld(); + int xPos = this.getBaseMetaTileEntity() + .getXCoord(); + int zPos = this.getBaseMetaTileEntity() + .getZCoord(); Chunk a1 = aWorld.getChunkFromBlockCoords(xPos - 32, zPos - 32); Chunk a2 = aWorld.getChunkFromBlockCoords(xPos - 32, zPos); @@ -624,11 +636,11 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi } Logger.INFO( - "Trying to remove pollution from chunk " + r.xPosition - + ", " - + r.zPosition - + " | " - + startPollution); + "Trying to remove pollution from chunk " + r.xPosition + + ", " + + r.zPosition + + " | " + + startPollution); int after = 0; boolean isMainChunk = r.isAtLocation(mainChunkX, mainChunkZ); @@ -643,13 +655,13 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi totalRemoved += (startPollution - after); } Logger.INFO( - "Removed " + (startPollution - after) - + " pollution from chunk " - + r.xPosition - + ", " - + r.zPosition - + " | " - + after); + "Removed " + (startPollution - after) + + " pollution from chunk " + + r.xPosition + + ", " + + r.zPosition + + " | " + + after); } return totalRemoved > 0 && chunksWithRemoval > 0; } @@ -727,7 +739,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi return true; } if (aStack.getItem() instanceof GT_MetaGenerated_Tool && aStack.getItemDamage() >= 170 - && aStack.getItemDamage() <= 179) { + && aStack.getItemDamage() <= 179) { return true; } } @@ -744,7 +756,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi public void doSound(byte aIndex, double aX, double aY, double aZ) { if (aIndex == -120) { GT_Utility - .doSoundAtClient(SoundResource.IC2_TOOLS_BATTERY_USE, MathUtils.randInt(5, 50), 0.05F, aX, aY, aZ); + .doSoundAtClient(SoundResource.IC2_TOOLS_BATTERY_USE, MathUtils.randInt(5, 50), 0.05F, aX, aY, aZ); } else { super.doSound((byte) 0, aX, aY, aZ); } @@ -764,7 +776,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); reduction += (((Math.max((tTier - 2), 1) * 2) * 50) * mAirSides); reduction = (MathUtils.safeInt((long) reduction * this.mBaseEff) / 100000) * mAirSides - * Math.max((tTier - 2), 1); + * Math.max((tTier - 2), 1); reduction = MathUtils.safeInt(((long) reduction / 100) * this.mOptimalAirFlow); aTooltipSuper.put("Maximum pollution removed per second: " + reduction); @@ -813,19 +825,11 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi if (sGregTurbines == null) { sGregTurbines = new ItemStack[3]; sGregTurbines[0] = GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01") - .getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE_SMALL, 1, Materials.Iron, Materials.Iron, null); - sGregTurbines[1] = GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats( - GT_MetaGenerated_Tool_01.TURBINE_SMALL, - 1, - Materials.Bronze, - Materials.Bronze, - null); - sGregTurbines[2] = GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats( - GT_MetaGenerated_Tool_01.TURBINE_SMALL, - 1, - Materials.Steel, - Materials.Steel, - null); + .getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE_SMALL, 1, Materials.Iron, Materials.Iron, null); + sGregTurbines[1] = GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01") + .getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE_SMALL, 1, Materials.Bronze, Materials.Bronze, null); + sGregTurbines[2] = GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01") + .getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE_SMALL, 1, Materials.Steel, Materials.Steel, null); } else { return sGregTurbines[aTier]; } @@ -838,7 +842,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi return getBaseEfficiency(getTieredTurbine(aStackRotor.getItemDamage())); } return (int) ((50.0F - + (10.0F * ((GT_MetaGenerated_Tool) aStackRotor.getItem()).getToolCombatDamage(aStackRotor))) * 100); + + (10.0F * ((GT_MetaGenerated_Tool) aStackRotor.getItem()).getToolCombatDamage(aStackRotor))) * 100); } public int getOptimalAirFlow(ItemStack aStackRotor) { @@ -846,10 +850,9 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi return getOptimalAirFlow(getTieredTurbine(aStackRotor.getItemDamage())); } return (int) Math.max( - Float.MIN_NORMAL, - ((GT_MetaGenerated_Tool) aStackRotor.getItem()).getToolStats(aStackRotor).getSpeedMultiplier() - * GT_MetaGenerated_Tool.getPrimaryMaterial(aStackRotor).mToolSpeed - * 50); + Float.MIN_NORMAL, + ((GT_MetaGenerated_Tool) aStackRotor.getItem()).getToolStats(aStackRotor) + .getSpeedMultiplier() * GT_MetaGenerated_Tool.getPrimaryMaterial(aStackRotor).mToolSpeed * 50); } @Override @@ -864,26 +867,27 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi return true; } return stack.getItem() instanceof GT_MetaGenerated_Tool && stack.getItemDamage() >= 170 - && stack.getItemDamage() <= 179; - }).setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_TURBINE).setPos(52, 24)) - .widget( - new SlotWidget(inventoryHandler, SLOT_FILTER) - .setFilter(stack -> stack.getItem() instanceof ItemAirFilter) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_RECYCLE) - .setPos(106, 24)) - .widget( - new SlotWidget(inventoryHandler, 7) - .setFilter(stack -> GT_Utility.areStacksEqual(stack, CI.getConveyor(mTier, 1), true)) - .setPos(124, 62)); + && stack.getItemDamage() <= 179; + }) + .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_TURBINE) + .setPos(52, 24)) + .widget( + new SlotWidget(inventoryHandler, SLOT_FILTER) + .setFilter(stack -> stack.getItem() instanceof ItemAirFilter) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_RECYCLE) + .setPos(106, 24)) + .widget( + new SlotWidget(inventoryHandler, 7) + .setFilter(stack -> GT_Utility.areStacksEqual(stack, CI.getConveyor(mTier, 1), true)) + .setPos(124, 62)); builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_INFORMATION) - .dynamicTooltip(() -> Collections.singletonList("Reduction: " + mPollutionReduction + "/s")) - .attachSyncer( - new FakeSyncWidget.IntegerSyncer( - () -> mPollutionReduction, - val -> mPollutionReduction = val), - builder, - (widget, val) -> widget.notifyTooltipChange()) - .setPos(163, 5).setSize(7, 18)); + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_INFORMATION) + .dynamicTooltip(() -> Collections.singletonList("Reduction: " + mPollutionReduction + "/s")) + .attachSyncer( + new FakeSyncWidget.IntegerSyncer(() -> mPollutionReduction, val -> mPollutionReduction = val), + builder, + (widget, val) -> widget.notifyTooltipChange()) + .setPos(163, 5) + .setSize(7, 18)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java index 2e59750e08..d7b6b8fffd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java @@ -27,12 +27,12 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { private int mSecondTimer = 0; public GregtechMetaPollutionCreator(final int aID, final String aName, final String aNameRegional, final int aTier, - final String aDescription, final int aSlotCount) { + final String aDescription, final int aSlotCount) { super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); } public GregtechMetaPollutionCreator(final String aName, final int aTier, final String aDescription, - final ITexture[][][] aTextures, final int aSlotCount) { + final ITexture[][][] aTextures, final int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } @@ -61,62 +61,60 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { - return this.mTextures[(aActive ? 5 : 0) - + (side == facing ? 0 - : side == facing.getOpposite() ? 1 - : side == ForgeDirection.DOWN ? 2 : side == ForgeDirection.UP ? 3 : 4)][aColorIndex - + 1]; + final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (side == facing ? 0 + : side == facing.getOpposite() ? 1 + : side == ForgeDirection.DOWN ? 2 : side == ForgeDirection.UP ? 3 : 4)][aColorIndex + 1]; } public ITexture[] getFront(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) }; } public ITexture[] getBack(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getBottom(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getTop(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getSides(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getFrontActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) }; } public ITexture[] getBackActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getBottomActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getTopActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getSidesActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } @Override @@ -133,11 +131,11 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMetaPollutionCreator( - this.mName, - this.mTier, - this.mDescription, - this.mTextures, - this.mInventory.length); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mInventory.length); } @Override @@ -172,12 +170,14 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { @Override public boolean isInputFacing(final ForgeDirection side) { - return side != this.getBaseMetaTileEntity().getFrontFacing(); + return side != this.getBaseMetaTileEntity() + .getFrontFacing(); } @Override public boolean isOutputFacing(final ForgeDirection side) { - return side == this.getBaseMetaTileEntity().getFrontFacing(); + return side == this.getBaseMetaTileEntity() + .getFrontFacing(); } @Override @@ -242,12 +242,14 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { @Override public int getProgresstime() { - return (int) this.getBaseMetaTileEntity().getUniversalEnergyStored(); + return (int) this.getBaseMetaTileEntity() + .getUniversalEnergyStored(); } @Override public int maxProgresstime() { - return (int) this.getBaseMetaTileEntity().getUniversalEnergyCapacity(); + return (int) this.getBaseMetaTileEntity() + .getUniversalEnergyCapacity(); } @Override @@ -272,7 +274,7 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { } else { addPollution(); PlayerUtils - .messagePlayer(playerIn, "This chunk now contains " + getCurrentChunkPollution() + " pollution."); + .messagePlayer(playerIn, "This chunk now contains " + getCurrentChunkPollution() + " pollution."); // PlayerUtils.messagePlayer(playerIn, "Average over last ten minutes: "+getAveragePollutionOverLastTen()+" // pollution."); } @@ -285,13 +287,13 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { @Override public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { + final ForgeDirection side, final ItemStack aStack) { return false; } @Override public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { + final ForgeDirection side, final ItemStack aStack) { return false; } @@ -306,7 +308,7 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { @Override public String[] getInfoData() { return new String[] { this.getLocalName(), "Current Pollution: " + this.mCurrentPollution, - "Average/10 minutes:" + getAveragePollutionOverLastTen() }; + "Average/10 minutes:" + getAveragePollutionOverLastTen() }; } @Override @@ -407,7 +409,8 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { @Override public void onFirstTick(final IGregTechTileEntity aBaseMetaTileEntity) { - if (this.getBaseMetaTileEntity().isServerSide()) { + if (this.getBaseMetaTileEntity() + .isServerSide()) { if (this.mCurrentPollution == 0) { this.mCurrentPollution = getCurrentChunkPollution(); } @@ -421,7 +424,8 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { @Override public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (this.getBaseMetaTileEntity().isServerSide()) { + if (this.getBaseMetaTileEntity() + .isServerSide()) { // TickTimer - 20 times a second this.mTickTimer++; if (mTickTimer % 20 == 0) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java index c4b93a83b7..92443d2658 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java @@ -30,30 +30,29 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { private long mRedstoneLevel = 0; public GregtechMetaPollutionDetector(final int aID, final String aName, final String aNameRegional, final int aTier, - final String aDescription, final int aSlotCount) { + final String aDescription, final int aSlotCount) { super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); } public GregtechMetaPollutionDetector(final String aName, final int aTier, final String aDescription, - final ITexture[][][] aTextures, final int aSlotCount) { + final ITexture[][][] aTextures, final int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } @Override public String[] getDescription() { return new String[] { this.mDescription, "Right click to check pollution levels.", - "Configure with screwdriver to set redstone output amount.", "Does not use power.", - CORE.GT_Tooltip.get() }; + "Configure with screwdriver to set redstone output amount.", "Does not use power.", CORE.GT_Tooltip.get() }; } @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { + final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { return side == facing - ? new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency) } - : new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), - new GT_RenderedTexture(Textures.BlockIcons.VOID) }; + ? new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency) } + : new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), + new GT_RenderedTexture(Textures.BlockIcons.VOID) }; } @Override @@ -83,62 +82,62 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { public ITexture[] getFront(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) }; } public ITexture[] getBack(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getBottom(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getTop(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getSides(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getFrontActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) }; } public ITexture[] getBackActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getBottomActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getTopActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getSidesActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMetaPollutionDetector( - this.mName, - this.mTier, - this.mDescription, - this.mTextures, - this.mInventory.length); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mInventory.length); } @Override @@ -173,12 +172,14 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { @Override public boolean isInputFacing(final ForgeDirection side) { - return side != this.getBaseMetaTileEntity().getFrontFacing(); + return side != this.getBaseMetaTileEntity() + .getFrontFacing(); } @Override public boolean isOutputFacing(final ForgeDirection side) { - return side == this.getBaseMetaTileEntity().getFrontFacing(); + return side == this.getBaseMetaTileEntity() + .getFrontFacing(); } @Override @@ -243,12 +244,14 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { @Override public int getProgresstime() { - return (int) this.getBaseMetaTileEntity().getUniversalEnergyStored(); + return (int) this.getBaseMetaTileEntity() + .getUniversalEnergyStored(); } @Override public int maxProgresstime() { - return (int) this.getBaseMetaTileEntity().getUniversalEnergyCapacity(); + return (int) this.getBaseMetaTileEntity() + .getUniversalEnergyCapacity(); } @Override @@ -276,13 +279,13 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { @Override public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { + final ForgeDirection side, final ItemStack aStack) { return false; } @Override public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { + final ForgeDirection side, final ItemStack aStack) { return false; } @@ -297,8 +300,7 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { @Override public String[] getInfoData() { return new String[] { this.getLocalName(), "Current Pollution: " + this.mCurrentPollution, - "Average/10 Sec: " + this.mAveragePollution, - "Emit Redstone at pollution level: " + this.mRedstoneLevel }; + "Average/10 Sec: " + this.mAveragePollution, "Emit Redstone at pollution level: " + this.mRedstoneLevel }; } @Override @@ -405,7 +407,8 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { } public boolean allowCoverOnSide(final ForgeDirection side, final int aCoverID) { - return side != this.getBaseMetaTileEntity().getFrontFacing(); + return side != this.getBaseMetaTileEntity() + .getFrontFacing(); } @Override @@ -413,18 +416,21 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { super.onPostTick(aBaseMetaTileEntity, aTick); // Only Calc server-side - if (!this.getBaseMetaTileEntity().isServerSide()) { + if (!this.getBaseMetaTileEntity() + .isServerSide()) { return; } // Emit Redstone if (this.getCurrentChunkPollution() >= this.mRedstoneLevel) { for (final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { - this.getBaseMetaTileEntity().setStrongOutputRedstoneSignal(side, (byte) 16); + this.getBaseMetaTileEntity() + .setStrongOutputRedstoneSignal(side, (byte) 16); } this.markDirty(); } else { for (final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { - this.getBaseMetaTileEntity().setStrongOutputRedstoneSignal(side, (byte) 0); + this.getBaseMetaTileEntity() + .setStrongOutputRedstoneSignal(side, (byte) 0); } this.markDirty(); } @@ -449,7 +455,8 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { @Override public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (side == this.getBaseMetaTileEntity().getFrontFacing()) { + if (side == this.getBaseMetaTileEntity() + .getFrontFacing()) { final float[] tCoords = GT_Utility.getClickedFacingCoords(side, aX, aY, aZ); switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) { case 0 -> this.mRedstoneLevel -= 5000; @@ -475,7 +482,7 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, ForgeDirection side, - float aX, float aY, float aZ) { + float aX, float aY, float aZ) { return super.onRightclick(aBaseMetaTileEntity, aPlayer, side, aX, aY, aZ); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java index 80a0aff5ee..751771f2b4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java @@ -32,22 +32,22 @@ public class GregtechMetaTileEntity_AutoChisel extends GT_MetaTileEntity_BasicMa public GregtechMetaTileEntity_AutoChisel(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 1, - "Chisels things, Gregtech style", - 1, - 1, - new ITexture[] { new GT_RenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), - new GT_RenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB), - new GT_RenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE), - new GT_RenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER), - new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active), - new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab), - new GT_RenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), - new GT_RenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB) }); + aID, + aName, + aNameRegional, + aTier, + 1, + "Chisels things, Gregtech style", + 1, + 1, + new ITexture[] { new GT_RenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), + new GT_RenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB), + new GT_RenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE), + new GT_RenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER), + new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active), + new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab), + new GT_RenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), + new GT_RenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB) }); } public GregtechMetaTileEntity_AutoChisel(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { @@ -62,16 +62,16 @@ public class GregtechMetaTileEntity_AutoChisel extends GT_MetaTileEntity_BasicMa @Override public String[] getDescription() { return ArrayUtils.addAll( - this.mDescriptionArray, - "What you want to chisel goes in slot 1", - "What you want to get goes in the special slot (bottom right)", - "If special slot is empty, first chisel result is used"); + this.mDescriptionArray, + "What you want to chisel goes in slot 1", + "What you want to get goes in the special slot (bottom right)", + "If special slot is empty, first chisel result is used"); } private boolean hasValidCache(ItemStack aStack, ItemStack aSpecialSlot, boolean aClearOnFailure) { if (mInputCache != null && mOutputCache != null) { if (GT_Utility.areStacksEqual(aStack, mInputCache) - && GT_Utility.areStacksEqual(aSpecialSlot, mOutputCache)) { + && GT_Utility.areStacksEqual(aSpecialSlot, mOutputCache)) { return true; } } @@ -90,9 +90,9 @@ public class GregtechMetaTileEntity_AutoChisel extends GT_MetaTileEntity_BasicMa @Override protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { + ItemStack aStack) { return hasValidCache(aStack, this.getSpecialSlot(), false) ? true - : super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, side, aStack) && hasChiselResults(aStack); + : super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, side, aStack) && hasChiselResults(aStack); } // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target @@ -167,22 +167,24 @@ public class GregtechMetaTileEntity_AutoChisel extends GT_MetaTileEntity_BasicMa } private static final FallbackableUITexture progressBarTexture = GT_UITextures - .fallbackableProgressbar("auto_chisel", GT_UITextures.PROGRESSBAR_COMPRESS); + .fallbackableProgressbar("auto_chisel", GT_UITextures.PROGRESSBAR_COMPRESS); @Override protected BasicUIProperties getUIProperties() { - return super.getUIProperties().toBuilder().progressBarTexture(progressBarTexture).build(); + return super.getUIProperties().toBuilder() + .progressBarTexture(progressBarTexture) + .build(); } @Override protected SlotWidget createItemInputSlot(int index, IDrawable[] backgrounds, Pos2d pos) { return (SlotWidget) super.createItemInputSlot(index, backgrounds, pos) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_COMPRESSOR); + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_COMPRESSOR); } @Override protected SlotWidget createSpecialSlot(IDrawable[] backgrounds, Pos2d pos, BasicUIProperties uiProperties) { return (SlotWidget) super.createSpecialSlot(backgrounds, pos, uiProperties) - .setGTTooltip(() -> mTooltipCache.getData("GTPP.machines.chisel_slot.tooltip")); + .setGTTooltip(() -> mTooltipCache.getData("GTPP.machines.chisel_slot.tooltip")); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java index bd0cf2e098..b1289958a9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java @@ -33,25 +33,24 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { public boolean mLocked = true; public GregtechMetaWirelessCharger(final int aID, final String aName, final String aNameRegional, final int aTier, - final String aDescription, final int aSlotCount) { + final String aDescription, final int aSlotCount) { super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); } public GregtechMetaWirelessCharger(final String aName, final int aTier, final String aDescription, - final ITexture[][][] aTextures, final int aSlotCount) { + final ITexture[][][] aTextures, final int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } @Override public String[] getDescription() { return new String[] { this.mDescription, "Can be locked to the owner by sneaking with a screwdriver", - "Can also be locked with a lock upgrade", "", "3 Modes, Long-Range, Local and Mixed.", - "Long-Range: Can supply 2A of power to a single player up to " + (GT_Values.V[this.mTier] * 4) - + "m away.", - "Local: Can supply several Amps to each player within " + this.mTier * 20 + "m.", - "Mixed: Provides both 2A of long range and 1A per player locally.", - "Mixed mode is more conservative of power and as a result only", - "Gets half the distances each singular mode gets.", CORE.GT_Tooltip.get() }; + "Can also be locked with a lock upgrade", "", "3 Modes, Long-Range, Local and Mixed.", + "Long-Range: Can supply 2A of power to a single player up to " + (GT_Values.V[this.mTier] * 4) + "m away.", + "Local: Can supply several Amps to each player within " + this.mTier * 20 + "m.", + "Mixed: Provides both 2A of long range and 1A per player locally.", + "Mixed mode is more conservative of power and as a result only", + "Gets half the distances each singular mode gets.", CORE.GT_Tooltip.get() }; } public int getTier() { @@ -94,62 +93,60 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { - return this.mTextures[(aActive ? 5 : 0) - + (side == facing ? 0 - : side == facing.getOpposite() ? 1 - : side == ForgeDirection.DOWN ? 2 : side == ForgeDirection.UP ? 3 : 4)][aColorIndex - + 1]; + final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (side == facing ? 0 + : side == facing.getOpposite() ? 1 + : side == ForgeDirection.DOWN ? 2 : side == ForgeDirection.UP ? 3 : 4)][aColorIndex + 1]; } public ITexture[] getFront(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) }; } public ITexture[] getBack(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getBottom(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getTop(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getSides(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getFrontActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) }; } public ITexture[] getBackActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getBottomActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getTopActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getSidesActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } @Override @@ -163,8 +160,10 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { mWirelessChargingMap.clear(); mLocalChargingMap.clear(); - if (!this.getBaseMetaTileEntity().getWorld().playerEntities.isEmpty()) { - for (Object mTempPlayer : this.getBaseMetaTileEntity().getWorld().playerEntities) { + if (!this.getBaseMetaTileEntity() + .getWorld().playerEntities.isEmpty()) { + for (Object mTempPlayer : this.getBaseMetaTileEntity() + .getWorld().playerEntities) { if (mTempPlayer instanceof EntityPlayer || mTempPlayer instanceof EntityPlayerMP) { EntityPlayer mTemp = (EntityPlayer) mTempPlayer; ChargingHelper.removeValidPlayer(mTemp, this); @@ -190,11 +189,11 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMetaWirelessCharger( - this.mName, - this.mTier, - this.mDescription, - this.mTextures, - this.mInventory.length); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mInventory.length); } @Override @@ -229,12 +228,14 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { @Override public boolean isInputFacing(final ForgeDirection side) { - return side != this.getBaseMetaTileEntity().getFrontFacing(); + return side != this.getBaseMetaTileEntity() + .getFrontFacing(); } @Override public boolean isOutputFacing(final ForgeDirection side) { - return side == this.getBaseMetaTileEntity().getFrontFacing(); + return side == this.getBaseMetaTileEntity() + .getFrontFacing(); } @Override @@ -305,12 +306,14 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { @Override public int getProgresstime() { - return (int) this.getBaseMetaTileEntity().getUniversalEnergyStored(); + return (int) this.getBaseMetaTileEntity() + .getUniversalEnergyStored(); } @Override public int maxProgresstime() { - return (int) this.getBaseMetaTileEntity().getUniversalEnergyCapacity(); + return (int) this.getBaseMetaTileEntity() + .getUniversalEnergyCapacity(); } @Override @@ -328,13 +331,13 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { @Override public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { + final ForgeDirection side, final ItemStack aStack) { return false; } @Override public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { + final ForgeDirection side, final ItemStack aStack) { return false; } @@ -452,7 +455,8 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { private boolean isValidPlayer(EntityPlayer aPlayer) { BaseMetaTileEntity aTile = (BaseMetaTileEntity) this.getBaseMetaTileEntity(); if (mLocked || (aTile != null && aTile.privateAccess())) { - if (aPlayer.getUniqueID().equals(getBaseMetaTileEntity().getOwnerUuid())) { + if (aPlayer.getUniqueID() + .equals(getBaseMetaTileEntity().getOwnerUuid())) { return true; } else { return false; @@ -464,7 +468,8 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { @Override public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (this.getBaseMetaTileEntity().isServerSide()) { + if (this.getBaseMetaTileEntity() + .isServerSide()) { if (this.mCurrentDimension != aBaseMetaTileEntity.getWorld().provider.dimensionId) { this.mCurrentDimension = aBaseMetaTileEntity.getWorld().provider.dimensionId; @@ -484,9 +489,9 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { if (this.mMode == 1 || this.mMode == 2) { int tempRange = (this.mMode == 1 ? this.mTier * 20 : this.mTier * 10); if (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp)) - < tempRange) { + < tempRange) { if (isValidPlayer(mTemp) - && !mLocalChargingMap.containsKey(mTemp.getDisplayName())) { + && !mLocalChargingMap.containsKey(mTemp.getDisplayName())) { mLocalChargingMap.put(mTemp.getDisplayName(), mTemp.getPersistentID()); ChargingHelper.addValidPlayer(mTemp, this); // PlayerUtils.messagePlayer(mTemp, "You have entered charging range. @@ -504,25 +509,24 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { } if (this.mMode == 0 || this.mMode == 2) { int tempRange = (int) (this.mMode == 0 ? 4 * GT_Values.V[this.mTier] - : 2 * GT_Values.V[this.mTier]); + : 2 * GT_Values.V[this.mTier]); if (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp)) - <= tempRange) { + <= tempRange) { if (!mWirelessChargingMap.containsKey(mTemp.getDisplayName())) { if (isValidPlayer(mTemp)) { mWirelessChargingMap.put(mTemp.getDisplayName(), mTemp.getPersistentID()); ChargingHelper.addValidPlayer(mTemp, this); PlayerUtils.messagePlayer( - mTemp, - "You have entered charging range. [" + tempRange - + "m - Long-Range]."); + mTemp, + "You have entered charging range. [" + tempRange + "m - Long-Range]."); } } } else { if (mWirelessChargingMap.containsKey(mTemp.getDisplayName())) { if (mWirelessChargingMap.remove(mTemp.getDisplayName()) != null) { PlayerUtils.messagePlayer( - mTemp, - "You have left charging range. [" + tempRange + "m - Long Range]."); + mTemp, + "You have left charging range. [" + tempRange + "m - Long Range]."); ChargingHelper.removeValidPlayer(mTemp, this); } } @@ -551,10 +555,14 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { public BlockPos getTileEntityPosition() { return new BlockPos( - this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getYCoord(), - this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld()); + this.getBaseMetaTileEntity() + .getXCoord(), + this.getBaseMetaTileEntity() + .getYCoord(), + this.getBaseMetaTileEntity() + .getZCoord(), + this.getBaseMetaTileEntity() + .getWorld()); } public BlockPos getPositionOfEntity(Entity mEntity) { @@ -572,9 +580,9 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { int[] objectArray2 = new int[] { objectB.xPos, objectB.yPos, objectB.zPos }; final double distance = Math.sqrt( - (objectArray2[0] - objectArray1[0]) * (objectArray2[0] - objectArray1[0]) - + (objectArray2[1] - objectArray1[1]) * (objectArray2[1] - objectArray1[1]) - + (objectArray2[2] - objectArray1[2]) * (objectArray2[2] - objectArray1[2])); + (objectArray2[0] - objectArray1[0]) * (objectArray2[0] - objectArray1[0]) + + (objectArray2[1] - objectArray1[1]) * (objectArray2[1] - objectArray1[1]) + + (objectArray2[2] - objectArray1[2]) * (objectArray2[2] - objectArray1[2])); return distance; } @@ -585,8 +593,10 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { mWirelessChargingMap.clear(); mLocalChargingMap.clear(); - if (!this.getBaseMetaTileEntity().getWorld().playerEntities.isEmpty()) { - for (Object mTempPlayer : this.getBaseMetaTileEntity().getWorld().playerEntities) { + if (!this.getBaseMetaTileEntity() + .getWorld().playerEntities.isEmpty()) { + for (Object mTempPlayer : this.getBaseMetaTileEntity() + .getWorld().playerEntities) { if (mTempPlayer instanceof EntityPlayer || mTempPlayer instanceof EntityPlayerMP) { EntityPlayer mTemp = (EntityPlayer) mTempPlayer; ChargingHelper.removeValidPlayer(mTemp, this); @@ -599,7 +609,7 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, ForgeDirection side, - float aX, float aY, float aZ) { + float aX, float aY, float aZ) { int tempRange; @@ -611,25 +621,29 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { if (this.mMode == 2) { PlayerUtils - .messagePlayer(aPlayer, "Mixed Mode | Local: " + this.mTier * 10 + "m | Long: " + tempRange + "m"); + .messagePlayer(aPlayer, "Mixed Mode | Local: " + this.mTier * 10 + "m | Long: " + tempRange + "m"); PlayerUtils.messagePlayer(aPlayer, "Players with access:"); - for (String name : this.getLocalMap().keySet()) { + for (String name : this.getLocalMap() + .keySet()) { PlayerUtils.messagePlayer(aPlayer, "Local: " + name); } - for (String name : this.getLongRangeMap().keySet()) { + for (String name : this.getLongRangeMap() + .keySet()) { PlayerUtils.messagePlayer(aPlayer, "Long: " + name); } } else if (this.mMode == 1) { PlayerUtils.messagePlayer(aPlayer, "Local Mode: " + this.mTier * 20 + "m"); PlayerUtils.messagePlayer(aPlayer, "Players with access:"); - for (String name : this.getLocalMap().keySet()) { + for (String name : this.getLocalMap() + .keySet()) { PlayerUtils.messagePlayer(aPlayer, "" + name); } } else { PlayerUtils.messagePlayer(aPlayer, "Long-range Mode: " + tempRange + "m"); PlayerUtils.messagePlayer(aPlayer, "Players with access:"); - for (String name : this.getLongRangeMap().keySet()) { + for (String name : this.getLongRangeMap() + .keySet()) { PlayerUtils.messagePlayer(aPlayer, "" + name); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java index 23e942737c..0e71c3b9b1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java @@ -32,7 +32,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_AmazonPackager> - implements ISurvivalConstructable { + implements ISurvivalConstructable { private int mCasing; @@ -60,18 +60,18 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_Amazon public IStructureDefinition<GMTE_AmazonPackager> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GMTE_AmazonPackager>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, - { "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GMTE_AmazonPackager.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(TAE.getIndexFromPage(2, 9)).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 9)))) - .build(); + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, { "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GMTE_AmazonPackager.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) + .casingIndex(TAE.getIndexFromPage(2, 9)) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 9)))) + .build(); } return STRUCTURE_DEFINITION; } @@ -79,17 +79,26 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_Amazon @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Amazon Warehouse") - .addInfo("This Multiblock is used for EXTREME packaging requirements") - .addInfo("Dust Schematics are inserted into the input busses") - .addInfo("If inserted into the controller, it is shared across all busses") - .addInfo("1x, 2x, 3x & Other Schematics are to be placed into the controller GUI slot") - .addInfo("500% faster than using single block machines of the same voltage") - .addInfo("Only uses 75% of the EU/t normally required").addInfo("Processes 16 items per voltage tier") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true) - .addController("Front center").addCasingInfoMin("Supply Depot Casings", 10, false) - .addInputBus("Any casing", 1).addOutputBus("Any casing", 1).addEnergyHatch("Any casing", 1) - .addMaintenanceHatch("Any casing", 1).addMufflerHatch("Any casing", 1).toolTipFinisher("GT++"); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Amazon Warehouse") + .addInfo("This Multiblock is used for EXTREME packaging requirements") + .addInfo("Dust Schematics are inserted into the input busses") + .addInfo("If inserted into the controller, it is shared across all busses") + .addInfo("1x, 2x, 3x & Other Schematics are to be placed into the controller GUI slot") + .addInfo("500% faster than using single block machines of the same voltage") + .addInfo("Only uses 75% of the EU/t normally required") + .addInfo("Processes 16 items per voltage tier") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfoMin("Supply Depot Casings", 10, false) + .addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1) + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addMufflerHatch("Any casing", 1) + .toolTipFinisher("GT++"); return tt; } @@ -115,8 +124,9 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_Amazon @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setSpeedBonus(1F / 6F).setEuModifier(0.75F) - .setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setSpeedBonus(1F / 6F) + .setEuModifier(0.75F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java index 0ba3e569cc..e5d138dfda 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java @@ -38,7 +38,7 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; public class GregtechMetaTileEntity_IndustrialAlloySmelter extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialAlloySmelter> implements ISurvivalConstructable { + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialAlloySmelter> implements ISurvivalConstructable { public static int CASING_TEXTURE_ID; private HeatingCoilLevel mHeatingCapacity; @@ -114,17 +114,25 @@ public class GregtechMetaTileEntity_IndustrialAlloySmelter extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Alloy Smelter") - .addInfo("Gains one parallel per voltage tier").addInfo("Gains one multiplier per coil tier") - .addInfo("Parallel = Tier * Coil Tier").addInfo("Gains 5% speed bonus per coil tier") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 5, 3, true) - .addController("Bottom center").addCasingInfoMin("Inconel Reinforced Casings", 8, false) - .addOtherStructurePart("Integral Encasement V", "Middle Layer") - .addOtherStructurePart("Heating Coils", "Above and below Integral Encasements") - .addInputBus("Any Inconel Reinforced Casing", 1).addOutputBus("Any Inconel Reinforced Casing", 1) - .addEnergyHatch("Any Inconel Reinforced Casing", 1) - .addMaintenanceHatch("Any Inconel Reinforced Casing", 1) - .addMufflerHatch("Any Inconel Reinforced Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Industrial Alloy Smelter") + .addInfo("Gains one parallel per voltage tier") + .addInfo("Gains one multiplier per coil tier") + .addInfo("Parallel = Tier * Coil Tier") + .addInfo("Gains 5% speed bonus per coil tier") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 5, 3, true) + .addController("Bottom center") + .addCasingInfoMin("Inconel Reinforced Casings", 8, false) + .addOtherStructurePart("Integral Encasement V", "Middle Layer") + .addOtherStructurePart("Heating Coils", "Above and below Integral Encasements") + .addInputBus("Any Inconel Reinforced Casing", 1) + .addOutputBus("Any Inconel Reinforced Casing", 1) + .addEnergyHatch("Any Inconel Reinforced Casing", 1) + .addMaintenanceHatch("Any Inconel Reinforced Casing", 1) + .addMufflerHatch("Any Inconel Reinforced Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -132,24 +140,25 @@ public class GregtechMetaTileEntity_IndustrialAlloySmelter extends public IStructureDefinition<GregtechMetaTileEntity_IndustrialAlloySmelter> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialAlloySmelter>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "HHH", "H-H", "HHH" }, - { "VVV", "V-V", "VVV" }, { "HHH", "H-H", "HHH" }, - { "C~C", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_IndustrialAlloySmelter.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(CASING_TEXTURE_ID).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 1)))) - .addElement( - 'H', - ofCoil( - GregtechMetaTileEntity_IndustrialAlloySmelter::setCoilLevel, - GregtechMetaTileEntity_IndustrialAlloySmelter::getCoilLevel)) - .addElement('V', ofBlock(ModBlocks.blockCasingsTieredGTPP, 4)).build(); + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "HHH", "H-H", "HHH" }, { "VVV", "V-V", "VVV" }, + { "HHH", "H-H", "HHH" }, { "C~C", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_IndustrialAlloySmelter.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) + .casingIndex(CASING_TEXTURE_ID) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 1)))) + .addElement( + 'H', + ofCoil( + GregtechMetaTileEntity_IndustrialAlloySmelter::setCoilLevel, + GregtechMetaTileEntity_IndustrialAlloySmelter::getCoilLevel)) + .addElement('V', ofBlock(ModBlocks.blockCasingsTieredGTPP, 4)) + .build(); } return STRUCTURE_DEFINITION; } @@ -171,9 +180,9 @@ public class GregtechMetaTileEntity_IndustrialAlloySmelter extends mLevel = 0; setCoilLevel(HeatingCoilLevel.None); return checkPiece(mName, 1, 4, 0) && mCasing >= 8 - && getCoilLevel() != HeatingCoilLevel.None - && (mLevel = getCoilLevel().getTier() + 1) > 0 - && checkHatch(); + && getCoilLevel() != HeatingCoilLevel.None + && (mLevel = getCoilLevel().getTier() + 1) > 0 + && checkHatch(); } @Override @@ -189,11 +198,12 @@ public class GregtechMetaTileEntity_IndustrialAlloySmelter extends @Override protected GT_OverclockCalculator createOverclockCalculator(@NotNull GT_Recipe recipe) { return super.createOverclockCalculator(recipe).setSpeedBoost(100F / (100F + 5F * mLevel)) - .setHeatOC(true).setRecipeHeat(0) - // Need to multiply by 2 because heat OC is done only once every 1800 and this one does it once - // every - // 900 - .setMachineHeat((int) (getCoilLevel().getHeat() * 2)); + .setHeatOC(true) + .setRecipeHeat(0) + // Need to multiply by 2 because heat OC is done only once every 1800 and this one does it once + // every + // 900 + .setMachineHeat((int) (getCoilLevel().getHeat() * 2)); } }.setMaxParallelSupplier(this::getMaxParallelRecipes); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java index 8ecd7548b7..c27422fb93 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java @@ -44,8 +44,8 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -public class GregtechMetaTileEntity_IndustrialArcFurnace extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialArcFurnace> implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialArcFurnace + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialArcFurnace> implements ISurvivalConstructable { // 862 private static final int mCasingTextureID = TAE.getIndexFromPage(3, 3); @@ -76,16 +76,26 @@ public class GregtechMetaTileEntity_IndustrialArcFurnace extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for Industrial Arc Furnace") - .addInfo("250% faster than using single block machines of the same voltage") - .addInfo("Processes 8 items per voltage tier * W/L") - .addInfo("Right-click controller with a Screwdriver to change modes") - .addInfo("Max Size required to process Plasma recipes").addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator().addController("Top center").addStructureInfo("Size: nxnx3 [WxHxL] (Hollow)") - .addStructureInfo("n can be 3, 5 or 7").addCasingInfoMin(mCasingName, 10, false) - .addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for Industrial Arc Furnace") + .addInfo("250% faster than using single block machines of the same voltage") + .addInfo("Processes 8 items per voltage tier * W/L") + .addInfo("Right-click controller with a Screwdriver to change modes") + .addInfo("Max Size required to process Plasma recipes") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .addController("Top center") + .addStructureInfo("Size: nxnx3 [WxHxL] (Hollow)") + .addStructureInfo("n can be 3, 5 or 7") + .addCasingInfoMin(mCasingName, 10, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -103,34 +113,29 @@ public class GregtechMetaTileEntity_IndustrialArcFurnace extends public IStructureDefinition<GregtechMetaTileEntity_IndustrialArcFurnace> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialArcFurnace>builder() - .addShape(STRUCTURE_PIECE_FRONT + 1, new String[][] { { "CCC", "C~C", "CCC" } }) - .addShape( - STRUCTURE_PIECE_FRONT + 2, - new String[][] { { "CCCCC", "C C", "C C", "C C", "CCCCC" } }) - .addShape( - STRUCTURE_PIECE_FRONT + 3, - new String[][] { - { "CCCCCCC", "C C", "C C", "C C", "C C", "C C", "CCCCCCC" }, }) - .addShape( - STRUCTURE_PIECE_REST + 1, - new String[][] { { "CCC", "C-C", "CCC" }, { "CCC", "CCC", "CCC" } }) - .addShape( - STRUCTURE_PIECE_REST + 2, - new String[][] { { "CCCCC", "C---C", "C---C", "C---C", "CCCCC" }, - { "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC" } }) - .addShape( - STRUCTURE_PIECE_REST + 3, - new String[][] { - { "CCCCCCC", "C-----C", "C-----C", "C-----C", "C-----C", "C-----C", "CCCCCCC" }, - { "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC" }, }) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_IndustrialArcFurnace.class) - .atLeast(InputBus, InputHatch, OutputBus, OutputHatch, Maintenance, Energy, Muffler) - .casingIndex(getCasingTextureIndex()).dot(1).allowOnly(ForgeDirection.NORTH) - .buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings4Misc, 3)))) - .build(); + .addShape(STRUCTURE_PIECE_FRONT + 1, new String[][] { { "CCC", "C~C", "CCC" } }) + .addShape(STRUCTURE_PIECE_FRONT + 2, new String[][] { { "CCCCC", "C C", "C C", "C C", "CCCCC" } }) + .addShape( + STRUCTURE_PIECE_FRONT + 3, + new String[][] { { "CCCCCCC", "C C", "C C", "C C", "C C", "C C", "CCCCCCC" }, }) + .addShape(STRUCTURE_PIECE_REST + 1, new String[][] { { "CCC", "C-C", "CCC" }, { "CCC", "CCC", "CCC" } }) + .addShape( + STRUCTURE_PIECE_REST + 2, + new String[][] { { "CCCCC", "C---C", "C---C", "C---C", "CCCCC" }, + { "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC" } }) + .addShape( + STRUCTURE_PIECE_REST + 3, + new String[][] { { "CCCCCCC", "C-----C", "C-----C", "C-----C", "C-----C", "C-----C", "CCCCCCC" }, + { "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC" }, }) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_IndustrialArcFurnace.class) + .atLeast(InputBus, InputHatch, OutputBus, OutputHatch, Maintenance, Energy, Muffler) + .casingIndex(getCasingTextureIndex()) + .dot(1) + .allowOnly(ForgeDirection.NORTH) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings4Misc, 3)))) + .build(); } return STRUCTURE_DEFINITION; } @@ -158,28 +163,28 @@ public class GregtechMetaTileEntity_IndustrialArcFurnace extends int built; for (int tier = 1; tier <= maxTier; tier++) { built = survivialBuildPiece( - STRUCTURE_PIECE_FRONT + tier, - stackSize, - tier, - tier, - 0, - elementBudget, - env, - false, - true); - if (built >= 0) return built; - } - - return survivialBuildPiece( - STRUCTURE_PIECE_REST + maxTier, + STRUCTURE_PIECE_FRONT + tier, stackSize, - maxTier, - maxTier, - -1, + tier, + tier, + 0, elementBudget, env, false, true); + if (built >= 0) return built; + } + + return survivialBuildPiece( + STRUCTURE_PIECE_REST + maxTier, + stackSize, + maxTier, + maxTier, + -1, + elementBudget, + env, + false, + true); } @Override @@ -236,7 +241,8 @@ public class GregtechMetaTileEntity_IndustrialArcFurnace extends @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setSpeedBonus(1F / 3.5F).setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setSpeedBonus(1F / 3.5F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override @@ -277,35 +283,35 @@ public class GregtechMetaTileEntity_IndustrialArcFurnace extends this.mPlasmaMode = !mPlasmaMode; if (mPlasmaMode) { PlayerUtils.messagePlayer( - aPlayer, - "[" + EnumChatFormatting.RED - + "MODE" - + EnumChatFormatting.RESET - + "] " - + EnumChatFormatting.LIGHT_PURPLE - + "Plasma" - + EnumChatFormatting.RESET); + aPlayer, + "[" + EnumChatFormatting.RED + + "MODE" + + EnumChatFormatting.RESET + + "] " + + EnumChatFormatting.LIGHT_PURPLE + + "Plasma" + + EnumChatFormatting.RESET); } else { PlayerUtils.messagePlayer( - aPlayer, - "[" + EnumChatFormatting.RED - + "MODE" - + EnumChatFormatting.RESET - + "] " - + EnumChatFormatting.YELLOW - + "Electric" - + EnumChatFormatting.RESET); + aPlayer, + "[" + EnumChatFormatting.RED + + "MODE" + + EnumChatFormatting.RESET + + "] " + + EnumChatFormatting.YELLOW + + "Electric" + + EnumChatFormatting.RESET); } } else { PlayerUtils.messagePlayer( - aPlayer, - "[" + EnumChatFormatting.RED - + "MODE" - + EnumChatFormatting.RESET - + "] " - + EnumChatFormatting.GRAY - + "Cannot change mode, structure not large enough." - + EnumChatFormatting.RESET); + aPlayer, + "[" + EnumChatFormatting.RED + + "MODE" + + EnumChatFormatting.RESET + + "] " + + EnumChatFormatting.GRAY + + "Cannot change mode, structure not large enough." + + EnumChatFormatting.RESET); } mLastRecipe = null; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java index acb69536f2..c04620d4b4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java @@ -39,8 +39,8 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; -public class GregtechMetaTileEntity_IndustrialCentrifuge extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCentrifuge> implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialCentrifuge + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCentrifuge> implements ISurvivalConstructable { private boolean mIsAnimated; private static final CustomIcon frontFaceActive = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE5"); @@ -72,15 +72,25 @@ public class GregtechMetaTileEntity_IndustrialCentrifuge extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Centrifuge") - .addInfo("125% faster than using single block machines of the same voltage") - .addInfo("Disable animations with a screwdriver").addInfo("Only uses 90% of the EU/t normally required") - .addInfo("Processes six items per voltage tier").addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator().beginStructureBlock(3, 3, 3, true).addController("Front Center") - .addCasingInfoMin("Centrifuge Casings", 6, false).addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1).addOutputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Industrial Centrifuge") + .addInfo("125% faster than using single block machines of the same voltage") + .addInfo("Disable animations with a screwdriver") + .addInfo("Only uses 90% of the EU/t normally required") + .addInfo("Processes six items per voltage tier") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front Center") + .addCasingInfoMin("Centrifuge Casings", 6, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -88,18 +98,18 @@ public class GregtechMetaTileEntity_IndustrialCentrifuge extends public IStructureDefinition<GregtechMetaTileEntity_IndustrialCentrifuge> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialCentrifuge>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, - { "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_IndustrialCentrifuge.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) - .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 0)))) - .build(); + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, { "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_IndustrialCentrifuge.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) + .casingIndex(getCasingTextureIndex()) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 0)))) + .build(); } return STRUCTURE_DEFINITION; } @@ -147,8 +157,9 @@ public class GregtechMetaTileEntity_IndustrialCentrifuge extends @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setEuModifier(0.9F).setSpeedBonus(1F / 2.25F) - .setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setEuModifier(0.9F) + .setSpeedBonus(1F / 2.25F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java index f7c91835e9..a9f18dfce8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java @@ -46,7 +46,7 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import team.chisel.carving.Carving; public class GregtechMetaTileEntity_IndustrialChisel - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialChisel> implements ISurvivalConstructable { + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialChisel> implements ISurvivalConstructable { private int mCasing; @@ -77,40 +77,48 @@ public class GregtechMetaTileEntity_IndustrialChisel @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Factory Grade Auto Chisel") - .addInfo("Target block goes in Controller slot for common Input Buses") - .addInfo("You can also set a target block in each Chisel Input Bus and use them as an Input Bus") - .addInfo("If no target is provided for common buses, the result of the first chisel is used") - .addInfo("Speed: +200% | EU Usage: 75% | Parallel: Tier x 16") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true) - .addController("Front center").addCasingInfoMin("Sturdy Printer Casing", 6, false) - .addInputBus("Any casing", 1).addOutputBus("Any casing", 1).addEnergyHatch("Any casing", 1) - .addMaintenanceHatch("Any casing", 1).addMufflerHatch("Any casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Factory Grade Auto Chisel") + .addInfo("Target block goes in Controller slot for common Input Buses") + .addInfo("You can also set a target block in each Chisel Input Bus and use them as an Input Bus") + .addInfo("If no target is provided for common buses, the result of the first chisel is used") + .addInfo("Speed: +200% | EU Usage: 75% | Parallel: Tier x 16") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfoMin("Sturdy Printer Casing", 6, false) + .addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1) + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addMufflerHatch("Any casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @Override public IStructureDefinition<GregtechMetaTileEntity_IndustrialChisel> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition - .<GregtechMetaTileEntity_IndustrialChisel>builder().addShape( - mName, - transpose( - // spotless:off + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialChisel>builder() + .addShape( + mName, + transpose( + // spotless:off new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, { "CCC", "CCC", "CCC" }, })) // spotless:on - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_IndustrialChisel.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler).casingIndex(90).dot(1) - .buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings5Misc, 5)))) - .build(); + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_IndustrialChisel.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) + .casingIndex(90) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings5Misc, 5)))) + .build(); } return STRUCTURE_DEFINITION; } @@ -155,7 +163,7 @@ public class GregtechMetaTileEntity_IndustrialChisel private boolean hasValidCache(ItemStack aStack, ItemStack aSpecialSlot, boolean aClearOnFailure) { if (mInputCache != null && mOutputCache != null && mCachedRecipe != null) { if (GT_Utility.areStacksEqual(aStack, mInputCache) - && GT_Utility.areStacksEqual(aSpecialSlot, mOutputCache)) { + && GT_Utility.areStacksEqual(aSpecialSlot, mOutputCache)) { return true; } } @@ -213,21 +221,21 @@ public class GregtechMetaTileEntity_IndustrialChisel ItemStack tOutput = tIsCached ? mOutputCache.copy() : getChiselOutput(aInput, this.target); if (tOutput != null) { if (mCachedRecipe != null && GT_Utility.areStacksEqual(aInput, mInputCache) - && GT_Utility.areStacksEqual(tOutput, mOutputCache)) { + && GT_Utility.areStacksEqual(tOutput, mOutputCache)) { return mCachedRecipe; } // We can chisel this GT_Recipe aRecipe = new GT_Recipe( - false, - new ItemStack[] { ItemUtils.getSimpleStack(aInput, 1) }, - new ItemStack[] { ItemUtils.getSimpleStack(tOutput, 1) }, - null, - new int[] { 10000 }, - new FluidStack[] {}, - new FluidStack[] {}, - 20, - 16, - 0); + false, + new ItemStack[] { ItemUtils.getSimpleStack(aInput, 1) }, + new ItemStack[] { ItemUtils.getSimpleStack(tOutput, 1) }, + null, + new int[] { 10000 }, + new FluidStack[] {}, + new FluidStack[] {}, + 20, + 16, + 0); // Cache it cacheItem(aInput, tOutput, aRecipe); @@ -278,7 +286,9 @@ public class GregtechMetaTileEntity_IndustrialChisel protected Stream<GT_Recipe> findRecipeMatches(@Nullable RecipeMap<?> map) { return GT_StreamUtil.ofNullable(getRecipe()); } - }.setSpeedBonus(1F / 3F).setEuModifier(0.75F).setMaxParallelSupplier(this::getMaxParallelRecipes); + }.setSpeedBonus(1F / 3F) + .setEuModifier(0.75F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override @@ -304,9 +314,9 @@ public class GregtechMetaTileEntity_IndustrialChisel public void doSound(byte aIndex, double aX, double aY, double aZ) { switch (aIndex) { case PROCESS_START_SOUND_INDEX -> GT_Utility - .doSoundAtClient(getChiselSound(), getTimeBetweenProcessSounds(), 1.0F, 1.0F, aX, aY, aZ); + .doSoundAtClient(getChiselSound(), getTimeBetweenProcessSounds(), 1.0F, 1.0F, aX, aY, aZ); case INTERRUPT_SOUND_INDEX -> GT_Utility - .doSoundAtClient(SoundResource.IC2_MACHINES_INTERRUPT_ONE, 100, 1.0F, aX, aY, aZ); + .doSoundAtClient(SoundResource.IC2_MACHINES_INTERRUPT_ONE, 100, 1.0F, aX, aY, aZ); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java index 2b5f90a5ca..b71600e3fd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java @@ -35,8 +35,8 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -public class GregtechMetaTileEntity_IndustrialCokeOven extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCokeOven> implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialCokeOven + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCokeOven> implements ISurvivalConstructable { private int mLevel = 0; private int mCasing; @@ -65,20 +65,26 @@ public class GregtechMetaTileEntity_IndustrialCokeOven extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Processes Logs and Coal into Charcoal and Coal Coke.") - .addInfo("Controller Block for the Industrial Coke Oven") - .addInfo("Gain 4% energy discount per voltage tier") - .addInfo("Process 12x materials with Heat Resistant Casings") - .addInfo("Or 24x materials with Heat Proof Casings").addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator().beginStructureBlock(3, 3, 3, true).addController("Front middle at bottom") - .addCasingInfoMin("Structural Coke Oven Casings", 8, false) - .addCasingInfoMin("Heat Resistant/Proof Coke Oven Casings", 8, false) - .addInputBus("Any Structural Coke Oven Casing", 1).addOutputBus("Any Structural Coke Oven Casing", 1) - .addInputHatch("Any Structural Coke Oven Casing", 1) - .addOutputHatch("Any Structural Coke Oven Casing", 1) - .addEnergyHatch("Any Structural Coke Oven Casing", 1) - .addMaintenanceHatch("Any Structural Coke Oven Casing", 1) - .addMufflerHatch("Any Structural Coke Oven Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Processes Logs and Coal into Charcoal and Coal Coke.") + .addInfo("Controller Block for the Industrial Coke Oven") + .addInfo("Gain 4% energy discount per voltage tier") + .addInfo("Process 12x materials with Heat Resistant Casings") + .addInfo("Or 24x materials with Heat Proof Casings") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front middle at bottom") + .addCasingInfoMin("Structural Coke Oven Casings", 8, false) + .addCasingInfoMin("Heat Resistant/Proof Coke Oven Casings", 8, false) + .addInputBus("Any Structural Coke Oven Casing", 1) + .addOutputBus("Any Structural Coke Oven Casing", 1) + .addInputHatch("Any Structural Coke Oven Casing", 1) + .addOutputHatch("Any Structural Coke Oven Casing", 1) + .addEnergyHatch("Any Structural Coke Oven Casing", 1) + .addMaintenanceHatch("Any Structural Coke Oven Casing", 1) + .addMufflerHatch("Any Structural Coke Oven Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -86,34 +92,33 @@ public class GregtechMetaTileEntity_IndustrialCokeOven extends public IStructureDefinition<GregtechMetaTileEntity_IndustrialCokeOven> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialCokeOven>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "HHH", "H-H", "HHH" }, - { "C~C", "CCC", "CCC" }, })) - .addShape( - mName + "1", - transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "aaa", "a-a", "aaa" }, - { "C~C", "CCC", "CCC" }, })) - .addShape( - mName + "2", - transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "bbb", "b-b", "bbb" }, - { "C~C", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_IndustrialCokeOven.class) - .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Maintenance, Energy, Muffler) - .casingIndex(TAE.GTPP_INDEX(1)).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 1)))) - .addElement( - 'H', - ofChain( - onElementPass(x -> ++x.mCasing1, ofBlock(ModBlocks.blockCasingsMisc, 2)), - onElementPass(x -> ++x.mCasing2, ofBlock(ModBlocks.blockCasingsMisc, 3)))) - .addElement('a', ofBlock(ModBlocks.blockCasingsMisc, 2)) - .addElement('b', ofBlock(ModBlocks.blockCasingsMisc, 3)).build(); + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "HHH", "H-H", "HHH" }, { "C~C", "CCC", "CCC" }, })) + .addShape( + mName + "1", + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "aaa", "a-a", "aaa" }, { "C~C", "CCC", "CCC" }, })) + .addShape( + mName + "2", + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "bbb", "b-b", "bbb" }, { "C~C", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_IndustrialCokeOven.class) + .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Maintenance, Energy, Muffler) + .casingIndex(TAE.GTPP_INDEX(1)) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 1)))) + .addElement( + 'H', + ofChain( + onElementPass(x -> ++x.mCasing1, ofBlock(ModBlocks.blockCasingsMisc, 2)), + onElementPass(x -> ++x.mCasing2, ofBlock(ModBlocks.blockCasingsMisc, 3)))) + .addElement('a', ofBlock(ModBlocks.blockCasingsMisc, 2)) + .addElement('b', ofBlock(ModBlocks.blockCasingsMisc, 3)) + .build(); } return STRUCTURE_DEFINITION; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java index e729b23ac1..295f195d55 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java @@ -43,14 +43,14 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregtechMetaTileEntity_IndustrialCuttingMachine extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCuttingMachine> implements ISurvivalConstructable { + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCuttingMachine> implements ISurvivalConstructable { private boolean mCuttingMode = true; private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_IndustrialCuttingMachine> STRUCTURE_DEFINITION = null; public GregtechMetaTileEntity_IndustrialCuttingMachine(final int aID, final String aName, - final String aNameRegional) { + final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -71,14 +71,23 @@ public class GregtechMetaTileEntity_IndustrialCuttingMachine extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Cutting Factory") - .addInfo("200% faster than using single block machines of the same voltage") - .addInfo("Only uses 75% of the EU/t normally required").addInfo("Processes four items per voltage tier") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 5, true) - .addController("Front Center").addCasingInfoMin("Cutting Factory Frames", 14, false) - .addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Industrial Cutting Factory") + .addInfo("200% faster than using single block machines of the same voltage") + .addInfo("Only uses 75% of the EU/t normally required") + .addInfo("Processes four items per voltage tier") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 5, true) + .addController("Front Center") + .addCasingInfoMin("Cutting Factory Frames", 14, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -86,19 +95,19 @@ public class GregtechMetaTileEntity_IndustrialCuttingMachine extends public IStructureDefinition<GregtechMetaTileEntity_IndustrialCuttingMachine> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialCuttingMachine>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCC", "CCC", "CCC", "CCC", "CCC" }, - { "C~C", "C-C", "C-C", "C-C", "CCC" }, - { "CCC", "CCC", "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_IndustrialCuttingMachine.class) - .atLeast(InputBus, InputHatch, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 13)))) - .build(); + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC", "CCC", "CCC" }, { "C~C", "C-C", "C-C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_IndustrialCuttingMachine.class) + .atLeast(InputBus, InputHatch, OutputBus, Maintenance, Energy, Muffler) + .casingIndex(getCasingTextureIndex()) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 13)))) + .build(); } return STRUCTURE_DEFINITION; } @@ -153,8 +162,9 @@ public class GregtechMetaTileEntity_IndustrialCuttingMachine extends @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setSpeedBonus(1F / 3F).setEuModifier(0.75F) - .setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setSpeedBonus(1F / 3F) + .setEuModifier(0.75F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java index 318b8cdac2..9122090f89 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java @@ -49,8 +49,8 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -public class GregtechMetaTileEntity_IndustrialDehydrator extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialDehydrator> implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialDehydrator + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialDehydrator> implements ISurvivalConstructable { private static int CASING_TEXTURE_ID; private static String mCasingName = "Vacuum Casing"; @@ -77,41 +77,52 @@ public class GregtechMetaTileEntity_IndustrialDehydrator extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Factory Grade Vacuum Furnace") - .addInfo("Can toggle the operation temperature with a Screwdriver") - .addInfo("All Dehydrator recipes are Low Temp recipes") - .addInfo("Speed: +120% | EU Usage: 50% | Parallel: 4") - .addInfo("Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively)") - .addInfo("Each 1800K over the min. Heat Capacity allows for one upgraded overclock") - .addInfo("Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 5, 3, true) - .addController("Bottom Center").addCasingInfoMin(mCasingName, 5, false).addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1).addOutputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Factory Grade Vacuum Furnace") + .addInfo("Can toggle the operation temperature with a Screwdriver") + .addInfo("All Dehydrator recipes are Low Temp recipes") + .addInfo("Speed: +120% | EU Usage: 50% | Parallel: 4") + .addInfo("Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively)") + .addInfo("Each 1800K over the min. Heat Capacity allows for one upgraded overclock") + .addInfo("Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 5, 3, true) + .addController("Bottom Center") + .addCasingInfoMin(mCasingName, 5, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @Override public IStructureDefinition<GregtechMetaTileEntity_IndustrialDehydrator> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialDehydrator>builder().addShape( + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialDehydrator>builder() + .addShape( mName, transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "HHH", "H-H", "HHH" }, { "HHH", "H-H", "HHH" }, - { "HHH", "H-H", "HHH" }, { "C~C", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_IndustrialDehydrator.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) - .casingIndex(CASING_TEXTURE_ID).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings4Misc, 10)))) - .addElement( - 'H', - ofCoil( - GregtechMetaTileEntity_IndustrialDehydrator::setCoilLevel, - GregtechMetaTileEntity_IndustrialDehydrator::getCoilLevel)) - .build(); + new String[][] { { "CCC", "CCC", "CCC" }, { "HHH", "H-H", "HHH" }, { "HHH", "H-H", "HHH" }, + { "HHH", "H-H", "HHH" }, { "C~C", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_IndustrialDehydrator.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) + .casingIndex(CASING_TEXTURE_ID) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings4Misc, 10)))) + .addElement( + 'H', + ofCoil( + GregtechMetaTileEntity_IndustrialDehydrator::setCoilLevel, + GregtechMetaTileEntity_IndustrialDehydrator::getCoilLevel)) + .build(); } return STRUCTURE_DEFINITION; } @@ -193,16 +204,20 @@ public class GregtechMetaTileEntity_IndustrialDehydrator extends @Override protected CheckRecipeResult validateRecipe(@NotNull GT_Recipe recipe) { return recipe.mSpecialValue <= getCoilLevel().getHeat() ? CheckRecipeResultRegistry.SUCCESSFUL - : CheckRecipeResultRegistry.insufficientHeat(recipe.mSpecialValue); + : CheckRecipeResultRegistry.insufficientHeat(recipe.mSpecialValue); } @NotNull @Override protected GT_OverclockCalculator createOverclockCalculator(@NotNull GT_Recipe recipe) { - return super.createOverclockCalculator(recipe).setHeatOC(true).setHeatDiscount(true) - .setRecipeHeat(recipe.mSpecialValue).setMachineHeat((int) getCoilLevel().getHeat()); + return super.createOverclockCalculator(recipe).setHeatOC(true) + .setHeatDiscount(true) + .setRecipeHeat(recipe.mSpecialValue) + .setMachineHeat((int) getCoilLevel().getHeat()); } - }.setSpeedBonus(1F / 2.2F).setEuModifier(0.5F).setMaxParallelSupplier(this::getMaxParallelRecipes); + }.setSpeedBonus(1F / 2.2F) + .setEuModifier(0.5F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java index 0092f43c21..f12007b952 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java @@ -34,13 +34,13 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregtechMetaTileEntity_IndustrialElectrolyzer extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialElectrolyzer> implements ISurvivalConstructable { + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialElectrolyzer> implements ISurvivalConstructable { private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_IndustrialElectrolyzer> STRUCTURE_DEFINITION = null; public GregtechMetaTileEntity_IndustrialElectrolyzer(final int aID, final String aName, - final String aNameRegional) { + final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -61,14 +61,24 @@ public class GregtechMetaTileEntity_IndustrialElectrolyzer extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Electrolyzer") - .addInfo("180% faster than using single block machines of the same voltage") - .addInfo("Only uses 90% of the EU/t normally required").addInfo("Processes two items per voltage tier") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true) - .addController("Front Center").addCasingInfoMin("Electrolyzer Casings", 6, false) - .addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Industrial Electrolyzer") + .addInfo("180% faster than using single block machines of the same voltage") + .addInfo("Only uses 90% of the EU/t normally required") + .addInfo("Processes two items per voltage tier") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front Center") + .addCasingInfoMin("Electrolyzer Casings", 6, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -76,18 +86,18 @@ public class GregtechMetaTileEntity_IndustrialElectrolyzer extends public IStructureDefinition<GregtechMetaTileEntity_IndustrialElectrolyzer> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialElectrolyzer>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, - { "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_IndustrialElectrolyzer.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) - .casingIndex(TAE.GTPP_INDEX(5)).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 5)))) - .build(); + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, { "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_IndustrialElectrolyzer.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) + .casingIndex(TAE.GTPP_INDEX(5)) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 5)))) + .build(); } return STRUCTURE_DEFINITION; } @@ -131,8 +141,9 @@ public class GregtechMetaTileEntity_IndustrialElectrolyzer extends @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setSpeedBonus(1F / 2.8F).setEuModifier(0.9F) - .setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setSpeedBonus(1F / 2.8F) + .setEuModifier(0.9F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java index 149d1a8017..ea61048f33 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java @@ -33,8 +33,8 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -public class GregtechMetaTileEntity_IndustrialExtruder extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialExtruder> implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialExtruder + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialExtruder> implements ISurvivalConstructable { private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_IndustrialExtruder> STRUCTURE_DEFINITION = null; @@ -60,37 +60,44 @@ public class GregtechMetaTileEntity_IndustrialExtruder extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Material Extruder") - .addInfo("250% faster than using single block machines of the same voltage") - .addInfo("Processes four items per voltage tier") - .addInfo("Extrusion Shape for recipe goes in the Input Bus") - .addInfo("Each Input Bus can have a different shape!") - .addInfo("You can use several input buses per multiblock") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 5, true) - .addController("Front Center").addCasingInfoMin("Inconel Reinforced Casings", 14, false) - .addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1).addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Material Extruder") + .addInfo("250% faster than using single block machines of the same voltage") + .addInfo("Processes four items per voltage tier") + .addInfo("Extrusion Shape for recipe goes in the Input Bus") + .addInfo("Each Input Bus can have a different shape!") + .addInfo("You can use several input buses per multiblock") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 5, true) + .addController("Front Center") + .addCasingInfoMin("Inconel Reinforced Casings", 14, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @Override public IStructureDefinition<GregtechMetaTileEntity_IndustrialExtruder> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialExtruder>builder().addShape( + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialExtruder>builder() + .addShape( mName, transpose( - new String[][] { { "CCC", "CCC", "CCC", "CCC", "CCC" }, - { "C~C", "C-C", "C-C", "C-C", "CCC" }, { "CCC", "CCC", "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_IndustrialExtruder.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( - onElementPass( - x -> ++x.mCasing, - ofBlock(getCasingBlock(), getCasingMeta())))) - .build(); + new String[][] { { "CCC", "CCC", "CCC", "CCC", "CCC" }, { "C~C", "C-C", "C-C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_IndustrialExtruder.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) + .casingIndex(getCasingTextureIndex()) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) + .build(); } return STRUCTURE_DEFINITION; } @@ -144,7 +151,8 @@ public class GregtechMetaTileEntity_IndustrialExtruder extends @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setSpeedBonus(1F / 3.5F).setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setSpeedBonus(1F / 3.5F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialFluidHeater.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialFluidHeater.java index 94c950ba50..a34532ee83 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialFluidHeater.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialFluidHeater.java @@ -35,7 +35,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregtechMetaTileEntity_IndustrialFluidHeater extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialFluidHeater> implements ISurvivalConstructable { + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialFluidHeater> implements ISurvivalConstructable { private int mCasing1; private static IStructureDefinition<GregtechMetaTileEntity_IndustrialFluidHeater> STRUCTURE_DEFINITION = null; @@ -61,17 +61,25 @@ public class GregtechMetaTileEntity_IndustrialFluidHeater extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Fluid Heater") - .addInfo("120% faster than using single block machines of the same voltage") - .addInfo("Only uses 90% of the EU/t normally required") - .addInfo("Processes eight items per voltage tier").addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator().beginStructureBlock(5, 6, 5, true).addController("Front Center") - .addCasingInfoMin("Top/Bottom layer: Multi-use Casings", 34, false) - .addCasingInfoMin("Middle layers: Thermal Containment Casing", 47, false) - .addInputBus("Bottom Layer (optional)", 1).addInputHatch("Bottom Layer", 1) - .addOutputBus("Top Layer (optional)", 1).addOutputHatch("Top Layer", 1) - .addEnergyHatch("Any Multi-use Casing", 1).addMaintenanceHatch("Any Multi-use Casing", 1) - .addMufflerHatch("Any Multi-use Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Industrial Fluid Heater") + .addInfo("120% faster than using single block machines of the same voltage") + .addInfo("Only uses 90% of the EU/t normally required") + .addInfo("Processes eight items per voltage tier") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(5, 6, 5, true) + .addController("Front Center") + .addCasingInfoMin("Top/Bottom layer: Multi-use Casings", 34, false) + .addCasingInfoMin("Middle layers: Thermal Containment Casing", 47, false) + .addInputBus("Bottom Layer (optional)", 1) + .addInputHatch("Bottom Layer", 1) + .addOutputBus("Top Layer (optional)", 1) + .addOutputHatch("Top Layer", 1) + .addEnergyHatch("Any Multi-use Casing", 1) + .addMaintenanceHatch("Any Multi-use Casing", 1) + .addMufflerHatch("Any Multi-use Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -79,33 +87,31 @@ public class GregtechMetaTileEntity_IndustrialFluidHeater extends public IStructureDefinition<GregtechMetaTileEntity_IndustrialFluidHeater> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialFluidHeater>builder() - .addShape( - mName, - transpose( - new String[][] { { " TTT ", "TTTTT", "TTTTT", "TTTTT", " TTT " }, - { " XXX ", "X---X", "X---X", "X---X", " XXX " }, - { " XXX ", "X---X", "X---X", "X---X", " XXX " }, - { " XXX ", "X---X", "X---X", "X---X", " XXX " }, - { " X~X ", "X---X", "X---X", "X---X", " XXX " }, - { " BBB ", "BBBBB", "BBBBB", "BBBBB", " BBB " }, })) - .addElement( - 'B', - buildHatchAdder(GregtechMetaTileEntity_IndustrialFluidHeater.class) - .atLeast(InputBus, InputHatch, Maintenance, Energy, Muffler) - .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( - onElementPass( - x -> ++x.mCasing1, - ofBlock(getCasingBlock2(), getCasingMeta2())))) - .addElement('X', ofBlock(getCasingBlock1(), getCasingMeta1())) - .addElement( - 'T', - buildHatchAdder(GregtechMetaTileEntity_IndustrialFluidHeater.class) - .atLeast(OutputBus, OutputHatch, Maintenance, Energy, Muffler) - .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( - onElementPass( - x -> ++x.mCasing1, - ofBlock(getCasingBlock2(), getCasingMeta2())))) - .build(); + .addShape( + mName, + transpose( + new String[][] { { " TTT ", "TTTTT", "TTTTT", "TTTTT", " TTT " }, + { " XXX ", "X---X", "X---X", "X---X", " XXX " }, + { " XXX ", "X---X", "X---X", "X---X", " XXX " }, + { " XXX ", "X---X", "X---X", "X---X", " XXX " }, + { " X~X ", "X---X", "X---X", "X---X", " XXX " }, + { " BBB ", "BBBBB", "BBBBB", "BBBBB", " BBB " }, })) + .addElement( + 'B', + buildHatchAdder(GregtechMetaTileEntity_IndustrialFluidHeater.class) + .atLeast(InputBus, InputHatch, Maintenance, Energy, Muffler) + .casingIndex(getCasingTextureIndex()) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing1, ofBlock(getCasingBlock2(), getCasingMeta2())))) + .addElement('X', ofBlock(getCasingBlock1(), getCasingMeta1())) + .addElement( + 'T', + buildHatchAdder(GregtechMetaTileEntity_IndustrialFluidHeater.class) + .atLeast(OutputBus, OutputHatch, Maintenance, Energy, Muffler) + .casingIndex(getCasingTextureIndex()) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing1, ofBlock(getCasingBlock2(), getCasingMeta2())))) + .build(); } return STRUCTURE_DEFINITION; } @@ -151,8 +157,9 @@ public class GregtechMetaTileEntity_IndustrialFluidHeater extends @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setSpeedBonus(1F / 2.2F).setEuModifier(0.9F) - .setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setSpeedBonus(1F / 2.2F) + .setEuModifier(0.9F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java index d7a182e483..8e2f040d75 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java @@ -51,7 +51,7 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @SuppressWarnings("SpellCheckingInspection") public class GregtechMetaTileEntity_IndustrialForgeHammer extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialForgeHammer> implements ISurvivalConstructable { + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialForgeHammer> implements ISurvivalConstructable { private int mCasing; private int mAnvilTier = 0; @@ -78,9 +78,10 @@ public class GregtechMetaTileEntity_IndustrialForgeHammer extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Forge Hammer") - .addInfo("Speed: +100% | EU Usage: 100% | Parallel: Tier x Anvil Tier x 8") - .addInfo("T1 - Vanilla Anvil"); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Industrial Forge Hammer") + .addInfo("Speed: +100% | EU Usage: 100% | Parallel: Tier x Anvil Tier x 8") + .addInfo("T1 - Vanilla Anvil"); if (Railcraft.isModLoaded()) { tt.addInfo("T2 - Steel Anvil"); } @@ -92,12 +93,20 @@ public class GregtechMetaTileEntity_IndustrialForgeHammer extends tt.addInfo("T4 - Void Metal Anvil"); } - tt.addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true) - .addController("Front Center").addCasingInfoMin("Forge Casing", 6, false).addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1).addOutputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) - .addOtherStructurePart("Anvil", "In the center of 3x3x3 structure", 2) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front Center") + .addCasingInfoMin("Forge Casing", 6, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .addOtherStructurePart("Anvil", "In the center of 3x3x3 structure", 2) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -122,32 +131,35 @@ public class GregtechMetaTileEntity_IndustrialForgeHammer extends } STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialForgeHammer>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "CAC", "CCC" }, - { "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_IndustrialForgeHammer.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) - .casingIndex(TAE.getIndexFromPage(1, 11)).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings5Misc, 6)))) - .addElement( - 'A', - ofBlocksTiered( - anvilTierConverter(anvilTiers), - getAllAnvilTiers(anvilTiers), - 0, - GregtechMetaTileEntity_IndustrialForgeHammer::setAnvilTier, - GregtechMetaTileEntity_IndustrialForgeHammer::getAnvilTier)) - .build(); + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "CAC", "CCC" }, { "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_IndustrialForgeHammer.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) + .casingIndex(TAE.getIndexFromPage(1, 11)) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings5Misc, 6)))) + .addElement( + 'A', + ofBlocksTiered( + anvilTierConverter(anvilTiers), + getAllAnvilTiers(anvilTiers), + 0, + GregtechMetaTileEntity_IndustrialForgeHammer::setAnvilTier, + GregtechMetaTileEntity_IndustrialForgeHammer::getAnvilTier)) + .build(); } return STRUCTURE_DEFINITION; } private static List<Pair<Block, Integer>> getAllAnvilTiers(Map<Block, Integer> anvilTiers) { - return anvilTiers.entrySet().stream().map(e -> Pair.of(e.getKey(), e.getValue())).collect(Collectors.toList()); + return anvilTiers.entrySet() + .stream() + .map(e -> Pair.of(e.getKey(), e.getValue())) + .collect(Collectors.toList()); } private static ITierConverter<Integer> anvilTierConverter(Map<Block, Integer> anvilTiers) { @@ -198,7 +210,8 @@ public class GregtechMetaTileEntity_IndustrialForgeHammer extends @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setSpeedBonus(1 / 2F).setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setSpeedBonus(1 / 2F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java index 3f291b38d6..5591b9fbe8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java @@ -50,8 +50,8 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; -public class GregtechMetaTileEntity_IndustrialMacerator extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMacerator> implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialMacerator + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMacerator> implements ISurvivalConstructable { private int controllerTier = 1; private int mCasing; @@ -79,16 +79,23 @@ public class GregtechMetaTileEntity_IndustrialMacerator extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller block for the Industrial Maceration Stack") - .addInfo("60% faster than using single block machines of the same voltage") - .addInfo("Maximum of n*tier parallels, LV = Tier 1, MV = Tier 2, etc.") - .addInfo("n=2 initially. n=8 after inserting Maceration Upgrade Chip.") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 6, 3, true) - .addController("Bottom center").addCasingInfoMin("Maceration Stack Casings (After upgrade)", 26, false) - .addCasingInfoMin("Stable Titanium Casings (Before upgrade)", 26, false).addInputBus("Bottom casing", 1) - .addEnergyHatch("Any casing", 1).addMaintenanceHatch("Any casing", 1) - .addOutputBus("One per layer except bottom layer", 2) - .addMufflerHatch("Any casing except bottom layer", 2).toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller block for the Industrial Maceration Stack") + .addInfo("60% faster than using single block machines of the same voltage") + .addInfo("Maximum of n*tier parallels, LV = Tier 1, MV = Tier 2, etc.") + .addInfo("n=2 initially. n=8 after inserting Maceration Upgrade Chip.") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 6, 3, true) + .addController("Bottom center") + .addCasingInfoMin("Maceration Stack Casings (After upgrade)", 26, false) + .addCasingInfoMin("Stable Titanium Casings (Before upgrade)", 26, false) + .addInputBus("Bottom casing", 1) + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addOutputBus("One per layer except bottom layer", 2) + .addMufflerHatch("Any casing except bottom layer", 2) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -96,59 +103,65 @@ public class GregtechMetaTileEntity_IndustrialMacerator extends public IStructureDefinition<GregtechMetaTileEntity_IndustrialMacerator> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialMacerator>builder() - .addShape(mName + "top1", transpose(new String[][] { { "ccc", "ccc", "ccc" }, })) - .addShape(mName + "mid1", transpose(new String[][] { { "ccc", "c-c", "ccc" }, })) - .addShape(mName + "bottom1", transpose(new String[][] { { "b~b", "bbb", "bbb" }, })) - .addShape(mName + "top2", transpose(new String[][] { { "CCC", "CCC", "CCC" }, })) - .addShape( - mName + "mid2", - transpose(new String[][] { { "CCC", "C-C", "CCC" }, })) - .addShape(mName + "bottom2", transpose(new String[][] { { "B~B", "BBB", "BBB" }, })) - .addElement( - 'C', - ofChain( - buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class).anyOf(OutputBus) - .shouldReject(t -> t.mPerLayer + 1 == t.mOutputBusses.size()) - .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) - .casingIndex(TAE.GTPP_INDEX(7)).dot(2).build(), - buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class) - .atLeast(Energy, Maintenance, Muffler) - .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) - .casingIndex(TAE.GTPP_INDEX(7)).dot(2).build(), - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 7)))) - .addElement( - 'B', - ofChain( - buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class) - .atLeast(Energy, Maintenance, InputBus).disallowOnly(ForgeDirection.UP) - .casingIndex(TAE.GTPP_INDEX(7)).dot(2).build(), - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 7)))) - .addElement( - 'c', - ofChain( - buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class).anyOf(OutputBus) - .shouldReject(t -> t.mPerLayer + 1 == t.mOutputBusses.size()) - .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) - .casingIndex( - GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings4, 2)) - .dot(2).build(), - buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class) - .atLeast(Energy, Maintenance, Muffler) - .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) - .casingIndex( - GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings4, 2)) - .dot(2).build(), - onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings4, 2)))) - .addElement( - 'b', - ofChain( - buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class) - .atLeast(Energy, Maintenance, InputBus).disallowOnly(ForgeDirection.UP) - .casingIndex( - GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings4, 2)) - .dot(2).build(), - onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings4, 2)))) - .build(); + .addShape(mName + "top1", transpose(new String[][] { { "ccc", "ccc", "ccc" }, })) + .addShape(mName + "mid1", transpose(new String[][] { { "ccc", "c-c", "ccc" }, })) + .addShape(mName + "bottom1", transpose(new String[][] { { "b~b", "bbb", "bbb" }, })) + .addShape(mName + "top2", transpose(new String[][] { { "CCC", "CCC", "CCC" }, })) + .addShape(mName + "mid2", transpose(new String[][] { { "CCC", "C-C", "CCC" }, })) + .addShape(mName + "bottom2", transpose(new String[][] { { "B~B", "BBB", "BBB" }, })) + .addElement( + 'C', + ofChain( + buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class).anyOf(OutputBus) + .shouldReject(t -> t.mPerLayer + 1 == t.mOutputBusses.size()) + .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) + .casingIndex(TAE.GTPP_INDEX(7)) + .dot(2) + .build(), + buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class) + .atLeast(Energy, Maintenance, Muffler) + .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) + .casingIndex(TAE.GTPP_INDEX(7)) + .dot(2) + .build(), + onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 7)))) + .addElement( + 'B', + ofChain( + buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class) + .atLeast(Energy, Maintenance, InputBus) + .disallowOnly(ForgeDirection.UP) + .casingIndex(TAE.GTPP_INDEX(7)) + .dot(2) + .build(), + onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 7)))) + .addElement( + 'c', + ofChain( + buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class).anyOf(OutputBus) + .shouldReject(t -> t.mPerLayer + 1 == t.mOutputBusses.size()) + .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) + .casingIndex(GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings4, 2)) + .dot(2) + .build(), + buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class) + .atLeast(Energy, Maintenance, Muffler) + .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) + .casingIndex(GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings4, 2)) + .dot(2) + .build(), + onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings4, 2)))) + .addElement( + 'b', + ofChain( + buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class) + .atLeast(Energy, Maintenance, InputBus) + .disallowOnly(ForgeDirection.UP) + .casingIndex(GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings4, 2)) + .dot(2) + .build(), + onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings4, 2)))) + .build(); } return STRUCTURE_DEFINITION; } @@ -168,63 +181,63 @@ public class GregtechMetaTileEntity_IndustrialMacerator extends if (mMachine) return -1; int built; built = survivialBuildPiece( - mName + "bottom" + controllerTier, - stackSize, - 1, - 0, - 0, - elementBudget, - env, - false, - true); + mName + "bottom" + controllerTier, + stackSize, + 1, + 0, + 0, + elementBudget, + env, + false, + true); mPerLayer = 0; if (built >= 0) return built; built = survivialBuildPiece( - mName + "mid" + controllerTier, - stackSize, - 1, - 1, - 0, - elementBudget, - env, - false, - true); + mName + "mid" + controllerTier, + stackSize, + 1, + 1, + 0, + elementBudget, + env, + false, + true); mPerLayer = 1; if (built >= 0) return built; built = survivialBuildPiece( - mName + "mid" + controllerTier, - stackSize, - 1, - 2, - 0, - elementBudget, - env, - false, - true); + mName + "mid" + controllerTier, + stackSize, + 1, + 2, + 0, + elementBudget, + env, + false, + true); if (built >= 0) return built; mPerLayer = 2; built = survivialBuildPiece( - mName + "mid" + controllerTier, - stackSize, - 1, - 3, - 0, - elementBudget, - env, - false, - true); + mName + "mid" + controllerTier, + stackSize, + 1, + 3, + 0, + elementBudget, + env, + false, + true); if (built >= 0) return built; mPerLayer = 3; built = survivialBuildPiece( - mName + "mid" + controllerTier, - stackSize, - 1, - 4, - 0, - elementBudget, - env, - false, - true); + mName + "mid" + controllerTier, + stackSize, + 1, + 4, + 0, + elementBudget, + env, + false, + true); if (built >= 0) return built; mPerLayer = 4; return survivialBuildPiece(mName + "top" + controllerTier, stackSize, 1, 5, 0, elementBudget, env, false, true); @@ -237,13 +250,12 @@ public class GregtechMetaTileEntity_IndustrialMacerator extends if (checkPiece(mName + "bottom" + controllerTier, 1, 0, 0)) { while (mPerLayer < 4) { if (!checkPiece(mName + "mid" + controllerTier, 1, mPerLayer + 1, 0) - || mPerLayer + 1 != mOutputBusses.size()) - return false; + || mPerLayer + 1 != mOutputBusses.size()) return false; mPerLayer++; } return checkPiece(mName + "top" + controllerTier, 1, 5, 0) && mOutputBusses.size() == 5 - && mCasing >= 26 - && checkHatch(); + && mCasing >= 26 + && checkHatch(); } return false; } @@ -285,11 +297,12 @@ public class GregtechMetaTileEntity_IndustrialMacerator extends public void onPreTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { super.onPreTick(aBaseMetaTileEntity, aTick); if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) - && (aBaseMetaTileEntity.getFrontFacing() != ForgeDirection.UP) - && (aBaseMetaTileEntity.getCoverIDAtSide(ForgeDirection.UP) == 0) - && (!aBaseMetaTileEntity.getOpacityAtSide(ForgeDirection.UP))) { + && (aBaseMetaTileEntity.getFrontFacing() != ForgeDirection.UP) + && (aBaseMetaTileEntity.getCoverIDAtSide(ForgeDirection.UP) == 0) + && (!aBaseMetaTileEntity.getOpacityAtSide(ForgeDirection.UP))) { final Random tRandom = aBaseMetaTileEntity.getWorld().rand; - aBaseMetaTileEntity.getWorld().spawnParticle( + aBaseMetaTileEntity.getWorld() + .spawnParticle( "smoke", (aBaseMetaTileEntity.getXCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F), aBaseMetaTileEntity.getYCoord() + 0.3f + (tRandom.nextFloat() * 0.2F), @@ -317,7 +330,7 @@ public class GregtechMetaTileEntity_IndustrialMacerator extends @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, ForgeDirection side, - float aX, float aY, float aZ) { + float aX, float aY, float aZ) { if (controllerTier == 1 && !aPlayer.isSneaking()) { ItemStack heldItem = aPlayer.getHeldItem(); if (GregtechItemList.Maceration_Upgrade_Chip.isStackEqual(heldItem, false, true)) { @@ -392,7 +405,8 @@ public class GregtechMetaTileEntity_IndustrialMacerator extends @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setSpeedBonus(1F / 1.6F).setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setSpeedBonus(1F / 1.6F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override @@ -424,21 +438,21 @@ public class GregtechMetaTileEntity_IndustrialMacerator extends @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, - int z) { + int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); tag.setInteger("tier", controllerTier); } @Override public void getWailaBody(ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { super.getWailaBody(itemStack, currentTip, accessor, config); final NBTTagCompound tag = accessor.getNBTData(); if (tag.hasKey("tier")) { currentTip.add( - "Tier: " + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(tag.getInteger("tier")) - + EnumChatFormatting.RESET); + "Tier: " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(tag.getInteger("tier")) + + EnumChatFormatting.RESET); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java index e9172ae5a9..3f4c4ccfa4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java @@ -40,7 +40,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregtechMetaTileEntity_IndustrialMixer - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMixer> implements ISurvivalConstructable { + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMixer> implements ISurvivalConstructable { public static int CASING_TEXTURE_ID; public static String mCasingName = "Multi-Use Casing"; @@ -87,14 +87,24 @@ public class GregtechMetaTileEntity_IndustrialMixer @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Mixer") - .addInfo("250% faster than using single block machines of the same voltage") - .addInfo("Processes eight recipes per voltage tier").addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator().beginStructureBlock(3, 4, 3, false).addController("Second Layer Center") - .addCasingInfoMin(mCasingName, 6, false).addCasingInfoMin(mCasingName2, 2, false) - .addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Industrial Mixer") + .addInfo("250% faster than using single block machines of the same voltage") + .addInfo("Processes eight recipes per voltage tier") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 4, 3, false) + .addController("Second Layer Center") + .addCasingInfoMin(mCasingName, 6, false) + .addCasingInfoMin(mCasingName2, 2, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -102,18 +112,20 @@ public class GregtechMetaTileEntity_IndustrialMixer public IStructureDefinition<GregtechMetaTileEntity_IndustrialMixer> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialMixer>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "CCC", "CMC", "CCC" }, - { "C~C", "CMC", "CCC" }, { "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_IndustrialMixer.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) - .casingIndex(CASING_TEXTURE_ID).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 2)))) - .addElement('M', ofBlock(GregTech_API.sBlockCasings4, 11)).build(); + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "CCC", "CMC", "CCC" }, { "C~C", "CMC", "CCC" }, + { "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_IndustrialMixer.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) + .casingIndex(CASING_TEXTURE_ID) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 2)))) + .addElement('M', ofBlock(GregTech_API.sBlockCasings4, 11)) + .build(); } return STRUCTURE_DEFINITION; } @@ -162,7 +174,8 @@ public class GregtechMetaTileEntity_IndustrialMixer @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setSpeedBonus(1F / 3.5F).setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setSpeedBonus(1F / 3.5F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override @@ -184,8 +197,8 @@ public class GregtechMetaTileEntity_IndustrialMixer public void onModeChangeByScrewdriver(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 diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java index d1613dc290..02b0bcf978 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java @@ -33,14 +33,14 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregtechMetaTileEntity_IndustrialMolecularTransformer - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMolecularTransformer> - implements ISurvivalConstructable { + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMolecularTransformer> + implements ISurvivalConstructable { private static final int CASING_TEXTURE_ID = 48; private int mCasing = 0; public GregtechMetaTileEntity_IndustrialMolecularTransformer(final int aID, final String aName, - final String aNameRegional) { + final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -62,21 +62,26 @@ public class GregtechMetaTileEntity_IndustrialMolecularTransformer protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Changes the structure of items to produce new ones") - .addInfo("Maximum 1x of each bus/hatch.").addPollutionAmount(getPollutionPerSecond(null)).addSeparator() - .beginStructureBlock(7, 7, 7, false).addController("Top Center") - .addCasingInfoMin("Robust Tungstensteel Machine Casing", 40, false) - .addCasingInfoMin("Tungstensteel Coils", 16, false) - .addCasingInfoMin("Molecular Containment Casing", 52, false) - .addCasingInfoMin("High Voltage Current Capacitor", 32, false) - .addCasingInfoMin("Particle Containment Casing", 4, false) - .addCasingInfoMin("Resonance Chamber I", 5, false).addCasingInfoMin("Modulator I", 4, false) - .addInputBus("Any Robust Tungstensteel Machine Casing", 1) - .addOutputBus("Any Robust Tungstensteel Machine Casing", 1) - .addEnergyHatch("Any Robust Tungstensteel Machine Casing", 1) - .addMaintenanceHatch("Any Robust Tungstensteel Machine Casing", 1) - .addMufflerHatch("Any Robust Tungstensteel Machine Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Changes the structure of items to produce new ones") + .addInfo("Maximum 1x of each bus/hatch.") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(7, 7, 7, false) + .addController("Top Center") + .addCasingInfoMin("Robust Tungstensteel Machine Casing", 40, false) + .addCasingInfoMin("Tungstensteel Coils", 16, false) + .addCasingInfoMin("Molecular Containment Casing", 52, false) + .addCasingInfoMin("High Voltage Current Capacitor", 32, false) + .addCasingInfoMin("Particle Containment Casing", 4, false) + .addCasingInfoMin("Resonance Chamber I", 5, false) + .addCasingInfoMin("Modulator I", 4, false) + .addInputBus("Any Robust Tungstensteel Machine Casing", 1) + .addOutputBus("Any Robust Tungstensteel Machine Casing", 1) + .addEnergyHatch("Any Robust Tungstensteel Machine Casing", 1) + .addMaintenanceHatch("Any Robust Tungstensteel Machine Casing", 1) + .addMufflerHatch("Any Robust Tungstensteel Machine Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -87,31 +92,31 @@ public class GregtechMetaTileEntity_IndustrialMolecularTransformer public IStructureDefinition<GregtechMetaTileEntity_IndustrialMolecularTransformer> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialMolecularTransformer>builder() - .addShape( - STRUCTURE_PIECE_MAIN, - (new String[][] { - { " ", " ", " xxx ", " x~x ", " xxx ", " ", " " }, - { " ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " " }, - { " ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " " }, - { " ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " " }, - { " t ", " ttxtt ", " tyyyt ", "txyzyxt", " tyyyt ", " ttxtt ", " t " }, - { " c ", " ccecc ", " cxfxc ", "cefefec", " cxfxc ", " ccecc ", " c " }, - { " h ", " hhhhh ", " hhhhh ", "hhhhhhh", " hhhhh ", " hhhhh ", " h " }, })) - .addElement('x', ofBlock(getCasingBlock(), getCasingMeta())) - .addElement('y', ofBlock(getCasingBlock(), getCasingMeta2())) - .addElement('z', ofBlock(getCasingBlock(), getCasingMeta3())) - .addElement('e', ofBlock(getCasingBlock2(), 0)).addElement('f', ofBlock(getCasingBlock2(), 4)) - .addElement('c', ofBlock(getCoilBlock(), 3)) - .addElement('t', ofBlock(getCasingBlock3(), getTungstenCasingMeta())) - .addElement( - 'h', - buildHatchAdder(GregtechMetaTileEntity_IndustrialMolecularTransformer.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( - onElementPass( - x -> ++x.mCasing, - ofBlock(getCasingBlock3(), getTungstenCasingMeta())))) - .build(); + .addShape( + STRUCTURE_PIECE_MAIN, + (new String[][] { { " ", " ", " xxx ", " x~x ", " xxx ", " ", " " }, + { " ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " " }, + { " ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " " }, + { " ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " " }, + { " t ", " ttxtt ", " tyyyt ", "txyzyxt", " tyyyt ", " ttxtt ", " t " }, + { " c ", " ccecc ", " cxfxc ", "cefefec", " cxfxc ", " ccecc ", " c " }, + { " h ", " hhhhh ", " hhhhh ", "hhhhhhh", " hhhhh ", " hhhhh ", " h " }, })) + .addElement('x', ofBlock(getCasingBlock(), getCasingMeta())) + .addElement('y', ofBlock(getCasingBlock(), getCasingMeta2())) + .addElement('z', ofBlock(getCasingBlock(), getCasingMeta3())) + .addElement('e', ofBlock(getCasingBlock2(), 0)) + .addElement('f', ofBlock(getCasingBlock2(), 4)) + .addElement('c', ofBlock(getCoilBlock(), 3)) + .addElement('t', ofBlock(getCasingBlock3(), getTungstenCasingMeta())) + .addElement( + 'h', + buildHatchAdder(GregtechMetaTileEntity_IndustrialMolecularTransformer.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) + .casingIndex(getCasingTextureIndex()) + .dot(1) + .buildAndChain( + onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock3(), getTungstenCasingMeta())))) + .build(); } return STRUCTURE_DEFINITION; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java index 17e1572cb1..52c7736ae3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java @@ -70,7 +70,7 @@ import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; public class GregtechMetaTileEntity_IndustrialMultiMachine extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMultiMachine> implements ISurvivalConstructable { + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMultiMachine> implements ISurvivalConstructable { protected int mInternalMode = 0; private static final int MODE_COMPRESSOR = 0; @@ -98,7 +98,7 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine extends } public GregtechMetaTileEntity_IndustrialMultiMachine(final int aID, final String aName, - final String aNameRegional) { + final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -124,30 +124,31 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine extends aBuiltStrings[2] = aToolTipNames[6] + ", " + aToolTipNames[7] + ", " + aToolTipNames[8]; GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Multi-Machine") - .addInfo("250% faster than using single block machines of the same voltage") - .addInfo("Only uses 80% of the EU/t normally required").addInfo("Processes two items per voltage tier") - .addInfo( - "Machine Type: Metal - " + EnumChatFormatting.YELLOW - + aBuiltStrings[0] - + EnumChatFormatting.RESET) - .addInfo( - "Machine Type: Fluid - " + EnumChatFormatting.YELLOW - + aBuiltStrings[1] - + EnumChatFormatting.RESET) - .addInfo( - "Machine Type: Misc - " + EnumChatFormatting.YELLOW - + aBuiltStrings[2] - + EnumChatFormatting.RESET) - .addInfo("Read Multi-Machine Manual for extra information") - .addInfo( - EnumChatFormatting.AQUA + "You can use Solidifier Hatch to solidify multiple liquids." - + EnumChatFormatting.RESET) - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true) - .addController("Front Center").addCasingInfoMin("Multi-Use Casings", 6, false) - .addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Industrial Multi-Machine") + .addInfo("250% faster than using single block machines of the same voltage") + .addInfo("Only uses 80% of the EU/t normally required") + .addInfo("Processes two items per voltage tier") + .addInfo("Machine Type: Metal - " + EnumChatFormatting.YELLOW + aBuiltStrings[0] + EnumChatFormatting.RESET) + .addInfo("Machine Type: Fluid - " + EnumChatFormatting.YELLOW + aBuiltStrings[1] + EnumChatFormatting.RESET) + .addInfo("Machine Type: Misc - " + EnumChatFormatting.YELLOW + aBuiltStrings[2] + EnumChatFormatting.RESET) + .addInfo("Read Multi-Machine Manual for extra information") + .addInfo( + EnumChatFormatting.AQUA + "You can use Solidifier Hatch to solidify multiple liquids." + + EnumChatFormatting.RESET) + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front Center") + .addCasingInfoMin("Multi-Use Casings", 6, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -155,18 +156,18 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine extends public IStructureDefinition<GregtechMetaTileEntity_IndustrialMultiMachine> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialMultiMachine>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, - { "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_IndustrialMultiMachine.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) - .casingIndex(getTextureIndex()).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 2)))) - .build(); + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, { "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_IndustrialMultiMachine.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) + .casingIndex(getTextureIndex()) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 2)))) + .build(); } return STRUCTURE_DEFINITION; } @@ -235,7 +236,8 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine extends private ItemStack getCircuit(ItemStack[] t) { for (ItemStack j : t) { - if (j.getItem() == CI.getNumberedCircuit(0).getItem()) { + if (j.getItem() == CI.getNumberedCircuit(0) + .getItem()) { if (j.getItemDamage() >= 20 && j.getItemDamage() <= 22) { return j; } @@ -259,15 +261,15 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine extends @Override public Collection<RecipeMap<?>> getAvailableRecipeMaps() { return Arrays.asList( - RecipeMaps.compressorRecipes, - RecipeMaps.latheRecipes, - RecipeMaps.polarizerRecipes, - RecipeMaps.fermentingRecipes, - RecipeMaps.fluidExtractionRecipes, - RecipeMaps.extractorRecipes, - RecipeMaps.laserEngraverRecipes, - RecipeMaps.autoclaveRecipes, - RecipeMaps.fluidSolidifierRecipes); + RecipeMaps.compressorRecipes, + RecipeMaps.latheRecipes, + RecipeMaps.polarizerRecipes, + RecipeMaps.fermentingRecipes, + RecipeMaps.fluidExtractionRecipes, + RecipeMaps.extractorRecipes, + RecipeMaps.laserEngraverRecipes, + RecipeMaps.autoclaveRecipes, + RecipeMaps.fluidSolidifierRecipes); } @Override @@ -322,7 +324,9 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine extends } return super.findRecipeMatches(foundMap); } - }.setSpeedBonus(1F / 3.5F).setEuModifier(0.8F).setMaxParallelSupplier(this::getMaxParallelRecipes); + }.setSpeedBonus(1F / 3.5F) + .setEuModifier(0.8F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override @@ -333,7 +337,7 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine extends mInternalMode = 0; } String mModeString = (mInternalMode == 0 ? "Metal" - : mInternalMode == 1 ? "Fluid" : mInternalMode == 2 ? "Misc." : "null"); + : mInternalMode == 1 ? "Fluid" : mInternalMode == 2 ? "Misc." : "null"); PlayerUtils.messagePlayer(aPlayer, "Multi-Machine is now in " + mModeString + " mode."); mLastRecipe = null; } @@ -373,7 +377,7 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine extends @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, - int z) { + int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); tag.setInteger("mode", mInternalMode); } @@ -496,7 +500,7 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine extends @Override public void getWailaBody(ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { super.getWailaBody(itemStack, currentTip, accessor, config); final NBTTagCompound tag = accessor.getNBTData(); if (tag.hasKey("mode")) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java index 8ea7787c35..972cf492b6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java @@ -40,8 +40,8 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -public class GregtechMetaTileEntity_IndustrialPlatePress extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialPlatePress> implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialPlatePress + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialPlatePress> implements ISurvivalConstructable { private boolean mFormingMode = false; private int mCasing; @@ -68,15 +68,23 @@ public class GregtechMetaTileEntity_IndustrialPlatePress extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for Advanced Bending & Forming") - .addInfo("500% faster than using single block machines of the same voltage") - .addInfo("Processes four items per voltage tier").addInfo("Circuit for recipe goes in the Input Bus") - .addInfo("Each Input Bus can have a different Circuit/Shape!") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true) - .addController("Front Center").addCasingInfoMin("Material Press Machine Casings", 6, false) - .addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1).addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for Advanced Bending & Forming") + .addInfo("500% faster than using single block machines of the same voltage") + .addInfo("Processes four items per voltage tier") + .addInfo("Circuit for recipe goes in the Input Bus") + .addInfo("Each Input Bus can have a different Circuit/Shape!") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front Center") + .addCasingInfoMin("Material Press Machine Casings", 6, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -84,18 +92,18 @@ public class GregtechMetaTileEntity_IndustrialPlatePress extends public IStructureDefinition<GregtechMetaTileEntity_IndustrialPlatePress> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialPlatePress>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, - { "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_IndustrialPlatePress.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler).casingIndex(50).dot(1) - .buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 4)))) - .build(); + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, { "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_IndustrialPlatePress.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) + .casingIndex(50) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 4)))) + .build(); } return STRUCTURE_DEFINITION; } @@ -155,7 +163,8 @@ public class GregtechMetaTileEntity_IndustrialPlatePress extends @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setSpeedBonus(1F / 6F).setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setSpeedBonus(1F / 6F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java index cad24dac77..e4dd3d11ba 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java @@ -37,7 +37,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregtechMetaTileEntity_IndustrialSifter - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialSifter> implements ISurvivalConstructable { + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialSifter> implements ISurvivalConstructable { private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_IndustrialSifter> STRUCTURE_DEFINITION = null; @@ -63,15 +63,25 @@ public class GregtechMetaTileEntity_IndustrialSifter @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Sifter") - .addInfo("400% faster than single-block machines of the same voltage") - .addInfo("Only uses 75% of the EU/t normally required").addInfo("Processes four items per voltage tier") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(5, 3, 5, false) - .addController("Bottom Center").addCasingInfoMin("Sieve Grate", 18, false) - .addCasingInfoMin("Sieve Casings", 35, false).addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1).addOutputHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Industrial Sifter") + .addInfo("400% faster than single-block machines of the same voltage") + .addInfo("Only uses 75% of the EU/t normally required") + .addInfo("Processes four items per voltage tier") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(5, 3, 5, false) + .addController("Bottom Center") + .addCasingInfoMin("Sieve Grate", 18, false) + .addCasingInfoMin("Sieve Casings", 35, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -79,19 +89,21 @@ public class GregtechMetaTileEntity_IndustrialSifter public IStructureDefinition<GregtechMetaTileEntity_IndustrialSifter> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialSifter>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCCCC", "CMMMC", "CMMMC", "CMMMC", "CCCCC" }, - { "CCCCC", "CMMMC", "CMMMC", "CMMMC", "CCCCC" }, - { "CC~CC", "CCCCC", "CCCCC", "CCCCC", "CCCCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_IndustrialSifter.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) - .casingIndex(TAE.GTPP_INDEX(21)).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 5)))) - .addElement('M', ofBlock(ModBlocks.blockCasings2Misc, 6)).build(); + .addShape( + mName, + transpose( + new String[][] { { "CCCCC", "CMMMC", "CMMMC", "CMMMC", "CCCCC" }, + { "CCCCC", "CMMMC", "CMMMC", "CMMMC", "CCCCC" }, + { "CC~CC", "CCCCC", "CCCCC", "CCCCC", "CCCCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_IndustrialSifter.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) + .casingIndex(TAE.GTPP_INDEX(21)) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 5)))) + .addElement('M', ofBlock(ModBlocks.blockCasings2Misc, 6)) + .build(); } return STRUCTURE_DEFINITION; } @@ -142,16 +154,17 @@ public class GregtechMetaTileEntity_IndustrialSifter public void onPreTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { super.onPreTick(aBaseMetaTileEntity, aTick); if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) - && (aBaseMetaTileEntity.getFrontFacing() != ForgeDirection.UP) - && (aBaseMetaTileEntity.getCoverIDAtSide(ForgeDirection.UP) == 0) - && (!aBaseMetaTileEntity.getOpacityAtSide(ForgeDirection.UP))) { + && (aBaseMetaTileEntity.getFrontFacing() != ForgeDirection.UP) + && (aBaseMetaTileEntity.getCoverIDAtSide(ForgeDirection.UP) == 0) + && (!aBaseMetaTileEntity.getOpacityAtSide(ForgeDirection.UP))) { final Random tRandom = aBaseMetaTileEntity.getWorld().rand; if (tRandom.nextFloat() > 0.4) return; final int xDir = aBaseMetaTileEntity.getBackFacing().offsetX * 2; final int zDir = aBaseMetaTileEntity.getBackFacing().offsetZ * 2; - aBaseMetaTileEntity.getWorld().spawnParticle( + aBaseMetaTileEntity.getWorld() + .spawnParticle( "smoke", (aBaseMetaTileEntity.getXCoord() + xDir + 2.1F) - (tRandom.nextFloat() * 3.2F), aBaseMetaTileEntity.getYCoord() + 2.5f + (tRandom.nextFloat() * 1.2F), @@ -164,8 +177,9 @@ public class GregtechMetaTileEntity_IndustrialSifter @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setSpeedBonus(1F / 5F).setEuModifier(0.75F) - .setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setSpeedBonus(1F / 5F) + .setEuModifier(0.75F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java index f207264eed..14ff4ebb6d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java @@ -34,15 +34,14 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -public class GregtechMetaTileEntity_IndustrialThermalCentrifuge - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialThermalCentrifuge> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialThermalCentrifuge extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialThermalCentrifuge> implements ISurvivalConstructable { private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_IndustrialThermalCentrifuge> STRUCTURE_DEFINITION = null; public GregtechMetaTileEntity_IndustrialThermalCentrifuge(final int aID, final String aName, - final String aNameRegional) { + final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -63,15 +62,22 @@ public class GregtechMetaTileEntity_IndustrialThermalCentrifuge @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Thermal Centrifuge") - .addInfo("150% faster than using single block machines of the same voltage") - .addInfo("Only uses 80% of the EU/t normally required") - .addInfo("Processes eight items per voltage tier").addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator().beginStructureBlock(3, 2, 3, false).addController("Front Center") - .addCasingInfoMin("Thermal Processing Casings/Noise Hazard Sign Blocks", 8, false) - .addInputBus("Bottom Casing", 1).addOutputBus("Bottom Casing", 1).addEnergyHatch("Bottom Casing", 1) - .addMaintenanceHatch("Bottom Casing", 1).addMufflerHatch("Bottom Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Industrial Thermal Centrifuge") + .addInfo("150% faster than using single block machines of the same voltage") + .addInfo("Only uses 80% of the EU/t normally required") + .addInfo("Processes eight items per voltage tier") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 2, 3, false) + .addController("Front Center") + .addCasingInfoMin("Thermal Processing Casings/Noise Hazard Sign Blocks", 8, false) + .addInputBus("Bottom Casing", 1) + .addOutputBus("Bottom Casing", 1) + .addEnergyHatch("Bottom Casing", 1) + .addMaintenanceHatch("Bottom Casing", 1) + .addMufflerHatch("Bottom Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -79,21 +85,23 @@ public class GregtechMetaTileEntity_IndustrialThermalCentrifuge public IStructureDefinition<GregtechMetaTileEntity_IndustrialThermalCentrifuge> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialThermalCentrifuge>builder() - .addShape(mName, transpose(new String[][] { { "X~X", "XXX", "XXX" }, { "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - ofChain( - buildHatchAdder(GregtechMetaTileEntity_IndustrialThermalCentrifuge.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(getCasingTextureIndex()).dot(1).build(), - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 0)), - onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings3, 9)))) - .addElement( - 'X', - ofChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 0)), - onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings3, 9)))) - .build(); + .addShape(mName, transpose(new String[][] { { "X~X", "XXX", "XXX" }, { "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + ofChain( + buildHatchAdder(GregtechMetaTileEntity_IndustrialThermalCentrifuge.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) + .casingIndex(getCasingTextureIndex()) + .dot(1) + .build(), + onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 0)), + onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings3, 9)))) + .addElement( + 'X', + ofChain( + onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 0)), + onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings3, 9)))) + .build(); } return STRUCTURE_DEFINITION; } @@ -137,8 +145,9 @@ public class GregtechMetaTileEntity_IndustrialThermalCentrifuge @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setSpeedBonus(1F / 2.5F).setEuModifier(0.8F) - .setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setSpeedBonus(1F / 2.5F) + .setEuModifier(0.8F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java index 592033de2c..aba508e183 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java @@ -42,7 +42,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialVacuumFreezer> implements ISurvivalConstructable { + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialVacuumFreezer> implements ISurvivalConstructable { public static int CASING_TEXTURE_ID; public static String mCryoFuelName = "Gelid Cryotheum"; @@ -55,7 +55,7 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends private final ArrayList<GT_MetaTileEntity_Hatch_CustomFluidBase> mCryotheumHatches = new ArrayList<>(); public GregtechMetaTileEntity_IndustrialVacuumFreezer(final int aID, final String aName, - final String aNameRegional) { + final String aNameRegional) { super(aID, aName, aNameRegional); mFuelStack = FluidUtils.getFluidStack("cryotheum", 1); CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 10); @@ -80,15 +80,25 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Factory Grade Advanced Vacuum Freezer") - .addInfo("Speed: +100% | EU Usage: 100% | Parallel: 4") - .addInfo("Consumes 20L of " + mCryoFuelName + "/s during operation") - .addInfo("Constructed exactly the same as a normal Vacuum Freezer") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true) - .addController("Front Center").addCasingInfoMin(mCasingName, 10, false).addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1).addOutputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1) - .addOtherStructurePart(mHatchName, "Any Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Factory Grade Advanced Vacuum Freezer") + .addInfo("Speed: +100% | EU Usage: 100% | Parallel: 4") + .addInfo("Consumes 20L of " + mCryoFuelName + "/s during operation") + .addInfo("Constructed exactly the same as a normal Vacuum Freezer") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front Center") + .addCasingInfoMin(mCasingName, 10, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addOtherStructurePart(mHatchName, "Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -96,28 +106,27 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends public IStructureDefinition<GregtechMetaTileEntity_IndustrialVacuumFreezer> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialVacuumFreezer>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, - { "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - ofChain( - buildHatchAdder(GregtechMetaTileEntity_IndustrialVacuumFreezer.class) - .adder(GregtechMetaTileEntity_IndustrialVacuumFreezer::addCryotheumHatch) - .hatchId(967).shouldReject(t -> !t.mCryotheumHatches.isEmpty()) - .casingIndex(CASING_TEXTURE_ID).dot(1).build(), - buildHatchAdder(GregtechMetaTileEntity_IndustrialVacuumFreezer.class).atLeast( - InputBus, - OutputBus, - Maintenance, - Energy, - Muffler, - InputHatch, - OutputHatch).casingIndex(CASING_TEXTURE_ID).dot(1).build(), - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 10)))) - .build(); + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, { "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + ofChain( + buildHatchAdder(GregtechMetaTileEntity_IndustrialVacuumFreezer.class) + .adder(GregtechMetaTileEntity_IndustrialVacuumFreezer::addCryotheumHatch) + .hatchId(967) + .shouldReject(t -> !t.mCryotheumHatches.isEmpty()) + .casingIndex(CASING_TEXTURE_ID) + .dot(1) + .build(), + buildHatchAdder(GregtechMetaTileEntity_IndustrialVacuumFreezer.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) + .casingIndex(CASING_TEXTURE_ID) + .dot(1) + .build(), + onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 10)))) + .build(); } return STRUCTURE_DEFINITION; } @@ -151,7 +160,8 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase - && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileID() == 967) { + && aMetaTileEntity.getBaseMetaTileEntity() + .getMetaTileID() == 967) { return addToMachineListInternal(mCryotheumHatches, aTileEntity, aBaseCasingIndex); } } @@ -191,7 +201,8 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setSpeedBonus(1F / 2F).setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setSpeedBonus(1F / 2F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override @@ -230,15 +241,16 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends super.onPostTick(aBaseMetaTileEntity, aTick); if (this.mStartUpCheck < 0) { - if (this.mMaxProgresstime > 0 && this.mProgresstime != 0 - || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) { - if (aTick % 10 == 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) { + if (this.mMaxProgresstime > 0 && this.mProgresstime != 0 || this.getBaseMetaTileEntity() + .hasWorkJustBeenEnabled()) { + if (aTick % 10 == 0 || this.getBaseMetaTileEntity() + .hasWorkJustBeenEnabled()) { if (!this.depleteInputFromRestrictedHatches(this.mCryotheumHatches, 10)) { if (mGraceTimer-- == 0) { this.causeMaintenanceIssue(); this.stopMachine( - ShutDownReasonRegistry.outOfFluid( - Objects.requireNonNull(FluidUtils.getFluidStack("cryotheum", 20)))); + ShutDownReasonRegistry + .outOfFluid(Objects.requireNonNull(FluidUtils.getFluidStack("cryotheum", 20)))); mGraceTimer = 2; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java index f5d8fd7bbb..a12db63f4e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java @@ -60,8 +60,8 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import ic2.core.init.BlocksItems; import ic2.core.init.InternalName; -public class GregtechMetaTileEntity_IndustrialWashPlant extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialWashPlant> implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialWashPlant + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialWashPlant> implements ISurvivalConstructable { private int mMode = 0; private int mCasing; @@ -88,17 +88,27 @@ public class GregtechMetaTileEntity_IndustrialWashPlant extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Wash Plant") - .addInfo("Can be configured with a screwdriver to also do Simple Washer and process Chemical Bathing") - .addInfo("400% faster than using single block machines of the same voltage") - .addInfo("Processes four item per voltage tier") - .addInfo("Always requires an Input Hatch full of water to refill structure") - .addInfo("Need to be filled with water.").addInfo("Will automatically fill water from input hatch.") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(5, 3, 7, true) - .addController("Front Center").addCasingInfoMin("Wash Plant Casings", 40, false) - .addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Industrial Wash Plant") + .addInfo("Can be configured with a screwdriver to also do Simple Washer and process Chemical Bathing") + .addInfo("400% faster than using single block machines of the same voltage") + .addInfo("Processes four item per voltage tier") + .addInfo("Always requires an Input Hatch full of water to refill structure") + .addInfo("Need to be filled with water.") + .addInfo("Will automatically fill water from input hatch.") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(5, 3, 7, true) + .addController("Front Center") + .addCasingInfoMin("Wash Plant Casings", 40, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -106,28 +116,27 @@ public class GregtechMetaTileEntity_IndustrialWashPlant extends public IStructureDefinition<GregtechMetaTileEntity_IndustrialWashPlant> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialWashPlant>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCCCC", "CwwwC", "CwwwC", "CwwwC", "CwwwC", "CwwwC", "CCCCC" }, - { "CC~CC", "CwwwC", "CwwwC", "CwwwC", "CwwwC", "CwwwC", "CCCCC" }, - { "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_IndustrialWashPlant.class) - .atLeast(InputBus, InputHatch, OutputHatch, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( - onElementPass( - x -> ++x.mCasing, - ofBlock(getCasingBlock(), getCasingMeta())))) - .addElement( - 'w', - ofChain( - isAir(), - ofBlockAnyMeta(Blocks.water), - ofBlockAnyMeta(Blocks.flowing_water), - ofBlockAnyMeta(BlocksItems.getFluidBlock(InternalName.fluidDistilledWater)))) - .build(); + .addShape( + mName, + transpose( + new String[][] { { "CCCCC", "CwwwC", "CwwwC", "CwwwC", "CwwwC", "CwwwC", "CCCCC" }, + { "CC~CC", "CwwwC", "CwwwC", "CwwwC", "CwwwC", "CwwwC", "CCCCC" }, + { "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_IndustrialWashPlant.class) + .atLeast(InputBus, InputHatch, OutputHatch, OutputBus, Maintenance, Energy, Muffler) + .casingIndex(getCasingTextureIndex()) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) + .addElement( + 'w', + ofChain( + isAir(), + ofBlockAnyMeta(Blocks.water), + ofBlockAnyMeta(Blocks.flowing_water), + ofBlockAnyMeta(BlocksItems.getFluidBlock(InternalName.fluidDistilledWater)))) + .build(); } return STRUCTURE_DEFINITION; } @@ -173,16 +182,14 @@ public class GregtechMetaTileEntity_IndustrialWashPlant extends @Override public RecipeMap<?> getRecipeMap() { return mMode == 0 ? RecipeMaps.oreWasherRecipes - : mMode == 1 ? GTPPRecipeMaps.simpleWasherRecipes : RecipeMaps.chemicalBathRecipes; + : mMode == 1 ? GTPPRecipeMaps.simpleWasherRecipes : RecipeMaps.chemicalBathRecipes; } @Nonnull @Override public Collection<RecipeMap<?>> getAvailableRecipeMaps() { - return Arrays.asList( - RecipeMaps.oreWasherRecipes, - GTPPRecipeMaps.simpleWasherRecipes, - RecipeMaps.chemicalBathRecipes); + return Arrays + .asList(RecipeMaps.oreWasherRecipes, GTPPRecipeMaps.simpleWasherRecipes, RecipeMaps.chemicalBathRecipes); } @Override @@ -202,7 +209,8 @@ public class GregtechMetaTileEntity_IndustrialWashPlant extends } return SimpleCheckRecipeResult.ofFailure("no_water"); } - }.setSpeedBonus(1F / 5F).setMaxParallelSupplier(this::getMaxParallelRecipes); + }.setSpeedBonus(1F / 5F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override @@ -291,7 +299,8 @@ public class GregtechMetaTileEntity_IndustrialWashPlant extends if (tBlock == Blocks.water) { fluidUsed = BlocksItems.getFluidBlock(InternalName.fluidDistilledWater); } - aBaseMetaTileEntity.getWorld().setBlock( + aBaseMetaTileEntity.getWorld() + .setBlock( aBaseMetaTileEntity.getXCoord() + xDir + i, aBaseMetaTileEntity.getYCoord() + h, aBaseMetaTileEntity.getZCoord() + zDir + j, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java index 13500d7df2..15ae5a96f8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java @@ -37,8 +37,8 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -public class GregtechMetaTileEntity_IndustrialWireMill extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialWireMill> implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialWireMill + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialWireMill> implements ISurvivalConstructable { private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_IndustrialWireMill> STRUCTURE_DEFINITION = null; @@ -66,34 +66,42 @@ public class GregtechMetaTileEntity_IndustrialWireMill extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Wire Factory") - .addInfo("200% faster than using single block machines of the same voltage") - .addInfo("Only uses 75% of the EU/t normally required").addInfo("Processes four items per voltage tier") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 5, true) - .addController("Front Center").addCasingInfoMin("Wire Factory Casings", 14, false) - .addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1).addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Industrial Wire Factory") + .addInfo("200% faster than using single block machines of the same voltage") + .addInfo("Only uses 75% of the EU/t normally required") + .addInfo("Processes four items per voltage tier") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 5, true) + .addController("Front Center") + .addCasingInfoMin("Wire Factory Casings", 14, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @Override public IStructureDefinition<GregtechMetaTileEntity_IndustrialWireMill> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialWireMill>builder().addShape( + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialWireMill>builder() + .addShape( mName, transpose( - new String[][] { { "CCC", "CCC", "CCC", "CCC", "CCC" }, - { "C~C", "C-C", "C-C", "C-C", "CCC" }, { "CCC", "CCC", "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_IndustrialWireMill.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( - onElementPass( - x -> ++x.mCasing, - ofBlock(getCasingBlock(), getCasingMeta())))) - .build(); + new String[][] { { "CCC", "CCC", "CCC", "CCC", "CCC" }, { "C~C", "C-C", "C-C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_IndustrialWireMill.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) + .casingIndex(getCasingTextureIndex()) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) + .build(); } return STRUCTURE_DEFINITION; } @@ -147,17 +155,17 @@ public class GregtechMetaTileEntity_IndustrialWireMill extends @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setSpeedBonus(1F / 3F).setEuModifier(0.75F) - .setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setSpeedBonus(1F / 3F) + .setEuModifier(0.75F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { inputSeparation = !inputSeparation; aPlayer.addChatMessage( - new ChatComponentTranslation( - inputSeparation ? "interaction.separateBusses.enabled" - : "interaction.separateBusses.disabled")); + new ChatComponentTranslation( + inputSeparation ? "interaction.separateBusses.enabled" : "interaction.separateBusses.disabled")); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java index b3de3a2426..c14cae9b88 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java @@ -63,7 +63,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers.G import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IsaMill> - implements ISurvivalConstructable { + implements ISurvivalConstructable { protected boolean boostEu = false; private int mCasing; @@ -86,47 +86,56 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase< @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Large Grinding Machine") - .addInfo("Grind ores.").addPollutionAmount(getPollutionPerSecond(null)).addSeparator() - .beginStructureBlock(3, 3, 7, false).addController("Front Center") - .addCasingInfoMin("IsaMill Exterior Casing", 40, false) - .addOtherStructurePart("IsaMill Gearbox", "5x, Inner Blocks") - .addOtherStructurePart("IsaMill Piping", "8x, ring around controller") - .addStructureInfo("IsaMill Pipings must not be obstructed in front (only air blocks)") - .addOtherStructurePart("Milling Ball Hatch", "Any Casing").addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1).addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Large Grinding Machine") + .addInfo("Grind ores.") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 7, false) + .addController("Front Center") + .addCasingInfoMin("IsaMill Exterior Casing", 40, false) + .addOtherStructurePart("IsaMill Gearbox", "5x, Inner Blocks") + .addOtherStructurePart("IsaMill Piping", "8x, ring around controller") + .addStructureInfo("IsaMill Pipings must not be obstructed in front (only air blocks)") + .addOtherStructurePart("Milling Ball Hatch", "Any Casing") + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @Override public IStructureDefinition<GregtechMetaTileEntity_IsaMill> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IsaMill>builder().addShape( + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IsaMill>builder() + .addShape( mName, transpose( - new String[][] { { "DDD", "CCC", "CCC", "CCC", "CCC", "CCC", "CCC" }, - { "D~D", "CGC", "CGC", "CGC", "CGC", "CGC", "CCC" }, - { "DDD", "CCC", "CCC", "CCC", "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - ofChain( - buildHatchAdder(GregtechMetaTileEntity_IsaMill.class) - .adder(GregtechMetaTileEntity_IsaMill::addMillingBallsHatch) - .hatchClass(GT_MetaTileEntity_Hatch_MillingBalls.class) - .shouldReject(t -> !t.mMillingBallBuses.isEmpty()) - .casingIndex(getCasingTextureIndex()).dot(1).build(), - buildHatchAdder(GregtechMetaTileEntity_IsaMill.class).atLeast( - InputBus, - OutputBus, - InputHatch, - OutputHatch, - Maintenance, - Energy, - Muffler).casingIndex(getCasingTextureIndex()).dot(1).build(), - onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) - .addElement('D', ofBlock(getIntakeBlock(), getIntakeMeta())) - .addElement('G', ofBlock(getGearboxBlock(), getGearboxMeta())).build(); + new String[][] { { "DDD", "CCC", "CCC", "CCC", "CCC", "CCC", "CCC" }, + { "D~D", "CGC", "CGC", "CGC", "CGC", "CGC", "CCC" }, + { "DDD", "CCC", "CCC", "CCC", "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + ofChain( + buildHatchAdder(GregtechMetaTileEntity_IsaMill.class) + .adder(GregtechMetaTileEntity_IsaMill::addMillingBallsHatch) + .hatchClass(GT_MetaTileEntity_Hatch_MillingBalls.class) + .shouldReject(t -> !t.mMillingBallBuses.isEmpty()) + .casingIndex(getCasingTextureIndex()) + .dot(1) + .build(), + buildHatchAdder(GregtechMetaTileEntity_IsaMill.class) + .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Maintenance, Energy, Muffler) + .casingIndex(getCasingTextureIndex()) + .dot(1) + .build(), + onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) + .addElement('D', ofBlock(getIntakeBlock(), getIntakeMeta())) + .addElement('G', ofBlock(getGearboxBlock(), getGearboxMeta())) + .build(); } return STRUCTURE_DEFINITION; } @@ -261,9 +270,9 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase< } } else if (aFoundEntity.getHealth() > 0) { EntityUtils.doDamage( - aFoundEntity, - mIsaMillDamageSource, - Math.max(1, (int) (aFoundEntity.getMaxHealth() / 3))); + aFoundEntity, + mIsaMillDamageSource, + Math.max(1, (int) (aFoundEntity.getMaxHealth() / 3))); if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) { generateParticles(aFoundEntity); } @@ -329,13 +338,13 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase< float aOffsetY = MathUtils.randFloat(-0.25f, 0.35f); float aOffsetZ = MathUtils.randFloat(-0.35f, 0.35f); aEntity.worldObj.spawnParticle( - "reddust", - aEffectPos.xPos + aOffsetX, - aEffectPos.yPos + 0.3f + aOffsetY, - aEffectPos.zPos + aOffsetZ, - 0.0D, - 0.0D, - 0.0D); + "reddust", + aEffectPos.xPos + aOffsetX, + aEffectPos.yPos + 0.3f + aOffsetY, + aEffectPos.zPos + aOffsetZ, + 0.0D, + 0.0D, + 0.0D); } } @@ -405,7 +414,7 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase< @Override public String[] getExtraInfoData() { return new String[] { "IsaMill Grinding Machine", "Current Efficiency: " + (mEfficiency / 100) + "%", - getIdealStatus() == getRepairStatus() ? "No Maintainance issues" : "Needs Maintainance" }; + getIdealStatus() == getRepairStatus() ? "No Maintainance issues" : "Needs Maintainance" }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_NuclearSaltProcessingPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_NuclearSaltProcessingPlant.java index bcfe53c41c..6d1593bec9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_NuclearSaltProcessingPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_NuclearSaltProcessingPlant.java @@ -35,9 +35,8 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; -public class GregtechMetaTileEntity_NuclearSaltProcessingPlant - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_NuclearSaltProcessingPlant> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_NuclearSaltProcessingPlant extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_NuclearSaltProcessingPlant> implements ISurvivalConstructable { protected GT_Recipe lastRecipeToBuffer; private int casing; @@ -74,22 +73,30 @@ public class GregtechMetaTileEntity_NuclearSaltProcessingPlant @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Nuclear Salt Processing Plant") - .addInfo("Processes depleted nuclear salts that come from the LFTR") - .addInfo("Handles the recipes of the Reactor Processor Unit and Cold Trap") - .addInfo("Only Thermally Insulated Casings can be replaced with hatches") - .addInfo("Mufflers on top, Energy Hatches on bottom, exactly 2 of each are required") - .addInfo("Maintenance Hatch goes on the back, opposite of the controller block") - .addInfo("Inputs go on the left side of the multi, outputs on the right side") - .addInfo("150% faster than using single block machines of the same voltage") - .addInfo("Processes two items per voltage tier").addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator().beginStructureBlock(3, 3, 3, true).addController("Front Center") - .addCasingInfoMin("IV Machine Casing", 58, false) - .addCasingInfoMin("Thermally Insulated Casing", 1, false).addInputBus("Left Half", 2) - .addInputHatch("Left Half", 2).addOutputBus("Right Half", 3).addOutputHatch("Right Half", 3) - .addMufflerHatch("Top Side, 2 Required", 4).addEnergyHatch("Bottom Side, 2 Required", 5) - .addMaintenanceHatch("Back Side, Opposite of Controller", 6) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Nuclear Salt Processing Plant") + .addInfo("Processes depleted nuclear salts that come from the LFTR") + .addInfo("Handles the recipes of the Reactor Processor Unit and Cold Trap") + .addInfo("Only Thermally Insulated Casings can be replaced with hatches") + .addInfo("Mufflers on top, Energy Hatches on bottom, exactly 2 of each are required") + .addInfo("Maintenance Hatch goes on the back, opposite of the controller block") + .addInfo("Inputs go on the left side of the multi, outputs on the right side") + .addInfo("150% faster than using single block machines of the same voltage") + .addInfo("Processes two items per voltage tier") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front Center") + .addCasingInfoMin("IV Machine Casing", 58, false) + .addCasingInfoMin("Thermally Insulated Casing", 1, false) + .addInputBus("Left Half", 2) + .addInputHatch("Left Half", 2) + .addOutputBus("Right Half", 3) + .addOutputHatch("Right Half", 3) + .addMufflerHatch("Top Side, 2 Required", 4) + .addEnergyHatch("Bottom Side, 2 Required", 5) + .addMaintenanceHatch("Back Side, Opposite of Controller", 6) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -112,53 +119,46 @@ public class GregtechMetaTileEntity_NuclearSaltProcessingPlant public IStructureDefinition<GregtechMetaTileEntity_NuclearSaltProcessingPlant> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_NuclearSaltProcessingPlant>builder() - .addShape( - mName, - transpose( - new String[][] { { "AAA AAA", "ADA ADA", "AAA AAA" }, - { "ABBA ACCA", "B AAA C", "ABBA ACCA" }, - { "ABBB~CCCA", "B C", "ABBBFCCCA" }, - { "ABBA ACCA", "B AAA C", "ABBA ACCA" }, - { "AAA AAA", "AEA AEA", "AAA AAA" } })) - .addElement('A', ofBlock(GregTech_API.sBlockCasings1, 5)) - .addElement( - 'B', - buildHatchAdder(GregtechMetaTileEntity_NuclearSaltProcessingPlant.class) - .atLeast(InputBus, InputHatch).casingIndex(TAE.getIndexFromPage(0, 10)).dot(2) - .buildAndChain( - onElementPass( - x -> ++x.casing, - ofBlock(ModBlocks.blockSpecialMultiCasings, 8)))) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_NuclearSaltProcessingPlant.class) - .atLeast(OutputBus, OutputHatch).casingIndex(TAE.getIndexFromPage(0, 10)).dot(3) - .buildAndChain( - onElementPass( - x -> ++x.casing, - ofBlock(ModBlocks.blockSpecialMultiCasings, 8)))) - .addElement( - 'D', - buildHatchAdder(GregtechMetaTileEntity_NuclearSaltProcessingPlant.class).atLeast(Muffler) - .casingIndex(TAE.getIndexFromPage(0, 10)).dot(4).buildAndChain( - onElementPass( - x -> ++x.casing, - ofBlock(ModBlocks.blockSpecialMultiCasings, 8)))) - .addElement( - 'E', - buildHatchAdder(GregtechMetaTileEntity_NuclearSaltProcessingPlant.class).atLeast(Energy) - .casingIndex(TAE.getIndexFromPage(0, 10)).dot(5).buildAndChain( - onElementPass( - x -> ++x.casing, - ofBlock(ModBlocks.blockSpecialMultiCasings, 8)))) - .addElement( - 'F', - buildHatchAdder(GregtechMetaTileEntity_NuclearSaltProcessingPlant.class) - .atLeast(Maintenance).casingIndex(TAE.getIndexFromPage(0, 10)).dot(6).buildAndChain( - onElementPass( - x -> ++x.casing, - ofBlock(ModBlocks.blockSpecialMultiCasings, 8)))) - .build(); + .addShape( + mName, + transpose( + new String[][] { { "AAA AAA", "ADA ADA", "AAA AAA" }, + { "ABBA ACCA", "B AAA C", "ABBA ACCA" }, { "ABBB~CCCA", "B C", "ABBBFCCCA" }, + { "ABBA ACCA", "B AAA C", "ABBA ACCA" }, { "AAA AAA", "AEA AEA", "AAA AAA" } })) + .addElement('A', ofBlock(GregTech_API.sBlockCasings1, 5)) + .addElement( + 'B', + buildHatchAdder(GregtechMetaTileEntity_NuclearSaltProcessingPlant.class) + .atLeast(InputBus, InputHatch) + .casingIndex(TAE.getIndexFromPage(0, 10)) + .dot(2) + .buildAndChain(onElementPass(x -> ++x.casing, ofBlock(ModBlocks.blockSpecialMultiCasings, 8)))) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_NuclearSaltProcessingPlant.class) + .atLeast(OutputBus, OutputHatch) + .casingIndex(TAE.getIndexFromPage(0, 10)) + .dot(3) + .buildAndChain(onElementPass(x -> ++x.casing, ofBlock(ModBlocks.blockSpecialMultiCasings, 8)))) + .addElement( + 'D', + buildHatchAdder(GregtechMetaTileEntity_NuclearSaltProcessingPlant.class).atLeast(Muffler) + .casingIndex(TAE.getIndexFromPage(0, 10)) + .dot(4) + .buildAndChain(onElementPass(x -> ++x.casing, ofBlock(ModBlocks.blockSpecialMultiCasings, 8)))) + .addElement( + 'E', + buildHatchAdder(GregtechMetaTileEntity_NuclearSaltProcessingPlant.class).atLeast(Energy) + .casingIndex(TAE.getIndexFromPage(0, 10)) + .dot(5) + .buildAndChain(onElementPass(x -> ++x.casing, ofBlock(ModBlocks.blockSpecialMultiCasings, 8)))) + .addElement( + 'F', + buildHatchAdder(GregtechMetaTileEntity_NuclearSaltProcessingPlant.class).atLeast(Maintenance) + .casingIndex(TAE.getIndexFromPage(0, 10)) + .dot(6) + .buildAndChain(onElementPass(x -> ++x.casing, ofBlock(ModBlocks.blockSpecialMultiCasings, 8)))) + .build(); } return STRUCTURE_DEFINITION; } @@ -192,7 +192,8 @@ public class GregtechMetaTileEntity_NuclearSaltProcessingPlant @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setSpeedBonus(1F / 2.5F).setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setSpeedBonus(1F / 2.5F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override @@ -204,7 +205,7 @@ public class GregtechMetaTileEntity_NuclearSaltProcessingPlant public String[] getExtraInfoData() { final String running = (this.mMaxProgresstime > 0 ? "Salt Plant running" : "Salt Plant stopped"); final String maintenance = (this.getIdealStatus() == this.getRepairStatus() ? "No Maintenance issues" - : "Needs Maintenance"); + : "Needs Maintenance"); String tSpecialText; if (lastRecipeToBuffer != null && lastRecipeToBuffer.mOutputs[0].getDisplayName() != null) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java index 17f59331ed..5f4203b99e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java @@ -54,7 +54,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_SpargeTower> - implements ISurvivalConstructable { + implements ISurvivalConstructable { protected static final String STRUCTURE_PIECE_BASE = "base"; protected static final String STRUCTURE_PIECE_LAYER = "layer"; @@ -64,56 +64,52 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB static { IHatchElement<GregtechMetaTileEntity_SpargeTower> layeredOutputHatch = OutputHatch - .withCount(GregtechMetaTileEntity_SpargeTower::getCurrentLayerOutputHatchCount) - .withAdder(GregtechMetaTileEntity_SpargeTower::addLayerOutputHatch); + .withCount(GregtechMetaTileEntity_SpargeTower::getCurrentLayerOutputHatchCount) + .withAdder(GregtechMetaTileEntity_SpargeTower::addLayerOutputHatch); STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_SpargeTower>builder() - .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] { { "b~b", "bbb", "bbb" }, })) - .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] { { "lll", "lcl", "lll" } })) - .addShape(STRUCTURE_PIECE_LAYER_HINT, transpose(new String[][] { { "lll", "l-l", "lll" } })) - .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][] { { "lll", "lll", "lll" } })) - .addElement( - 'b', - buildHatchAdder(GregtechMetaTileEntity_SpargeTower.class) - .atLeast(Energy, InputHatch, InputBus, Maintenance).disallowOnly(ForgeDirection.UP) - .casingIndex(getCasingIndex()).dot(1).buildAndChain( - onElementPass( - GregtechMetaTileEntity_SpargeTower::onCasingFound, - ofBlock(ModBlocks.blockCasings5Misc, 4)))) - .addElement( - 'l', - ofChain( - buildHatchAdder(GregtechMetaTileEntity_SpargeTower.class).atLeast(layeredOutputHatch) - .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) - .casingIndex(getCasingIndex()).dot(2).build(), - ofHatchAdder( - GregtechMetaTileEntity_SpargeTower::addEnergyInputToMachineList, - getCasingIndex(), - 2), - ofHatchAdder( - GregtechMetaTileEntity_SpargeTower::addMaintenanceToMachineList, - getCasingIndex(), - 2), - onElementPass( - GregtechMetaTileEntity_SpargeTower::onCasingFound, - ofBlock(ModBlocks.blockCasings5Misc, 4)))) - .addElement( - 'c', - ofChain( - onElementPass( - t -> t.onTopLayerFound(false), - ofHatchAdder( - GregtechMetaTileEntity_SpargeTower::addOutputToMachineList, - getCasingIndex(), - 3)), - onElementPass( - t -> t.onTopLayerFound(false), - ofHatchAdder( - GregtechMetaTileEntity_SpargeTower::addMaintenanceToMachineList, - getCasingIndex(), - 3)), - onElementPass(t -> t.onTopLayerFound(true), ofBlock(ModBlocks.blockCasings5Misc, 4)), - isAir())) - .build(); + .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] { { "b~b", "bbb", "bbb" }, })) + .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] { { "lll", "lcl", "lll" } })) + .addShape(STRUCTURE_PIECE_LAYER_HINT, transpose(new String[][] { { "lll", "l-l", "lll" } })) + .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][] { { "lll", "lll", "lll" } })) + .addElement( + 'b', + buildHatchAdder(GregtechMetaTileEntity_SpargeTower.class) + .atLeast(Energy, InputHatch, InputBus, Maintenance) + .disallowOnly(ForgeDirection.UP) + .casingIndex(getCasingIndex()) + .dot(1) + .buildAndChain( + onElementPass( + GregtechMetaTileEntity_SpargeTower::onCasingFound, + ofBlock(ModBlocks.blockCasings5Misc, 4)))) + .addElement( + 'l', + ofChain( + buildHatchAdder(GregtechMetaTileEntity_SpargeTower.class).atLeast(layeredOutputHatch) + .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) + .casingIndex(getCasingIndex()) + .dot(2) + .build(), + ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addEnergyInputToMachineList, getCasingIndex(), 2), + ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addMaintenanceToMachineList, getCasingIndex(), 2), + onElementPass( + GregtechMetaTileEntity_SpargeTower::onCasingFound, + ofBlock(ModBlocks.blockCasings5Misc, 4)))) + .addElement( + 'c', + ofChain( + onElementPass( + t -> t.onTopLayerFound(false), + ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addOutputToMachineList, getCasingIndex(), 3)), + onElementPass( + t -> t.onTopLayerFound(false), + ofHatchAdder( + GregtechMetaTileEntity_SpargeTower::addMaintenanceToMachineList, + getCasingIndex(), + 3)), + onElementPass(t -> t.onTopLayerFound(true), ofBlock(ModBlocks.blockCasings5Misc, 4)), + isAir())) + .build(); } protected final List<List<GT_MetaTileEntity_Hatch_Output>> mOutputHatchesByLayer = new ArrayList<>(); @@ -141,17 +137,21 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Gas Sparge Tower").addInfo("Controller block for the Sparging Tower") - .addInfo("Runs gases through depleted molten salts to extract precious fluids") - .addInfo("Works the same way as the Distillation Tower, but with a fixed height of 8") - .addInfo("Fluids are only put out at the correct height") - .addInfo("The correct height equals the slot number in the NEI recipe").addSeparator() - .beginStructureBlock(3, 8, 3, true).addController("Front bottom") - .addOtherStructurePart("Sparge Tower Exterior Casing", "45 (minimum)") - .addEnergyHatch("Any casing", 1, 2).addMaintenanceHatch("Any casing", 1, 2, 3) - .addInputHatch("2x Input Hatches (Any bottom layer casing)", 1) - .addOutputHatch("6x Output Hatches (At least one per layer except bottom layer)", 2, 3) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType("Gas Sparge Tower") + .addInfo("Controller block for the Sparging Tower") + .addInfo("Runs gases through depleted molten salts to extract precious fluids") + .addInfo("Works the same way as the Distillation Tower, but with a fixed height of 8") + .addInfo("Fluids are only put out at the correct height") + .addInfo("The correct height equals the slot number in the NEI recipe") + .addSeparator() + .beginStructureBlock(3, 8, 3, true) + .addController("Front bottom") + .addOtherStructurePart("Sparge Tower Exterior Casing", "45 (minimum)") + .addEnergyHatch("Any casing", 1, 2) + .addMaintenanceHatch("Any casing", 1, 2, 3) + .addInputHatch("2x Input Hatches (Any bottom layer casing)", 1) + .addOutputHatch("6x Output Hatches (At least one per layer except bottom layer)", 2, 3) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -172,7 +172,8 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB @Override public RecipeMap<?> getRecipeMap() { - if (GTPPRecipeMaps.spargeTowerFakeRecipes.getAllRecipes().isEmpty()) { + if (GTPPRecipeMaps.spargeTowerFakeRecipes.getAllRecipes() + .isEmpty()) { generateRecipes(); } return GTPPRecipeMaps.spargeTowerFakeRecipes; @@ -181,19 +182,20 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB private static boolean generateRecipes() { for (GasSpargingRecipe aRecipe : GasSpargingRecipeMap.mRecipes) { GT_Recipe newRecipe = new GT_Recipe( - false, - new ItemStack[] {}, - new ItemStack[] {}, - null, - null, - aRecipe.mFluidInputs.clone(), - new FluidStack[] {}, - aRecipe.mDuration, - aRecipe.mEUt, - 0); + false, + new ItemStack[] {}, + new ItemStack[] {}, + null, + null, + aRecipe.mFluidInputs.clone(), + new FluidStack[] {}, + aRecipe.mDuration, + aRecipe.mEUt, + 0); GTPPRecipeMaps.spargeTowerFakeRecipes.add(newRecipe); } - return !GTPPRecipeMaps.spargeTowerFakeRecipes.getAllRecipes().isEmpty(); + return !GTPPRecipeMaps.spargeTowerFakeRecipes.getAllRecipes() + .isEmpty(); } @Override @@ -209,11 +211,11 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); if (tFluids.length > 0) { GT_Recipe tRecipe = getRecipeMap() - .findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids); + .findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids); if (tRecipe != null) { FluidStack[] possibleOutputs = getPossibleByproductsOfSparge( - tRecipe.mFluidInputs[0], - tRecipe.mFluidInputs[1]).toArray(new FluidStack[0]); + tRecipe.mFluidInputs[0], + tRecipe.mFluidInputs[1]).toArray(new FluidStack[0]); if (canOutputAll(possibleOutputs) && tRecipe.isRecipeInputEqual(true, tFluids)) { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; @@ -221,8 +223,8 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB calculateOverclockedNessMulti((long) tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); mMaxProgresstime = Math.max(1, mMaxProgresstime); ArrayList<FluidStack> aFluidOutputs = getByproductsOfSparge( - tRecipe.mFluidInputs[0], - tRecipe.mFluidInputs[1]); + tRecipe.mFluidInputs[0], + tRecipe.mFluidInputs[1]); this.mOutputFluids = aFluidOutputs.toArray(new FluidStack[0]); updateSlots(); @@ -240,7 +242,7 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB } private static List<FluidStack> getPossibleByproductsOfSparge(final FluidStack aSpargeGas, - final FluidStack aSpentFuel) { + final FluidStack aSpentFuel) { GasSpargingRecipe aSpargeRecipe = GasSpargingRecipeMap.findRecipe(aSpargeGas, aSpentFuel); ArrayList<FluidStack> aOutputGases = new ArrayList<>(); if (aSpargeRecipe == null) { @@ -264,7 +266,7 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB } private static ArrayList<FluidStack> getByproductsOfSparge(final FluidStack aSpargeGas, - final FluidStack aSpentFuel) { + final FluidStack aSpentFuel) { GasSpargingRecipe aSpargeRecipe = GasSpargingRecipeMap.findRecipe(aSpargeGas, aSpentFuel); ArrayList<FluidStack> aOutputGases = new ArrayList<>(); if (aSpargeRecipe == null) { @@ -309,12 +311,13 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB protected int getCurrentLayerOutputHatchCount() { return mOutputHatchesByLayer.size() < mHeight || mHeight <= 0 ? 0 - : mOutputHatchesByLayer.get(mHeight - 1).size(); + : mOutputHatchesByLayer.get(mHeight - 1) + .size(); } protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null || aTileEntity.isDead() - || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output tHatch)) { + || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output tHatch)) { Logger.INFO("Bad Output Hatch"); return false; } @@ -322,7 +325,8 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB mOutputHatchesByLayer.add(new ArrayList<>()); } tHatch.updateTexture(aBaseCasingIndex); - boolean addedHatch = mOutputHatchesByLayer.get(mHeight - 1).add(tHatch); + boolean addedHatch = mOutputHatchesByLayer.get(mHeight - 1) + .add(tHatch); Logger.INFO("Added Hatch: " + addedHatch); return addedHatch; } @@ -359,7 +363,8 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB // check each layer while (mHeight < 8 && checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0) && !mTopLayerFound) { - if (mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) { + if (mOutputHatchesByLayer.get(mHeight - 1) + .isEmpty()) { // layer without output hatch Logger.INFO("Height: " + mHeight + " - Missing output on " + (mHeight - 1)); return false; @@ -429,28 +434,28 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB for (int i = 1; i < tTotalHeight - 1; i++) { mHeight = i; built = survivialBuildPiece( - STRUCTURE_PIECE_LAYER_HINT, - stackSize, - 1, - i, - 0, - elementBudget, - env, - false, - true); - if (built >= 0) return built; - } - mHeight = tTotalHeight - 1; - return survivialBuildPiece( - STRUCTURE_PIECE_TOP_HINT, + STRUCTURE_PIECE_LAYER_HINT, stackSize, 1, - tTotalHeight - 1, + i, 0, elementBudget, env, false, true); + if (built >= 0) return built; + } + mHeight = tTotalHeight - 1; + return survivialBuildPiece( + STRUCTURE_PIECE_TOP_HINT, + stackSize, + 1, + tTotalHeight - 1, + 0, + elementBudget, + env, + false, + true); } @Override @@ -466,23 +471,22 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB @Override public boolean onPlungerRightClick(EntityPlayer aPlayer, ForgeDirection side, float aX, float aY, float aZ) { int aLayerIndex = 0; - PlayerUtils.messagePlayer( - aPlayer, - "Trying to clear " + mOutputHatchesByLayer.size() + " layers of output hatches."); + PlayerUtils + .messagePlayer(aPlayer, "Trying to clear " + mOutputHatchesByLayer.size() + " layers of output hatches."); for (List<GT_MetaTileEntity_Hatch_Output> layer : this.mOutputHatchesByLayer) { int aHatchIndex = 0; for (GT_MetaTileEntity_Hatch_Output hatch : layer) { if (hatch.mFluid != null) { PlayerUtils.messagePlayer( - aPlayer, - "Clearing " + hatch.mFluid.amount - + "L of " - + hatch.mFluid.getLocalizedName() - + " from hatch " - + aHatchIndex - + " on layer " - + aLayerIndex - + "."); + aPlayer, + "Clearing " + hatch.mFluid.amount + + "L of " + + hatch.mFluid.getLocalizedName() + + " from hatch " + + aHatchIndex + + " on layer " + + aLayerIndex + + "."); hatch.mFluid = null; } aHatchIndex++; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java index 1c84c7886b..8296b8e7cb 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java @@ -56,7 +56,7 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; public class GregtechMetaTileEntity_Adv_DistillationTower extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_DistillationTower> implements ISurvivalConstructable { + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_DistillationTower> implements ISurvivalConstructable { private Mode mMode = Mode.DistillationTower; private boolean mUpgraded = false; @@ -90,81 +90,88 @@ public class GregtechMetaTileEntity_Adv_DistillationTower extends public IStructureDefinition<GregtechMetaTileEntity_Adv_DistillationTower> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { IHatchElement<GregtechMetaTileEntity_Adv_DistillationTower> layeredOutputHatch = OutputHatch - .withCount(GregtechMetaTileEntity_Adv_DistillationTower::getCurrentLayerOutputHatchCount) - .withAdder(GregtechMetaTileEntity_Adv_DistillationTower::addLayerOutputHatch); + .withCount(GregtechMetaTileEntity_Adv_DistillationTower::getCurrentLayerOutputHatchCount) + .withAdder(GregtechMetaTileEntity_Adv_DistillationTower::addLayerOutputHatch); STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Adv_DistillationTower>builder() - .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] { { "b~b", "bbb", "bbb" }, })) - .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] { { "lll", "lcl", "lll" }, })) - .addShape(STRUCTURE_PIECE_LAYER_HINT, transpose(new String[][] { { "lll", "l-l", "lll" }, })) - .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][] { { "ttt", "ttt", "ttt" }, })) - .addElement( - 'b', - ofChain( - buildHatchAdder(GregtechMetaTileEntity_Adv_DistillationTower.class) - .atLeast(Energy, OutputBus, InputHatch, InputBus, Maintenance) - .disallowOnly(ForgeDirection.UP).casingIndex(getCasingTextureId()).dot(1) - .build(), - ofBlock(GregTech_API.sBlockCasings4, 1))) - .addElement( - 'l', - ofChain( - buildHatchAdder(GregtechMetaTileEntity_Adv_DistillationTower.class) - .atLeast(layeredOutputHatch, Energy, Maintenance) - .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) - .casingIndex(getCasingTextureId()).dot(2).build(), - ofHatchAdder( - GregtechMetaTileEntity_Adv_DistillationTower::addMufflerToMachineList, - getCasingTextureId(), - 3), - ofBlock(GregTech_API.sBlockCasings4, 1))) - .addElement( - 'c', - ofChain( - onElementPass( - GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound, - ofHatchAdder( - GregtechMetaTileEntity_Adv_DistillationTower::addMufflerToMachineList, - getCasingTextureId(), - 3)), - onElementPass( - GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound, - ofHatchAdder( - GregtechMetaTileEntity_Adv_DistillationTower::addOutputToMachineList, - getCasingTextureId(), - 3)), - onElementPass( - GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound, - ofHatchAdder( - GregtechMetaTileEntity_Adv_DistillationTower::addMaintenanceToMachineList, - getCasingTextureId(), - 3)), - onElementPass( - GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound, - ofBlock(GregTech_API.sBlockCasings4, 1)), - isAir())) - .addElement( - 't', - buildHatchAdder(GregtechMetaTileEntity_Adv_DistillationTower.class) - .atLeast(layeredOutputHatch, Muffler).disallowOnly(ForgeDirection.DOWN) - .casingIndex(getCasingTextureId()).dot(2) - .buildAndChain(GregTech_API.sBlockCasings4, 1)) - .build(); + .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] { { "b~b", "bbb", "bbb" }, })) + .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] { { "lll", "lcl", "lll" }, })) + .addShape(STRUCTURE_PIECE_LAYER_HINT, transpose(new String[][] { { "lll", "l-l", "lll" }, })) + .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][] { { "ttt", "ttt", "ttt" }, })) + .addElement( + 'b', + ofChain( + buildHatchAdder(GregtechMetaTileEntity_Adv_DistillationTower.class) + .atLeast(Energy, OutputBus, InputHatch, InputBus, Maintenance) + .disallowOnly(ForgeDirection.UP) + .casingIndex(getCasingTextureId()) + .dot(1) + .build(), + ofBlock(GregTech_API.sBlockCasings4, 1))) + .addElement( + 'l', + ofChain( + buildHatchAdder(GregtechMetaTileEntity_Adv_DistillationTower.class) + .atLeast(layeredOutputHatch, Energy, Maintenance) + .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) + .casingIndex(getCasingTextureId()) + .dot(2) + .build(), + ofHatchAdder( + GregtechMetaTileEntity_Adv_DistillationTower::addMufflerToMachineList, + getCasingTextureId(), + 3), + ofBlock(GregTech_API.sBlockCasings4, 1))) + .addElement( + 'c', + ofChain( + onElementPass( + GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound, + ofHatchAdder( + GregtechMetaTileEntity_Adv_DistillationTower::addMufflerToMachineList, + getCasingTextureId(), + 3)), + onElementPass( + GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound, + ofHatchAdder( + GregtechMetaTileEntity_Adv_DistillationTower::addOutputToMachineList, + getCasingTextureId(), + 3)), + onElementPass( + GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound, + ofHatchAdder( + GregtechMetaTileEntity_Adv_DistillationTower::addMaintenanceToMachineList, + getCasingTextureId(), + 3)), + onElementPass( + GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound, + ofBlock(GregTech_API.sBlockCasings4, 1)), + isAir())) + .addElement( + 't', + buildHatchAdder(GregtechMetaTileEntity_Adv_DistillationTower.class) + .atLeast(layeredOutputHatch, Muffler) + .disallowOnly(ForgeDirection.DOWN) + .casingIndex(getCasingTextureId()) + .dot(2) + .buildAndChain(GregTech_API.sBlockCasings4, 1)) + .build(); } return STRUCTURE_DEFINITION; } protected int getCurrentLayerOutputHatchCount() { return mOutputHatchesByLayer.size() < mHeight || mHeight <= 0 ? 0 - : mOutputHatchesByLayer.get(mHeight - 1).size(); + : mOutputHatchesByLayer.get(mHeight - 1) + .size(); } protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null || aTileEntity.isDead() - || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output tHatch)) - return false; + || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output tHatch)) return false; while (mOutputHatchesByLayer.size() < mHeight) mOutputHatchesByLayer.add(new ArrayList<>()); tHatch.updateTexture(aBaseCasingIndex); - return mOutputHatchesByLayer.get(mHeight - 1).add(tHatch) && mOutputHatches.add(tHatch); + return mOutputHatchesByLayer.get(mHeight - 1) + .add(tHatch) && mOutputHatches.add(tHatch); } protected void onTopLayerFound() { @@ -174,17 +181,26 @@ public class GregtechMetaTileEntity_Adv_DistillationTower extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Advanced Distillation Tower") - .addInfo("Use 85% less energy in distillery mode").addInfo("250%/100% faster in DT/distillery mode") - .addInfo("Right click the controller with screwdriver to change mode.") - .addInfo("Max parallel dictated by tower tier and mode").addInfo("DTower Mode: T1=4, T2=12") - .addInfo("Distilery Mode: Tower Tier * (4*InputTier)") - .addInfo("Distilery Mode require a full height tower").addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator().addCasingInfoMin("Clean Stainless Steel Machine Casing", 7, false) - .addInputBus("Bottom Casing", 1).addOutputBus("Bottom Casing", 1).addInputHatch("Bottom Casing", 1) - .addMaintenanceHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1) - .addOutputHatch("One per layer except bottom", 2).addMufflerHatch("Top Casing", 3) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Advanced Distillation Tower") + .addInfo("Use 85% less energy in distillery mode") + .addInfo("250%/100% faster in DT/distillery mode") + .addInfo("Right click the controller with screwdriver to change mode.") + .addInfo("Max parallel dictated by tower tier and mode") + .addInfo("DTower Mode: T1=4, T2=12") + .addInfo("Distilery Mode: Tower Tier * (4*InputTier)") + .addInfo("Distilery Mode require a full height tower") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .addCasingInfoMin("Clean Stainless Steel Machine Casing", 7, false) + .addInputBus("Bottom Casing", 1) + .addOutputBus("Bottom Casing", 1) + .addInputHatch("Bottom Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addOutputHatch("One per layer except bottom", 2) + .addMufflerHatch("Top Casing", 3) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -207,28 +223,28 @@ public class GregtechMetaTileEntity_Adv_DistillationTower extends for (int i = 1; i < tTotalHeight - 1; i++) { mHeight = i; built = survivialBuildPiece( - STRUCTURE_PIECE_LAYER_HINT, - stackSize, - 1, - i, - 0, - elementBudget, - env, - false, - true); - if (built >= 0) return built; - } - mHeight = tTotalHeight - 1; - return survivialBuildPiece( - STRUCTURE_PIECE_TOP_HINT, + STRUCTURE_PIECE_LAYER_HINT, stackSize, 1, - tTotalHeight - 1, + i, 0, elementBudget, env, false, true); + if (built >= 0) return built; + } + mHeight = tTotalHeight - 1; + return survivialBuildPiece( + STRUCTURE_PIECE_TOP_HINT, + stackSize, + 1, + tTotalHeight - 1, + 0, + elementBudget, + env, + false, + true); } @Override @@ -246,7 +262,8 @@ public class GregtechMetaTileEntity_Adv_DistillationTower extends if (!checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0)) { return false; } - if (mOutputHatchesByLayer.size() < mHeight || mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) + if (mOutputHatchesByLayer.size() < mHeight || mOutputHatchesByLayer.get(mHeight - 1) + .isEmpty()) // layer without output hatch return false; if (mTopLayerFound || !mMufflerHatches.isEmpty()) { @@ -430,9 +447,10 @@ public class GregtechMetaTileEntity_Adv_DistillationTower extends @Override public boolean canDumpFluidToME() { // All fluids can be dumped to ME only if each layer contains a ME Output Hatch. - return this.mOutputHatchesByLayer.stream().allMatch( + return this.mOutputHatchesByLayer.stream() + .allMatch( tLayerOutputHatches -> tLayerOutputHatches.stream() - .anyMatch(tHatch -> tHatch instanceof GT_MetaTileEntity_Hatch_Output_ME)); + .anyMatch(tHatch -> tHatch instanceof GT_MetaTileEntity_Hatch_Output_ME)); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java index 31880e0266..89c219c14e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java @@ -56,7 +56,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_EBF> - implements ISurvivalConstructable { + implements ISurvivalConstructable { public static int CASING_TEXTURE_ID; public static String mHotFuelName = "Blazing Pyrotheum"; @@ -91,57 +91,65 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase< @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Factory Grade Advanced Blast Furnace") - .addInfo("Speed: +120% | EU Usage: 90% | Parallel: 8") - .addInfo("Consumes 10L of " + mHotFuelName + " per second during operation") - .addInfo("Constructed exactly the same as a normal EBF").addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator().addController("Bottom center").addCasingInfoMin(mCasingName, 8, false) - .addInputHatch("Any Casing", 1).addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1) - .addOutputHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1).addOtherStructurePart(mHatchName, "Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Factory Grade Advanced Blast Furnace") + .addInfo("Speed: +120% | EU Usage: 90% | Parallel: 8") + .addInfo("Consumes 10L of " + mHotFuelName + " per second during operation") + .addInfo("Constructed exactly the same as a normal EBF") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .addController("Bottom center") + .addCasingInfoMin(mCasingName, 8, false) + .addInputHatch("Any Casing", 1) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addOtherStructurePart(mHatchName, "Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @Override public String[] getExtraInfoData() { return new String[] { StatCollector.translateToLocal("GT5U.EBF.heat") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mHeatingCapacity.getHeat()) - + EnumChatFormatting.RESET - + " K" }; + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mHeatingCapacity.getHeat()) + + EnumChatFormatting.RESET + + " K" }; } @Override public IStructureDefinition<GregtechMetaTileEntity_Adv_EBF> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Adv_EBF>builder().addShape( + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Adv_EBF>builder() + .addShape( mName, transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "HHH", "H-H", "HHH" }, { "HHH", "H-H", "HHH" }, - { "C~C", "CCC", "CCC" }, })) - .addElement( - 'C', - ofChain( - buildHatchAdder(GregtechMetaTileEntity_Adv_EBF.class) - .adder(GregtechMetaTileEntity_Adv_EBF::addPyrotheumHatch).hatchId(968) - .shouldReject(x -> !x.mPyrotheumHatches.isEmpty()) - .casingIndex(CASING_TEXTURE_ID).dot(1).build(), - buildHatchAdder(GregtechMetaTileEntity_Adv_EBF.class).atLeast( - InputBus, - OutputBus, - Maintenance, - Energy, - Muffler, - InputHatch, - OutputHatch).casingIndex(CASING_TEXTURE_ID).dot(1).build(), - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 11)))) - .addElement( - 'H', - ofCoil( - GregtechMetaTileEntity_Adv_EBF::setCoilLevel, - GregtechMetaTileEntity_Adv_EBF::getCoilLevel)) - .build(); + new String[][] { { "CCC", "CCC", "CCC" }, { "HHH", "H-H", "HHH" }, { "HHH", "H-H", "HHH" }, + { "C~C", "CCC", "CCC" }, })) + .addElement( + 'C', + ofChain( + buildHatchAdder(GregtechMetaTileEntity_Adv_EBF.class) + .adder(GregtechMetaTileEntity_Adv_EBF::addPyrotheumHatch) + .hatchId(968) + .shouldReject(x -> !x.mPyrotheumHatches.isEmpty()) + .casingIndex(CASING_TEXTURE_ID) + .dot(1) + .build(), + buildHatchAdder(GregtechMetaTileEntity_Adv_EBF.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) + .casingIndex(CASING_TEXTURE_ID) + .dot(1) + .build(), + onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 11)))) + .addElement( + 'H', + ofCoil(GregtechMetaTileEntity_Adv_EBF::setCoilLevel, GregtechMetaTileEntity_Adv_EBF::getCoilLevel)) + .build(); } return STRUCTURE_DEFINITION; } @@ -176,7 +184,8 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase< } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase - && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileID() == 968) { + && aMetaTileEntity.getBaseMetaTileEntity() + .getMetaTileID() == 968) { return addToMachineListInternal(mPyrotheumHatches, aTileEntity, aBaseCasingIndex); } } @@ -227,16 +236,20 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase< @Override protected CheckRecipeResult validateRecipe(@NotNull GT_Recipe recipe) { return recipe.mSpecialValue <= getCoilLevel().getHeat() ? CheckRecipeResultRegistry.SUCCESSFUL - : CheckRecipeResultRegistry.insufficientHeat(recipe.mSpecialValue); + : CheckRecipeResultRegistry.insufficientHeat(recipe.mSpecialValue); } @NotNull @Override protected GT_OverclockCalculator createOverclockCalculator(@NotNull GT_Recipe recipe) { - return super.createOverclockCalculator(recipe).setHeatOC(true).setHeatDiscount(true) - .setRecipeHeat(recipe.mSpecialValue).setMachineHeat((int) getCoilLevel().getHeat()); + return super.createOverclockCalculator(recipe).setHeatOC(true) + .setHeatDiscount(true) + .setRecipeHeat(recipe.mSpecialValue) + .setMachineHeat((int) getCoilLevel().getHeat()); } - }.setSpeedBonus(1F / 2.2F).setEuModifier(0.9F).setMaxParallelSupplier(this::getMaxParallelRecipes); + }.setSpeedBonus(1F / 2.2F) + .setEuModifier(0.9F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override @@ -266,15 +279,16 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase< super.onPostTick(aBaseMetaTileEntity, aTick); // Try dry Pyrotheum after all other logic if (this.mStartUpCheck < 0) { - if (this.mMaxProgresstime > 0 && this.mProgresstime != 0 - || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) { - if (aTick % 10 == 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) { + if (this.mMaxProgresstime > 0 && this.mProgresstime != 0 || this.getBaseMetaTileEntity() + .hasWorkJustBeenEnabled()) { + if (aTick % 10 == 0 || this.getBaseMetaTileEntity() + .hasWorkJustBeenEnabled()) { if (!this.depleteInputFromRestrictedHatches(this.mPyrotheumHatches, 5)) { if (mGraceTimer-- == 0) { this.causeMaintenanceIssue(); this.stopMachine( - ShutDownReasonRegistry.outOfFluid( - Objects.requireNonNull(FluidUtils.getFluidStack("pyrotheum", 10)))); + ShutDownReasonRegistry + .outOfFluid(Objects.requireNonNull(FluidUtils.getFluidStack("pyrotheum", 10)))); mGraceTimer = 2; } } @@ -292,9 +306,8 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase< public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { inputSeparation = !inputSeparation; aPlayer.addChatMessage( - new ChatComponentTranslation( - inputSeparation ? "interaction.separateBusses.enabled" - : "interaction.separateBusses.disabled")); + new ChatComponentTranslation( + inputSeparation ? "interaction.separateBusses.enabled" : "interaction.separateBusses.disabled")); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java index ee4db3c76e..0981a34b85 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java @@ -52,18 +52,24 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_Fus @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Fusion Reactor").addInfo("HARNESSING THE POWER OF A BLUE GIANT") - .addInfo("Controller block for the Fusion Reactor Mk IV") - .addInfo("131072EU/t and 320M 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("Performs 4/4 overclocks") - .addSeparator().beginStructureBlock(15, 3, 15, false).addController("See diagram when placed") - .addCasingInfoMin("Fusion Machine Casings MK III", 79, false) - .addStructureInfo("Cover the coils with casing") - .addOtherStructurePart("Advanced Fusion Coils", "Center part of the ring") - .addEnergyHatch("1-16, Specified casings", 2).addInputHatch("2-16, Specified casings", 1) - .addOutputHatch("1-16, Specified casings", 3).addStructureInfo("ALL Hatches must be UHV or better") - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType("Fusion Reactor") + .addInfo("HARNESSING THE POWER OF A BLUE GIANT") + .addInfo("Controller block for the Fusion Reactor Mk IV") + .addInfo("131072EU/t and 320M 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("Performs 4/4 overclocks") + .addSeparator() + .beginStructureBlock(15, 3, 15, false) + .addController("See diagram when placed") + .addCasingInfoMin("Fusion Machine Casings MK III", 79, false) + .addStructureInfo("Cover the coils with casing") + .addOtherStructurePart("Advanced Fusion Coils", "Center part of the ring") + .addEnergyHatch("1-16, Specified casings", 2) + .addInputHatch("2-16, Specified casings", 1) + .addOutputHatch("1-16, Specified casings", 3) + .addStructureInfo("ALL Hatches must be UHV or better") + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -119,34 +125,37 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_Fus @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { + final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { if (side == facing) { return new ITexture[] { - new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, - Dyes.getModulation(-1, Dyes._NULL.mRGBa)), - TextureFactory.builder().addIcon(this.getIconOverlay()).extFacing().build() }; + new GT_RenderedTexture( + Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, + Dyes.getModulation(-1, Dyes._NULL.mRGBa)), + TextureFactory.builder() + .addIcon(this.getIconOverlay()) + .extFacing() + .build() }; } else if (!aActive) { return new ITexture[] { new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, - Dyes.getModulation(-1, Dyes._NULL.mRGBa)) }; + Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, + Dyes.getModulation(-1, Dyes._NULL.mRGBa)) }; } else { return new ITexture[] { new GT_RenderedTexture( - TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_ULTRA, - Dyes.getModulation(-1, Dyes._NULL.mRGBa)) }; + TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_ULTRA, + Dyes.getModulation(-1, Dyes._NULL.mRGBa)) }; } } @Override public ITexture getTextureOverlay() { return new GT_RenderedTexture( - this.getBaseMetaTileEntity().isActive() ? TexturesGtBlock.Casing_Machine_Screen_3 - : TexturesGtBlock.Casing_Machine_Screen_1); + this.getBaseMetaTileEntity() + .isActive() ? TexturesGtBlock.Casing_Machine_Screen_3 : TexturesGtBlock.Casing_Machine_Screen_1); } public IIconContainer getIconOverlay() { - return this.getBaseMetaTileEntity().isActive() ? TexturesGtBlock.Casing_Machine_Screen_3 - : TexturesGtBlock.Casing_Machine_Screen_1; + return this.getBaseMetaTileEntity() + .isActive() ? TexturesGtBlock.Casing_Machine_Screen_3 : TexturesGtBlock.Casing_Machine_Screen_1; } @Override @@ -186,6 +195,6 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_Fus } return new String[] { "Fusion Reactor MK " + tier, "EU Required: " + powerRequired + "EU/t", - "Stored EU: " + mEUStore + " / " + maxEUStore(), "Plasma Output: " + plasmaOut + "L/t" }; + "Stored EU: " + mEUStore + " / " + maxEUStore(), "Plasma Output: " + plasmaOut + "L/t" }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK5.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK5.java index 5d546b5bfb..b2c2e5eb27 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK5.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK5.java @@ -52,18 +52,24 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK5 extends GT_MetaTileEntity_Fus @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Fusion Reactor").addInfo("HARNESSING THE POWER OF A NEUTRON STAR") - .addInfo("Controller block for the Fusion Reactor Mk V") - .addInfo("524,288EU/t and 1.28B 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("Performs 4/4 overclocks") - .addSeparator().beginStructureBlock(15, 3, 15, false).addController("See diagram when placed") - .addCasingInfoMin("Fusion Machine Casings MK IV", 79, false) - .addStructureInfo("Cover the coils with casing") - .addOtherStructurePart("Advanced Fusion Coils II", "Center part of the ring") - .addEnergyHatch("1-16, Specified casings", 2).addInputHatch("2-16, Specified casings", 1) - .addOutputHatch("1-16, Specified casings", 3).addStructureInfo("ALL Hatches must be UEV or better") - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType("Fusion Reactor") + .addInfo("HARNESSING THE POWER OF A NEUTRON STAR") + .addInfo("Controller block for the Fusion Reactor Mk V") + .addInfo("524,288EU/t and 1.28B 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("Performs 4/4 overclocks") + .addSeparator() + .beginStructureBlock(15, 3, 15, false) + .addController("See diagram when placed") + .addCasingInfoMin("Fusion Machine Casings MK IV", 79, false) + .addStructureInfo("Cover the coils with casing") + .addOtherStructurePart("Advanced Fusion Coils II", "Center part of the ring") + .addEnergyHatch("1-16, Specified casings", 2) + .addInputHatch("2-16, Specified casings", 1) + .addOutputHatch("1-16, Specified casings", 3) + .addStructureInfo("ALL Hatches must be UEV or better") + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -119,34 +125,37 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK5 extends GT_MetaTileEntity_Fus @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { + final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { if (side == facing) { return new ITexture[] { - new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, - Dyes.getModulation(-1, Dyes._NULL.mRGBa)), - TextureFactory.builder().addIcon(this.getIconOverlay()).extFacing().build() }; + new GT_RenderedTexture( + Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, + Dyes.getModulation(-1, Dyes._NULL.mRGBa)), + TextureFactory.builder() + .addIcon(this.getIconOverlay()) + .extFacing() + .build() }; } else if (!aActive) { return new ITexture[] { new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, - Dyes.getModulation(-1, Dyes._NULL.mRGBa)) }; + Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, + Dyes.getModulation(-1, Dyes._NULL.mRGBa)) }; } else { return new ITexture[] { new GT_RenderedTexture( - TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_HYPER, - Dyes.getModulation(-1, Dyes._NULL.mRGBa)) }; + TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_HYPER, + Dyes.getModulation(-1, Dyes._NULL.mRGBa)) }; } } @Override public ITexture getTextureOverlay() { return new GT_RenderedTexture( - this.getBaseMetaTileEntity().isActive() ? TexturesGtBlock.Casing_Machine_Screen_Rainbow - : TexturesGtBlock.Casing_Machine_Screen_1); + this.getBaseMetaTileEntity() + .isActive() ? TexturesGtBlock.Casing_Machine_Screen_Rainbow : TexturesGtBlock.Casing_Machine_Screen_1); } public IIconContainer getIconOverlay() { - return this.getBaseMetaTileEntity().isActive() ? TexturesGtBlock.Casing_Machine_Screen_Rainbow - : TexturesGtBlock.Casing_Machine_Screen_1; + return this.getBaseMetaTileEntity() + .isActive() ? TexturesGtBlock.Casing_Machine_Screen_Rainbow : TexturesGtBlock.Casing_Machine_Screen_1; } @Override @@ -186,6 +195,6 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK5 extends GT_MetaTileEntity_Fus } return new String[] { "Fusion Reactor MK " + tier, "EU Required: " + powerRequired + "EU/t", - "Stored EU: " + mEUStore + " / " + maxEUStore(), "Plasma Output: " + plasmaOut + "L/t" }; + "Stored EU: " + mEUStore + " / " + maxEUStore(), "Plasma Output: " + plasmaOut + "L/t" }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_HeatExchanger.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_HeatExchanger.java index 6a1edc3d08..e4340c4d28 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_HeatExchanger.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_HeatExchanger.java @@ -43,71 +43,57 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregtechMetaTileEntity_Adv_HeatExchanger - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_HeatExchanger> { + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_HeatExchanger> { private static final int CASING_INDEX = TAE.getIndexFromPage(1, 12); private static final String STRUCTURE_PIECE_MAIN = "main"; private static final IStructureDefinition<GregtechMetaTileEntity_Adv_HeatExchanger> STRUCTURE_DEFINITION = StructureDefinition - .<GregtechMetaTileEntity_Adv_HeatExchanger>builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { { " ccc ", "cCCCc", "cCCCc", "cCCCc", " ccc " }, - { " ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc " }, - { " ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc " }, - { " ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc " }, - { " ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc " }, - { " c~c ", "cPPPc", "cPPPc", "cPPPc", " ccc " }, - { " hhh ", "hHHHh", "hHHHh", "hHHHh", " hhh " }, - { " f f ", "f f", " ", "f f", " f f " }, - { " f f ", "f f", " ", "f f", " f f " }, })) - .addElement('P', ofBlock(GregTech_API.sBlockCasings2, 15)).addElement('f', ofBlock(getFrame(), 0)) - .addElement( - 'C', - ofChain( - ofHatchAdder( - GregtechMetaTileEntity_Adv_HeatExchanger::addColdFluidOutputToMachineList, - CASING_INDEX, - 2), - onElementPass( - GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, - ofBlock(ModBlocks.blockSpecialMultiCasings, 14)))) - .addElement( - 'H', - ofChain( - ofHatchAdder( - GregtechMetaTileEntity_Adv_HeatExchanger::addHotFluidInputToMachineList, - CASING_INDEX, - 3), - onElementPass( - GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, - ofBlock(ModBlocks.blockSpecialMultiCasings, 14)))) - .addElement( - 'h', - ofChain( - ofHatchAdder( - GregtechMetaTileEntity_Adv_HeatExchanger::addInputToMachineList, - CASING_INDEX, - 1), - ofHatchAdder( - GregtechMetaTileEntity_Adv_HeatExchanger::addOutputToMachineList, - CASING_INDEX, - 1), - ofHatchAdder( - GregtechMetaTileEntity_Adv_HeatExchanger::addMaintenanceToMachineList, - CASING_INDEX, - 1), - onElementPass( - GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, - ofBlock(ModBlocks.blockSpecialMultiCasings, 14)))) - .addElement( - 'c', - ofChain( - onElementPass( - GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, - ofBlock(ModBlocks.blockSpecialMultiCasings, 14)))) - .build(); + .<GregtechMetaTileEntity_Adv_HeatExchanger>builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { { " ccc ", "cCCCc", "cCCCc", "cCCCc", " ccc " }, + { " ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc " }, { " ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc " }, + { " ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc " }, { " ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc " }, + { " c~c ", "cPPPc", "cPPPc", "cPPPc", " ccc " }, { " hhh ", "hHHHh", "hHHHh", "hHHHh", " hhh " }, + { " f f ", "f f", " ", "f f", " f f " }, + { " f f ", "f f", " ", "f f", " f f " }, })) + .addElement('P', ofBlock(GregTech_API.sBlockCasings2, 15)) + .addElement('f', ofBlock(getFrame(), 0)) + .addElement( + 'C', + ofChain( + ofHatchAdder( + GregtechMetaTileEntity_Adv_HeatExchanger::addColdFluidOutputToMachineList, + CASING_INDEX, + 2), + onElementPass( + GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, + ofBlock(ModBlocks.blockSpecialMultiCasings, 14)))) + .addElement( + 'H', + ofChain( + ofHatchAdder(GregtechMetaTileEntity_Adv_HeatExchanger::addHotFluidInputToMachineList, CASING_INDEX, 3), + onElementPass( + GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, + ofBlock(ModBlocks.blockSpecialMultiCasings, 14)))) + .addElement( + 'h', + ofChain( + ofHatchAdder(GregtechMetaTileEntity_Adv_HeatExchanger::addInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GregtechMetaTileEntity_Adv_HeatExchanger::addOutputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GregtechMetaTileEntity_Adv_HeatExchanger::addMaintenanceToMachineList, CASING_INDEX, 1), + onElementPass( + GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, + ofBlock(ModBlocks.blockSpecialMultiCasings, 14)))) + .addElement( + 'c', + ofChain( + onElementPass( + GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, + ofBlock(ModBlocks.blockSpecialMultiCasings, 14)))) + .build(); public static float penalty_per_config = 0.015f; // penalize 1.5% efficiency per circuitry level (1-25) private GT_MetaTileEntity_Hatch_Input mInputHotFluidHatch; @@ -128,24 +114,30 @@ public class GregtechMetaTileEntity_Adv_HeatExchanger @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the XL Heat Exchanger") - .addInfo("More complicated than a Fusion Reactor. Seriously") - .addInfo("But you know this by now, right?").addInfo("Works as fast as 32 Large Heat Exchangers") - .addSeparator().addInfo("Inputs are Hot Coolant or Lava") - .addInfo("Outputs Coolant or Pahoehoe Lava and SH Steam/Steam") - .addInfo("Outputs SH Steam if input flow is equal to or above a certain value:") - .addInfo("Hot Coolant: 25,600 L/s, maximum 51,200 L/s, max output 10,240,000 SH Steam/s") - .addInfo("Lava: 32,000 L/s, maximum 64,000 L/s, max output 5,120,000 SH Steam/s") - .addInfo("A circuit in the controller lowers the SH Steam threshold and efficiency") - .addInfo("3.75% reduction and 1.5% efficiency loss per circuit config over 1").addSeparator() - .beginStructureBlock(5, 9, 5, false).addController("Front bottom") - .addCasingInfoMin("Reinforced Heat Exchanger Casing", 90, false) - .addOtherStructurePart("Tungstensteel Pipe Casing", "Center 3x5x3 (45 blocks)") - .addMaintenanceHatch("Any casing", 1).addInputHatch("Hot fluid, bottom center", 2) - .addInputHatch("Distilled water, any bottom layer casing", 1) - .addOutputHatch("Cold fluid, top center", 3) - .addOutputHatch("Steam/SH Steam, any bottom layer casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the XL Heat Exchanger") + .addInfo("More complicated than a Fusion Reactor. Seriously") + .addInfo("But you know this by now, right?") + .addInfo("Works as fast as 32 Large Heat Exchangers") + .addSeparator() + .addInfo("Inputs are Hot Coolant or Lava") + .addInfo("Outputs Coolant or Pahoehoe Lava and SH Steam/Steam") + .addInfo("Outputs SH Steam if input flow is equal to or above a certain value:") + .addInfo("Hot Coolant: 25,600 L/s, maximum 51,200 L/s, max output 10,240,000 SH Steam/s") + .addInfo("Lava: 32,000 L/s, maximum 64,000 L/s, max output 5,120,000 SH Steam/s") + .addInfo("A circuit in the controller lowers the SH Steam threshold and efficiency") + .addInfo("3.75% reduction and 1.5% efficiency loss per circuit config over 1") + .addSeparator() + .beginStructureBlock(5, 9, 5, false) + .addController("Front bottom") + .addCasingInfoMin("Reinforced Heat Exchanger Casing", 90, false) + .addOtherStructurePart("Tungstensteel Pipe Casing", "Center 3x5x3 (45 blocks)") + .addMaintenanceHatch("Any casing", 1) + .addInputHatch("Hot fluid, bottom center", 2) + .addInputHatch("Distilled water, any bottom layer casing", 1) + .addOutputHatch("Cold fluid, top center", 3) + .addOutputHatch("Steam/SH Steam, any bottom layer casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -202,7 +194,8 @@ public class GregtechMetaTileEntity_Adv_HeatExchanger boolean do_lava = false; // Do we have an integrated circuit with a valid configuration? - 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) { // If so, apply the penalty and reduced threshold. @@ -217,14 +210,16 @@ public class GregtechMetaTileEntity_Adv_HeatExchanger steam_output_multiplier /= 5f; // lava is not boosted superheated_threshold /= 4f; // unchanged do_lava = true; - } else if (mInputHotFluidHatch.getFluid().isFluidEqual(FluidRegistry.getFluidStack("ic2hotcoolant", 1))) { - steam_output_multiplier /= 2f; // was boosted x2 on top of x5 -> total x10 -> nerf with this code back to 5x - superheated_threshold /= 5f; // 10x smaller since the Hot Things production in reactor is the same. - } else { - // If we're working with neither, fail out - superheated_threshold = 0; - return CheckRecipeResultRegistry.NO_RECIPE; - } + } else if (mInputHotFluidHatch.getFluid() + .isFluidEqual(FluidRegistry.getFluidStack("ic2hotcoolant", 1))) { + steam_output_multiplier /= 2f; // was boosted x2 on top of x5 -> total x10 -> nerf with this code back + // to 5x + superheated_threshold /= 5f; // 10x smaller since the Hot Things production in reactor is the same. + } else { + // If we're working with neither, fail out + superheated_threshold = 0; + return CheckRecipeResultRegistry.NO_RECIPE; + } superheated = fluidAmountToConsume >= superheated_threshold; // set the internal superheated flag if we have // enough hot fluid. Used in the @@ -354,43 +349,43 @@ public class GregtechMetaTileEntity_Adv_HeatExchanger @Override public String[] getExtraInfoData() { 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.usage") + " " - + StatCollector.translateToLocal("GT5U.LHE.steam") - + ": " - + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW) - + GT_Utility.formatNumbers(superheated ? -2 * lEUt : -lEUt) - + EnumChatFormatting.RESET - + " EU/t", - 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("GT5U.LHE.superheated") + ": " - + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.BLUE) - + superheated - + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.LHE.superheated") + " " - + StatCollector.translateToLocal("GT5U.LHE.threshold") - + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(superheated_threshold) - + EnumChatFormatting.RESET }; + 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.usage") + " " + + StatCollector.translateToLocal("GT5U.LHE.steam") + + ": " + + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW) + + GT_Utility.formatNumbers(superheated ? -2 * lEUt : -lEUt) + + EnumChatFormatting.RESET + + " EU/t", + 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("GT5U.LHE.superheated") + ": " + + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.BLUE) + + superheated + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.LHE.superheated") + " " + + StatCollector.translateToLocal("GT5U.LHE.threshold") + + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(superheated_threshold) + + EnumChatFormatting.RESET }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java index 3a8093edaa..432ce23e74 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java @@ -31,7 +31,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregtechMetaTileEntity_Adv_Implosion - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_Implosion> { + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_Implosion> { private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_Adv_Implosion> STRUCTURE_DEFINITION = null; @@ -57,14 +57,21 @@ public class GregtechMetaTileEntity_Adv_Implosion @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Factory Grade Advanced Implosion Compressor") - .addInfo("Speed: +100% | EU Usage: 100% | Parallel: ((Tier/2)+1)") - .addInfo("Constructed exactly the same as a normal Implosion Compressor") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true) - .addController("Front center").addCasingInfoMin("Robust TungstenSteel Casing", 10, false) - .addInputBus("Any casing", 1).addOutputBus("Any casing", 1).addEnergyHatch("Any casing", 1) - .addMaintenanceHatch("Any casing", 1).addMufflerHatch("Any casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Factory Grade Advanced Implosion Compressor") + .addInfo("Speed: +100% | EU Usage: 100% | Parallel: ((Tier/2)+1)") + .addInfo("Constructed exactly the same as a normal Implosion Compressor") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfoMin("Robust TungstenSteel Casing", 10, false) + .addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1) + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addMufflerHatch("Any casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -72,19 +79,20 @@ public class GregtechMetaTileEntity_Adv_Implosion public IStructureDefinition<GregtechMetaTileEntity_Adv_Implosion> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Adv_Implosion>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, - { "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - ofChain( - buildHatchAdder(GregtechMetaTileEntity_Adv_Implosion.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler).casingIndex(48) - .dot(1).build(), - onElementPass(x -> ++x.mCasing, ofBlock(sBlockCasings4, 0)))) - .build(); + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, { "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + ofChain( + buildHatchAdder(GregtechMetaTileEntity_Adv_Implosion.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) + .casingIndex(48) + .dot(1) + .build(), + onElementPass(x -> ++x.mCasing, ofBlock(sBlockCasings4, 0)))) + .build(); } return STRUCTURE_DEFINITION; } @@ -132,7 +140,8 @@ public class GregtechMetaTileEntity_Adv_Implosion @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setSpeedBonus(1F / 2F).setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setSpeedBonus(1F / 2F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java index b3b15ca5f7..0845c7f061 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java @@ -32,7 +32,7 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_SteamMultiBase; public class GregtechMetaTileEntity_SteamCompressor - extends GregtechMeta_SteamMultiBase<GregtechMetaTileEntity_SteamCompressor> implements ISurvivalConstructable { + extends GregtechMeta_SteamMultiBase<GregtechMetaTileEntity_SteamCompressor> implements ISurvivalConstructable { private String mCasingName = "Bronze Plated Bricks"; private static IStructureDefinition<GregtechMetaTileEntity_SteamCompressor> STRUCTURE_DEFINITION = null; @@ -69,35 +69,44 @@ public class GregtechMetaTileEntity_SteamCompressor @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Steam Compressor") - .addInfo("33.3% faster than using a single block Steam Compressor.") - .addInfo("Uses only 66.6% of the steam/s compared to a single block Steam Compressor.") - .addInfo("Compresses up to " + getMaxParallelRecipes() + " things at a time").addSeparator() - .beginStructureBlock(3, 3, 4, true).addController("Front center") - .addCasingInfoMin(mCasingName, 28, false).addOtherStructurePart(TT_steaminputbus, "Any casing", 1) - .addOtherStructurePart(TT_steamoutputbus, "Any casing", 1) - .addOtherStructurePart(TT_steamhatch, "Any casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Steam Compressor") + .addInfo("33.3% faster than using a single block Steam Compressor.") + .addInfo("Uses only 66.6% of the steam/s compared to a single block Steam Compressor.") + .addInfo("Compresses up to " + getMaxParallelRecipes() + " things at a time") + .addSeparator() + .beginStructureBlock(3, 3, 4, true) + .addController("Front center") + .addCasingInfoMin(mCasingName, 28, false) + .addOtherStructurePart(TT_steaminputbus, "Any casing", 1) + .addOtherStructurePart(TT_steamoutputbus, "Any casing", 1) + .addOtherStructurePart(TT_steamhatch, "Any casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @Override public IStructureDefinition<GregtechMetaTileEntity_SteamCompressor> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_SteamCompressor>builder().addShape( + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_SteamCompressor>builder() + .addShape( mName, transpose( - new String[][] { { "CCC", "CCC", "CCC", "CCC" }, { "C~C", "C-C", "C-C", "CCC" }, - { "CCC", "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - ofChain( - buildSteamInput(GregtechMetaTileEntity_SteamCompressor.class).casingIndex(10).dot(1) - .build(), - buildHatchAdder(GregtechMetaTileEntity_SteamCompressor.class).atLeast( - SteamHatchElement.InputBus_Steam, - SteamHatchElement.OutputBus_Steam).casingIndex(10).dot(1).build(), - onElementPass(x -> ++x.mCasing, ofBlock(sBlockCasings1, 10)))) - .build(); + new String[][] { { "CCC", "CCC", "CCC", "CCC" }, { "C~C", "C-C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + ofChain( + buildSteamInput(GregtechMetaTileEntity_SteamCompressor.class).casingIndex(10) + .dot(1) + .build(), + buildHatchAdder(GregtechMetaTileEntity_SteamCompressor.class) + .atLeast(SteamHatchElement.InputBus_Steam, SteamHatchElement.OutputBus_Steam) + .casingIndex(10) + .dot(1) + .build(), + onElementPass(x -> ++x.mCasing, ofBlock(sBlockCasings1, 10)))) + .build(); } return STRUCTURE_DEFINITION; } @@ -137,7 +146,9 @@ public class GregtechMetaTileEntity_SteamCompressor @Override @Nonnull protected GT_OverclockCalculator createOverclockCalculator(@NotNull GT_Recipe recipe) { - return GT_OverclockCalculator.ofNoOverclock(recipe).setEUtDiscount(1.33F).setSpeedBoost(1.5F); + return GT_OverclockCalculator.ofNoOverclock(recipe) + .setEUtDiscount(1.33F) + .setSpeedBoost(1.5F); } }.setMaxParallel(getMaxParallelRecipes()); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java index e1c4fec434..dce362fa14 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java @@ -33,7 +33,7 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_SteamMultiBase; public class GregtechMetaTileEntity_SteamMacerator - extends GregtechMeta_SteamMultiBase<GregtechMetaTileEntity_SteamMacerator> implements ISurvivalConstructable { + extends GregtechMeta_SteamMultiBase<GregtechMetaTileEntity_SteamMacerator> implements ISurvivalConstructable { private String mCasingName = "Bronze Plated Bricks"; private static IStructureDefinition<GregtechMetaTileEntity_SteamMacerator> STRUCTURE_DEFINITION = null; @@ -70,38 +70,47 @@ public class GregtechMetaTileEntity_SteamMacerator @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { if (mCasingName.contains("gt.blockcasings")) { - mCasingName = ItemList.Casing_BronzePlatedBricks.get(1).getDisplayName(); + mCasingName = ItemList.Casing_BronzePlatedBricks.get(1) + .getDisplayName(); } GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Steam Macerator") - .addInfo("33.3% faster than using a single block Steam Macerator.") - .addInfo("Uses only 66.6% of the steam/s required compared to a single block Steam Macerator.") - .addInfo("Macerates up to " + getMaxParallelRecipes() + " things at a time").addSeparator() - .beginStructureBlock(3, 3, 3, true).addController("Front center") - .addCasingInfoMin(mCasingName, 14, false).addOtherStructurePart(TT_steaminputbus, "Any casing", 1) - .addOtherStructurePart(TT_steamoutputbus, "Any casing", 1) - .addOtherStructurePart(TT_steamhatch, "Any casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Steam Macerator") + .addInfo("33.3% faster than using a single block Steam Macerator.") + .addInfo("Uses only 66.6% of the steam/s required compared to a single block Steam Macerator.") + .addInfo("Macerates up to " + getMaxParallelRecipes() + " things at a time") + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfoMin(mCasingName, 14, false) + .addOtherStructurePart(TT_steaminputbus, "Any casing", 1) + .addOtherStructurePart(TT_steamoutputbus, "Any casing", 1) + .addOtherStructurePart(TT_steamhatch, "Any casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @Override public IStructureDefinition<GregtechMetaTileEntity_SteamMacerator> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_SteamMacerator>builder().addShape( + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_SteamMacerator>builder() + .addShape( mName, transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, - { "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - ofChain( - buildSteamInput(GregtechMetaTileEntity_SteamMacerator.class).casingIndex(10).dot(1) - .build(), - buildHatchAdder(GregtechMetaTileEntity_SteamMacerator.class).atLeast( - SteamHatchElement.InputBus_Steam, - SteamHatchElement.OutputBus_Steam).casingIndex(10).dot(1).build(), - onElementPass(x -> ++x.mCasing, ofBlock(sBlockCasings1, 10)))) - .build(); + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, { "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + ofChain( + buildSteamInput(GregtechMetaTileEntity_SteamMacerator.class).casingIndex(10) + .dot(1) + .build(), + buildHatchAdder(GregtechMetaTileEntity_SteamMacerator.class) + .atLeast(SteamHatchElement.InputBus_Steam, SteamHatchElement.OutputBus_Steam) + .casingIndex(10) + .dot(1) + .build(), + onElementPass(x -> ++x.mCasing, ofBlock(sBlockCasings1, 10)))) + .build(); } return STRUCTURE_DEFINITION; } @@ -141,7 +150,9 @@ public class GregtechMetaTileEntity_SteamMacerator @Override @Nonnull protected GT_OverclockCalculator createOverclockCalculator(@NotNull GT_Recipe recipe) { - return GT_OverclockCalculator.ofNoOverclock(recipe).setEUtDiscount(1.33F).setSpeedBoost(1.5F); + return GT_OverclockCalculator.ofNoOverclock(recipe) + .setEUtDiscount(1.33F) + .setSpeedBoost(1.5F); } }.setMaxParallel(getMaxParallelRecipes()); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java index 62972b3957..6cae5e4bcd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java @@ -34,7 +34,7 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity_AutoCrafter> - implements ISurvivalConstructable { + implements ISurvivalConstructable { protected GT_Recipe lastRecipeToBuffer; private int casing; @@ -86,14 +86,22 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Highly Advanced Assembling Machine") - .addInfo("200% faster than using single block machines of the same voltage") - .addInfo("Processes two items per voltage tier").addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator().beginStructureBlock(3, 3, 3, true).addController("Front Center") - .addCasingInfoRange("Bulk Production Frame", 10, 25, false).addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Highly Advanced Assembling Machine") + .addInfo("200% faster than using single block machines of the same voltage") + .addInfo("Processes two items per voltage tier") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front Center") + .addCasingInfoRange("Bulk Production Frame", 10, 25, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -116,18 +124,18 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity public IStructureDefinition<GT4Entity_AutoCrafter> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GT4Entity_AutoCrafter>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, - { "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GT4Entity_AutoCrafter.class) - .atLeast(InputBus, OutputBus, InputHatch, Maintenance, Energy, Muffler) - .casingIndex(TAE.getIndexFromPage(0, 10)).dot(1).buildAndChain( - onElementPass(x -> ++x.casing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) - .build(); + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, { "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GT4Entity_AutoCrafter.class) + .atLeast(InputBus, OutputBus, InputHatch, Maintenance, Energy, Muffler) + .casingIndex(TAE.getIndexFromPage(0, 10)) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.casing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) + .build(); } return STRUCTURE_DEFINITION; } @@ -156,7 +164,8 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setSpeedBonus(1F / 3F).setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setSpeedBonus(1F / 3F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override @@ -168,7 +177,7 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity public String[] getExtraInfoData() { final String running = (this.mMaxProgresstime > 0 ? "Auto-Crafter running" : "Auto-Crafter stopped"); final String maintenance = (this.getIdealStatus() == this.getRepairStatus() ? "No Maintenance issues" - : "Needs Maintenance"); + : "Needs Maintenance"); String tSpecialText; if (lastRecipeToBuffer != null && lastRecipeToBuffer.mOutputs[0].getDisplayName() != null) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java index 39266717b7..b7a4afb878 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java @@ -51,7 +51,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GT4Entity_ThermalBoiler extends GregtechMeta_MultiBlockBase<GT4Entity_ThermalBoiler> - implements ISurvivalConstructable { + implements ISurvivalConstructable { private int mCasing; private static IStructureDefinition<GT4Entity_ThermalBoiler> STRUCTURE_DEFINITION = null; @@ -63,9 +63,12 @@ public class GT4Entity_ThermalBoiler extends GregtechMeta_MultiBlockBase<GT4Enti private static final Item itemLavaFilter = ItemList.Component_LavaFilter.getItem(); private static final Item itemObsidian = Item.getItemFromBlock(Blocks.obsidian); private static final Fluid fluidWater = FluidRegistry.WATER; - private static final Fluid fluidDistilledWater = FluidUtils.getDistilledWater(1).getFluid(); - private static final Fluid fluidSteam = FluidUtils.getSteam(1).getFluid(); - private static final Fluid fluidSHSteam = FluidUtils.getSuperHeatedSteam(1).getFluid(); + private static final Fluid fluidDistilledWater = FluidUtils.getDistilledWater(1) + .getFluid(); + private static final Fluid fluidSteam = FluidUtils.getSteam(1) + .getFluid(); + private static final Fluid fluidSHSteam = FluidUtils.getSuperHeatedSteam(1) + .getFluid(); public GT4Entity_ThermalBoiler(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -125,7 +128,9 @@ public class GT4Entity_ThermalBoiler extends GregtechMeta_MultiBlockBase<GT4Enti if (map == null) { return Stream.empty(); } - return map.getAllRecipes().stream().filter(recipe -> depleteInput(recipe.mFluidInputs[0], true)); + return map.getAllRecipes() + .stream() + .filter(recipe -> depleteInput(recipe.mFluidInputs[0], true)); } @NotNull @@ -136,7 +141,7 @@ public class GT4Entity_ThermalBoiler extends GregtechMeta_MultiBlockBase<GT4Enti // Hack the recipe logic to not consume water, so that we can explode. for (FluidStack inputFluid : adjustedRecipe.mFluidInputs) { if (inputFluid != null - && (inputFluid.getFluid() == fluidWater || inputFluid.getFluid() == fluidDistilledWater)) { + && (inputFluid.getFluid() == fluidWater || inputFluid.getFluid() == fluidDistilledWater)) { inputFluid.amount = 0; } } @@ -168,7 +173,7 @@ public class GT4Entity_ThermalBoiler extends GregtechMeta_MultiBlockBase<GT4Enti if (mOutputFluids != null) { for (FluidStack outputFluid : mOutputFluids) { if (outputFluid != null - && (outputFluid.getFluid() == fluidSteam || outputFluid.getFluid() == fluidSHSteam)) { + && (outputFluid.getFluid() == fluidSteam || outputFluid.getFluid() == fluidSHSteam)) { // Purely for display reasons, we don't actually make any EU. if (outputFluid.getFluid() == fluidSteam) { @@ -181,7 +186,7 @@ public class GT4Entity_ThermalBoiler extends GregtechMeta_MultiBlockBase<GT4Enti // TODO: This is not reflected in the GUI while the player has it open?? if (mEfficiency < getMaxEfficiency(null)) { outputFluid.amount = Math - .max(1, (outputFluid.amount * mEfficiency) / getMaxEfficiency(null)); + .max(1, (outputFluid.amount * mEfficiency) / getMaxEfficiency(null)); } // Consume water to run recipe. @@ -274,14 +279,23 @@ public class GT4Entity_ThermalBoiler extends GregtechMeta_MultiBlockBase<GT4Enti @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Thermal Boiler Controller") - .addInfo("Converts Water & Heat into Steam").addInfo("Filters raw materials from lava") - .addInfo("Explodes if water is not supplied").addInfo("Consult user manual for more information") - .addPollutionAmount(getPollutionPerSecond(null)).beginStructureBlock(3, 3, 3, true) - .addController("Front Center").addCasingInfoMin("Thermal Containment Casings", 10, false) - .addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Thermal Boiler Controller") + .addInfo("Converts Water & Heat into Steam") + .addInfo("Filters raw materials from lava") + .addInfo("Explodes if water is not supplied") + .addInfo("Consult user manual for more information") + .addPollutionAmount(getPollutionPerSecond(null)) + .beginStructureBlock(3, 3, 3, true) + .addController("Front Center") + .addCasingInfoMin("Thermal Containment Casings", 10, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -304,18 +318,18 @@ public class GT4Entity_ThermalBoiler extends GregtechMeta_MultiBlockBase<GT4Enti public IStructureDefinition<GT4Entity_ThermalBoiler> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GT4Entity_ThermalBoiler>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, - { "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GT4Entity_ThermalBoiler.class) - .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Maintenance, Muffler) - .casingIndex(TAE.getIndexFromPage(0, 1)).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 11)))) - .build(); + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, { "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GT4Entity_ThermalBoiler.class) + .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Maintenance, Muffler) + .casingIndex(TAE.getIndexFromPage(0, 1)) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 11)))) + .build(); } return STRUCTURE_DEFINITION; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java index 15d144c4a5..d835d9be4c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java @@ -42,7 +42,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase<GregtechMTE_ElementalDuplicator> - implements ISurvivalConstructable { + implements ISurvivalConstructable { private final ArrayList<GT_MetaTileEntity_Hatch_ElementalDataOrbHolder> mReplicatorDataOrbHatches = new ArrayList<>(); private static final int CASING_TEXTURE_ID = TAE.getIndexFromPage(0, 3); @@ -70,21 +70,31 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Produces Elemental Material from UU Matter") - .addInfo("Speed: +100% | EU Usage: 100% | Parallel: 8 * Tier").addInfo("Maximum 1x of each bus/hatch.") - .addInfo("Requires circuit 1-16 in your Data Orb Repository") - .addInfo("depending on what Data Orb you want to prioritize") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(9, 6, 9, true) - .addController("Top Center").addCasingInfoMin("Elemental Confinement Shell", 138, false) - .addCasingInfoMin("Matter Fabricator Casing", 24, false) - .addCasingInfoMin("Particle Containment Casing", 24, false) - .addCasingInfoMin("Matter Generation Coil", 24, false) - .addCasingInfoMin("High Voltage Current Capacitor", 20, false) - .addCasingInfoMin("Resonance Chamber III", 24, false).addCasingInfoMin("Modulator III", 16, false) - .addOtherStructurePart("Data Orb Repository", "1x", 1).addInputHatch("Any 1 dot hint", 1) - .addOutputBus("Any 1 dot hint", 1).addOutputHatch("Any 1 dot hint", 1) - .addEnergyHatch("Any 1 dot hint", 1).addMaintenanceHatch("Any 1 dot hint", 1) - .addMufflerHatch("Any 1 dot hint", 1).toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Produces Elemental Material from UU Matter") + .addInfo("Speed: +100% | EU Usage: 100% | Parallel: 8 * Tier") + .addInfo("Maximum 1x of each bus/hatch.") + .addInfo("Requires circuit 1-16 in your Data Orb Repository") + .addInfo("depending on what Data Orb you want to prioritize") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(9, 6, 9, true) + .addController("Top Center") + .addCasingInfoMin("Elemental Confinement Shell", 138, false) + .addCasingInfoMin("Matter Fabricator Casing", 24, false) + .addCasingInfoMin("Particle Containment Casing", 24, false) + .addCasingInfoMin("Matter Generation Coil", 24, false) + .addCasingInfoMin("High Voltage Current Capacitor", 20, false) + .addCasingInfoMin("Resonance Chamber III", 24, false) + .addCasingInfoMin("Modulator III", 16, false) + .addOtherStructurePart("Data Orb Repository", "1x", 1) + .addInputHatch("Any 1 dot hint", 1) + .addOutputBus("Any 1 dot hint", 1) + .addOutputHatch("Any 1 dot hint", 1) + .addEnergyHatch("Any 1 dot hint", 1) + .addMaintenanceHatch("Any 1 dot hint", 1) + .addMufflerHatch("Any 1 dot hint", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -96,62 +106,58 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_ElementalDuplicator>builder() - // h = Hatch - // c = Casing - - // a = MF Casing 1 - // b = Matter Gen Coil - - // d = Current Capacitor - // e = Particle - - // f = Resonance III - // g = Modulator III - - .addShape( - STRUCTURE_PIECE_MAIN, - (new String[][] { - { " ccc ", " ccccc ", " ccccccc ", "ccchhhccc", "ccch~hccc", "ccchhhccc", - " ccccccc ", " ccccc ", " ccc " }, - { " cac ", " abfba ", " abfgfba ", "cbfgdgfbc", "afgdddgfa", "cbfgdgfbc", - " abfgfba ", " abfba ", " cac " }, - { " cec ", " e e ", " e e ", "c d c", "e ddd e", "c d c", - " e e ", " e e ", " cec " }, - { " cec ", " e e ", " e e ", "c d c", "e ddd e", "c d c", - " e e ", " e e ", " cec " }, - { " cac ", " abfba ", " abfgfba ", "cbfgdgfbc", "afgdddgfa", "cbfgdgfbc", - " abfgfba ", " abfba ", " cac " }, - { " ccc ", " ccccc ", " ccccccc ", "ccchhhccc", "ccchhhccc", "ccchhhccc", - " ccccccc ", " ccccc ", " ccc " }, })) - .addElement('a', ofBlock(getCasingBlock4(), getCasingMeta6())) - .addElement('b', ofBlock(getCasingBlock4(), getCasingMeta7())) - .addElement('d', ofBlock(getCasingBlock2(), getCasingMeta2())) - .addElement('e', ofBlock(getCasingBlock2(), getCasingMeta3())) - .addElement('f', ofBlock(getCasingBlock3(), getCasingMeta4())) - .addElement('g', ofBlock(getCasingBlock3(), getCasingMeta5())) - .addElement( - 'c', - lazy(t -> onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) - .addElement( - 'h', - lazy( - t -> ofChain( - buildHatchAdder(GregtechMTE_ElementalDuplicator.class).atLeast( - InputHatch, - OutputBus, - OutputHatch, - Maintenance, - Muffler, - Energy).casingIndex(getCasingTextureIndex()).dot(1).build(), - buildHatchAdder(GregtechMTE_ElementalDuplicator.class) - .hatchClass(GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.class) - .shouldReject(x -> x.mReplicatorDataOrbHatches.size() >= 1) - .adder(GregtechMTE_ElementalDuplicator::addDataOrbHatch) - .casingIndex(getCasingTextureIndex()).dot(1).build(), - onElementPass( - x -> ++x.mCasing, - ofBlock(getCasingBlock(), getCasingMeta()))))) - .build(); + // h = Hatch + // c = Casing + + // a = MF Casing 1 + // b = Matter Gen Coil + + // d = Current Capacitor + // e = Particle + + // f = Resonance III + // g = Modulator III + + .addShape( + STRUCTURE_PIECE_MAIN, + (new String[][] { + { " ccc ", " ccccc ", " ccccccc ", "ccchhhccc", "ccch~hccc", "ccchhhccc", " ccccccc ", + " ccccc ", " ccc " }, + { " cac ", " abfba ", " abfgfba ", "cbfgdgfbc", "afgdddgfa", "cbfgdgfbc", " abfgfba ", + " abfba ", " cac " }, + { " cec ", " e e ", " e e ", "c d c", "e ddd e", "c d c", " e e ", + " e e ", " cec " }, + { " cec ", " e e ", " e e ", "c d c", "e ddd e", "c d c", " e e ", + " e e ", " cec " }, + { " cac ", " abfba ", " abfgfba ", "cbfgdgfbc", "afgdddgfa", "cbfgdgfbc", " abfgfba ", + " abfba ", " cac " }, + { " ccc ", " ccccc ", " ccccccc ", "ccchhhccc", "ccchhhccc", "ccchhhccc", " ccccccc ", + " ccccc ", " ccc " }, })) + .addElement('a', ofBlock(getCasingBlock4(), getCasingMeta6())) + .addElement('b', ofBlock(getCasingBlock4(), getCasingMeta7())) + .addElement('d', ofBlock(getCasingBlock2(), getCasingMeta2())) + .addElement('e', ofBlock(getCasingBlock2(), getCasingMeta3())) + .addElement('f', ofBlock(getCasingBlock3(), getCasingMeta4())) + .addElement('g', ofBlock(getCasingBlock3(), getCasingMeta5())) + .addElement('c', lazy(t -> onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) + .addElement( + 'h', + lazy( + t -> ofChain( + buildHatchAdder(GregtechMTE_ElementalDuplicator.class) + .atLeast(InputHatch, OutputBus, OutputHatch, Maintenance, Muffler, Energy) + .casingIndex(getCasingTextureIndex()) + .dot(1) + .build(), + buildHatchAdder(GregtechMTE_ElementalDuplicator.class) + .hatchClass(GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.class) + .shouldReject(x -> x.mReplicatorDataOrbHatches.size() >= 1) + .adder(GregtechMTE_ElementalDuplicator::addDataOrbHatch) + .casingIndex(getCasingTextureIndex()) + .dot(1) + .build(), + onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta()))))) + .build(); } return STRUCTURE_DEFINITION; } @@ -166,8 +172,8 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase mCasing = 0; boolean aDidBuild = checkPiece(STRUCTURE_PIECE_MAIN, 4, 4, 0); if (this.mInputHatches.size() != 1 || (this.mOutputBusses.size() != 1 && this.mOutputHatches.size() != 0) - || this.mEnergyHatches.size() != 1 - || this.mReplicatorDataOrbHatches.size() != 1) { + || this.mEnergyHatches.size() != 1 + || this.mReplicatorDataOrbHatches.size() != 1) { return false; } log("Casings: " + mCasing); @@ -279,8 +285,9 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase @Override protected ProcessingLogic createProcessingLogic() { - return new ProcessingLogic().setSpeedBonus(1F / 2F).enablePerfectOverclock() - .setMaxParallelSupplier(this::getMaxParallelRecipes); + return new ProcessingLogic().setSpeedBonus(1F / 2F) + .enablePerfectOverclock() + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java index 47a6d40c4e..8f807b94fd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java @@ -50,7 +50,7 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.helpers.FlotationRecipeHandler; public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase<GregtechMTE_FrothFlotationCell> - implements ISurvivalConstructable { + implements ISurvivalConstructable { private int mCasing; private static IStructureDefinition<GregtechMTE_FrothFlotationCell> STRUCTURE_DEFINITION = null; @@ -76,13 +76,21 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase< @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Process that milled ore!") - .addInfo("You can only ever process one type of material per controller") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(7, 9, 7, true) - .addController("Front Center").addCasingInfoMin("Inconel Reinforced Casing", 68, false) - .addCasingInfoMin("Flotation Casing", 52, false).addInputBus("Bottom Casing", 1) - .addInputHatch("Bottom Casing", 1).addOutputHatch("Bottom Casing", 1).addEnergyHatch("Bottom Casing", 1) - .addMaintenanceHatch("Bottom Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Process that milled ore!") + .addInfo("You can only ever process one type of material per controller") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(7, 9, 7, true) + .addController("Front Center") + .addCasingInfoMin("Inconel Reinforced Casing", 68, false) + .addCasingInfoMin("Flotation Casing", 52, false) + .addInputBus("Bottom Casing", 1) + .addInputHatch("Bottom Casing", 1) + .addOutputHatch("Bottom Casing", 1) + .addEnergyHatch("Bottom Casing", 1) + .addMaintenanceHatch("Bottom Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -119,25 +127,28 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase< @Override public IStructureDefinition<GregtechMTE_FrothFlotationCell> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_FrothFlotationCell>builder().addShape( + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_FrothFlotationCell>builder() + .addShape( mName, new String[][] { { " ", " ", " X ", " X~X ", " X ", " ", " " }, - { " ", " F ", " FFF ", " FF FF ", " FFF ", " F ", " " }, - { " ", " F ", " F F ", " F F ", " F F ", " F ", " " }, - { " ", " F ", " F F ", " F F ", " F F ", " F ", " " }, - { " ", " F ", " F F ", " F F ", " F F ", " F ", " " }, - { " ", " F ", " F F ", " F F ", " F F ", " F ", " " }, - { " ", " F ", " F F ", " F F ", " F F ", " F ", " " }, - { " CCC ", " CCCCC ", "CCCCCCC", "CCCCCCC", "CCCCCCC", " CCCCC ", " CCC " }, - { " CCC ", " CCCCC ", "CCCCCCC", "CCCCCCC", "CCCCCCC", " CCCCC ", " CCC " }, }) - .addElement( - 'C', - buildHatchAdder(GregtechMTE_FrothFlotationCell.class) - .atLeast(InputBus, InputHatch, OutputHatch, Maintenance, Energy) - .casingIndex(getCasingTextureId()).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 1)))) - .addElement('F', ofBlock(ModBlocks.blockSpecialMultiCasings, 9)) - .addElement('X', ofBlock(ModBlocks.blockCasings3Misc, 1)).build(); + { " ", " F ", " FFF ", " FF FF ", " FFF ", " F ", " " }, + { " ", " F ", " F F ", " F F ", " F F ", " F ", " " }, + { " ", " F ", " F F ", " F F ", " F F ", " F ", " " }, + { " ", " F ", " F F ", " F F ", " F F ", " F ", " " }, + { " ", " F ", " F F ", " F F ", " F F ", " F ", " " }, + { " ", " F ", " F F ", " F F ", " F F ", " F ", " " }, + { " CCC ", " CCCCC ", "CCCCCCC", "CCCCCCC", "CCCCCCC", " CCCCC ", " CCC " }, + { " CCC ", " CCCCC ", "CCCCCCC", "CCCCCCC", "CCCCCCC", " CCCCC ", " CCC " }, }) + .addElement( + 'C', + buildHatchAdder(GregtechMTE_FrothFlotationCell.class) + .atLeast(InputBus, InputHatch, OutputHatch, Maintenance, Energy) + .casingIndex(getCasingTextureId()) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 1)))) + .addElement('F', ofBlock(ModBlocks.blockSpecialMultiCasings, 9)) + .addElement('X', ofBlock(ModBlocks.blockCasings3Misc, 1)) + .build(); } return STRUCTURE_DEFINITION; } @@ -192,7 +203,7 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase< * material now. */ Material foundMaterial = FlotationRecipeHandler - .getMaterialOfMilledProduct(FlotationRecipeHandler.findMilledStack(recipe)); + .getMaterialOfMilledProduct(FlotationRecipeHandler.findMilledStack(recipe)); String foundMaterialName = null; if (foundMaterial != null) { foundMaterialName = foundMaterial.getUnlocalizedName(); @@ -248,10 +259,13 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase< @Override public void addAdditionalTooltipInformation(ItemStack stack, List<String> tooltip) { - if (stack.hasTagCompound() && stack.getTagCompound().hasKey("lockedMaterialName")) { + if (stack.hasTagCompound() && stack.getTagCompound() + .hasKey("lockedMaterialName")) { tooltip.add( - StatCollector.translateToLocal("tooltip.flotationCell.lockedTo") + " " - + StatCollector.translateToLocal(stack.getTagCompound().getString("lockedMaterialName"))); + StatCollector.translateToLocal("tooltip.flotationCell.lockedTo") + " " + + StatCollector.translateToLocal( + stack.getTagCompound() + .getString("lockedMaterialName"))); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java index 18db519622..2faccc9697 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java @@ -55,7 +55,7 @@ import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<GregtechMTE_NuclearReactor> - implements ISurvivalConstructable { + implements ISurvivalConstructable { protected int mFuelRemaining = 0; @@ -88,22 +88,30 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<Greg @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Liquid Fluoride Thorium Reactor.") - .addInfo("Produces energy and new elements from Radioactive Beta Decay!") - .addInfo("Input LFTB and a molten salt as fuel, and match the 4 Buffered Dynamo Hatches:") - .addInfo("LFTR Fuel 1 (4 EV Hatches), LFTR Fuel 2 (4 IV Hatches), LFTR Fuel 3 (4 LuV Hatches)") - .addInfo("If using better hatches for a worse fuel, only 1 hatch will output EU") - .addInfo("Outputs U233 every 10 seconds, on average, while the reactor is running") - .addInfo("Check NEI to see the other 3 outputs - they differ between fuels") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(7, 4, 7, true) - .addController("Bottom Center").addCasingInfoMin("Hastelloy-N Reactor Casing", 27, false) - .addCasingInfoMin("Zeron-100 Reactor Shielding", 26, false) - .addInputHatch("Top or bottom layer edges", 1).addOutputHatch("Top or bottom layer edges", 1) - .addDynamoHatch("Top or bottom layer edges", 1).addMaintenanceHatch("Top or bottom layer edges", 1) - .addMufflerHatch("Top 3x3", 2).addStructureInfo("All dynamos must be between EV and LuV tier.") - .addStructureInfo("All other hatches must be IV+ tier.") - .addStructureInfo("4x Output Hatches or 1x Output Hatch (ME), 1+ Input Hatches, 4x Dynamo Hatches") - .addStructureInfo("2x Maintenance Hatches, 4x Mufflers").toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Liquid Fluoride Thorium Reactor.") + .addInfo("Produces energy and new elements from Radioactive Beta Decay!") + .addInfo("Input LFTB and a molten salt as fuel, and match the 4 Buffered Dynamo Hatches:") + .addInfo("LFTR Fuel 1 (4 EV Hatches), LFTR Fuel 2 (4 IV Hatches), LFTR Fuel 3 (4 LuV Hatches)") + .addInfo("If using better hatches for a worse fuel, only 1 hatch will output EU") + .addInfo("Outputs U233 every 10 seconds, on average, while the reactor is running") + .addInfo("Check NEI to see the other 3 outputs - they differ between fuels") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(7, 4, 7, true) + .addController("Bottom Center") + .addCasingInfoMin("Hastelloy-N Reactor Casing", 27, false) + .addCasingInfoMin("Zeron-100 Reactor Shielding", 26, false) + .addInputHatch("Top or bottom layer edges", 1) + .addOutputHatch("Top or bottom layer edges", 1) + .addDynamoHatch("Top or bottom layer edges", 1) + .addMaintenanceHatch("Top or bottom layer edges", 1) + .addMufflerHatch("Top 3x3", 2) + .addStructureInfo("All dynamos must be between EV and LuV tier.") + .addStructureInfo("All other hatches must be IV+ tier.") + .addStructureInfo("4x Output Hatches or 1x Output Hatch (ME), 1+ Input Hatches, 4x Dynamo Hatches") + .addStructureInfo("2x Maintenance Hatches, 4x Mufflers") + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -111,39 +119,50 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<Greg public String[] getExtraInfoData() { final String tRunning = (this.mMaxProgresstime > 0 ? "Reactor running" : "Reactor stopped"); final String tMaintainance = (this.getIdealStatus() == this.getRepairStatus() ? "No Maintainance issues" - : "Needs Maintainance"); + : "Needs Maintainance"); return new String[] { "Liquid Fluoride Thorium Reactor", tRunning, tMaintainance, - "Current Output: " + this.lEUt + " EU/t", "Fuel Remaining: " + this.mFuelRemaining + " Litres", - "Current Efficiency: " + (this.mEfficiency / 5) + "%", - "Current Efficiency (Raw): " + (this.mEfficiency), "It requires you to have 100% Efficiency." }; + "Current Output: " + this.lEUt + " EU/t", "Fuel Remaining: " + this.mFuelRemaining + " Litres", + "Current Efficiency: " + (this.mEfficiency / 5) + "%", "Current Efficiency (Raw): " + (this.mEfficiency), + "It requires you to have 100% Efficiency." }; } @Override public boolean allowCoverOnSide(final ForgeDirection side, final GT_ItemStack aStack) { - return side != this.getBaseMetaTileEntity().getFrontFacing(); + return side != this.getBaseMetaTileEntity() + .getFrontFacing(); } @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { + final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { boolean aWarmedUp = this.mEfficiency == this.getMaxEfficiency(null); if (!aBaseMetaTileEntity.isActive() || !aWarmedUp) { if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE) - .extFacing().build() }; - return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)), TextureFactory - .builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR).extFacing().build() }; + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE) + .extFacing() + .build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR) + .extFacing() + .build() }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)) }; } else if (aBaseMetaTileEntity.isActive() && aWarmedUp) { if (side == facing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(13)), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE) - .extFacing().build() }; - return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(13)), TextureFactory - .builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR).extFacing().build() }; + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE) + .extFacing() + .build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(13)), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR) + .extFacing() + .build() }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(13)) }; } @@ -158,18 +177,16 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<Greg if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) { return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo dynamo - && dynamo.getTierForStructure() >= 4 - && dynamo.getTierForStructure() <= 6) { + && dynamo.getTierForStructure() >= 4 + && dynamo.getTierForStructure() <= 6) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input hatch + && hatch.getTierForStructure() >= 5) { return addToMachineList(aTileEntity, aBaseCasingIndex); - } else - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input hatch + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output hatch && hatch.getTierForStructure() >= 5) { return addToMachineList(aTileEntity, aBaseCasingIndex); - } else - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output hatch - && hatch.getTierForStructure() >= 5) { - return addToMachineList(aTileEntity, aBaseCasingIndex); - } + } } return false; } @@ -189,37 +206,46 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<Greg @Override public IStructureDefinition<GregtechMTE_NuclearReactor> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_NuclearReactor>builder().addShape( + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_NuclearReactor>builder() + .addShape( mName, transpose( - new String[][] { - { "CCCCCCC", "COOOOOC", "COXXXOC", "COXXXOC", "COXXXOC", "COOOOOC", "CCCCCCC" }, - { "GGGGGGG", "G-----G", "G-----G", "G-----G", "G-----G", "G-----G", "GGGGGGG" }, - { "GGGGGGG", "G-----G", "G-----G", "G-----G", "G-----G", "G-----G", "GGGGGGG" }, - { "CCC~CCC", "COOOOOC", "COOOOOC", "COOOOOC", "COOOOOC", "COOOOOC", "CCCCCCC" }, })) - .addElement( - 'C', - ofChain( - buildHatchAdder(GregtechMTE_NuclearReactor.class).atLeast(Maintenance) - .casingIndex(TAE.GTPP_INDEX(12)).dot(1).build(), - buildHatchAdder(GregtechMTE_NuclearReactor.class).atLeast(InputHatch, OutputHatch) - .adder(GregtechMTE_NuclearReactor::addNuclearReactorEdgeList) - .hatchItemFilterAnd(t -> filterByMTETier(5, Integer.MAX_VALUE)) - .casingIndex(TAE.GTPP_INDEX(12)).dot(1).build(), - buildHatchAdder(GregtechMTE_NuclearReactor.class).atLeast(Dynamo) - .adder(GregtechMTE_NuclearReactor::addNuclearReactorEdgeList) - .hatchItemFilterAnd(t -> filterByMTETier(4, 6)) - .casingIndex(TAE.GTPP_INDEX(12)).dot(1).build(), - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 12)))) - .addElement( - 'X', - buildHatchAdder(GregtechMTE_NuclearReactor.class).atLeast(Muffler) - .adder(GregtechMTE_NuclearReactor::addNuclearReactorTopList) - .hatchItemFilterAnd(t -> filterByMTETier(5, Integer.MAX_VALUE)) - .casingIndex(TAE.GTPP_INDEX(12)).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 12)))) - .addElement('O', ofBlock(ModBlocks.blockCasingsMisc, 12)) - .addElement('G', ofBlock(ModBlocks.blockCasingsMisc, 13)).build(); + new String[][] { + { "CCCCCCC", "COOOOOC", "COXXXOC", "COXXXOC", "COXXXOC", "COOOOOC", "CCCCCCC" }, + { "GGGGGGG", "G-----G", "G-----G", "G-----G", "G-----G", "G-----G", "GGGGGGG" }, + { "GGGGGGG", "G-----G", "G-----G", "G-----G", "G-----G", "G-----G", "GGGGGGG" }, + { "CCC~CCC", "COOOOOC", "COOOOOC", "COOOOOC", "COOOOOC", "COOOOOC", "CCCCCCC" }, })) + .addElement( + 'C', + ofChain( + buildHatchAdder(GregtechMTE_NuclearReactor.class).atLeast(Maintenance) + .casingIndex(TAE.GTPP_INDEX(12)) + .dot(1) + .build(), + buildHatchAdder(GregtechMTE_NuclearReactor.class).atLeast(InputHatch, OutputHatch) + .adder(GregtechMTE_NuclearReactor::addNuclearReactorEdgeList) + .hatchItemFilterAnd(t -> filterByMTETier(5, Integer.MAX_VALUE)) + .casingIndex(TAE.GTPP_INDEX(12)) + .dot(1) + .build(), + buildHatchAdder(GregtechMTE_NuclearReactor.class).atLeast(Dynamo) + .adder(GregtechMTE_NuclearReactor::addNuclearReactorEdgeList) + .hatchItemFilterAnd(t -> filterByMTETier(4, 6)) + .casingIndex(TAE.GTPP_INDEX(12)) + .dot(1) + .build(), + onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 12)))) + .addElement( + 'X', + buildHatchAdder(GregtechMTE_NuclearReactor.class).atLeast(Muffler) + .adder(GregtechMTE_NuclearReactor::addNuclearReactorTopList) + .hatchItemFilterAnd(t -> filterByMTETier(5, Integer.MAX_VALUE)) + .casingIndex(TAE.GTPP_INDEX(12)) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 12)))) + .addElement('O', ofBlock(ModBlocks.blockCasingsMisc, 12)) + .addElement('G', ofBlock(ModBlocks.blockCasingsMisc, 13)) + .build(); } return STRUCTURE_DEFINITION; } @@ -240,9 +266,9 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<Greg mCasing = 0; if (checkPiece(mName, 3, 3, 0) && mCasing >= 27) { if ((mOutputHatches.size() >= 3 || canDumpFluidToME()) && mInputHatches.size() >= 1 - && mDynamoHatches.size() == 4 - && mMufflerHatches.size() == 4 - && mMaintenanceHatches.size() == 2) { + && mDynamoHatches.size() == 4 + && mMufflerHatches.size() == 4 + && mMaintenanceHatches.size() == 2) { fixAllMaintenanceIssue(); this.turnCasingActive(false); return true; @@ -350,7 +376,8 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<Greg int li2bef4 = 0; FluidStack aFuelFluid = null; for (FluidStack aFluidInput : recipe.mFluidInputs) { - if (!aFluidInput.getFluid().equals(NUCLIDE.Li2BeF4.getFluid())) { + if (!aFluidInput.getFluid() + .equals(NUCLIDE.Li2BeF4.getFluid())) { aFuelFluid = aFluidInput; break; } @@ -359,9 +386,10 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<Greg for (FluidStack fluidStack : getStoredFluids()) { if (fluidStack.isFluidEqual(aFuelFluid)) { mFuelRemaining += fluidStack.amount; - } else if (fluidStack.getFluid().equals(NUCLIDE.Li2BeF4.getFluid())) { - li2bef4 += fluidStack.amount; - } + } else if (fluidStack.getFluid() + .equals(NUCLIDE.Li2BeF4.getFluid())) { + li2bef4 += fluidStack.amount; + } } } if (mFuelRemaining < 100) { @@ -410,38 +438,47 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<Greg long explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L); for (final MetaTileEntity tTileEntity : this.mInputBusses) { explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L); - tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue); + tTileEntity.getBaseMetaTileEntity() + .doExplosion(explodevalue); } for (final MetaTileEntity tTileEntity : this.mOutputBusses) { explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L); - tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue); + tTileEntity.getBaseMetaTileEntity() + .doExplosion(explodevalue); } for (final MetaTileEntity tTileEntity : this.mInputHatches) { explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L); - tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue); + tTileEntity.getBaseMetaTileEntity() + .doExplosion(explodevalue); } for (final MetaTileEntity tTileEntity : this.mOutputHatches) { explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L); - tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue); + tTileEntity.getBaseMetaTileEntity() + .doExplosion(explodevalue); } for (final MetaTileEntity tTileEntity : this.mDynamoHatches) { explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L); - tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue); + tTileEntity.getBaseMetaTileEntity() + .doExplosion(explodevalue); } for (final MetaTileEntity tTileEntity : this.mMufflerHatches) { explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L); - tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue); + tTileEntity.getBaseMetaTileEntity() + .doExplosion(explodevalue); } for (final MetaTileEntity tTileEntity : this.mEnergyHatches) { explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L); - tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue); + tTileEntity.getBaseMetaTileEntity() + .doExplosion(explodevalue); } for (final MetaTileEntity tTileEntity : this.mMaintenanceHatches) { explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L); - tTileEntity.getBaseMetaTileEntity().doExplosion(explodevalue); + tTileEntity.getBaseMetaTileEntity() + .doExplosion(explodevalue); } explodevalue = MathUtils.randLong(Integer.MAX_VALUE, 8589934588L); - this.getBaseMetaTileEntity().doExplosion(explodevalue); + this.getBaseMetaTileEntity() + .doExplosion(explodevalue); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java index bc53dbeab5..0441907f40 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java @@ -66,7 +66,7 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntityTreeFarm> - implements ISurvivalConstructable { + implements ISurvivalConstructable { public static int CASING_TEXTURE_ID; private static final int TICKS_PER_OPERATION = 100; @@ -100,23 +100,35 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller block for the Tree Growth Simulator") - .addInfo("Farms and harvests trees using EU").addInfo("Place a sapling in the controller slot") - .addInfo("Place a tool in an input bus").addInfo("Different tools are required for different outputs") - .addInfo("Advanced tools multiply output amount") - .addInfo(" Logs: Saw (1x), Buzzsaw (2x), Chainsaw (4x)") - .addInfo(" Saplings: Branch Cutter (1x), Grafter (3x)") - .addInfo(" Leaves: Shears (1x), Wire Cutter (2x), Automatic Snips (4x)").addInfo(" Fruit: Knife (1x)") - .addInfo("Multiple tools can be used at the same time").addSeparator() - .addInfo("Work time is fixed at 5 seconds").addInfo("Energy input tier multiplies output further") - .addInfo("Output multiplier is equal to: 2*tier^2 - 2*tier + 5") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true) - .addController("Front center").addCasingInfoMin(mCasingName, 8, false).addInputBus("Any casing", 1) - .addStructureInfo( - EnumChatFormatting.YELLOW - + "Stocking Input Busses and Crafting Input Busses/Buffers are not allowed!") - .addOutputBus("Any casing", 1).addEnergyHatch("Any casing", 1).addMaintenanceHatch("Any casing", 1) - .addMufflerHatch("Any casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller block for the Tree Growth Simulator") + .addInfo("Farms and harvests trees using EU") + .addInfo("Place a sapling in the controller slot") + .addInfo("Place a tool in an input bus") + .addInfo("Different tools are required for different outputs") + .addInfo("Advanced tools multiply output amount") + .addInfo(" Logs: Saw (1x), Buzzsaw (2x), Chainsaw (4x)") + .addInfo(" Saplings: Branch Cutter (1x), Grafter (3x)") + .addInfo(" Leaves: Shears (1x), Wire Cutter (2x), Automatic Snips (4x)") + .addInfo(" Fruit: Knife (1x)") + .addInfo("Multiple tools can be used at the same time") + .addSeparator() + .addInfo("Work time is fixed at 5 seconds") + .addInfo("Energy input tier multiplies output further") + .addInfo("Output multiplier is equal to: 2*tier^2 - 2*tier + 5") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfoMin(mCasingName, 8, false) + .addInputBus("Any casing", 1) + .addStructureInfo( + EnumChatFormatting.YELLOW + "Stocking Input Busses and Crafting Input Busses/Buffers are not allowed!") + .addOutputBus("Any casing", 1) + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addMufflerHatch("Any casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -192,23 +204,25 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< public IStructureDefinition<GregtechMetaTileEntityTreeFarm> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntityTreeFarm>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, - { "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntityTreeFarm.class).atLeast( - InputHatch, - OutputHatch, - InputBus, - OutputBus, - Maintenance, - Energy.or(TTEnergy), - Muffler).casingIndex(CASING_TEXTURE_ID).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 15)))) - .build(); + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, { "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntityTreeFarm.class) + .atLeast( + InputHatch, + OutputHatch, + InputBus, + OutputBus, + Maintenance, + Energy.or(TTEnergy), + Muffler) + .casingIndex(CASING_TEXTURE_ID) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 15)))) + .build(); } return STRUCTURE_DEFINITION; } @@ -339,7 +353,8 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< outputItems = outputs.toArray(new ItemStack[0]); VoidProtectionHelper voidProtection = new VoidProtectionHelper().setMachine(machine) - .setItemOutputs(outputItems).build(); + .setItemOutputs(outputItems) + .build(); if (voidProtection.isItemFull()) { return CheckRecipeResultRegistry.ITEM_OUTPUT_FULL; } @@ -365,11 +380,11 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< int toolMultiplier = getToolMultiplier(stack, mode); if (toolMultiplier < 0) continue; boolean canDamage = GT_ModHandler - .damageOrDechargeItem(stack, TOOL_DAMAGE_PER_OPERATION, TOOL_CHARGE_PER_OPERATION, null); + .damageOrDechargeItem(stack, TOOL_DAMAGE_PER_OPERATION, TOOL_CHARGE_PER_OPERATION, null); if (canDamage) { // Tool was used. if (GT_ModHandler.isElectricItem(stack) - && !GT_ModHandler.canUseElectricItem(stack, TOOL_CHARGE_PER_OPERATION)) { + && !GT_ModHandler.canUseElectricItem(stack, TOOL_CHARGE_PER_OPERATION)) { // Tool is out of charge, move it to output. depleteInput(stack); addOutput(stack); @@ -537,7 +552,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< if (stack == null) return false; String registryName = Item.itemRegistry.getNameForObject(stack.getItem()); return treeProductsMap.containsKey(registryName + ":" + stack.getItemDamage()) - || "Forestry:sapling".equals(registryName); + || "Forestry:sapling".equals(registryName); } /** @@ -585,8 +600,12 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< ItemStack log = defaultMap.get(Mode.LOG); if (log != null) { - double height = Math.max(3 * (tree.getGenome().getHeight() - 1), 0) + 1; - double girth = tree.getGenome().getGirth(); + double height = Math.max( + 3 * (tree.getGenome() + .getHeight() - 1), + 0) + 1; + double girth = tree.getGenome() + .getGirth(); log = log.copy(); log.stackSize = (int) (log.stackSize * height * girth); @@ -596,7 +615,8 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< ItemStack saplingOut = defaultMap.get(Mode.SAPLING); if (saplingOut != null) { // Lowest = 0.01 ... Average = 0.05 ... Highest = 0.3 - double fertility = tree.getGenome().getFertility() * 10; + double fertility = tree.getGenome() + .getFertility() * 10; // Return a copy of the *input* sapling, retaining its genetics. int stackSize = Math.max(1, (int) (saplingOut.stackSize * fertility)); @@ -613,7 +633,8 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< ItemStack fruit = defaultMap.get(Mode.FRUIT); if (fruit != null) { // Lowest = 0.025 ... Average = 0.2 ... Highest = 0.4 - double yield = tree.getGenome().getYield() * 10; + double yield = tree.getGenome() + .getYield() * 10; fruit = fruit.copy(); fruit.stackSize = (int) (fruit.stackSize * yield); @@ -650,7 +671,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< * @param fruit ItemStack to output in mode FRUIT. */ public static void registerTreeProducts(ItemStack saplingIn, ItemStack log, ItemStack saplingOut, ItemStack leaves, - ItemStack fruit) { + ItemStack fruit) { String key = Item.itemRegistry.getNameForObject(saplingIn.getItem()) + ":" + saplingIn.getItemDamage(); EnumMap<Mode, ItemStack> map = new EnumMap<>(Mode.class); if (log != null) map.put(Mode.LOG, log); @@ -670,7 +691,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< * to the stats of the real sapling that is in the controller slot. */ public static void registerForestryTree(String speciesUID, ItemStack sapling, ItemStack log, ItemStack leaves, - ItemStack fruit) { + ItemStack fruit) { String key = "Forestry:sapling:" + speciesUID; EnumMap<Mode, ItemStack> map = new EnumMap<>(Mode.class); map.put(Mode.LOG, log); @@ -687,11 +708,11 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< return; } addFakeRecipeToNEI( - sapling, - map.get(Mode.LOG), - map.get(Mode.SAPLING), - map.get(Mode.LEAVES), - map.get(Mode.FRUIT)); + sapling, + map.get(Mode.LOG), + map.get(Mode.SAPLING), + map.get(Mode.LEAVES), + map.get(Mode.FRUIT)); } /** @@ -701,29 +722,28 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< static { GT_MetaGenerated_Tool toolInstance = GT_MetaGenerated_Tool_01.INSTANCE; altToolsForNEI = new ItemStack[][] { - // Mode.LOG - { toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.SAW, 1, null, null, null), - toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.POCKET_SAW, 1, null, null, null), - toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.BUZZSAW_LV, 1, null, null, null), - toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.CHAINSAW_LV, 1, null, null, null), - toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.BUZZSAW_MV, 1, null, null, null), - toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.CHAINSAW_MV, 1, null, null, null), - toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.BUZZSAW_HV, 1, null, null, null), - toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.CHAINSAW_HV, 1, null, null, null), }, - // Mode.SAPLING - { toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.BRANCHCUTTER, 1, null, null, null), - toolInstance - .getToolWithStats(GT_MetaGenerated_Tool_01.POCKET_BRANCHCUTTER, 1, null, null, null), - GT_ModHandler.getModItem(Mods.Forestry.ID, "grafter", 1, 0), }, - // Mode.LEAVES - { new ItemStack(Items.shears), - toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.WIRECUTTER, 1, null, null, null), - toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.POCKET_WIRECUTTER, 1, null, null, null), - MetaGeneratedGregtechTools.getInstance() - .getToolWithStats(MetaGeneratedGregtechTools.ELECTRIC_SNIPS, 1, null, null, null), }, - // Mode.FRUIT - { toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.KNIFE, 1, null, null, null), - toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.POCKET_KNIFE, 1, null, null, null), } }; + // Mode.LOG + { toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.SAW, 1, null, null, null), + toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.POCKET_SAW, 1, null, null, null), + toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.BUZZSAW_LV, 1, null, null, null), + toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.CHAINSAW_LV, 1, null, null, null), + toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.BUZZSAW_MV, 1, null, null, null), + toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.CHAINSAW_MV, 1, null, null, null), + toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.BUZZSAW_HV, 1, null, null, null), + toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.CHAINSAW_HV, 1, null, null, null), }, + // Mode.SAPLING + { toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.BRANCHCUTTER, 1, null, null, null), + toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.POCKET_BRANCHCUTTER, 1, null, null, null), + GT_ModHandler.getModItem(Mods.Forestry.ID, "grafter", 1, 0), }, + // Mode.LEAVES + { new ItemStack(Items.shears), + toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.WIRECUTTER, 1, null, null, null), + toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.POCKET_WIRECUTTER, 1, null, null, null), + MetaGeneratedGregtechTools.getInstance() + .getToolWithStats(MetaGeneratedGregtechTools.ELECTRIC_SNIPS, 1, null, null, null), }, + // Mode.FRUIT + { toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.KNIFE, 1, null, null, null), + toolInstance.getToolWithStats(GT_MetaGenerated_Tool_01.POCKET_KNIFE, 1, null, null, null), } }; } /** @@ -732,8 +752,9 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< * @return True if the recipe was added successfully. */ public static boolean addFakeRecipeToNEI(ItemStack saplingIn, ItemStack log, ItemStack saplingOut, ItemStack leaves, - ItemStack fruit) { - int recipeCount = GTPPRecipeMaps.treeGrowthSimulatorFakeRecipes.getAllRecipes().size(); + ItemStack fruit) { + int recipeCount = GTPPRecipeMaps.treeGrowthSimulatorFakeRecipes.getAllRecipes() + .size(); // Sapling goes into the "special" slot. ItemStack specialStack = saplingIn.copy(); @@ -763,25 +784,26 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< } Logger.INFO( - "Adding Tree Growth Simulation NEI recipe for " + specialStack.getDisplayName() - + " -> " - + ItemUtils.getArrayStackNames(outputStacks)); + "Adding Tree Growth Simulation NEI recipe for " + specialStack.getDisplayName() + + " -> " + + ItemUtils.getArrayStackNames(outputStacks)); GTPPRecipeMaps.treeGrowthSimulatorFakeRecipes.addFakeRecipe( + false, + new GT_Recipe.GT_Recipe_WithAlt( false, - new GT_Recipe.GT_Recipe_WithAlt( - false, - null, // All inputs are taken from aAtl argument. - outputStacks, - specialStack, - null, - null, - null, - TICKS_PER_OPERATION, - 0, - recipeCount, // special value, also sorts recipes correctly in order of addition. - inputStacks)); - - return GTPPRecipeMaps.treeGrowthSimulatorFakeRecipes.getAllRecipes().size() > recipeCount; + null, // All inputs are taken from aAtl argument. + outputStacks, + specialStack, + null, + null, + null, + TICKS_PER_OPERATION, + 0, + recipeCount, // special value, also sorts recipes correctly in order of addition. + inputStacks)); + + return GTPPRecipeMaps.treeGrowthSimulatorFakeRecipes.getAllRecipes() + .size() > recipeCount; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java index 93602ad5f2..580efdcdab 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java @@ -41,8 +41,8 @@ import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -public class GregtechMetaTileEntity_AlloyBlastSmelter extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_AlloyBlastSmelter> implements ISurvivalConstructable { +public class GregtechMetaTileEntity_AlloyBlastSmelter + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_AlloyBlastSmelter> implements ISurvivalConstructable { private int mMode = 0; private boolean isUsingControllerCircuit = false; @@ -79,16 +79,25 @@ public class GregtechMetaTileEntity_AlloyBlastSmelter extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Alloy Blast Smelter") - .addInfo("20% Faster than the Electric Blast Furnace") - .addInfo("Allows Complex GT++ alloys to be created").addInfo("Accepts only one Energy Hatch") - .addInfo("Circuit for recipe goes in the Input Bus or GUI slot") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 4, 3, true) - .addController("Bottom Center").addCasingInfoMin("Blast Smelter Casings", 5, false) - .addCasingInfoMin("Blast Smelter Heat Containment Coils", 16, false).addInputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1).addOutputHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Alloy Blast Smelter") + .addInfo("20% Faster than the Electric Blast Furnace") + .addInfo("Allows Complex GT++ alloys to be created") + .addInfo("Accepts only one Energy Hatch") + .addInfo("Circuit for recipe goes in the Input Bus or GUI slot") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 4, 3, true) + .addController("Bottom Center") + .addCasingInfoMin("Blast Smelter Casings", 5, false) + .addCasingInfoMin("Blast Smelter Heat Containment Coils", 16, false) + .addInputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -96,18 +105,20 @@ public class GregtechMetaTileEntity_AlloyBlastSmelter extends public IStructureDefinition<GregtechMetaTileEntity_AlloyBlastSmelter> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_AlloyBlastSmelter>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "HHH", "H-H", "HHH" }, - { "HHH", "H-H", "HHH" }, { "C~C", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_AlloyBlastSmelter.class) - .atLeast(InputBus, InputHatch, OutputBus, OutputHatch, Maintenance, Energy, Muffler) - .casingIndex(TAE.GTPP_INDEX(15)).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 15)))) - .addElement('H', ofBlock(ModBlocks.blockCasingsMisc, 14)).build(); + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "HHH", "H-H", "HHH" }, { "HHH", "H-H", "HHH" }, + { "C~C", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_AlloyBlastSmelter.class) + .atLeast(InputBus, InputHatch, OutputBus, OutputHatch, Maintenance, Energy, Muffler) + .casingIndex(TAE.GTPP_INDEX(15)) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 15)))) + .addElement('H', ofBlock(ModBlocks.blockCasingsMisc, 14)) + .build(); } return STRUCTURE_DEFINITION; } @@ -156,10 +167,12 @@ public class GregtechMetaTileEntity_AlloyBlastSmelter extends @Override public boolean isCorrectMachinePart(final ItemStack aStack) { - if (this.getBaseMetaTileEntity().isServerSide()) { + if (this.getBaseMetaTileEntity() + .isServerSide()) { // Get Controller Circuit if (circuit == null) { - circuit = CI.getNumberedCircuit(0).getItem(); + circuit = CI.getNumberedCircuit(0) + .getItem(); } if (aStack != null && aStack.getItem() == circuit) { this.mMode = aStack.getItemDamage(); @@ -186,8 +199,8 @@ public class GregtechMetaTileEntity_AlloyBlastSmelter extends public void onModeChangeByScrewdriver(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 diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java index f42641c80e..5861885bd0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java @@ -43,7 +43,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Cyclotron> - implements ISurvivalConstructable { + implements ISurvivalConstructable { private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_Cyclotron> STRUCTURE_DEFINITION = null; @@ -93,31 +93,32 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas @Override public IStructureDefinition<GregtechMetaTileEntity_Cyclotron> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Cyclotron>builder().addShape( + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Cyclotron>builder() + .addShape( mName, transpose( - new String[][] { - { " ", " hhh ", " hh hh ", " h h ", - " h h ", " h h ", " h h ", " h h ", - " h h ", " h h ", " h h ", " h h ", - " hh hh ", " hhh ", " ", }, - { " hhh ", " hhccchh ", " hcchhhcch ", " hchh hhch ", - " hch hch ", " hch hch ", "hch hch", "hch hch", - "hch hch", " hch hch ", " hch hch ", " hchh hhch ", - " hcch~hcch ", " hhccchh ", " hhh ", }, - { " ", " hhh ", " hh hh ", " h h ", - " h h ", " h h ", " h h ", " h h ", - " h h ", " h h ", " h h ", " h h ", - " hh hh ", " hhh ", " ", } })) - .addElement( - 'h', - buildHatchAdder(GregtechMetaTileEntity_Cyclotron.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) - .casingIndex(44).dot(1).buildAndChain( - onElementPass( - x -> ++x.mCasing, - ofBlock(getCasingBlock(), getCasingMeta())))) - .addElement('c', ofBlock(getCyclotronCoil(), getCyclotronCoilMeta())).build(); + new String[][] { + { " ", " hhh ", " hh hh ", " h h ", + " h h ", " h h ", " h h ", " h h ", + " h h ", " h h ", " h h ", " h h ", + " hh hh ", " hhh ", " ", }, + { " hhh ", " hhccchh ", " hcchhhcch ", " hchh hhch ", + " hch hch ", " hch hch ", "hch hch", "hch hch", + "hch hch", " hch hch ", " hch hch ", " hchh hhch ", + " hcch~hcch ", " hhccchh ", " hhh ", }, + { " ", " hhh ", " hh hh ", " h h ", + " h h ", " h h ", " h h ", " h h ", + " h h ", " h h ", " h h ", " h h ", + " hh hh ", " hhh ", " ", } })) + .addElement( + 'h', + buildHatchAdder(GregtechMetaTileEntity_Cyclotron.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) + .casingIndex(44) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) + .addElement('c', ofBlock(getCyclotronCoil(), getCyclotronCoilMeta())) + .build(); } return STRUCTURE_DEFINITION; } @@ -163,19 +164,29 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Super Magnetic Speed Shooter").addSeparator() - .addInfo("Particles are accelerated over 186 revolutions to 80% light speed") - .addInfo("Can produce a continuous beam current of 2.2 mA at 590 MeV") - .addInfo("Which will be extracted from the Isochronous Cyclotron").addSeparator() - .addInfo("Consists of the same layout as a Fusion Reactor") - .addInfo("Any external casing can be a hatch/bus, unlike Fusion") - .addInfo("Cyclotron Machine Casings around Cyclotron Coil Blocks") - .addInfo("All Hatches must be IV or better").addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator().addCasingInfoMin("Cyclotron Machine Casings", 40, false) - .addCasingInfoMin("Cyclotron Coil", 32, false).addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1).addOutputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Super Magnetic Speed Shooter") + .addSeparator() + .addInfo("Particles are accelerated over 186 revolutions to 80% light speed") + .addInfo("Can produce a continuous beam current of 2.2 mA at 590 MeV") + .addInfo("Which will be extracted from the Isochronous Cyclotron") + .addSeparator() + .addInfo("Consists of the same layout as a Fusion Reactor") + .addInfo("Any external casing can be a hatch/bus, unlike Fusion") + .addInfo("Cyclotron Machine Casings around Cyclotron Coil Blocks") + .addInfo("All Hatches must be IV or better") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .addCasingInfoMin("Cyclotron Machine Casings", 40, false) + .addCasingInfoMin("Cyclotron Coil", 32, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -195,7 +206,8 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas } public IIconContainer getIconOverlay() { - if (this.getBaseMetaTileEntity().isActive()) { + if (this.getBaseMetaTileEntity() + .isActive()) { return TexturesGtBlock.Overlay_MatterFab_Active_Animated; } return TexturesGtBlock.Overlay_MatterFab_Animated; @@ -227,12 +239,12 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas long aCharge = IonParticles.getChargeState(s); if (aCharge == 0) { IonParticles.setChargeState( - s, - MathUtils.getRandomFromArray( - new int[] { -5, -5, -4, -4, -4, -3, -3, -3, -3, -3, -2, -2, -2, -2, - -2, -2, -2, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6 })); + s, + MathUtils.getRandomFromArray( + new int[] { -5, -5, -4, -4, -4, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -2, + -2, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, + 5, 5, 5, 6, 6 })); } } } @@ -259,12 +271,12 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas long aCharge = IonParticles.getChargeState(s); if (aCharge == 0) { IonParticles.setChargeState( - s, - MathUtils.getRandomFromArray( - new int[] { -5, -5, -4, -4, -4, -3, -3, -3, -3, -3, -2, -2, -2, -2, - -2, -2, -2, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6 })); + s, + MathUtils.getRandomFromArray( + new int[] { -5, -5, -4, -4, -4, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -2, + -2, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, + 5, 5, 5, 6, 6 })); } } } @@ -309,7 +321,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas } return new String[] { "COMET - Compact Cyclotron MK " + tier, "EU Required: " + powerRequired + "EU/t", - "Stored EU: " + this.getEUVar() + " / " + maxEUStore() }; + "Stored EU: " + this.getEUVar() + " / " + maxEUStore() }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java index 3504afb8bd..78e4a17274 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java @@ -59,10 +59,11 @@ import ic2.core.init.BlocksItems; import ic2.core.init.InternalName; public class GregtechMetaTileEntity_IndustrialFishingPond extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialFishingPond> implements ISurvivalConstructable { + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialFishingPond> implements ISurvivalConstructable { private boolean isUsingControllerCircuit = false; - private static final Item circuit = CI.getNumberedCircuit(0).getItem(); + private static final Item circuit = CI.getNumberedCircuit(0) + .getItem(); private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_IndustrialFishingPond> STRUCTURE_DEFINITION = null; private static final Class<?> cofhWater; @@ -92,15 +93,27 @@ public class GregtechMetaTileEntity_IndustrialFishingPond extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Fishing Pond") - .addInfo("Can process (Tier + 1) * 2 recipes").addInfo("Put a numbered circuit into the input bus.") - .addInfo("Circuit 14 for Fish").addInfo("Circuit 15 for Junk").addInfo("Circuit 16 for Treasure") - .addInfo("Need to be filled with water.").addInfo("Will automatically fill water from input hatch.") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(9, 3, 9, true) - .addController("Front Center").addCasingInfoMin("Aquatic Casings", 64, false) - .addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Fishing Pond") + .addInfo("Can process (Tier + 1) * 2 recipes") + .addInfo("Put a numbered circuit into the input bus.") + .addInfo("Circuit 14 for Fish") + .addInfo("Circuit 15 for Junk") + .addInfo("Circuit 16 for Treasure") + .addInfo("Need to be filled with water.") + .addInfo("Will automatically fill water from input hatch.") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(9, 3, 9, true) + .addController("Front Center") + .addCasingInfoMin("Aquatic Casings", 64, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -113,25 +126,24 @@ public class GregtechMetaTileEntity_IndustrialFishingPond extends public IStructureDefinition<GregtechMetaTileEntity_IndustrialFishingPond> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialFishingPond>builder() - .addShape( - mName, - transpose( - new String[][] { - { "XXXXXXXXX", "X X", "X X", "X X", "X X", - "X X", "X X", "X X", "XXXXXXXXX" }, - { "XXXX~XXXX", "X X", "X X", "X X", "X X", - "X X", "X X", "X X", "XXXXXXXXX" }, - { "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", - "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX" }, })) - .addElement( - 'X', - buildHatchAdder(GregtechMetaTileEntity_IndustrialFishingPond.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch) - .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( - onElementPass( - x -> ++x.mCasing, - ofBlock(getCasingBlock(), getCasingMeta())))) - .build(); + .addShape( + mName, + transpose( + new String[][] { + { "XXXXXXXXX", "X X", "X X", "X X", "X X", "X X", "X X", + "X X", "XXXXXXXXX" }, + { "XXXX~XXXX", "X X", "X X", "X X", "X X", "X X", "X X", + "X X", "XXXXXXXXX" }, + { "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", + "XXXXXXXXX", "XXXXXXXXX" }, })) + .addElement( + 'X', + buildHatchAdder(GregtechMetaTileEntity_IndustrialFishingPond.class) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch) + .casingIndex(getCasingTextureIndex()) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) + .build(); } return STRUCTURE_DEFINITION; } @@ -211,22 +223,29 @@ public class GregtechMetaTileEntity_IndustrialFishingPond extends ItemStack[] mFishOutput = generateLoot(this.mMode); mFishOutput = removeNulls(mFishOutput); GT_Recipe g = new GT_Recipe( - true, - new ItemStack[] {}, - mFishOutput, - null, - new int[] {}, - tFluidInputs, - null, - 200, - 16, - 0); - GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(g.mEUt).setEUt(tEnergy) - .setDuration(g.mDuration); - GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(g).setItemInputs(tItemInputs) - .setFluidInputs(tFluidInputs).setAvailableEUt(tEnergy).setMaxParallel(getMaxParallelRecipes()) - .setConsumption(true).setOutputCalculation(true).setMachine(this).enableBatchMode(batchMode ? 128 : 1) - .setCalculator(calculator); + true, + new ItemStack[] {}, + mFishOutput, + null, + new int[] {}, + tFluidInputs, + null, + 200, + 16, + 0); + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(g.mEUt) + .setEUt(tEnergy) + .setDuration(g.mDuration); + GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(g) + .setItemInputs(tItemInputs) + .setFluidInputs(tFluidInputs) + .setAvailableEUt(tEnergy) + .setMaxParallel(getMaxParallelRecipes()) + .setConsumption(true) + .setOutputCalculation(true) + .setMachine(this) + .enableBatchMode(batchMode ? 128 : 1) + .setCalculator(calculator); helper.build(); @@ -318,7 +337,8 @@ public class GregtechMetaTileEntity_IndustrialFishingPond extends // Utils.LOG_WARNING("Going to try swap an air block for water from inut bus."); stored.amount -= 1000; Block fluidUsed = Blocks.water; - aBaseMetaTileEntity.getWorld().setBlock( + aBaseMetaTileEntity.getWorld() + .setBlock( aBaseMetaTileEntity.getXCoord() + xDir + i, aBaseMetaTileEntity.getYCoord() + h, aBaseMetaTileEntity.getZCoord() + zDir + j, @@ -341,8 +361,8 @@ public class GregtechMetaTileEntity_IndustrialFishingPond extends private boolean isNotStaticWater(Block block, byte meta) { return block == Blocks.air || block == Blocks.flowing_water - || block == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater) - || (cofhWater != null && cofhWater.isAssignableFrom(block.getClass()) && meta != 0); + || block == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater) + || (cofhWater != null && cofhWater.isAssignableFrom(block.getClass()) && meta != 0); } private static AutoMap<AutoMap<WeightedRandomFishable>> categories = new AutoMap<>(); @@ -374,7 +394,8 @@ public class GregtechMetaTileEntity_IndustrialFishingPond extends private int getCircuit(ItemStack[] t) { if (!this.isUsingControllerCircuit) { for (ItemStack j : t) { - if (j.getItem() == CI.getNumberedCircuit(0).getItem()) { + if (j.getItem() == CI.getNumberedCircuit(0) + .getItem()) { // Fish if (j.getItemDamage() == 14) { mMax = 8 + (this.getMaxParallelRecipes() - 2); @@ -416,7 +437,8 @@ public class GregtechMetaTileEntity_IndustrialFishingPond extends } ItemStack t; try { - t = (ItemStack) ReflectionUtils.getField(WeightedRandomFishable.class, "field_150711_b").get(y); + t = (ItemStack) ReflectionUtils.getField(WeightedRandomFishable.class, "field_150711_b") + .get(y); ItemStack k = ItemUtils.getSimpleStack(t, 1); reflectiveFishMap.put(y, k); return t; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java index 833e347ce2..e7e74ac061 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java @@ -52,7 +52,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregtechMetaTileEntity_IndustrialRockBreaker extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialRockBreaker> implements ISurvivalConstructable { + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialRockBreaker> implements ISurvivalConstructable { private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_IndustrialRockBreaker> STRUCTURE_DEFINITION = null; @@ -77,21 +77,31 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker extends private static final String casingBaseName = GT_LanguageManager.getTranslation("gtplusplus.blockcasings.2.0.name"); private static final String casingMiddleName = GT_LanguageManager - .getTranslation("gtplusplus.blockcasings.2.11.name"); + .getTranslation("gtplusplus.blockcasings.2.11.name"); private static final String anyBaseCasing = "Any " + casingBaseName; @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Rock Breaker") - .addInfo("Speed: +200% | EU Usage: 75% | Parallel: Tier x 8").addInfo("Circuit goes in the GUI slot") - .addInfo("1 = cobble, 2 = stone, 3 = obsidian").addInfo("Supply Water/Lava") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 4, 3, true) - .addController("Bottom Center").addCasingInfoMin(casingBaseName, 9, false) - .addCasingInfoExactly(casingMiddleName, 16, false).addInputBus(anyBaseCasing, 1) - .addInputHatch(anyBaseCasing, 1).addOutputBus(anyBaseCasing, 1).addEnergyHatch(anyBaseCasing, 1) - .addMaintenanceHatch(anyBaseCasing, 1).addMufflerHatch(anyBaseCasing, 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Industrial Rock Breaker") + .addInfo("Speed: +200% | EU Usage: 75% | Parallel: Tier x 8") + .addInfo("Circuit goes in the GUI slot") + .addInfo("1 = cobble, 2 = stone, 3 = obsidian") + .addInfo("Supply Water/Lava") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 4, 3, true) + .addController("Bottom Center") + .addCasingInfoMin(casingBaseName, 9, false) + .addCasingInfoExactly(casingMiddleName, 16, false) + .addInputBus(anyBaseCasing, 1) + .addInputHatch(anyBaseCasing, 1) + .addOutputBus(anyBaseCasing, 1) + .addEnergyHatch(anyBaseCasing, 1) + .addMaintenanceHatch(anyBaseCasing, 1) + .addMufflerHatch(anyBaseCasing, 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -99,18 +109,20 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker extends public IStructureDefinition<GregtechMetaTileEntity_IndustrialRockBreaker> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialRockBreaker>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCC", "CCC", "CCC" }, { "HHH", "H-H", "HHH" }, - { "HHH", "H-H", "HHH" }, { "C~C", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_IndustrialRockBreaker.class) - .atLeast(InputBus, InputHatch, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(TAE.GTPP_INDEX(16)).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 0)))) - .addElement('H', ofBlock(ModBlocks.blockCasings2Misc, 11)).build(); + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "HHH", "H-H", "HHH" }, { "HHH", "H-H", "HHH" }, + { "C~C", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_IndustrialRockBreaker.class) + .atLeast(InputBus, InputHatch, OutputBus, Maintenance, Energy, Muffler) + .casingIndex(TAE.GTPP_INDEX(16)) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 0)))) + .addElement('H', ofBlock(ModBlocks.blockCasings2Misc, 11)) + .build(); } return STRUCTURE_DEFINITION; } @@ -177,39 +189,39 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker extends private static void generateRecipes() { sRecipe_Cobblestone = new GT_Recipe( - false, - new ItemStack[] { CI.getNumberedCircuit(1) }, - new ItemStack[] { ItemUtils.getSimpleStack(Blocks.cobblestone) }, - null, - new int[] { 10000 }, - null, - null, - 16, - 32, - 0); + false, + new ItemStack[] { CI.getNumberedCircuit(1) }, + new ItemStack[] { ItemUtils.getSimpleStack(Blocks.cobblestone) }, + null, + new int[] { 10000 }, + null, + null, + 16, + 32, + 0); sRecipe_SmoothStone = new GT_Recipe( - false, - new ItemStack[] { CI.getNumberedCircuit(2) }, - new ItemStack[] { ItemUtils.getSimpleStack(Blocks.stone) }, - null, - new int[] { 10000 }, - null, - null, - 16, - 32, - 0); + false, + new ItemStack[] { CI.getNumberedCircuit(2) }, + new ItemStack[] { ItemUtils.getSimpleStack(Blocks.stone) }, + null, + new int[] { 10000 }, + null, + null, + 16, + 32, + 0); sRecipe_Redstone = new GT_Recipe( - false, - new ItemStack[] { CI.getNumberedCircuit(3), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L) }, - new ItemStack[] { ItemUtils.getSimpleStack(Blocks.obsidian) }, - null, - new int[] { 10000 }, - null, - null, - 128, - 32, - 0); + false, + new ItemStack[] { CI.getNumberedCircuit(3), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L) }, + new ItemStack[] { ItemUtils.getSimpleStack(Blocks.obsidian) }, + null, + new int[] { 10000 }, + null, + null, + 128, + 32, + 0); } @Override @@ -233,7 +245,7 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker extends if (!aItems.isEmpty()) { for (ItemStack aItem : aItems) { if (GT_Utility - .areStacksEqual(aItem, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L))) { + .areStacksEqual(aItem, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L))) { aHasRedstone = true; break; } @@ -279,9 +291,15 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker extends // Remember last recipe - an optimization for findRecipe() this.mLastRecipe = tRecipe; - GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(aItemInputs) - .setFluidInputs(aFluidInputs).setAvailableEUt(tEnergy).setMaxParallel(getMaxParallelRecipes()) - .setConsumption(true).setOutputCalculation(true).setEUtModifier(0.75F).setMachine(this); + GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe) + .setItemInputs(aItemInputs) + .setFluidInputs(aFluidInputs) + .setAvailableEUt(tEnergy) + .setMaxParallel(getMaxParallelRecipes()) + .setConsumption(true) + .setOutputCalculation(true) + .setEUtModifier(0.75F) + .setMachine(this); if (batchMode) { helper.enableBatchMode(128); @@ -296,10 +314,13 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker extends this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt).setEUt(tEnergy) - .setDuration(tRecipe.mDuration).setEUtDiscount(0.75F).setSpeedBoost(1F / 3F) - .setParallel((int) Math.floor(helper.getCurrentParallel() / helper.getDurationMultiplierDouble())) - .calculate(); + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt) + .setEUt(tEnergy) + .setDuration(tRecipe.mDuration) + .setEUtDiscount(0.75F) + .setSpeedBoost(1F / 3F) + .setParallel((int) Math.floor(helper.getCurrentParallel() / helper.getDurationMultiplierDouble())) + .calculate(); lEUt = -calculator.getConsumption(); mMaxProgresstime = (int) Math.ceil(calculator.getDuration() * helper.getDurationMultiplierDouble()); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java index ba037c9654..e77ac454ee 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java @@ -52,8 +52,8 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEn import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -public class GregtechMetaTileEntity_LargeRocketEngine extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargeRocketEngine> implements ISurvivalConstructable { +public class GregtechMetaTileEntity_LargeRocketEngine + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargeRocketEngine> implements ISurvivalConstructable { protected int fuelConsumption; protected int fuelValue; @@ -98,30 +98,36 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Large Rocket Engine") - .addInfo("Generating Power from Rocket Fuels - Supports TecTech Multi-Amp Dynamos!") - .addInfo("Supply GT++ Rocket Fuels and 1000L of " + mLubricantName + " per hour") - .addInfo("Produces as much energy as you put fuel in, with optional boosting") - .addInfo("This multi doesn't accept fluids if not enabled - enable it first!") - .addInfo("Consumes 2000L/s of air and pollutes 1500 gibbl/s per 16384 eu/t produced") - .addInfo("Place 1-8 Air Intake Hatches on the sides to maintain Air input") - .addInfo("If it runs out of air, it will shut down and have to be manually restarted") - .addInfo("Supply 3L of " + mCoolantName + " per second, per 1000 EU/t to boost") - .addInfo("Takes 3x the amount of " + mLubricantName + " and maintains efficiency") - .addInfo("Fuel efficiency starts at ~160%, falls more slowly at higher EU/t if boosted") - .addInfo("If producing more than 30k EU/t, fuel efficiency will be lower:") - .addInfo("(These thresholds are 3x higher when boosted, boosted values displayed second)") - .addInfo("- 75% of max fuel efficiency at 53k or 159k EU/t output energy") - .addInfo("- 50% of max fuel efficiency at 69k or 207k EU/t output energy") - .addInfo("- 25% of max fuel efficiency at 98k or 294k EU/t output energy") - .addInfo("formula: x = input of energy (30000^(1/3)/ x^(1/3)) * (80000^(1/3)/ x^(1/3))").addSeparator() - .beginStructureBlock(3, 3, 10, false).addController("Front Center") - .addCasingInfoMin(mCasingName, 64, false).addCasingInfoMin(mGearboxName, 8, false) - .addStructureHint("Air Intake Hatch", 1).addInputBus("Side center line", 1) - .addInputHatch("Side center line", 1) - .addMaintenanceHatch("Any Block Touching Inconel Reinforced Casing", 1) - .addDynamoHatch("Top center line", 2).addMufflerHatch("Back Center", 3) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Large Rocket Engine") + .addInfo("Generating Power from Rocket Fuels - Supports TecTech Multi-Amp Dynamos!") + .addInfo("Supply GT++ Rocket Fuels and 1000L of " + mLubricantName + " per hour") + .addInfo("Produces as much energy as you put fuel in, with optional boosting") + .addInfo("This multi doesn't accept fluids if not enabled - enable it first!") + .addInfo("Consumes 2000L/s of air and pollutes 1500 gibbl/s per 16384 eu/t produced") + .addInfo("Place 1-8 Air Intake Hatches on the sides to maintain Air input") + .addInfo("If it runs out of air, it will shut down and have to be manually restarted") + .addInfo("Supply 3L of " + mCoolantName + " per second, per 1000 EU/t to boost") + .addInfo("Takes 3x the amount of " + mLubricantName + " and maintains efficiency") + .addInfo("Fuel efficiency starts at ~160%, falls more slowly at higher EU/t if boosted") + .addInfo("If producing more than 30k EU/t, fuel efficiency will be lower:") + .addInfo("(These thresholds are 3x higher when boosted, boosted values displayed second)") + .addInfo("- 75% of max fuel efficiency at 53k or 159k EU/t output energy") + .addInfo("- 50% of max fuel efficiency at 69k or 207k EU/t output energy") + .addInfo("- 25% of max fuel efficiency at 98k or 294k EU/t output energy") + .addInfo("formula: x = input of energy (30000^(1/3)/ x^(1/3)) * (80000^(1/3)/ x^(1/3))") + .addSeparator() + .beginStructureBlock(3, 3, 10, false) + .addController("Front Center") + .addCasingInfoMin(mCasingName, 64, false) + .addCasingInfoMin(mGearboxName, 8, false) + .addStructureHint("Air Intake Hatch", 1) + .addInputBus("Side center line", 1) + .addInputHatch("Side center line", 1) + .addMaintenanceHatch("Any Block Touching Inconel Reinforced Casing", 1) + .addDynamoHatch("Top center line", 2) + .addMufflerHatch("Back Center", 3) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -129,35 +135,32 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends public IStructureDefinition<GregtechMetaTileEntity_LargeRocketEngine> getStructureDefinition() { if (this.STRUCTURE_DEFINITION == null) { this.STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_LargeRocketEngine>builder() - .addShape( - this.mName, - transpose( - new String[][] { - { "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC" }, - { "C~C", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "CMC" }, - { "CCC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", - "CCC" }, })) - .addElement('C', ofBlock(getCasingBlock(), getCasingMeta())) - .addElement('I', ofBlock(getGearboxBlock(), getGearboxMeta())) - // side - .addElement( - 'S', - buildHatchAdder(GregtechMetaTileEntity_LargeRocketEngine.class) - .atLeast(ImmutableMap.of(AirIntake, 8, InputBus, 1, InputHatch, 3, Maintenance, 1)) - .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( - onElementPass( - x -> ++x.mCasing, - ofBlock(getCasingBlock(), getCasingMeta())))) - // top - .addElement( - 'T', - buildHatchAdder(GregtechMetaTileEntity_LargeRocketEngine.class) - .atLeast(ImmutableMap.of(AirIntake, 8, Dynamo.or(TTDynamo), 1, Maintenance, 1)) - .casingIndex(getCasingTextureIndex()).dot(2).buildAndChain( - onElementPass( - x -> ++x.mCasing, - ofBlock(getCasingBlock(), getCasingMeta())))) - .addElement('M', Muffler.newAny(getCasingTextureIndex(), 3)).build(); + .addShape( + this.mName, + transpose( + new String[][] { { "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC" }, + { "C~C", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "CMC" }, + { "CCC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CCC" }, })) + .addElement('C', ofBlock(getCasingBlock(), getCasingMeta())) + .addElement('I', ofBlock(getGearboxBlock(), getGearboxMeta())) + // side + .addElement( + 'S', + buildHatchAdder(GregtechMetaTileEntity_LargeRocketEngine.class) + .atLeast(ImmutableMap.of(AirIntake, 8, InputBus, 1, InputHatch, 3, Maintenance, 1)) + .casingIndex(getCasingTextureIndex()) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) + // top + .addElement( + 'T', + buildHatchAdder(GregtechMetaTileEntity_LargeRocketEngine.class) + .atLeast(ImmutableMap.of(AirIntake, 8, Dynamo.or(TTDynamo), 1, Maintenance, 1)) + .casingIndex(getCasingTextureIndex()) + .dot(2) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) + .addElement('M', Muffler.newAny(getCasingTextureIndex(), 3)) + .build(); } return this.STRUCTURE_DEFINITION; } @@ -180,8 +183,8 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends this.mAllDynamoHatches.clear(); this.mAirIntakes.clear(); return checkPiece(this.mName, 1, 1, 0) && this.mCasing >= 64 - 48 - && this.mAirIntakes.size() >= 1 - && checkHatch(); + && this.mAirIntakes.size() >= 1 + && checkHatch(); } @Override @@ -358,7 +361,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends public boolean consumeCO2() { return this.depleteInput(MISC_MATERIALS.CARBON_DIOXIDE.getFluidStack(this.boostEu ? 3 : 1)) - || this.depleteInput(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 3 : 1))); + || this.depleteInput(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 3 : 1))); } public boolean consumeLOH() { @@ -421,7 +424,8 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends } else { powerGain = aVoltage; } - aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(powerGain, false); + aDynamo.getBaseMetaTileEntity() + .increaseStoredEnergyUnits(powerGain, false); injected += powerGain; } } @@ -490,13 +494,12 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends @Override public String[] getExtraInfoData() { return new String[] { "Rocket Engine", "Current Air: " + getAir(), - "Current Pollution: " + getPollutionPerTick(null), - "Time until next fuel consumption: " + this.freeFuelTicks, - "Current Output: " + this.lEUt * this.mEfficiency / 10000 + " EU/t", - "Fuel Consumption: " + (this.fuelConsumption) + "L/s", "Fuel Value: " + this.fuelValue + " EU/L", - "Fuel Remaining: " + this.fuelRemaining + " Litres", - "Current Efficiency: " + this.mEfficiency / 100 + "%", - (this.getIdealStatus() == this.getRepairStatus()) ? "No Maintainance issues" : "Needs Maintainance" }; + "Current Pollution: " + getPollutionPerTick(null), + "Time until next fuel consumption: " + this.freeFuelTicks, + "Current Output: " + this.lEUt * this.mEfficiency / 10000 + " EU/t", + "Fuel Consumption: " + (this.fuelConsumption) + "L/s", "Fuel Value: " + this.fuelValue + " EU/L", + "Fuel Remaining: " + this.fuelRemaining + " Litres", "Current Efficiency: " + this.mEfficiency / 100 + "%", + (this.getIdealStatus() == this.getRepairStatus()) ? "No Maintainance issues" : "Needs Maintainance" }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java index 351920f2b7..4403779d09 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java @@ -44,7 +44,7 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; public class GregtechMetaTileEntity_LargeSemifluidGenerator extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargeSemifluidGenerator> implements ISurvivalConstructable { + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargeSemifluidGenerator> implements ISurvivalConstructable { private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_LargeSemifluidGenerator> STRUCTURE_DEFINITION = null; @@ -65,18 +65,25 @@ public class GregtechMetaTileEntity_LargeSemifluidGenerator extends @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Large Semifluid Generator") - .addInfo("Engine Intake Casings must not be obstructed in front (only air blocks)") - .addInfo("Supply Semifluid Fuels and 2000L of Lubricant per hour to run.") - .addInfo("Supply 80L of Oxygen per second to boost output (optional).") - .addInfo("Default: Produces 2048EU/t at 100% efficiency") - .addInfo("Boosted: Produces 6144EU/t at 150% efficiency") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 4, false) - .addController("Front Center").addCasingInfoMin("Stable Titanium Machine Casing", 16, false) - .addCasingInfoMin("Steel Gear Box Machine Casing", 2, false) - .addCasingInfoMin("Engine Intake Machine Casing", 8, false).addInputHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1).addDynamoHatch("Back Center", 2) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Large Semifluid Generator") + .addInfo("Engine Intake Casings must not be obstructed in front (only air blocks)") + .addInfo("Supply Semifluid Fuels and 2000L of Lubricant per hour to run.") + .addInfo("Supply 80L of Oxygen per second to boost output (optional).") + .addInfo("Default: Produces 2048EU/t at 100% efficiency") + .addInfo("Boosted: Produces 6144EU/t at 150% efficiency") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 4, false) + .addController("Front Center") + .addCasingInfoMin("Stable Titanium Machine Casing", 16, false) + .addCasingInfoMin("Steel Gear Box Machine Casing", 2, false) + .addCasingInfoMin("Engine Intake Machine Casing", 8, false) + .addInputHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .addDynamoHatch("Back Center", 2) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -123,7 +130,8 @@ public class GregtechMetaTileEntity_LargeSemifluidGenerator extends } for (FluidStack hatchFluid : tFluids) { // Loops through hatches - GT_Recipe aFuel = GTPPRecipeMaps.semiFluidFuels.getBackend().findFuel(hatchFluid); + GT_Recipe aFuel = GTPPRecipeMaps.semiFluidFuels.getBackend() + .findFuel(hatchFluid); if (aFuel == null) { // Not a valid semi-fluid fuel. continue; @@ -166,22 +174,25 @@ public class GregtechMetaTileEntity_LargeSemifluidGenerator extends public IStructureDefinition<GregtechMetaTileEntity_LargeSemifluidGenerator> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_LargeSemifluidGenerator>builder() - .addShape( - mName, - transpose( - new String[][] { { "III", "CCC", "CCC", "CCC" }, { "I~I", "CGC", "CGC", "CMC" }, - { "III", "CCC", "CCC", "CCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_LargeSemifluidGenerator.class) - .atLeast(Muffler, InputHatch, Maintenance).casingIndex(getCasingTextureIndex()) - .dot(1).buildAndChain( - onElementPass( - x -> ++x.mCasing, - ofBlock(getCasingBlock(), getCasingMeta())))) - .addElement('G', ofBlock(getGearboxBlock(), getGearboxMeta())) - .addElement('I', ofBlock(getIntakeBlock(), getIntakeMeta())) - .addElement('M', Dynamo.or(TTDynamo).newAny(getCasingTextureIndex(), 2)).build(); + .addShape( + mName, + transpose( + new String[][] { { "III", "CCC", "CCC", "CCC" }, { "I~I", "CGC", "CGC", "CMC" }, + { "III", "CCC", "CCC", "CCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_LargeSemifluidGenerator.class) + .atLeast(Muffler, InputHatch, Maintenance) + .casingIndex(getCasingTextureIndex()) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) + .addElement('G', ofBlock(getGearboxBlock(), getGearboxMeta())) + .addElement('I', ofBlock(getIntakeBlock(), getIntakeMeta())) + .addElement( + 'M', + Dynamo.or(TTDynamo) + .newAny(getCasingTextureIndex(), 2)) + .build(); } return STRUCTURE_DEFINITION; } @@ -298,9 +309,9 @@ public class GregtechMetaTileEntity_LargeSemifluidGenerator extends @Override public String[] getExtraInfoData() { return new String[] { "Large Semifluid Generator", "Current Output: " + lEUt * mEfficiency / 10000 + " EU/t", - "Fuel Consumption: " + fuelConsumption + "L/t", "Fuel Value: " + fuelValue + " EU/L", - "Fuel Remaining: " + fuelRemaining + " Litres", "Current Efficiency: " + (mEfficiency / 100) + "%", - getIdealStatus() == getRepairStatus() ? "No Maintainance issues" : "Needs Maintainance" }; + "Fuel Consumption: " + fuelConsumption + "L/t", "Fuel Value: " + fuelValue + " EU/L", + "Fuel Remaining: " + fuelRemaining + " Litres", "Current Efficiency: " + (mEfficiency / 100) + "%", + getIdealStatus() == getRepairStatus() ? "No Maintainance issues" : "Needs Maintainance" }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java index 20d6ba93c3..69042b7982 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java @@ -59,7 +59,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregtechMetaTileEntity_MassFabricator - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_MassFabricator> implements ISurvivalConstructable { + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_MassFabricator> implements ISurvivalConstructable { public static int sUUAperUUM = 1; public static int sUUASpeedBonus = 4; @@ -97,15 +97,27 @@ public class GregtechMetaTileEntity_MassFabricator @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Matter Fabricator") - .addInfo("Speed: +0% | EU Usage: 80%").addInfo("Parallel: Scrap = 64 | UU = 8 * Tier") - .addInfo("Produces UU-A, UU-M & Scrap").addInfo("Change mode with screwdriver") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(5, 4, 5, true) - .addController("Front Center").addCasingInfoMin(mCasingName3, 9, false) - .addCasingInfoMin(mCasingName2, 24, false).addCasingInfoMin(mCasingName1, 36, false) - .addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Matter Fabricator") + .addInfo("Speed: +0% | EU Usage: 80%") + .addInfo("Parallel: Scrap = 64 | UU = 8 * Tier") + .addInfo("Produces UU-A, UU-M & Scrap") + .addInfo("Change mode with screwdriver") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(5, 4, 5, true) + .addController("Front Center") + .addCasingInfoMin(mCasingName3, 9, false) + .addCasingInfoMin(mCasingName2, 24, false) + .addCasingInfoMin(mCasingName1, 36, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -128,7 +140,7 @@ public class GregtechMetaTileEntity_MassFabricator public void onConfigLoad(final GT_Config aConfig) { super.onConfigLoad(aConfig); sDurationMultiplier = aConfig - .get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier); + .get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier); sUUAperUUM = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_per_UUM", sUUAperUUM); sUUASpeedBonus = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Speed_Bonus", sUUASpeedBonus); sRequiresUUA = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Requirement", sRequiresUUA); @@ -159,21 +171,23 @@ public class GregtechMetaTileEntity_MassFabricator public IStructureDefinition<GregtechMetaTileEntity_MassFabricator> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_MassFabricator>builder() - .addShape( - mName, - transpose( - new String[][] { { "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC" }, - { "CGGGC", "G---G", "G---G", "G---G", "CGGGC" }, - { "CGGGC", "G---G", "G---G", "G---G", "CGGGC" }, - { "CC~CC", "CHHHC", "CHHHC", "CHHHC", "CCCCC" }, })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_MassFabricator.class) - .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Maintenance, Energy, Muffler) - .casingIndex(TAE.GTPP_INDEX(9)).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 9)))) - .addElement('H', ofBlock(ModBlocks.blockCasingsMisc, 8)) - .addElement('G', ofBlock(ModBlocks.blockCasings3Misc, 15)).build(); + .addShape( + mName, + transpose( + new String[][] { { "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC" }, + { "CGGGC", "G---G", "G---G", "G---G", "CGGGC" }, + { "CGGGC", "G---G", "G---G", "G---G", "CGGGC" }, + { "CC~CC", "CHHHC", "CHHHC", "CHHHC", "CCCCC" }, })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_MassFabricator.class) + .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Maintenance, Energy, Muffler) + .casingIndex(TAE.GTPP_INDEX(9)) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 9)))) + .addElement('H', ofBlock(ModBlocks.blockCasingsMisc, 8)) + .addElement('G', ofBlock(ModBlocks.blockCasings3Misc, 15)) + .build(); } return STRUCTURE_DEFINITION; } @@ -259,18 +273,18 @@ public class GregtechMetaTileEntity_MassFabricator for (ItemStack item : inputItems) { if (item == null || item.stackSize == 0) continue; ItemStack aPotentialOutput = GT_ModHandler - .getRecyclerOutput(GT_Utility.copyAmount(1, item), 0); + .getRecyclerOutput(GT_Utility.copyAmount(1, item), 0); GT_Recipe recipe = new GT_Recipe( - false, - new ItemStack[] { GT_Utility.copyAmount(1, item) }, - aPotentialOutput == null ? null : new ItemStack[] { aPotentialOutput }, - null, - new int[] { 2000 }, - null, - null, - 40, - MaterialUtils.getVoltageForTier(1), - 0); + false, + new ItemStack[] { GT_Utility.copyAmount(1, item) }, + aPotentialOutput == null ? null : new ItemStack[] { aPotentialOutput }, + null, + new int[] { 2000 }, + null, + null, + 40, + MaterialUtils.getVoltageForTier(1), + 0); return Stream.of(recipe); } } @@ -278,7 +292,8 @@ public class GregtechMetaTileEntity_MassFabricator } return super.findRecipeMatches(map); } - }.setEuModifier(0.8F).setMaxParallelSupplier(this::getMaxParallelRecipes); + }.setEuModifier(0.8F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_QuantumForceTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_QuantumForceTransformer.java index 803d0f0a9c..bd5e579cd2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_QuantumForceTransformer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_QuantumForceTransformer.java @@ -82,8 +82,8 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @SuppressWarnings("SpellCheckingInspection") public class GregtechMetaTileEntity_QuantumForceTransformer - extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase<GregtechMetaTileEntity_QuantumForceTransformer> - implements ISurvivalConstructable { + extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase<GregtechMetaTileEntity_QuantumForceTransformer> + implements ISurvivalConstructable { private int mCasing; protected int mCraftingTier = 0; @@ -96,152 +96,142 @@ public class GregtechMetaTileEntity_QuantumForceTransformer private GT_MetaTileEntity_Hatch_Input mNeptuniumHatch; private GT_MetaTileEntity_Hatch_Input mFermiumHatch; private static final IStructureDefinition<GregtechMetaTileEntity_QuantumForceTransformer> STRUCTURE_DEFINITION = StructureDefinition - .<GregtechMetaTileEntity_QuantumForceTransformer>builder().addShape( - MAIN_PIECE, - new String[][] { // A - 142, B - 234, C - 177, D - 96, E - 224, H - 36, M - 21 - { " ", " ", " ", " ", - " ", " ", " ", " ", - " ", " ", " ", " ", - " ", " BAB ", " BBBBABBBB ", " BAAAAAAAB ", - " BABBABBAB ", " BA AB ", " A A ", " A A ", - " A A " }, - { " ", " ", " ", " ", - " ", " ", " ", " ", - " ", " ", " ", " ", - " BAB ", " AAABBBAAA ", " BAAAAAAAAAB ", " B B ", - " A A ", " A A ", " ", " ", - " " }, - { " ", " ", " ", " ", - " ", " ", " ", " ", - " ", " ", " ", " BAB ", - " AA AA ", " AA AA ", " BAA AAB ", " B B ", - " A A ", " A A ", " ", " ", - " " }, - { " ", " ", " ", " ", - " ", " ", " ", " ", - " ", " ", " ", " BAAAB ", - " AA AA ", " AA AA ", "BAA AAB", "B B", - "A A", "A A", "A A", "A A", - "A A" }, - { " TTT ", " EEE ", " EEE ", " EEE ", - " DDD ", " EEE ", " DDD ", " EEE ", - " EEE ", " EEE ", " DDD ", " BAEEEAB ", - " AA EEE AA ", " A EEE A ", "BA DDD AB", "B EEE B", - "B DDD B", " EEE ", " EEE ", " EEE ", - " Z~X " }, - { " TTTTT ", " ECCCE ", " ECCCE ", " ECCCE ", - " D D ", " ECCCE ", " D D ", " ECCCE ", - " ECCCE ", " ECCCE ", " D D ", " BAECCCEAB ", - " A ECCCE A ", " A ECCCE A ", "BA D D AB", "B ECCCE B", - "B D D B", "B ECCCE B", " ECCCE ", " ECCCE ", - " HHHHH " }, - { " TTTTTTT ", " ECCCCCE ", " EC CE ", " EC CE ", - " D D ", " EC CE ", " D D ", " EC CE ", - " EC CE ", " EC CE ", " D D ", " BAEC CEAB ", - " B EC CE B ", "BB EC CE BB", "BA D D AB", "A EC CE A", - "A D D A", "A EC CE A", " EC CE ", " EC CE ", - " HHHHHHH " }, - { " TTTTTTT ", " ECCCCCE ", " EC CE ", " EC CE ", - " D D ", " EC CE ", " D D ", " EC CE ", - " EC CE ", " EC CE ", " D D ", " AAEC CEAA ", - " A EC CE A ", "AB EC CE BA", "AA D D AA", "A EC CE A", - "A D D A", " EC CE ", " EC CE ", " EC CE ", - " HHHHHHH " }, - { " TTTTTTT ", " ECCCCCE ", " EC CE ", " EC CE ", - " D D ", " EC CE ", " D D ", " EC CE ", - " EC CE ", " EC CE ", " D D ", " BAEC CEAB ", - " B EC CE B ", "BB EC CE BB", "BA D D AB", "A EC CE A", - "A D D A", "A EC CE A", " EC CE ", " EC CE ", - " HHHHHHH " }, - { " TTTTT ", " ECCCE ", " ECCCE ", " ECCCE ", - " D D ", " ECCCE ", " D D ", " ECCCE ", - " ECCCE ", " ECCCE ", " D D ", " BAECCCEAB ", - " A ECCCE A ", " A ECCCE A ", "BA D D AB", "B ECCCE B", - "B D D B", "B ECCCE B", " ECCCE ", " ECCCE ", - " HHHHH " }, - { " TTT ", " EEE ", " EEE ", " EEE ", - " DDD ", " EEE ", " DDD ", " EEE ", - " EEE ", " EEE ", " DDD ", " BAEEEAB ", - " AA EEE AA ", " A EEE A ", "BA DDD AB", "B EEE B", - "B DDD B", " EEE ", " EEE ", " EEE ", - " HHH " }, - { " ", " ", " ", " ", - " ", " ", " ", " ", - " ", " ", " ", " BAAAB ", - " AA AA ", " AA AA ", "BAA AAB", "B B", - "A A", "A A", "A A", "A A", - "A A" }, - { " ", " ", " ", " ", - " ", " ", " ", " ", - " ", " ", " ", " BAB ", - " AA AA ", " AA AA ", " BAA AAB ", " B B ", - " A A ", " A A ", " ", " ", - " " }, - { " ", " ", " ", " ", - " ", " ", " ", " ", - " ", " ", " ", " ", - " BAB ", " AAABBBAAA ", " BAAAAAAAAAB ", " B B ", - " A A ", " A A ", " ", " ", - " " }, - { " ", " ", " ", " ", - " ", " ", " ", " ", - " ", " ", " ", " ", - " ", " BAB ", " BBBBABBBB ", " BBBAAABBB ", - " ABBAAABBA ", " A BA AB A ", " A A ", " A A ", - " A A " }, }) - .addElement( - 'A', - withChannel( - "manipulator", - StructureUtility.ofBlocksTiered( - craftingTierConverter(), - getAllCraftingTiers(), - 0, - GregtechMetaTileEntity_QuantumForceTransformer::setCraftingTier, - GregtechMetaTileEntity_QuantumForceTransformer::getCraftingTier))) - .addElement( - 'B', - withChannel( - "shielding", - StructureUtility.ofBlocksTiered( - focusingTierConverter(), - getAllFocusingTiers(), - 0, - GregtechMetaTileEntity_QuantumForceTransformer::setFocusingTier, - GregtechMetaTileEntity_QuantumForceTransformer::getFocusingTier))) - .addElement('C', ofBlock(ModBlocks.blockCasings4Misc, 4)) - .addElement('D', ofBlock(ModBlocks.blockCasings2Misc, 12)) - .addElement('E', lazy(t -> ofBlock(t.getCasingBlock1(), t.getCasingMeta1()))) - .addElement( - 'H', - buildHatchAdder(GregtechMetaTileEntity_QuantumForceTransformer.class) - .atLeast(InputBus, InputHatch, Maintenance, Energy.or(ExoticEnergy)) - .casingIndex(TAE.getIndexFromPage(0, 10)).dot(4) - .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) - .addElement( - 'T', - buildHatchAdder(GregtechMetaTileEntity_QuantumForceTransformer.class) - .atLeast(OutputBus, OutputHatch, Maintenance).casingIndex(TAE.getIndexFromPage(0, 10)) - .dot(5) - .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) - .addElement( - 'Z', - buildHatchAdder(GregtechMetaTileEntity_QuantumForceTransformer.class) - .hatchClass(GT_MetaTileEntity_Hatch_Input.class) - .adder(GregtechMetaTileEntity_QuantumForceTransformer::addNeptuniumHatch) - .casingIndex(TAE.getIndexFromPage(0, 10)).dot(5) - .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) - .addElement( - 'X', - buildHatchAdder(GregtechMetaTileEntity_QuantumForceTransformer.class) - .hatchClass(GT_MetaTileEntity_Hatch_Input.class) - .adder(GregtechMetaTileEntity_QuantumForceTransformer::addFermiumHatch) - .casingIndex(TAE.getIndexFromPage(0, 10)).dot(5) - .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) - .build(); + .<GregtechMetaTileEntity_QuantumForceTransformer>builder() + .addShape( + MAIN_PIECE, + new String[][] { // A - 142, B - 234, C - 177, D - 96, E - 224, H - 36, M - 21 + { " ", " ", " ", " ", " ", + " ", " ", " ", " ", " ", + " ", " ", " ", " BAB ", " BBBBABBBB ", + " BAAAAAAAB ", " BABBABBAB ", " BA AB ", " A A ", " A A ", + " A A " }, + { " ", " ", " ", " ", " ", + " ", " ", " ", " ", " ", + " ", " ", " BAB ", " AAABBBAAA ", " BAAAAAAAAAB ", + " B B ", " A A ", " A A ", " ", " ", + " " }, + { " ", " ", " ", " ", " ", + " ", " ", " ", " ", " ", + " ", " BAB ", " AA AA ", " AA AA ", " BAA AAB ", + " B B ", " A A ", " A A ", " ", " ", + " " }, + { " ", " ", " ", " ", " ", + " ", " ", " ", " ", " ", + " ", " BAAAB ", " AA AA ", " AA AA ", "BAA AAB", + "B B", "A A", "A A", "A A", "A A", + "A A" }, + { " TTT ", " EEE ", " EEE ", " EEE ", " DDD ", + " EEE ", " DDD ", " EEE ", " EEE ", " EEE ", + " DDD ", " BAEEEAB ", " AA EEE AA ", " A EEE A ", "BA DDD AB", + "B EEE B", "B DDD B", " EEE ", " EEE ", " EEE ", + " Z~X " }, + { " TTTTT ", " ECCCE ", " ECCCE ", " ECCCE ", " D D ", + " ECCCE ", " D D ", " ECCCE ", " ECCCE ", " ECCCE ", + " D D ", " BAECCCEAB ", " A ECCCE A ", " A ECCCE A ", "BA D D AB", + "B ECCCE B", "B D D B", "B ECCCE B", " ECCCE ", " ECCCE ", + " HHHHH " }, + { " TTTTTTT ", " ECCCCCE ", " EC CE ", " EC CE ", " D D ", + " EC CE ", " D D ", " EC CE ", " EC CE ", " EC CE ", + " D D ", " BAEC CEAB ", " B EC CE B ", "BB EC CE BB", "BA D D AB", + "A EC CE A", "A D D A", "A EC CE A", " EC CE ", " EC CE ", + " HHHHHHH " }, + { " TTTTTTT ", " ECCCCCE ", " EC CE ", " EC CE ", " D D ", + " EC CE ", " D D ", " EC CE ", " EC CE ", " EC CE ", + " D D ", " AAEC CEAA ", " A EC CE A ", "AB EC CE BA", "AA D D AA", + "A EC CE A", "A D D A", " EC CE ", " EC CE ", " EC CE ", + " HHHHHHH " }, + { " TTTTTTT ", " ECCCCCE ", " EC CE ", " EC CE ", " D D ", + " EC CE ", " D D ", " EC CE ", " EC CE ", " EC CE ", + " D D ", " BAEC CEAB ", " B EC CE B ", "BB EC CE BB", "BA D D AB", + "A EC CE A", "A D D A", "A EC CE A", " EC CE ", " EC CE ", + " HHHHHHH " }, + { " TTTTT ", " ECCCE ", " ECCCE ", " ECCCE ", " D D ", + " ECCCE ", " D D ", " ECCCE ", " ECCCE ", " ECCCE ", + " D D ", " BAECCCEAB ", " A ECCCE A ", " A ECCCE A ", "BA D D AB", + "B ECCCE B", "B D D B", "B ECCCE B", " ECCCE ", " ECCCE ", + " HHHHH " }, + { " TTT ", " EEE ", " EEE ", " EEE ", " DDD ", + " EEE ", " DDD ", " EEE ", " EEE ", " EEE ", + " DDD ", " BAEEEAB ", " AA EEE AA ", " A EEE A ", "BA DDD AB", + "B EEE B", "B DDD B", " EEE ", " EEE ", " EEE ", + " HHH " }, + { " ", " ", " ", " ", " ", + " ", " ", " ", " ", " ", + " ", " BAAAB ", " AA AA ", " AA AA ", "BAA AAB", + "B B", "A A", "A A", "A A", "A A", + "A A" }, + { " ", " ", " ", " ", " ", + " ", " ", " ", " ", " ", + " ", " BAB ", " AA AA ", " AA AA ", " BAA AAB ", + " B B ", " A A ", " A A ", " ", " ", + " " }, + { " ", " ", " ", " ", " ", + " ", " ", " ", " ", " ", + " ", " ", " BAB ", " AAABBBAAA ", " BAAAAAAAAAB ", + " B B ", " A A ", " A A ", " ", " ", + " " }, + { " ", " ", " ", " ", " ", + " ", " ", " ", " ", " ", + " ", " ", " ", " BAB ", " BBBBABBBB ", + " BBBAAABBB ", " ABBAAABBA ", " A BA AB A ", " A A ", " A A ", + " A A " }, }) + .addElement( + 'A', + withChannel( + "manipulator", + StructureUtility.ofBlocksTiered( + craftingTierConverter(), + getAllCraftingTiers(), + 0, + GregtechMetaTileEntity_QuantumForceTransformer::setCraftingTier, + GregtechMetaTileEntity_QuantumForceTransformer::getCraftingTier))) + .addElement( + 'B', + withChannel( + "shielding", + StructureUtility.ofBlocksTiered( + focusingTierConverter(), + getAllFocusingTiers(), + 0, + GregtechMetaTileEntity_QuantumForceTransformer::setFocusingTier, + GregtechMetaTileEntity_QuantumForceTransformer::getFocusingTier))) + .addElement('C', ofBlock(ModBlocks.blockCasings4Misc, 4)) + .addElement('D', ofBlock(ModBlocks.blockCasings2Misc, 12)) + .addElement('E', lazy(t -> ofBlock(t.getCasingBlock1(), t.getCasingMeta1()))) + .addElement( + 'H', + buildHatchAdder(GregtechMetaTileEntity_QuantumForceTransformer.class) + .atLeast(InputBus, InputHatch, Maintenance, Energy.or(ExoticEnergy)) + .casingIndex(TAE.getIndexFromPage(0, 10)) + .dot(4) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) + .addElement( + 'T', + buildHatchAdder(GregtechMetaTileEntity_QuantumForceTransformer.class) + .atLeast(OutputBus, OutputHatch, Maintenance) + .casingIndex(TAE.getIndexFromPage(0, 10)) + .dot(5) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) + .addElement( + 'Z', + buildHatchAdder(GregtechMetaTileEntity_QuantumForceTransformer.class) + .hatchClass(GT_MetaTileEntity_Hatch_Input.class) + .adder(GregtechMetaTileEntity_QuantumForceTransformer::addNeptuniumHatch) + .casingIndex(TAE.getIndexFromPage(0, 10)) + .dot(5) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) + .addElement( + 'X', + buildHatchAdder(GregtechMetaTileEntity_QuantumForceTransformer.class) + .hatchClass(GT_MetaTileEntity_Hatch_Input.class) + .adder(GregtechMetaTileEntity_QuantumForceTransformer::addFermiumHatch) + .casingIndex(TAE.getIndexFromPage(0, 10)) + .dot(5) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) + .build(); public GregtechMetaTileEntity_QuantumForceTransformer(final int aID, final String aName, - final String aNameRegional) { + final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -257,61 +247,66 @@ public class GregtechMetaTileEntity_QuantumForceTransformer @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Quantum Force Transformer").addInfo("Controller Block for the Quantum Force Transformer") - .addInfo("Allows Complex chemical lines to be performed instantly in one step") - .addInfo("Every recipe requires a catalyst, each catalyst adds 1 parallel and lasts forever") - .addInfo("Accepts TecTech Energy and Laser Hatches") - .addInfo("All inputs go on the bottom, all outputs go on the top") - .addInfo("Put a circuit in the controller to specify the focused output") - .addInfo("Check NEI to see the order of outputs, and which circuit number you need.") - .addInfo("If separate input busses are enabled put the circuit in the circuit slot of the bus") - .addInfo("Uses FocusTier*4*sqrt(parallels) Neptunium Plasma if focusing") - .addInfo("Can use FocusTier*4*sqrt(parallels) Fermium Plasma for additional chance output") - .addInfo("Use a screwdriver to enable Fluid mode") - .addInfo( - "Fluid mode turns all possible outputs into their fluid variant, those which can't are left as they were.") - .addInfo("This multi gets improved when all casings of some types are upgraded") - .addInfo("Casing functions:") - .addInfo("Pulse Manipulators: Recipe Tier Allowed (check NEI for the tier of each recipe)") - .addInfo("Shielding Cores: Focusing Tier (equal to or higher than recipe tier to allow focus)") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(15, 21, 15, true) - .addController("Bottom Center").addCasingInfoMin("Bulk Production Frame", 80, false) - .addCasingInfoMin("Quantum Force Conductor", 177, false) - .addCasingInfoMin("Force Field Glass", 224, false).addCasingInfoMin("Pulse Manipulators", 236, true) - .addCasingInfoMin("Shielding Cores", 142, true) - .addInputBus(EnumChatFormatting.BLUE + "Bottom" + EnumChatFormatting.GRAY + " Layer", 4) - .addInputHatch(EnumChatFormatting.BLUE + "Bottom" + EnumChatFormatting.GRAY + " Layer", 4) - .addOutputHatch(EnumChatFormatting.AQUA + "Top" + EnumChatFormatting.GRAY + " Layer", 5) - .addOutputBus(EnumChatFormatting.AQUA + "Top" + EnumChatFormatting.GRAY + " Layer", 5) - .addEnergyHatch(EnumChatFormatting.BLUE + "Bottom" + EnumChatFormatting.GRAY + " Layer", 4) - .addMaintenanceHatch( - EnumChatFormatting.BLUE + "Bottom" - + EnumChatFormatting.GRAY - + " or " - + EnumChatFormatting.AQUA - + "Top" - + EnumChatFormatting.GRAY - + " Layer", - 4, - 5) - .addStructureInfo( - EnumChatFormatting.WHITE + "Neptunium Plasma Hatch: " - + EnumChatFormatting.GREEN - + "Left" - + EnumChatFormatting.GRAY - + " side of Controller") - .addStructureInfo( - EnumChatFormatting.WHITE + "Fermium Plasma Hatch: " - + EnumChatFormatting.DARK_GREEN - + "Right" - + EnumChatFormatting.GRAY - + " side of Controller") - .toolTipFinisher( - GT_Values.AuthorBlueWeabo + EnumChatFormatting.RESET - + EnumChatFormatting.GREEN - + " + Steelux" - + EnumChatFormatting.RESET - + " - [GT++]"); + tt.addMachineType("Quantum Force Transformer") + .addInfo("Controller Block for the Quantum Force Transformer") + .addInfo("Allows Complex chemical lines to be performed instantly in one step") + .addInfo("Every recipe requires a catalyst, each catalyst adds 1 parallel and lasts forever") + .addInfo("Accepts TecTech Energy and Laser Hatches") + .addInfo("All inputs go on the bottom, all outputs go on the top") + .addInfo("Put a circuit in the controller to specify the focused output") + .addInfo("Check NEI to see the order of outputs, and which circuit number you need.") + .addInfo("If separate input busses are enabled put the circuit in the circuit slot of the bus") + .addInfo("Uses FocusTier*4*sqrt(parallels) Neptunium Plasma if focusing") + .addInfo("Can use FocusTier*4*sqrt(parallels) Fermium Plasma for additional chance output") + .addInfo("Use a screwdriver to enable Fluid mode") + .addInfo( + "Fluid mode turns all possible outputs into their fluid variant, those which can't are left as they were.") + .addInfo("This multi gets improved when all casings of some types are upgraded") + .addInfo("Casing functions:") + .addInfo("Pulse Manipulators: Recipe Tier Allowed (check NEI for the tier of each recipe)") + .addInfo("Shielding Cores: Focusing Tier (equal to or higher than recipe tier to allow focus)") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(15, 21, 15, true) + .addController("Bottom Center") + .addCasingInfoMin("Bulk Production Frame", 80, false) + .addCasingInfoMin("Quantum Force Conductor", 177, false) + .addCasingInfoMin("Force Field Glass", 224, false) + .addCasingInfoMin("Pulse Manipulators", 236, true) + .addCasingInfoMin("Shielding Cores", 142, true) + .addInputBus(EnumChatFormatting.BLUE + "Bottom" + EnumChatFormatting.GRAY + " Layer", 4) + .addInputHatch(EnumChatFormatting.BLUE + "Bottom" + EnumChatFormatting.GRAY + " Layer", 4) + .addOutputHatch(EnumChatFormatting.AQUA + "Top" + EnumChatFormatting.GRAY + " Layer", 5) + .addOutputBus(EnumChatFormatting.AQUA + "Top" + EnumChatFormatting.GRAY + " Layer", 5) + .addEnergyHatch(EnumChatFormatting.BLUE + "Bottom" + EnumChatFormatting.GRAY + " Layer", 4) + .addMaintenanceHatch( + EnumChatFormatting.BLUE + "Bottom" + + EnumChatFormatting.GRAY + + " or " + + EnumChatFormatting.AQUA + + "Top" + + EnumChatFormatting.GRAY + + " Layer", + 4, + 5) + .addStructureInfo( + EnumChatFormatting.WHITE + "Neptunium Plasma Hatch: " + + EnumChatFormatting.GREEN + + "Left" + + EnumChatFormatting.GRAY + + " side of Controller") + .addStructureInfo( + EnumChatFormatting.WHITE + "Fermium Plasma Hatch: " + + EnumChatFormatting.DARK_GREEN + + "Right" + + EnumChatFormatting.GRAY + + " side of Controller") + .toolTipFinisher( + GT_Values.AuthorBlueWeabo + EnumChatFormatting.RESET + + EnumChatFormatting.GREEN + + " + Steelux" + + EnumChatFormatting.RESET + + " - [GT++]"); return tt; } @@ -542,34 +537,35 @@ public class GregtechMetaTileEntity_QuantumForceTransformer } return items.toArray(new ItemStack[0]); - }).setCustomFluidOutputCalculation(parallel -> { - ArrayList<FluidStack> fluids = new ArrayList<>(); + }) + .setCustomFluidOutputCalculation(parallel -> { + ArrayList<FluidStack> fluids = new ArrayList<>(); + + if (mFluidMode) { + for (int i = 0; i < recipe.mOutputs.length; i++) { + FluidStack fluid = fluidModeItems[i]; + if (fluid == null) continue; + FluidStack fluidToAdd = fluid.copy(); + double outputMultiplier = calculateChancedOutputMultiplier(chances[i], parallel); + int itemAmount = recipe.mOutputs[i].stackSize; + long fluidAmount = (long) (fluidToAdd.amount * outputMultiplier * itemAmount); + addFluidsLong(fluids, fluidToAdd, fluidAmount); + } + } - if (mFluidMode) { - for (int i = 0; i < recipe.mOutputs.length; i++) { - FluidStack fluid = fluidModeItems[i]; + for (int i = 0; i < recipe.mFluidOutputs.length; i++) { + FluidStack fluid = recipe.getFluidOutput(i); if (fluid == null) continue; FluidStack fluidToAdd = fluid.copy(); - double outputMultiplier = calculateChancedOutputMultiplier(chances[i], parallel); - int itemAmount = recipe.mOutputs[i].stackSize; - long fluidAmount = (long) (fluidToAdd.amount * outputMultiplier * itemAmount); - addFluidsLong(fluids, fluidToAdd, fluidAmount); - } - } - - for (int i = 0; i < recipe.mFluidOutputs.length; i++) { - FluidStack fluid = recipe.getFluidOutput(i); - if (fluid == null) continue; - FluidStack fluidToAdd = fluid.copy(); - double outputMultiplier = calculateChancedOutputMultiplier( + double outputMultiplier = calculateChancedOutputMultiplier( chances[i + recipe.mOutputs.length], parallel); - long fluidAmount = (long) (fluidToAdd.amount * outputMultiplier); - addFluidsLong(fluids, fluidToAdd, fluidAmount); - } + long fluidAmount = (long) (fluidToAdd.amount * outputMultiplier); + addFluidsLong(fluids, fluidToAdd, fluidAmount); + } - return fluids.toArray(new FluidStack[0]); - }); + return fluids.toArray(new FluidStack[0]); + }); } private int findProgrammedCircuitNumber() { @@ -583,7 +579,7 @@ public class GregtechMetaTileEntity_QuantumForceTransformer } else { final ItemStack controllerStack = getControllerSlot(); return GT_Utility.isAnyIntegratedCircuit(controllerStack) ? controllerStack.getItemDamage() - 1 - : -1; + : -1; } } }; @@ -605,7 +601,7 @@ public class GregtechMetaTileEntity_QuantumForceTransformer if (runningTick % 20 == 0) { int amount = (int) (getFocusingTier() * 4 - * Math.sqrt(Math.min(mMaxParallel, processingLogic.getCurrentParallels()))); + * Math.sqrt(Math.min(mMaxParallel, processingLogic.getCurrentParallels()))); if (doFermium) { FluidStack fermiumToConsume = new FluidStack(mFermium, amount); if (!drain(mFermiumHatch, fermiumToConsume, true)) { @@ -723,8 +719,8 @@ public class GregtechMetaTileEntity_QuantumForceTransformer public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { mFluidMode = !mFluidMode; GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("miscutils.machines.QFTFluidMode") + " " + mFluidMode); + aPlayer, + StatCollector.translateToLocal("miscutils.machines.QFTFluidMode") + " " + mFluidMode); } public boolean addNeptuniumHatch(IGregTechTileEntity aTileEntity, short aBaseCasingIndex) { @@ -787,12 +783,16 @@ public class GregtechMetaTileEntity_QuantumForceTransformer @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int aColorIndex, boolean aActive, boolean aRedstone) { + int aColorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { - if (aActive) return new ITexture[] { getCasingTexture(), - TextureFactory.builder().addIcon(getActiveOverlay()).extFacing().build() }; - return new ITexture[] { getCasingTexture(), - TextureFactory.builder().addIcon(getInactiveOverlay()).extFacing().build() }; + if (aActive) return new ITexture[] { getCasingTexture(), TextureFactory.builder() + .addIcon(getActiveOverlay()) + .extFacing() + .build() }; + return new ITexture[] { getCasingTexture(), TextureFactory.builder() + .addIcon(getInactiveOverlay()) + .extFacing() + .build() }; } return new ITexture[] { getCasingTexture() }; } @@ -803,7 +803,7 @@ public class GregtechMetaTileEntity_QuantumForceTransformer @SideOnly(Side.CLIENT) private void renderForceField(double x, double y, double z, int side, double minU, double maxU, double minV, - double maxV) { + double maxV) { // spotless:off Tessellator tes = Tessellator.instance; switch (side) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java index f60f835c34..8a6564858e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java @@ -35,7 +35,7 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; public class GregtechMetaTileEntity_Refinery extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Refinery> - implements ISurvivalConstructable { + implements ISurvivalConstructable { private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_Refinery> STRUCTURE_DEFINITION = null; @@ -56,23 +56,30 @@ public class GregtechMetaTileEntity_Refinery extends GregtechMeta_MultiBlockBase @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Fission Fuel Processing Unit") - .addInfo("Refines fluorides and Uranium into nuclear fuel for the LFTR") - .addInfo("LFTR Fuel 2 and Fuel 3 have alternative, much more efficient recipes") - .addInfo("However, they require fission breeding outputs from the LFTR itself") - .addInfo("Only one Energy Hatch is allowed per Processing Unit") - .addInfo("All recipe times in this multi are very long, watch out!") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 9, 3, false) - .addController("Bottom Center").addCasingInfoMin("Hastelloy-X Structural Block", 7, false) - .addCasingInfoMin("Incoloy-DS Fluid Containment Block", 5, false) - .addCasingInfoMin("Zeron-100 Reactor Shielding", 4, false) - .addCasingInfoMin("Hastelloy-N Sealant Blocks", 17, false).addInputHatch("Base platform", 1) - .addOutputHatch("Base platform", 1).addMufflerHatch("Base platform", 1) - .addMaintenanceHatch("Base platform", 1).addEnergyHatch("Base platform", 1) - .addStructureInfo("Muffler's Tier must be IV+") - .addStructureInfo("2-4x Input Hatches, 1-2x Output Hatches") - .addStructureInfo("1x Muffler, 1x Maintenance Hatch, 1x Energy Hatch") - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Fission Fuel Processing Unit") + .addInfo("Refines fluorides and Uranium into nuclear fuel for the LFTR") + .addInfo("LFTR Fuel 2 and Fuel 3 have alternative, much more efficient recipes") + .addInfo("However, they require fission breeding outputs from the LFTR itself") + .addInfo("Only one Energy Hatch is allowed per Processing Unit") + .addInfo("All recipe times in this multi are very long, watch out!") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 9, 3, false) + .addController("Bottom Center") + .addCasingInfoMin("Hastelloy-X Structural Block", 7, false) + .addCasingInfoMin("Incoloy-DS Fluid Containment Block", 5, false) + .addCasingInfoMin("Zeron-100 Reactor Shielding", 4, false) + .addCasingInfoMin("Hastelloy-N Sealant Blocks", 17, false) + .addInputHatch("Base platform", 1) + .addOutputHatch("Base platform", 1) + .addMufflerHatch("Base platform", 1) + .addMaintenanceHatch("Base platform", 1) + .addEnergyHatch("Base platform", 1) + .addStructureInfo("Muffler's Tier must be IV+") + .addStructureInfo("2-4x Input Hatches, 1-2x Output Hatches") + .addStructureInfo("1x Muffler, 1x Maintenance Hatch, 1x Energy Hatch") + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -113,7 +120,7 @@ public class GregtechMetaTileEntity_Refinery extends GregtechMeta_MultiBlockBase } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler - && ((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity).mTier >= 5) { + && ((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity).mTier >= 5) { return addToMachineList(aTileEntity, aBaseCasingIndex); } } @@ -123,26 +130,32 @@ public class GregtechMetaTileEntity_Refinery extends GregtechMeta_MultiBlockBase @Override public IStructureDefinition<GregtechMetaTileEntity_Refinery> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Refinery>builder().addShape( + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Refinery>builder() + .addShape( mName, transpose( - new String[][] { { " ", " N ", " " }, { " N ", "NIN", " N " }, { " N ", "NIN", " N " }, - { " N ", "NIN", " N " }, { " Z ", "ZIZ", " Z " }, { " N ", "NIN", " N " }, - { "XXX", "XXX", "XXX" }, { "X~X", "XXX", "XXX" }, })) - .addElement( - 'X', - ofChain( - buildHatchAdder(GregtechMetaTileEntity_Refinery.class) - .atLeast(Energy, Maintenance, OutputHatch, OutputBus, InputHatch) - .casingIndex(TAE.GTPP_INDEX(18)).dot(1).build(), - buildHatchAdder(GregtechMetaTileEntity_Refinery.class).atLeast(Muffler) - .adder(GregtechMetaTileEntity_Refinery::addMufflerToMachineList) - .hatchItemFilterAnd(t -> filterByMTETier(6, Integer.MAX_VALUE)) - .casingIndex(TAE.GTPP_INDEX(18)).dot(1).build(), - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 2)))) - .addElement('I', ofBlock(ModBlocks.blockCasings2Misc, 3)) - .addElement('N', ofBlock(ModBlocks.blockCasings2Misc, 1)) - .addElement('Z', ofBlock(ModBlocks.blockCasingsMisc, 13)).build(); + new String[][] { { " ", " N ", " " }, { " N ", "NIN", " N " }, { " N ", "NIN", " N " }, + { " N ", "NIN", " N " }, { " Z ", "ZIZ", " Z " }, { " N ", "NIN", " N " }, + { "XXX", "XXX", "XXX" }, { "X~X", "XXX", "XXX" }, })) + .addElement( + 'X', + ofChain( + buildHatchAdder(GregtechMetaTileEntity_Refinery.class) + .atLeast(Energy, Maintenance, OutputHatch, OutputBus, InputHatch) + .casingIndex(TAE.GTPP_INDEX(18)) + .dot(1) + .build(), + buildHatchAdder(GregtechMetaTileEntity_Refinery.class).atLeast(Muffler) + .adder(GregtechMetaTileEntity_Refinery::addMufflerToMachineList) + .hatchItemFilterAnd(t -> filterByMTETier(6, Integer.MAX_VALUE)) + .casingIndex(TAE.GTPP_INDEX(18)) + .dot(1) + .build(), + onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 2)))) + .addElement('I', ofBlock(ModBlocks.blockCasings2Misc, 3)) + .addElement('N', ofBlock(ModBlocks.blockCasings2Misc, 1)) + .addElement('Z', ofBlock(ModBlocks.blockCasingsMisc, 13)) + .build(); } return STRUCTURE_DEFINITION; } @@ -163,11 +176,11 @@ public class GregtechMetaTileEntity_Refinery extends GregtechMeta_MultiBlockBase mCasing = 0; if (checkPiece(mName, 1, 7, 0) && mCasing >= 7) { if (this.mInputHatches.size() >= 2 && this.mInputHatches.size() <= 4 - && this.mOutputHatches.size() >= 1 - && this.mOutputHatches.size() <= 2 - && this.mMufflerHatches.size() == 1 - && this.mMaintenanceHatches.size() == 1 - && this.mEnergyHatches.size() == 1) { + && this.mOutputHatches.size() >= 1 + && this.mOutputHatches.size() <= 2 + && this.mMufflerHatches.size() == 1 + && this.mMaintenanceHatches.size() == 1 + && this.mEnergyHatches.size() == 1) { this.resetRecipeMapForAllInputHatches(this.getRecipeMap()); return true; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java index a232910d1c..0395ab5a01 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java @@ -49,7 +49,7 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.tileentities.misc.TileEntitySolarHeater; public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_SolarTower> - implements ISurvivalConstructable { + implements ISurvivalConstructable { // 862 private static final int mCasingTextureID = TAE.getIndexFromPage(3, 9); @@ -82,30 +82,35 @@ public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBa @Override protected final GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Contributing Green Energy towards the future") - .addInfo("Surround with rings of Solar Reflectors") - .addInfo("The Reflectors increase the internal heat value of the Tower (see below for formula)") - .addInfo("Each Reflector ring increases tier, the first ring is required for the Tower to work") - .addInfo("Input: " + MISC_MATERIALS.SOLAR_SALT_COLD.getLocalizedName()) - .addInfo("Output: " + MISC_MATERIALS.SOLAR_SALT_HOT.getLocalizedName()) - .addInfo("Every cycle (10 seconds), heat increases and all the Cold Solar Salt is heated") - .addInfo("Converting Cold to Hot Solar Salt reduces heat, equal to the amount converted") - .addInfo("This conversion only happens if heat >= 30000 and controller efficiency = 100%") - .addInfo("If there's more Cold Salt than heat, all the heat is used up and returns to 0") - .addInfo("The heat increase is most efficient at exactly half of maximum heat") - .addInfo("Minimum efficiency at 0 or 100000 heat, maximum efficiency at 50000") - .addInfo("Heat Efficiency formula: ( 7000 - [|currentHeat - 50000| ^ 0.8]) / 7000") - .addInfo("Heat gain per cycle: numberHeaters * heatEfficiency * (10 + bonus)") - .addInfo("Bonus: 1 ring = +1, 2 rings = +2, 3 rings = +4, 4 rings = +8, 5 rings = +16") - .addInfo("Total number of reflectors based on how many rings are built:") - .addInfo("1 ring = 36, 2 rings = 88, 3 rings = 156, 4 rings = 240, 5 rings = 340").addSeparator() - .beginVariableStructureBlock(15, 31, 28, 28, 15, 31, false).addController("Top Middle") - .addCasingInfoMin("Structural Solar Casing", 229, false) - .addCasingInfoMin("Thermally Insulated Casing", 60, false) - .addCasingInfoMin("Salt Containment Casing", 66, false) - .addCasingInfoMin("Thermal Containment Casing", 60, false).addInputHatch("Any 2 dot hint(min 1)", 2) - .addOutputHatch("Any 2 dot hint(min 1)", 2).addMaintenanceHatch("Any 2 dot hint", 2) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Contributing Green Energy towards the future") + .addInfo("Surround with rings of Solar Reflectors") + .addInfo("The Reflectors increase the internal heat value of the Tower (see below for formula)") + .addInfo("Each Reflector ring increases tier, the first ring is required for the Tower to work") + .addInfo("Input: " + MISC_MATERIALS.SOLAR_SALT_COLD.getLocalizedName()) + .addInfo("Output: " + MISC_MATERIALS.SOLAR_SALT_HOT.getLocalizedName()) + .addInfo("Every cycle (10 seconds), heat increases and all the Cold Solar Salt is heated") + .addInfo("Converting Cold to Hot Solar Salt reduces heat, equal to the amount converted") + .addInfo("This conversion only happens if heat >= 30000 and controller efficiency = 100%") + .addInfo("If there's more Cold Salt than heat, all the heat is used up and returns to 0") + .addInfo("The heat increase is most efficient at exactly half of maximum heat") + .addInfo("Minimum efficiency at 0 or 100000 heat, maximum efficiency at 50000") + .addInfo("Heat Efficiency formula: ( 7000 - [|currentHeat - 50000| ^ 0.8]) / 7000") + .addInfo("Heat gain per cycle: numberHeaters * heatEfficiency * (10 + bonus)") + .addInfo("Bonus: 1 ring = +1, 2 rings = +2, 3 rings = +4, 4 rings = +8, 5 rings = +16") + .addInfo("Total number of reflectors based on how many rings are built:") + .addInfo("1 ring = 36, 2 rings = 88, 3 rings = 156, 4 rings = 240, 5 rings = 340") + .addSeparator() + .beginVariableStructureBlock(15, 31, 28, 28, 15, 31, false) + .addController("Top Middle") + .addCasingInfoMin("Structural Solar Casing", 229, false) + .addCasingInfoMin("Thermally Insulated Casing", 60, false) + .addCasingInfoMin("Salt Containment Casing", 66, false) + .addCasingInfoMin("Thermal Containment Casing", 60, false) + .addInputHatch("Any 2 dot hint(min 1)", 2) + .addOutputHatch("Any 2 dot hint(min 1)", 2) + .addMaintenanceHatch("Any 2 dot hint", 2) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -126,149 +131,131 @@ public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBa protected IStructureDefinition<GregtechMetaTileEntity_SolarTower> computeValue(Class<?> type) { return StructureDefinition.<GregtechMetaTileEntity_SolarTower>builder() - // s = salt - // c = thermal containment - // i = thermal insulated - // t = solar structural - // h = hatch - // g = solar heater - - .addShape( - STRUCTURE_PIECE_TOP, - (new String[][] { { " ", " ", " ~ ", " ", " " }, - { " ", " s ", " sss ", " s ", " " }, - { " c ", " ccc ", "ccscc", " ccc ", " c " }, - { " c ", " ccc ", "ccscc", " ccc ", " c " }, - { " c ", " ccc ", "ccscc", " ccc ", " c " }, - { " c ", " ccc ", "ccscc", " ccc ", " c " }, - { " c ", " ccc ", "ccscc", " ccc ", " c " }, })) - .addShape( - STRUCTURE_PIECE_TOWER, - (new String[][] { { " i ", "isi", " i " }, { " i ", "isi", " i " }, { " i ", "isi", " i " }, - { " i ", "isi", " i " }, { " i ", "isi", " i " }, { " i ", "isi", " i " }, - { " i ", "isi", " i " }, { " i ", "isi", " i " }, { " i ", "isi", " i " }, - { " i ", "isi", " i " }, { " i ", "isi", " i " }, { " i ", "isi", " i " }, - { " i ", "isi", " i " }, { " i ", "isi", " i " }, { " i ", "isi", " i " }, })) - .addShape( - STRUCTURE_PIECE_BASE, - (new String[][] { - { " ", " ", " t ", " ttt ", " ttstt ", - " ttssstt ", " ttstt ", " ttt ", " t ", " ", - " " }, - { " ", " ", " t ", " ttt ", " tssst ", - " ttssstt ", " tssst ", " ttt ", " t ", " ", - " " }, - { " ", " t ", " ttt ", " ttttt ", " ttssstt ", - " tttsssttt ", " ttssstt ", " ttttt ", " ttt ", " t ", - " " }, - { " ", " t ", " ttt ", " ttttt ", " ttssstt ", - " tttsssttt ", " ttssstt ", " ttttt ", " ttt ", " t ", - " " }, - { " hhh ", " ttttt ", " ttttttt ", " ttttttttt ", "htttsssttth", - "htttsssttth", "htttsssttth", " ttttttttt ", " ttttttt ", " ttttt ", - " hhh " }, - { " hhh ", " ttttt ", " ttttttt ", " ttttttttt ", "httttttttth", - "httttttttth", "httttttttth", " ttttttttt ", " ttttttt ", " ttttt ", - " hhh " }, })) - .addShape( - SOLAR_HEATER_RING_1, - (new String[][] { { " ggggg ", " g g ", " g g ", - " g g ", " g g ", "g g", "g g", - "g g", "g g", "g g", " g g ", - " g g ", " g g ", " g g ", " ggggg ", } })) - .addShape( - SOLAR_HEATER_RING_2, - (new String[][] { { " ggggggggg ", " g g ", " g g ", - " g g ", " g g ", "g g", - "g g", "g g", "g g", - "g g", "g g", "g g", - "g g", "g g", " g g ", - " g g ", " g g ", " g g ", - " ggggggggg ", } })) - .addShape( - SOLAR_HEATER_RING_3, - (new String[][] { { " ggggggggggggg ", " g g ", - " g g ", " g g ", " g g ", - "g g", "g g", "g g", - "g g", "g g", "g g", - "g g", "g g", "g g", - "g g", "g g", "g g", - "g g", " g g ", " g g ", - " g g ", " g g ", - " ggggggggggggg ", } })) - .addShape( - SOLAR_HEATER_RING_4, - (new String[][] { { " ggggggggggggggggg ", " g g ", - " g g ", " g g ", - " g g ", "g g", - "g g", "g g", - "g g", "g g", - "g g", "g g", - "g g", "g g", - "g g", "g g", - "g g", "g g", - "g g", "g g", - "g g", "g g", - " g g ", " g g ", - " g g ", " g g ", - " ggggggggggggggggg ", } })) - .addShape( - SOLAR_HEATER_RING_5, - (new String[][] { { " ggggggggggggggggggggg ", " g g ", - " g g ", " g g ", - " g g ", "g g", - "g g", "g g", - "g g", "g g", - "g g", "g g", - "g g", "g g", - "g g", "g g", - "g g", "g g", - "g g", "g g", - "g g", "g g", - "g g", "g g", - "g g", "g g", - " g g ", " g g ", - " g g ", " g g ", - " ggggggggggggggggggggg ", } })) - .addElement( - 'g', - lazy( - t -> buildHatchAdder(GregtechMetaTileEntity_SolarTower.class) - .hatchClass(TileEntitySolarHeater.class) - .adder(GregtechMetaTileEntity_SolarTower::addSolarHeater) - // Use a positive casing index to make adder builder happy - .casingIndex(1).dot(1).continueIfSuccess().build())) - .addElement( - 't', - lazy(t -> onElementPass(x -> ++x.mCasing1, ofBlock(t.getCasingBlock(), t.getCasingMeta())))) - .addElement( - 'i', - lazy( - t -> onElementPass( - x -> ++x.mCasing2, - ofBlock(t.getCasingBlock(), t.getCasingMeta2())))) - .addElement( - 's', - lazy( - t -> onElementPass( - x -> ++x.mCasing3, - ofBlock(t.getCasingBlock(), t.getCasingMeta3())))) - .addElement( - 'c', - lazy( - t -> onElementPass( - x -> ++x.mCasing4, - ofBlock(t.getCasingBlock2(), t.getCasingMeta4())))) - .addElement( - 'h', - lazy( - t -> buildHatchAdder(GregtechMetaTileEntity_SolarTower.class) - .atLeast(InputHatch, OutputHatch, Maintenance) - .casingIndex(t.getCasingTextureIndex()).dot(2).buildAndChain( - onElementPass( - x -> ++x.mCasing1, - ofBlock(t.getCasingBlock(), t.getCasingMeta()))))) - .build(); + // s = salt + // c = thermal containment + // i = thermal insulated + // t = solar structural + // h = hatch + // g = solar heater + + .addShape( + STRUCTURE_PIECE_TOP, + (new String[][] { { " ", " ", " ~ ", " ", " " }, + { " ", " s ", " sss ", " s ", " " }, + { " c ", " ccc ", "ccscc", " ccc ", " c " }, + { " c ", " ccc ", "ccscc", " ccc ", " c " }, + { " c ", " ccc ", "ccscc", " ccc ", " c " }, + { " c ", " ccc ", "ccscc", " ccc ", " c " }, + { " c ", " ccc ", "ccscc", " ccc ", " c " }, })) + .addShape( + STRUCTURE_PIECE_TOWER, + (new String[][] { { " i ", "isi", " i " }, { " i ", "isi", " i " }, { " i ", "isi", " i " }, + { " i ", "isi", " i " }, { " i ", "isi", " i " }, { " i ", "isi", " i " }, + { " i ", "isi", " i " }, { " i ", "isi", " i " }, { " i ", "isi", " i " }, + { " i ", "isi", " i " }, { " i ", "isi", " i " }, { " i ", "isi", " i " }, + { " i ", "isi", " i " }, { " i ", "isi", " i " }, { " i ", "isi", " i " }, })) + .addShape( + STRUCTURE_PIECE_BASE, + (new String[][] { + { " ", " ", " t ", " ttt ", " ttstt ", " ttssstt ", + " ttstt ", " ttt ", " t ", " ", " " }, + { " ", " ", " t ", " ttt ", " tssst ", " ttssstt ", + " tssst ", " ttt ", " t ", " ", " " }, + { " ", " t ", " ttt ", " ttttt ", " ttssstt ", " tttsssttt ", + " ttssstt ", " ttttt ", " ttt ", " t ", " " }, + { " ", " t ", " ttt ", " ttttt ", " ttssstt ", " tttsssttt ", + " ttssstt ", " ttttt ", " ttt ", " t ", " " }, + { " hhh ", " ttttt ", " ttttttt ", " ttttttttt ", "htttsssttth", "htttsssttth", + "htttsssttth", " ttttttttt ", " ttttttt ", " ttttt ", " hhh " }, + { " hhh ", " ttttt ", " ttttttt ", " ttttttttt ", "httttttttth", "httttttttth", + "httttttttth", " ttttttttt ", " ttttttt ", " ttttt ", " hhh " }, })) + .addShape( + SOLAR_HEATER_RING_1, + (new String[][] { { " ggggg ", " g g ", " g g ", " g g ", + " g g ", "g g", "g g", "g g", "g g", + "g g", " g g ", " g g ", " g g ", " g g ", + " ggggg ", } })) + .addShape( + SOLAR_HEATER_RING_2, + (new String[][] { + { " ggggggggg ", " g g ", " g g ", " g g ", + " g g ", "g g", "g g", "g g", + "g g", "g g", "g g", "g g", + "g g", "g g", " g g ", " g g ", + " g g ", " g g ", " ggggggggg ", } })) + .addShape( + SOLAR_HEATER_RING_3, + (new String[][] { { " ggggggggggggg ", " g g ", " g g ", + " g g ", " g g ", "g g", + "g g", "g g", "g g", + "g g", "g g", "g g", + "g g", "g g", "g g", + "g g", "g g", "g g", + " g g ", " g g ", " g g ", + " g g ", " ggggggggggggg ", } })) + .addShape( + SOLAR_HEATER_RING_4, + (new String[][] { { " ggggggggggggggggg ", " g g ", + " g g ", " g g ", " g g ", + "g g", "g g", "g g", + "g g", "g g", "g g", + "g g", "g g", "g g", + "g g", "g g", "g g", + "g g", "g g", "g g", + "g g", "g g", " g g ", + " g g ", " g g ", " g g ", + " ggggggggggggggggg ", } })) + .addShape( + SOLAR_HEATER_RING_5, + (new String[][] { { " ggggggggggggggggggggg ", " g g ", + " g g ", " g g ", + " g g ", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + " g g ", " g g ", + " g g ", " g g ", + " ggggggggggggggggggggg ", } })) + .addElement( + 'g', + lazy( + t -> buildHatchAdder(GregtechMetaTileEntity_SolarTower.class) + .hatchClass(TileEntitySolarHeater.class) + .adder(GregtechMetaTileEntity_SolarTower::addSolarHeater) + // Use a positive casing index to make adder builder happy + .casingIndex(1) + .dot(1) + .continueIfSuccess() + .build())) + .addElement( + 't', + lazy(t -> onElementPass(x -> ++x.mCasing1, ofBlock(t.getCasingBlock(), t.getCasingMeta())))) + .addElement( + 'i', + lazy(t -> onElementPass(x -> ++x.mCasing2, ofBlock(t.getCasingBlock(), t.getCasingMeta2())))) + .addElement( + 's', + lazy(t -> onElementPass(x -> ++x.mCasing3, ofBlock(t.getCasingBlock(), t.getCasingMeta3())))) + .addElement( + 'c', + lazy(t -> onElementPass(x -> ++x.mCasing4, ofBlock(t.getCasingBlock2(), t.getCasingMeta4())))) + .addElement( + 'h', + lazy( + t -> buildHatchAdder(GregtechMetaTileEntity_SolarTower.class) + .atLeast(InputHatch, OutputHatch, Maintenance) + .casingIndex(t.getCasingTextureIndex()) + .dot(2) + .buildAndChain( + onElementPass(x -> ++x.mCasing1, ofBlock(t.getCasingBlock(), t.getCasingMeta()))))) + .build(); } }; @@ -296,52 +283,52 @@ public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBa boolean aAllStructure = aStructureTop && aStructureTower && aStructureBase; boolean aAllCasings = aCasingCount1 && aCasingCount2 && aCasingCount3 && aCasingCount4; if (!aAllCasings || !aAllStructure - || mMaintenanceHatches.size() != 1 - || mInputHatches.size() < 1 - || mOutputHatches.size() < 1) { + || mMaintenanceHatches.size() != 1 + || mInputHatches.size() < 1 + || mOutputHatches.size() < 1) { log( - "Bad Hatches - Solar Heaters: " + mSolarHeaters.size() - + ", Maint: " - + mMaintenanceHatches.size() - + ", Input Hatches: " - + mInputHatches.size() - + ", Output Hatches: " - + mOutputHatches.size() - + ", Top: " - + aStructureTop - + ", Tower: " - + aStructureTower - + ", Base: " - + aStructureBase - + ", Casing Count: " - + aCasingCount1 - + " | Found: " - + mCasing1 - + ", Casing Count: " - + aCasingCount2 - + " | Found: " - + mCasing2 - + ", Casing Count: " - + aCasingCount3 - + " | Found: " - + mCasing3 - + ", Casing Count: " - + aCasingCount4 - + " | Found: " - + mCasing4); + "Bad Hatches - Solar Heaters: " + mSolarHeaters.size() + + ", Maint: " + + mMaintenanceHatches.size() + + ", Input Hatches: " + + mInputHatches.size() + + ", Output Hatches: " + + mOutputHatches.size() + + ", Top: " + + aStructureTop + + ", Tower: " + + aStructureTower + + ", Base: " + + aStructureBase + + ", Casing Count: " + + aCasingCount1 + + " | Found: " + + mCasing1 + + ", Casing Count: " + + aCasingCount2 + + " | Found: " + + mCasing2 + + ", Casing Count: " + + aCasingCount3 + + " | Found: " + + mCasing3 + + ", Casing Count: " + + aCasingCount4 + + " | Found: " + + mCasing4); return false; } log( - "Built " + this.getLocalName() - + " with " - + mCasing1 - + " Structural Solar casings, " - + mCasing2 - + " Thermally Insulated casings, " - + mCasing3 - + " Salt Containment casings, " - + mCasing4 - + " Thermal Containment casings."); + "Built " + this.getLocalName() + + " with " + + mCasing1 + + " Structural Solar casings, " + + mCasing2 + + " Thermally Insulated casings, " + + mCasing3 + + " Salt Containment casings, " + + mCasing4 + + " Thermal Containment casings."); return aAllCasings && aAllStructure; } @@ -411,13 +398,18 @@ public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBa @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { + final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { if (side == ForgeDirection.DOWN || side == ForgeDirection.UP) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)), - TextureFactory.builder().addIcon(TexturesGtBlock.Overlay_Machine_Controller_Default_Active) - .extFacing().build() }; - return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)), TextureFactory - .builder().addIcon(TexturesGtBlock.Overlay_Machine_Controller_Default).extFacing().build() }; + TextureFactory.builder() + .addIcon(TexturesGtBlock.Overlay_Machine_Controller_Default_Active) + .extFacing() + .build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)), + TextureFactory.builder() + .addIcon(TexturesGtBlock.Overlay_Machine_Controller_Default) + .extFacing() + .build() }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)) }; } @@ -530,7 +522,7 @@ public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBa this.mMaxProgresstime = 200; if (this.mSolarHeaters.isEmpty() || this.mSolarHeaters.size() < 340 - || this.getTotalRuntimeInTicks() % 200 == 0) { + || this.getTotalRuntimeInTicks() % 200 == 0) { getConnectedSolarReflectors(); } @@ -543,13 +535,15 @@ public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBa // Min efficiency is 0.179, at mHeatLevel = 0 or 100000 double aEfficiency = (-Math.pow(Math.abs(this.mHeatLevel - 50000), 0.8) + 7000) / 7000; - World w = this.getBaseMetaTileEntity().getWorld(); + World w = this.getBaseMetaTileEntity() + .getWorld(); // Manage Heat every 10s // Add Heat First, if sources available and it's daytime, heat gain is halved if raining if (w != null) { if (aHeaters > 0 && w.isDaytime()) { - if (w.isRaining() && this.getBaseMetaTileEntity().getBiome().rainfall > 0.0F) { + if (w.isRaining() && this.getBaseMetaTileEntity() + .getBiome().rainfall > 0.0F) { this.mHeatLevel += GT_Utility.safeInt((long) ((aHeaters / 2) * aEfficiency * (10 + aTier))); } else { this.mHeatLevel += GT_Utility.safeInt((long) (aHeaters * aEfficiency * (10 + aTier))); @@ -575,7 +569,8 @@ public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBa } ArrayList<FluidStack> aFluids = this.getStoredFluids(); for (FluidStack aFluid : aFluids) { - if (aFluid.getFluid().equals(mColdSalt)) { + if (aFluid.getFluid() + .equals(mColdSalt)) { int aFluidAmount = Math.min(aFluid.amount, this.mHeatLevel); this.mHeatLevel -= aFluidAmount; @@ -670,7 +665,7 @@ public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBa @Override public String[] getExtraInfoData() { return new String[] { "Internal Heat Level: " + this.mHeatLevel, - "Connected Solar Reflectors: " + this.mSolarHeaters.size() }; + "Connected Solar Reflectors: " + this.mSolarHeaters.size() }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java index 2269166732..8a3442b5e7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java @@ -56,7 +56,7 @@ import ic2.core.init.BlocksItems; import ic2.core.init.InternalName; public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<GregtechMTE_AlgaePondBase> - implements ISurvivalConstructable { + implements ISurvivalConstructable { private int mLevel = -1; private int mCasing; @@ -90,17 +90,24 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Grows Algae!").addInfo("Controller Block for the Algae Farm") - .addInfo("Provide compost to boost production by one tier") - .addInfo("Does not require power or maintenance") - .addInfo("All Machine Casings must be the same tier, this dictates machine speed.") - .addInfo("All Buses/Hatches must, at least, match the tier of the Casings") - .addInfo("Fill Input Hatch with Water to fill the inside of the multiblock.") - .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(9, 3, 9, true) - .addController("Front Center").addCasingInfoMin("Machine Casings", 64, true) - .addCasingInfoMin("Sterile Farm Casings", 64, false).addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Grows Algae!") + .addInfo("Controller Block for the Algae Farm") + .addInfo("Provide compost to boost production by one tier") + .addInfo("Does not require power or maintenance") + .addInfo("All Machine Casings must be the same tier, this dictates machine speed.") + .addInfo("All Buses/Hatches must, at least, match the tier of the Casings") + .addInfo("Fill Input Hatch with Water to fill the inside of the multiblock.") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(9, 3, 9, true) + .addController("Front Center") + .addCasingInfoMin("Machine Casings", 64, true) + .addCasingInfoMin("Sterile Farm Casings", 64, false) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -116,30 +123,32 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt public IStructureDefinition<GregtechMTE_AlgaePondBase> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_AlgaePondBase>builder() - .addShape( - mName, - transpose( - new String[][] { - { "XXXXXXXXX", "X X", "X X", "X X", "X X", - "X X", "X X", "X X", "XXXXXXXXX" }, - { "XXXXXXXXX", "X X", "X X", "X X", "X X", - "X X", "X X", "X X", "XXXXXXXXX" }, - { "CCCC~CCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", - "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC" }, })) - .addElement( - 'C', - ofChain( - buildHatchAdder(GregtechMTE_AlgaePondBase.class) - .atLeast(InputHatch, InputBus, OutputBus) - .casingIndex(TAE.getIndexFromPage(1, 15)).dot(1).build(), - onElementPass( - x -> ++x.mCasing, - addTieredBlock( - GregTech_API.sBlockCasings1, - GregtechMTE_AlgaePondBase::setMeta, - GregtechMTE_AlgaePondBase::getMeta, - 10)))) - .addElement('X', ofBlock(ModBlocks.blockCasings2Misc, 15)).build(); + .addShape( + mName, + transpose( + new String[][] { + { "XXXXXXXXX", "X X", "X X", "X X", "X X", "X X", "X X", + "X X", "XXXXXXXXX" }, + { "XXXXXXXXX", "X X", "X X", "X X", "X X", "X X", "X X", + "X X", "XXXXXXXXX" }, + { "CCCC~CCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", + "CCCCCCCCC", "CCCCCCCCC" }, })) + .addElement( + 'C', + ofChain( + buildHatchAdder(GregtechMTE_AlgaePondBase.class).atLeast(InputHatch, InputBus, OutputBus) + .casingIndex(TAE.getIndexFromPage(1, 15)) + .dot(1) + .build(), + onElementPass( + x -> ++x.mCasing, + addTieredBlock( + GregTech_API.sBlockCasings1, + GregtechMTE_AlgaePondBase::setMeta, + GregtechMTE_AlgaePondBase::getMeta, + 10)))) + .addElement('X', ofBlock(ModBlocks.blockCasings2Misc, 15)) + .build(); } return STRUCTURE_DEFINITION; } @@ -241,7 +250,8 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt // Utils.LOG_WARNING("Going to try swap an air block for water from inut bus."); stored.amount -= 1000; Block fluidUsed = Blocks.water; - aBaseMetaTileEntity.getWorld().setBlock( + aBaseMetaTileEntity.getWorld() + .setBlock( aBaseMetaTileEntity.getXCoord() + xDir + i, aBaseMetaTileEntity.getYCoord() + h, aBaseMetaTileEntity.getZCoord() + zDir + j, @@ -272,8 +282,8 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt private boolean isNotStaticWater(Block block, byte meta) { return block == Blocks.air || block == Blocks.flowing_water - || block == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater) - || (cofhWater != null && cofhWater.isAssignableFrom(block.getClass()) && meta != 0); + || block == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater) + || (cofhWater != null && cofhWater.isAssignableFrom(block.getClass()) && meta != 0); } @Override @@ -313,8 +323,8 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt @Nonnull @Override protected Stream<GT_Recipe> findRecipeMatches(@Nullable RecipeMap<?> map) { - return GT_StreamUtil.ofNullable( - RecipeLoader_AlgaeFarm.getTieredRecipeFromCache(mLevel, isUsingCompost(inputItems))); + return GT_StreamUtil + .ofNullable(RecipeLoader_AlgaeFarm.getTieredRecipeFromCache(mLevel, isUsingCompost(inputItems))); } @NotNull @@ -325,7 +335,8 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt } return CheckRecipeResultRegistry.SUCCESSFUL; } - }.setEuModifier(0F).setMaxParallelSupplier(this::getMaxParallelRecipes); + }.setEuModifier(0F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } private boolean isUsingCompost(ItemStack[] aItemInputs) { @@ -341,7 +352,8 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt } private int getCasingTier() { - if (this.getBaseMetaTileEntity().getWorld() == null) { + if (this.getBaseMetaTileEntity() + .getWorld() == null) { return 0; } try { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index 6471a5e262..30d2f75457 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -75,7 +75,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers.G import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<GregtechMTE_ChemicalPlant> - implements ISurvivalConstructable { + implements ISurvivalConstructable { private int mSolidCasingTier = 0; private int mMachineCasingTier = 0; @@ -105,8 +105,8 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt Triplet<Block, Integer, Integer> aCasingData = new Triplet<>(aBlock, aMeta, aCasingTextureID); if (mTieredBlockRegistry.containsKey(aTier)) { CORE.crash( - "Tried to register a Machine casing for tier " + aTier - + " to the Chemical Plant, however this tier already contains one."); + "Tried to register a Machine casing for tier " + aTier + + " to the Chemical Plant, however this tier already contains one."); } mTieredBlockRegistry.put(aTier, aCasingData); return true; @@ -116,7 +116,8 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt if (!mTieredBlockRegistry.containsKey(aTier)) { return 10; } - int aCasingID = mTieredBlockRegistry.get(aTier).getValue_3(); + int aCasingID = mTieredBlockRegistry.get(aTier) + .getValue_3(); // Logger.INFO("Found casing texture ID "+aCasingID+" for tier "+aTier); return aCasingID; } @@ -134,15 +135,24 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Chemical Plant") - .addInfo("Heavy Industry, now right at your doorstep!") - .addInfo("Please read the user manual for more information on construction and usage").addSeparator() - .addController("Bottom Center").addStructureHint("Catalyst Housing", 1).addInputBus("Bottom Casing", 1) - .addOutputBus("Bottom Casing", 1).addInputHatch("Bottom Casing", 1).addOutputHatch("Bottom Casing", 1) - .addEnergyHatch("Bottom Casing", 1).addMaintenanceHatch("Bottom Casing", 1) - .addSubChannelUsage("casing", "metal machine casing") - .addSubChannelUsage("machine", "tier machine casing").addSubChannelUsage("coil", "heating coil blocks") - .addSubChannelUsage("pipe", "pipe casing blocks").toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Chemical Plant") + .addInfo("Heavy Industry, now right at your doorstep!") + .addInfo("Please read the user manual for more information on construction and usage") + .addSeparator() + .addController("Bottom Center") + .addStructureHint("Catalyst Housing", 1) + .addInputBus("Bottom Casing", 1) + .addOutputBus("Bottom Casing", 1) + .addInputHatch("Bottom Casing", 1) + .addOutputHatch("Bottom Casing", 1) + .addEnergyHatch("Bottom Casing", 1) + .addMaintenanceHatch("Bottom Casing", 1) + .addSubChannelUsage("casing", "metal machine casing") + .addSubChannelUsage("machine", "tier machine casing") + .addSubChannelUsage("coil", "heating coil blocks") + .addSubChannelUsage("pipe", "pipe casing blocks") + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @@ -174,68 +184,74 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt public IStructureDefinition<GregtechMTE_ChemicalPlant> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { IStructureElement<GregtechMTE_ChemicalPlant> allCasingsElement = withChannel( - "casing", - ofChain( - IntStream.range(0, 8).mapToObj(GregtechMTE_ChemicalPlant::ofSolidCasing) - .collect(Collectors.toList()))); - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_ChemicalPlant>builder().addShape( + "casing", + ofChain( + IntStream.range(0, 8) + .mapToObj(GregtechMTE_ChemicalPlant::ofSolidCasing) + .collect(Collectors.toList()))); + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_ChemicalPlant>builder() + .addShape( mName, transpose( - new String[][] { - { "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX" }, - { "X X", " MMMMM ", " MHHHM ", " MHHHM ", " MHHHM ", " MMMMM ", "X X" }, - { "X X", " ", " PPP ", " PPP ", " PPP ", " ", "X X" }, - { "X X", " ", " HHH ", " HHH ", " HHH ", " ", "X X" }, - { "X X", " ", " PPP ", " PPP ", " PPP ", " ", "X X" }, - { "X X", " MMMMM ", " MHHHM ", " MHHHM ", " MHHHM ", " MMMMM ", "X X" }, - { "CCC~CCC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CCCCCCC" }, })) - .addElement( - 'C', - ofChain( - buildHatchAdder(GregtechMTE_ChemicalPlant.class).atLeast(Maintenance) - .casingIndex(getCasingTextureID()).dot(1).build(), - buildHatchAdder(GregtechMTE_ChemicalPlant.class) - .atLeast(InputHatch, OutputHatch, InputBus, OutputBus) - .adder(GregtechMTE_ChemicalPlant::addChemicalPlantList) - .hatchItemFilterAnd( - (t, s) -> filterByMTETier( - Integer.MIN_VALUE, - s.stackSize >= 10 ? Integer.MAX_VALUE : s.stackSize)) - .casingIndex(getCasingTextureID()).dot(1).build(), - buildHatchAdder(GregtechMTE_ChemicalPlant.class) - .hatchClass(GT_MetaTileEntity_Hatch_Catalysts.class) - .shouldReject(t -> t.mCatalystBuses.size() >= 1) - .adder(GregtechMTE_ChemicalPlant::addChemicalPlantList) - .casingIndex(getCasingTextureID()).dot(1).build(), - allCasingsElement)) - .addElement('X', allCasingsElement) - .addElement( - 'M', - withChannel( - "machine", - addTieredBlock( - GregTech_API.sBlockCasings1, - GregtechMTE_ChemicalPlant::setMachineMeta, - GregtechMTE_ChemicalPlant::getMachineMeta, - 10))) - .addElement( - 'H', - withChannel( - "coil", - ofCoil( - GregtechMTE_ChemicalPlant::setCoilMeta, - GregtechMTE_ChemicalPlant::getCoilMeta))) - .addElement( - 'P', - withChannel( - "pipe", - addTieredBlock( - GregTech_API.sBlockCasings2, - GregtechMTE_ChemicalPlant::setPipeMeta, - GregtechMTE_ChemicalPlant::getPipeMeta, - 12, - 16))) - .build(); + new String[][] { + { "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX" }, + { "X X", " MMMMM ", " MHHHM ", " MHHHM ", " MHHHM ", " MMMMM ", "X X" }, + { "X X", " ", " PPP ", " PPP ", " PPP ", " ", "X X" }, + { "X X", " ", " HHH ", " HHH ", " HHH ", " ", "X X" }, + { "X X", " ", " PPP ", " PPP ", " PPP ", " ", "X X" }, + { "X X", " MMMMM ", " MHHHM ", " MHHHM ", " MHHHM ", " MMMMM ", "X X" }, + { "CCC~CCC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CCCCCCC" }, })) + .addElement( + 'C', + ofChain( + buildHatchAdder(GregtechMTE_ChemicalPlant.class).atLeast(Maintenance) + .casingIndex(getCasingTextureID()) + .dot(1) + .build(), + buildHatchAdder(GregtechMTE_ChemicalPlant.class) + .atLeast(InputHatch, OutputHatch, InputBus, OutputBus) + .adder(GregtechMTE_ChemicalPlant::addChemicalPlantList) + .hatchItemFilterAnd( + (t, s) -> filterByMTETier( + Integer.MIN_VALUE, + s.stackSize >= 10 ? Integer.MAX_VALUE : s.stackSize)) + .casingIndex(getCasingTextureID()) + .dot(1) + .build(), + buildHatchAdder(GregtechMTE_ChemicalPlant.class) + .hatchClass(GT_MetaTileEntity_Hatch_Catalysts.class) + .shouldReject(t -> t.mCatalystBuses.size() >= 1) + .adder(GregtechMTE_ChemicalPlant::addChemicalPlantList) + .casingIndex(getCasingTextureID()) + .dot(1) + .build(), + allCasingsElement)) + .addElement('X', allCasingsElement) + .addElement( + 'M', + withChannel( + "machine", + addTieredBlock( + GregTech_API.sBlockCasings1, + GregtechMTE_ChemicalPlant::setMachineMeta, + GregtechMTE_ChemicalPlant::getMachineMeta, + 10))) + .addElement( + 'H', + withChannel( + "coil", + ofCoil(GregtechMTE_ChemicalPlant::setCoilMeta, GregtechMTE_ChemicalPlant::getCoilMeta))) + .addElement( + 'P', + withChannel( + "pipe", + addTieredBlock( + GregTech_API.sBlockCasings2, + GregtechMTE_ChemicalPlant::setPipeMeta, + GregtechMTE_ChemicalPlant::getPipeMeta, + 12, + 16))) + .build(); } return STRUCTURE_DEFINITION; } @@ -255,8 +271,10 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt private boolean check(int aIndex, World world, int x, int y, int z) { Block block = world.getBlock(x, y, z); int meta = world.getBlockMetadata(x, y, z); - Block target = mTieredBlockRegistry.get(aIndex).getValue_1(); - int targetMeta = mTieredBlockRegistry.get(aIndex).getValue_2(); + Block target = mTieredBlockRegistry.get(aIndex) + .getValue_1(); + int targetMeta = mTieredBlockRegistry.get(aIndex) + .getValue_2(); return target.equals(block) && meta == targetMeta; } @@ -268,50 +286,58 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt @Override public boolean spawnHint(GregtechMTE_ChemicalPlant t, World world, int x, int y, int z, ItemStack trigger) { StructureLibAPI.hintParticle( - world, - x, - y, - z, - mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_1(), - mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_2()); + world, + x, + y, + z, + mTieredBlockRegistry.get(getIndex(trigger.stackSize)) + .getValue_1(), + mTieredBlockRegistry.get(getIndex(trigger.stackSize)) + .getValue_2()); return true; } @Override public boolean placeBlock(GregtechMTE_ChemicalPlant t, World world, int x, int y, int z, - ItemStack trigger) { + ItemStack trigger) { return world.setBlock( - x, - y, - z, - mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_1(), - mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_2(), - 3); + x, + y, + z, + mTieredBlockRegistry.get(getIndex(trigger.stackSize)) + .getValue_1(), + mTieredBlockRegistry.get(getIndex(trigger.stackSize)) + .getValue_2(), + 3); } @Nullable @Override public BlocksToPlace getBlocksToPlace(GregtechMTE_ChemicalPlant gregtechMTE_chemicalPlant, World world, - int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { + int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { return BlocksToPlace.create( - mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_1(), - mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_2()); + mTieredBlockRegistry.get(getIndex(trigger.stackSize)) + .getValue_1(), + mTieredBlockRegistry.get(getIndex(trigger.stackSize)) + .getValue_2()); } @Override public PlaceResult survivalPlaceBlock(GregtechMTE_ChemicalPlant t, World world, int x, int y, int z, - ItemStack trigger, AutoPlaceEnvironment env) { + ItemStack trigger, AutoPlaceEnvironment env) { if (check(getIndex(trigger.stackSize), world, x, y, z)) return PlaceResult.SKIP; return StructureUtility.survivalPlaceBlock( - mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_1(), - mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_2(), - world, - x, - y, - z, - env.getSource(), - env.getActor(), - env.getChatter()); + mTieredBlockRegistry.get(getIndex(trigger.stackSize)) + .getValue_1(), + mTieredBlockRegistry.get(getIndex(trigger.stackSize)) + .getValue_2(), + world, + x, + y, + z, + env.getSource(), + env.getActor(), + env.getChatter()); } }; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/mega/GregTechMetaTileEntity_MegaAlloyBlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/mega/GregTechMetaTileEntity_MegaAlloyBlastSmelter.java index 40a8b322b0..1679629c88 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/mega/GregTechMetaTileEntity_MegaAlloyBlastSmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/mega/GregTechMetaTileEntity_MegaAlloyBlastSmelter.java @@ -57,8 +57,8 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregTechMetaTileEntity_MegaAlloyBlastSmelter - extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase<GregTechMetaTileEntity_MegaAlloyBlastSmelter> - implements ISurvivalConstructable { + extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase<GregTechMetaTileEntity_MegaAlloyBlastSmelter> + implements ISurvivalConstructable { private static final int MAX_PARALLELS = 256; private HeatingCoilLevel coilLevel; @@ -66,87 +66,88 @@ public class GregTechMetaTileEntity_MegaAlloyBlastSmelter private boolean hasNormalCoils; private static final IStructureDefinition<GregTechMetaTileEntity_MegaAlloyBlastSmelter> STRUCTURE_DEFINITION = StructureDefinition - .<GregTechMetaTileEntity_MegaAlloyBlastSmelter>builder() - .addShape( - "main", - new String[][] { - { " ", " ", " ", " ", " ", " ", - " ", " ", " ", " ", " ", - " ", " ", " DDDDD ", " CCCCC ", " AEEEA ", - " AE~EA ", " AEEEA ", " CCCCC ", " ZZZZZ " }, - { " DDDDD ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", - " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", - " AAAAA ", " DDDDD ", " D D ", " C C ", " A A ", - " A A ", " A A ", " C C ", " ZZZZZZZ " }, - { " DDDDDDD ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", - " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", - " ABBBBBA ", " DBBBBBD ", " D BBBBB D ", " C BBBBB C ", " A BBBBB A ", - " A BBBBB A ", " A BBBBB A ", " C BBBBB C ", " ZZZZZZZZZ " }, - { " DDDDDDDDD ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", - " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", - " AB BA ", " DB BD ", "D B B D", "C B B C", "A B B A", - "A B B A", "A B B A", "C B B C", "ZZZZZZZZZZZ" }, - { " DDDDDDDDD ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", - " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", - " AB BA ", " DB BD ", "D B B D", "C B B C", "A B B A", - "A B B A", "A B B A", "C B B C", "ZZZZZZZZZZZ" }, - { " DDDDFDDDD ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", - " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", - " AB BA ", " DB BD ", "D B B D", "C B B C", "A B B A", - "A B B A", "A B B A", "C B B C", "ZZZZZZZZZZZ" }, - { " DDDDDDDDD ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", - " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", - " AB BA ", " DB BD ", "D B B D", "C B B C", "A B B A", - "A B B A", "A B B A", "C B B C", "ZZZZZZZZZZZ" }, - { " DDDDDDDDD ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", - " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", - " AB BA ", " DB BD ", "D B B D", "C B B C", "A B B A", - "A B B A", "A B B A", "C B B C", "ZZZZZZZZZZZ" }, - { " DDDDDDD ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", - " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", - " ABBBBBA ", " DBBBBBD ", " D BBBBB D ", " C BBBBB C ", " A BBBBB A ", - " A BBBBB A ", " A BBBBB A ", " C BBBBB C ", " ZZZZZZZZZ " }, - { " DDDDD ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", - " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", - " AAAAA ", " DDDDD ", " D D ", " C C ", " A A ", - " A A ", " A A ", " C C ", " ZZZZZZZ " }, - { " ", " ", " ", " ", " ", " ", - " ", " ", " ", " ", " ", - " ", " ", " DDDDD ", " CCCCC ", " AAAAA ", - " AAAAA ", " AAAAA ", " CCCCC ", " ZZZZZ " } }) - .addElement( - 'B', - withChannel( - "coil", - ofChain( - onElementPass( - te -> te.hasNormalCoils = false, - ofCoil( - GregTechMetaTileEntity_MegaAlloyBlastSmelter::setCoilLevel, - GregTechMetaTileEntity_MegaAlloyBlastSmelter::getCoilLevel)), - onElementPass( - te -> te.hasNormalCoils = true, - ofBlock(ModBlocks.blockCasingsMisc, 14))))) - - .addElement( - 'Z', - buildHatchAdder(GregTechMetaTileEntity_MegaAlloyBlastSmelter.class) - .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Energy, ExoticEnergy) - .casingIndex(TAE.GTPP_INDEX(15)).dot(1) - .buildAndChain(ofBlock(ModBlocks.blockCasingsMisc, 15))) - .addElement( - 'E', - buildHatchAdder(GregTechMetaTileEntity_MegaAlloyBlastSmelter.class).atLeast(Maintenance) - .casingIndex(TAE.GTPP_INDEX(15)).dot(2) - .buildAndChain(ofBlock(ModBlocks.blockCasingsMisc, 15))) - .addElement('D', ofBlock(ModBlocks.blockCasingsMisc, 15)) - .addElement('C', ofBlock(ModBlocks.blockCasingsMisc, 14)) - .addElement( - 'A', - withChannel( - "glass", - BorosilicateGlass.ofBoroGlass((byte) -1, (te, t) -> te.glassTier = t, te -> te.glassTier))) - .addElement('F', Muffler.newAny(TAE.GTPP_INDEX(15), 3)).build(); + .<GregTechMetaTileEntity_MegaAlloyBlastSmelter>builder() + .addShape( + "main", + new String[][] { + { " ", " ", " ", " ", " ", " ", + " ", " ", " ", " ", " ", " ", + " ", " DDDDD ", " CCCCC ", " AEEEA ", " AE~EA ", " AEEEA ", + " CCCCC ", " ZZZZZ " }, + { " DDDDD ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", + " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", + " DDDDD ", " D D ", " C C ", " A A ", " A A ", " A A ", + " C C ", " ZZZZZZZ " }, + { " DDDDDDD ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", + " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", + " DBBBBBD ", " D BBBBB D ", " C BBBBB C ", " A BBBBB A ", " A BBBBB A ", " A BBBBB A ", + " C BBBBB C ", " ZZZZZZZZZ " }, + { " DDDDDDDDD ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " DB BD ", "D B B D", "C B B C", "A B B A", "A B B A", "A B B A", + "C B B C", "ZZZZZZZZZZZ" }, + { " DDDDDDDDD ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " DB BD ", "D B B D", "C B B C", "A B B A", "A B B A", "A B B A", + "C B B C", "ZZZZZZZZZZZ" }, + { " DDDDFDDDD ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " DB BD ", "D B B D", "C B B C", "A B B A", "A B B A", "A B B A", + "C B B C", "ZZZZZZZZZZZ" }, + { " DDDDDDDDD ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " DB BD ", "D B B D", "C B B C", "A B B A", "A B B A", "A B B A", + "C B B C", "ZZZZZZZZZZZ" }, + { " DDDDDDDDD ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " DB BD ", "D B B D", "C B B C", "A B B A", "A B B A", "A B B A", + "C B B C", "ZZZZZZZZZZZ" }, + { " DDDDDDD ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", + " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", + " DBBBBBD ", " D BBBBB D ", " C BBBBB C ", " A BBBBB A ", " A BBBBB A ", " A BBBBB A ", + " C BBBBB C ", " ZZZZZZZZZ " }, + { " DDDDD ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", + " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", + " DDDDD ", " D D ", " C C ", " A A ", " A A ", " A A ", + " C C ", " ZZZZZZZ " }, + { " ", " ", " ", " ", " ", " ", + " ", " ", " ", " ", " ", " ", + " ", " DDDDD ", " CCCCC ", " AAAAA ", " AAAAA ", " AAAAA ", + " CCCCC ", " ZZZZZ " } }) + .addElement( + 'B', + withChannel( + "coil", + ofChain( + onElementPass( + te -> te.hasNormalCoils = false, + ofCoil( + GregTechMetaTileEntity_MegaAlloyBlastSmelter::setCoilLevel, + GregTechMetaTileEntity_MegaAlloyBlastSmelter::getCoilLevel)), + onElementPass(te -> te.hasNormalCoils = true, ofBlock(ModBlocks.blockCasingsMisc, 14))))) + + .addElement( + 'Z', + buildHatchAdder(GregTechMetaTileEntity_MegaAlloyBlastSmelter.class) + .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Energy, ExoticEnergy) + .casingIndex(TAE.GTPP_INDEX(15)) + .dot(1) + .buildAndChain(ofBlock(ModBlocks.blockCasingsMisc, 15))) + .addElement( + 'E', + buildHatchAdder(GregTechMetaTileEntity_MegaAlloyBlastSmelter.class).atLeast(Maintenance) + .casingIndex(TAE.GTPP_INDEX(15)) + .dot(2) + .buildAndChain(ofBlock(ModBlocks.blockCasingsMisc, 15))) + .addElement('D', ofBlock(ModBlocks.blockCasingsMisc, 15)) + .addElement('C', ofBlock(ModBlocks.blockCasingsMisc, 14)) + .addElement( + 'A', + withChannel( + "glass", + BorosilicateGlass.ofBoroGlass((byte) -1, (te, t) -> te.glassTier = t, te -> te.glassTier))) + .addElement('F', Muffler.newAny(TAE.GTPP_INDEX(15), 3)) + .build(); public GregTechMetaTileEntity_MegaAlloyBlastSmelter(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -178,7 +179,7 @@ public class GregTechMetaTileEntity_MegaAlloyBlastSmelter @Override protected GT_OverclockCalculator createOverclockCalculator(@NotNull GT_Recipe recipe) { return super.createOverclockCalculator(recipe) - .setSpeedBoost((float) (1.0 - getCoilDiscount(coilLevel))); + .setSpeedBoost((float) (1.0 - getCoilDiscount(coilLevel))); } }.setMaxParallel(MAX_PARALLELS); } @@ -271,40 +272,39 @@ public class GregTechMetaTileEntity_MegaAlloyBlastSmelter @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Fluid Alloy Cooker").addInfo("Controller block for the Mega Alloy Blast Smelter") - .addInfo( - "Runs the same recipes as the normal ABS, except with up to " + EnumChatFormatting.BOLD - + EnumChatFormatting.UNDERLINE - + MAX_PARALLELS - + EnumChatFormatting.RESET - + EnumChatFormatting.GRAY - + " parallels.") - .addInfo("Every coil tier above cupronickel grants a speed bonus, based on this function:") - .addInfo("Bonus = TIER / 150, rounded to the nearest thousandth.") - .addInfo( - EnumChatFormatting.ITALIC - + "Can also use normal ABS coils in their place instead, if you don't like the bonuses :)" - + EnumChatFormatting.RESET - + EnumChatFormatting.GRAY) - .addInfo("The glass limits the tier of the energy hatch. UEV glass unlocks all tiers.") - .addInfo("UV glass required for TecTech laser hatches.") - .addInfo( - EnumChatFormatting.ITALIC + "\"all it does is make metals hot\"" - + EnumChatFormatting.RESET - + EnumChatFormatting.GRAY) - .beginStructureBlock(11, 20, 11, false) - .addStructureInfo("This structure is too complex! See schematic for details.") - .addMaintenanceHatch("Around the controller", 2) - .addOtherStructurePart( - "Input Bus, Output Bus, Input Hatch, Output Bus, Energy Hatch", - "Bottom Casing", - 1) - .addMufflerHatch("1 in the center of the top layer", 3).toolTipFinisher( - EnumChatFormatting.AQUA + "MadMan310 " - + EnumChatFormatting.GRAY - + "via " - + EnumChatFormatting.RED - + "GT++"); + tt.addMachineType("Fluid Alloy Cooker") + .addInfo("Controller block for the Mega Alloy Blast Smelter") + .addInfo( + "Runs the same recipes as the normal ABS, except with up to " + EnumChatFormatting.BOLD + + EnumChatFormatting.UNDERLINE + + MAX_PARALLELS + + EnumChatFormatting.RESET + + EnumChatFormatting.GRAY + + " parallels.") + .addInfo("Every coil tier above cupronickel grants a speed bonus, based on this function:") + .addInfo("Bonus = TIER / 150, rounded to the nearest thousandth.") + .addInfo( + EnumChatFormatting.ITALIC + + "Can also use normal ABS coils in their place instead, if you don't like the bonuses :)" + + EnumChatFormatting.RESET + + EnumChatFormatting.GRAY) + .addInfo("The glass limits the tier of the energy hatch. UEV glass unlocks all tiers.") + .addInfo("UV glass required for TecTech laser hatches.") + .addInfo( + EnumChatFormatting.ITALIC + "\"all it does is make metals hot\"" + + EnumChatFormatting.RESET + + EnumChatFormatting.GRAY) + .beginStructureBlock(11, 20, 11, false) + .addStructureInfo("This structure is too complex! See schematic for details.") + .addMaintenanceHatch("Around the controller", 2) + .addOtherStructurePart("Input Bus, Output Bus, Input Hatch, Output Bus, Energy Hatch", "Bottom Casing", 1) + .addMufflerHatch("1 in the center of the top layer", 3) + .toolTipFinisher( + EnumChatFormatting.AQUA + "MadMan310 " + + EnumChatFormatting.GRAY + + "via " + + EnumChatFormatting.RED + + "GT++"); return tt; } @@ -316,51 +316,53 @@ public class GregTechMetaTileEntity_MegaAlloyBlastSmelter int discountP = (int) (getCoilDiscount(coilLevel) * 1000) / 10; for (GT_MetaTileEntity_Hatch tHatch : filterValidMTEs(mExoticEnergyHatches)) { - storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); + storedEnergy += tHatch.getBaseMetaTileEntity() + .getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity() + .getEUCapacity(); } return new String[] { "------------ Critical Information ------------", - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mProgresstime) - + EnumChatFormatting.RESET - + "t / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mMaxProgresstime) - + EnumChatFormatting.RESET - + "t", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(storedEnergy) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEnergy) - + EnumChatFormatting.RESET - + " EU", - StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " - + EnumChatFormatting.RED - + GT_Utility.formatNumbers(-lEUt) - + EnumChatFormatting.RESET - + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(getAverageInputVoltage()) - + EnumChatFormatting.RESET - + " EU/t(*" - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(getMaxInputAmps()) - + EnumChatFormatting.RESET - + "A) " - + StatCollector.translateToLocal("GT5U.machines.tier") - + ": " - + EnumChatFormatting.YELLOW - + GT_Values.VN[GT_Utility.getTier(getAverageInputVoltage())] - + EnumChatFormatting.RESET, - "Parallels: " + EnumChatFormatting.BLUE + paras + EnumChatFormatting.RESET, - "Coil Discount: " + EnumChatFormatting.BLUE + discountP + "%" + EnumChatFormatting.RESET, - "-----------------------------------------" }; + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime) + + EnumChatFormatting.RESET + + "t / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime) + + EnumChatFormatting.RESET + + "t", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(-lEUt) + + EnumChatFormatting.RESET + + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getAverageInputVoltage()) + + EnumChatFormatting.RESET + + " EU/t(*" + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getMaxInputAmps()) + + EnumChatFormatting.RESET + + "A) " + + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + + EnumChatFormatting.YELLOW + + GT_Values.VN[GT_Utility.getTier(getAverageInputVoltage())] + + EnumChatFormatting.RESET, + "Parallels: " + EnumChatFormatting.BLUE + paras + EnumChatFormatting.RESET, + "Coil Discount: " + EnumChatFormatting.BLUE + discountP + "%" + EnumChatFormatting.RESET, + "-----------------------------------------" }; } @Override @@ -370,15 +372,20 @@ public class GregTechMetaTileEntity_MegaAlloyBlastSmelter @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int aColorIndex, boolean aActive, boolean aRedstone) { + int aColorIndex, boolean aActive, boolean aRedstone) { if (side == facing) { if (aActive) { return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(15)), - TextureFactory.builder().addIcon(TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active) - .extFacing().build() }; + TextureFactory.builder() + .addIcon(TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active) + .extFacing() + .build() }; } - return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(15)), TextureFactory - .builder().addIcon(TexturesGtBlock.Overlay_Machine_Controller_Advanced).extFacing().build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(15)), + TextureFactory.builder() + .addIcon(TexturesGtBlock.Overlay_Machine_Controller_Advanced) + .extFacing() + .build() }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(15)) }; } @@ -404,14 +411,14 @@ public class GregTechMetaTileEntity_MegaAlloyBlastSmelter } else { 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/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java index c1491c7bf6..84fac40265 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java @@ -33,7 +33,9 @@ public class GT_MTE_LargeTurbine_Gas extends GregtechMetaTileEntity_LargerTurbin private static final HashSet<Fluid> BLACKLIST = new HashSet<>(); static { - BLACKLIST.add(Materials.Benzene.getFluid(0).getFluid()); + BLACKLIST.add( + Materials.Benzene.getFluid(0) + .getFluid()); } public GT_MTE_LargeTurbine_Gas(int aID, String aName, String aNameRegional) { @@ -74,7 +76,8 @@ public class GT_MTE_LargeTurbine_Gas extends GregtechMetaTileEntity_LargerTurbin if (aLiquid == null) { return 0; } - GT_Recipe tFuel = getRecipeMap().getBackend().findFuel(aLiquid); + GT_Recipe tFuel = getRecipeMap().getBackend() + .findFuel(aLiquid); if (tFuel != null) { return tFuel.mSpecialValue; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java index f6293920b5..db99b52be1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java @@ -71,7 +71,8 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur if (aLiquid == null) { return 0; } - GT_Recipe tFuel = getRecipeMap().getBackend().findFuel(aLiquid); + GT_Recipe tFuel = getRecipeMap().getBackend() + .findFuel(aLiquid); if (tFuel != null) { return tFuel.mSpecialValue; } @@ -127,31 +128,32 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur } } if (baseEff == 0 || optFlow == 0 - || counter >= 512 - || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled() - || this.getBaseMetaTileEntity().hasInventoryBeenModified()) { + || counter >= 512 + || this.getBaseMetaTileEntity() + .hasWorkJustBeenEnabled() + || this.getBaseMetaTileEntity() + .hasInventoryBeenModified()) { counter = 0; float aTotalBaseEff = 0; float aTotalOptimalFlow = 0; - ItemStack aStack = getFullTurbineAssemblies().get(0).getTurbine(); + ItemStack aStack = getFullTurbineAssemblies().get(0) + .getTurbine(); aTotalBaseEff += GT_Utility.safeInt( - (long) ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) - * 1000F)); + (long) ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); aTotalOptimalFlow += GT_Utility.safeInt( - (long) Math.max( - Float.MIN_NORMAL, - ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier() - * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed - * 50)); + (long) Math.max( + Float.MIN_NORMAL, + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack) + .getSpeedMultiplier() * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed + * 50)); // Calculate total EU/t (as shown on turbine tooltip (Fast mode doesn't affect)) double aEUPerTurbine = aTotalOptimalFlow * 40 - * 0.0105 - * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mPlasmaMultiplier - * (50.0f + (10.0f - * ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack))); + * 0.0105 + * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mPlasmaMultiplier + * (50.0f + (10.0f * ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack))); aTotalOptimalFlow *= getSpeedMultiplier(); if (aTotalOptimalFlow < 0) { @@ -231,7 +233,7 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur // Doesn't matter which one. Ignore the rest! int fuelValue = getFuelValue(firstFuelType); actualOptimalFlow = GT_Utility - .safeInt((long) Math.ceil((double) aOptFlow * (double) flowMultipliers[2] / (double) fuelValue)); + .safeInt((long) Math.ceil((double) aOptFlow * (double) flowMultipliers[2] / (double) fuelValue)); this.realOptFlow = actualOptimalFlow; // For scanner info int remainingFlow = GT_Utility.safeInt((long) (actualOptimalFlow * 1.25f)); // Allowed to use up to 125% of diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java index dded1d04d9..d1346d3a51 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java @@ -92,7 +92,9 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu storedFluid = 0; for (int i = 0; i < aFluids.size() && remainingFlow > 0; i++) { - String fluidName = aFluids.get(i).getFluid().getUnlocalizedName(aFluids.get(i)); + String fluidName = aFluids.get(i) + .getFluid() + .getUnlocalizedName(aFluids.get(i)); if (fluidName.equals("ic2.fluidSuperheatedSteam")) { flow = Math.min(aFluids.get(i).amount, remainingFlow); // try to use up w/o exceeding remainingFlow depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount @@ -102,16 +104,19 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu if (!achievement) { try { GT_Mod.achievements.issueAchievement( - this.getBaseMetaTileEntity().getWorld() - .getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), - "efficientsteam"); + this.getBaseMetaTileEntity() + .getWorld() + .getPlayerEntityByName( + this.getBaseMetaTileEntity() + .getOwnerName()), + "efficientsteam"); } catch (Exception e) {} achievement = true; } } else if (fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") - || fluidName.equals("fluid.mfr.steam.still.name")) { - depleteInput(new FluidStack(aFluids.get(i), aFluids.get(i).amount)); - } + || fluidName.equals("fluid.mfr.steam.still.name")) { + depleteInput(new FluidStack(aFluids.get(i), aFluids.get(i).amount)); + } } if (totalFlow <= 0) return 0; tEU = totalFlow; @@ -137,8 +142,8 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu if (side == getBaseMetaTileEntity().getFrontFacing()) { looseFit ^= true; GT_Utility.sendChatToPlayer( - aPlayer, - looseFit ? "Fitting is Loose (Higher Flow)" : "Fitting is Tight (Higher Efficiency)"); + aPlayer, + looseFit ? "Fitting is Loose (Higher Flow)" : "Fitting is Tight (Higher Efficiency)"); } if (looseFit) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java index cb8bc06124..c882b84aab 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java @@ -104,9 +104,11 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb storedFluid = 0; for (int i = 0; i < aFluids.size() && remainingFlow > 0; i++) { // loop through each hatch; extract inputs and // track totals. - String fluidName = aFluids.get(i).getFluid().getUnlocalizedName(aFluids.get(i)); + String fluidName = aFluids.get(i) + .getFluid() + .getUnlocalizedName(aFluids.get(i)); if (fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") - || fluidName.equals("fluid.mfr.steam.still.name")) { + || fluidName.equals("fluid.mfr.steam.still.name")) { flow = Math.min(aFluids.get(i).amount, remainingFlow); // try to use up w/o exceeding remainingFlow depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount this.storedFluid += aFluids.get(i).amount; @@ -114,9 +116,12 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb totalFlow += flow; // track total input used if (!achievement) { GT_Mod.achievements.issueAchievement( - this.getBaseMetaTileEntity().getWorld() - .getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), - "muchsteam"); + this.getBaseMetaTileEntity() + .getWorld() + .getPlayerEntityByName( + this.getBaseMetaTileEntity() + .getOwnerName()), + "muchsteam"); achievement = true; } } else if (fluidName.equals("ic2.fluidSuperheatedSteam")) { @@ -148,8 +153,8 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb if (side == getBaseMetaTileEntity().getFrontFacing()) { looseFit ^= true; GT_Utility.sendChatToPlayer( - aPlayer, - looseFit ? "Fitting: Loose - More Flow" : "Fitting: Tight - More Efficiency"); + aPlayer, + looseFit ? "Fitting: Loose - More Flow" : "Fitting: Tight - More Efficiency"); } if (looseFit) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java index adb35cc0dd..eec137cea2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java @@ -58,8 +58,8 @@ import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; -public abstract class GregtechMetaTileEntity_LargerTurbineBase extends - GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargerTurbineBase> implements ISurvivalConstructable { +public abstract class GregtechMetaTileEntity_LargerTurbineBase + extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargerTurbineBase> implements ISurvivalConstructable { protected int baseEff = 0; protected long optFlow = 0; @@ -101,28 +101,35 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends @Override protected final GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the XL " + getTurbineType() + " Turbine") - .addInfo("Runs as fast as 16 Large Turbines of the same type, takes the space of 12") - .addInfo("Right-click with screwdriver to enable Fast Mode, to run it even faster") - .addInfo("Optimal flow will increase or decrease accordingly on mode switch") - .addInfo("Fast Mode increases speed to 48x instead of 16x, with some penalties") - .addInfo("Maintenance problems and turbine damage happen 12x as often in Fast Mode"); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the XL " + getTurbineType() + " Turbine") + .addInfo("Runs as fast as 16 Large Turbines of the same type, takes the space of 12") + .addInfo("Right-click with screwdriver to enable Fast Mode, to run it even faster") + .addInfo("Optimal flow will increase or decrease accordingly on mode switch") + .addInfo("Fast Mode increases speed to 48x instead of 16x, with some penalties") + .addInfo("Maintenance problems and turbine damage happen 12x as often in Fast Mode"); if (getTurbineType().contains("Steam")) { tt.addInfo("XL Steam Turbines can use Loose Mode with either Slow or Fast Mode"); } if (getTurbineType().equals("Plasma")) { tt.addInfo("Plasma fuel efficiency is lower for high tier turbines when using low-grade plasmas") - .addInfo("Efficiency = ((FuelValue / 200,000)^2) / (EU per Turbine)"); - } - tt.addPollutionAmount(getPollutionPerSecond(null)).addInfo("Pollution is 3x higher in Fast Mode").addSeparator() - .beginStructureBlock(7, 9, 7, false).addController("Top Middle") - .addCasingInfoMin(getCasingName(), 360, false).addCasingInfoMin("Rotor Shaft", 30, false) - .addOtherStructurePart("Rotor Assembly", "Any 1 dot hint", 1).addInputBus("Any 4 dot hint (min 1)", 4) - .addInputHatch("Any 4 dot hint(min 1)", 4); + .addInfo("Efficiency = ((FuelValue / 200,000)^2) / (EU per Turbine)"); + } + tt.addPollutionAmount(getPollutionPerSecond(null)) + .addInfo("Pollution is 3x higher in Fast Mode") + .addSeparator() + .beginStructureBlock(7, 9, 7, false) + .addController("Top Middle") + .addCasingInfoMin(getCasingName(), 360, false) + .addCasingInfoMin("Rotor Shaft", 30, false) + .addOtherStructurePart("Rotor Assembly", "Any 1 dot hint", 1) + .addInputBus("Any 4 dot hint (min 1)", 4) + .addInputHatch("Any 4 dot hint(min 1)", 4); if (requiresOutputHatch()) { tt.addOutputHatch("Any 4 dot hint(min 1)", 4); } - tt.addDynamoHatch("Any 4 dot hint(min 1)", 4).addMaintenanceHatch("Any 4 dot hint(min 1)", 4); + tt.addDynamoHatch("Any 4 dot hint(min 1)", 4) + .addMaintenanceHatch("Any 4 dot hint(min 1)", 4); if (requiresMufflers()) { tt.addMufflerHatch("Any 7 dot hint (x4)", 7); } @@ -137,51 +144,49 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends @SuppressWarnings("SpellCheckingInspection") protected IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase> computeValue(Class<?> type) { return StructureDefinition.<GregtechMetaTileEntity_LargerTurbineBase>builder() - // c = turbine casing - // s = turbine shaft - // t = turbine housing - // h = dynamo/maint - // m = muffler - .addShape( - STRUCTURE_PIECE_MAIN, - (new String[][] { - { "ccchccc", "ccccccc", "ccmmmcc", "ccm~mcc", "ccmmmcc", "ccccccc", "ccchccc" }, - { "ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc" }, - { "ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc" }, - { "ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc" }, - { "ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc" }, - { "ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc" }, - { "ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc" }, - { "ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc" }, - { "ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc" }, })) - .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) - .addElement('s', lazy(t -> ofBlock(t.getShaftBlock(), t.getTurbineShaftMeta()))) - .addElement( - 't', - lazy( - t -> buildHatchAdder(GregtechMetaTileEntity_LargerTurbineBase.class) - .adder(GregtechMetaTileEntity_LargerTurbineBase::addTurbineHatch) - .hatchClass(GT_MetaTileEntity_Hatch_Turbine.class) - .casingIndex(t.getCasingTextureIndex()).dot(1).build())) - .addElement( - 'h', - lazy( - t -> buildHatchAdder(GregtechMetaTileEntity_LargerTurbineBase.class) - .atLeast( - InputBus, - InputHatch, - OutputHatch, - Dynamo.or(TTDynamo), - Maintenance) - .casingIndex(t.getCasingTextureIndex()).dot(4) - .buildAndChain(t.getCasingBlock(), t.getCasingMeta()))) - .addElement( - 'm', - lazy( - t -> buildHatchAdder(GregtechMetaTileEntity_LargerTurbineBase.class) - .atLeast(Muffler).casingIndex(t.getCasingTextureIndex()).dot(7) - .buildAndChain(t.getCasingBlock(), t.getCasingMeta()))) - .build(); + // c = turbine casing + // s = turbine shaft + // t = turbine housing + // h = dynamo/maint + // m = muffler + .addShape( + STRUCTURE_PIECE_MAIN, + (new String[][] { { "ccchccc", "ccccccc", "ccmmmcc", "ccm~mcc", "ccmmmcc", "ccccccc", "ccchccc" }, + { "ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc" }, + { "ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc" }, + { "ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc" }, + { "ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc" }, + { "ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc" }, + { "ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc" }, + { "ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc" }, + { "ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc" }, })) + .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) + .addElement('s', lazy(t -> ofBlock(t.getShaftBlock(), t.getTurbineShaftMeta()))) + .addElement( + 't', + lazy( + t -> buildHatchAdder(GregtechMetaTileEntity_LargerTurbineBase.class) + .adder(GregtechMetaTileEntity_LargerTurbineBase::addTurbineHatch) + .hatchClass(GT_MetaTileEntity_Hatch_Turbine.class) + .casingIndex(t.getCasingTextureIndex()) + .dot(1) + .build())) + .addElement( + 'h', + lazy( + t -> buildHatchAdder(GregtechMetaTileEntity_LargerTurbineBase.class) + .atLeast(InputBus, InputHatch, OutputHatch, Dynamo.or(TTDynamo), Maintenance) + .casingIndex(t.getCasingTextureIndex()) + .dot(4) + .buildAndChain(t.getCasingBlock(), t.getCasingMeta()))) + .addElement( + 'm', + lazy( + t -> buildHatchAdder(GregtechMetaTileEntity_LargerTurbineBase.class).atLeast(Muffler) + .casingIndex(t.getCasingTextureIndex()) + .dot(7) + .buildAndChain(t.getCasingBlock(), t.getCasingMeta()))) + .build(); } }; @@ -217,25 +222,25 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends boolean aStructure = checkPiece(STRUCTURE_PIECE_MAIN, 3, 3, 0); log("Structure Check: " + aStructure); if (mTurbineRotorHatches.size() != 12 || mMaintenanceHatches.size() != 1 - || (mDynamoHatches.size() < 1 && mTecTechDynamoHatches.size() < 1) - || (requiresMufflers() && mMufflerHatches.size() != 4) - || mInputBusses.size() < 1 - || mInputHatches.size() < 1 - || (requiresOutputHatch() && mOutputHatches.size() < 1)) { + || (mDynamoHatches.size() < 1 && mTecTechDynamoHatches.size() < 1) + || (requiresMufflers() && mMufflerHatches.size() != 4) + || mInputBusses.size() < 1 + || mInputHatches.size() < 1 + || (requiresOutputHatch() && mOutputHatches.size() < 1)) { log( - "Bad Hatches - Turbine Housings: " + mTurbineRotorHatches.size() - + ", Maint: " - + mMaintenanceHatches.size() - + ", Dynamo: " - + mDynamoHatches.size() - + ", Muffler: " - + mMufflerHatches.size() - + ", Input Buses: " - + mInputBusses.size() - + ", Input Hatches: " - + mInputHatches.size() - + ", Output Hatches: " - + mOutputHatches.size()); + "Bad Hatches - Turbine Housings: " + mTurbineRotorHatches.size() + + ", Maint: " + + mMaintenanceHatches.size() + + ", Dynamo: " + + mDynamoHatches.size() + + ", Muffler: " + + mMufflerHatches.size() + + ", Input Buses: " + + mInputBusses.size() + + ", Input Hatches: " + + mInputHatches.size() + + ", Output Hatches: " + + mOutputHatches.size()); return false; } mufflerReduction = getMufflerReduction(); @@ -303,8 +308,8 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends public static boolean isValidTurbine(ItemStack aTurbine) { return (aTurbine != null && aTurbine.getItem() instanceof GT_MetaGenerated_Tool - && aTurbine.getItemDamage() >= 170 - && aTurbine.getItemDamage() <= 176); + && aTurbine.getItemDamage() >= 170 + && aTurbine.getItemDamage() <= 176); } protected ArrayList<ItemStack> getAllBufferedTurbines() { @@ -448,24 +453,26 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends 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; float aTotalBaseEff = 0; float aTotalOptimalFlow = 0; - ItemStack aStack = getFullTurbineAssemblies().get(0).getTurbine(); + ItemStack aStack = getFullTurbineAssemblies().get(0) + .getTurbine(); aTotalBaseEff += GT_Utility.safeInt( - (long) ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) - * 1000F)); + (long) ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); aTotalOptimalFlow += GT_Utility.safeInt( - (long) Math.max( - Float.MIN_NORMAL, - ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier() - * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed - * 50) - * getSpeedMultiplier()); + (long) Math.max( + Float.MIN_NORMAL, + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack) + .getSpeedMultiplier() * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed + * 50) + * getSpeedMultiplier()); if (aTotalOptimalFlow < 0) { aTotalOptimalFlow = 100; } @@ -582,85 +589,92 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends int mPollutionReduction = (int) (100 * mufflerReduction); 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 tMaintenance = 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; StringBuilder aTurbineDamage = new StringBuilder(); for (GT_MetaTileEntity_Hatch_Turbine aHatch : this.getFullTurbineAssemblies()) { ItemStack aTurbine = aHatch.getTurbine(); tDura = MathUtils.safeInt( - (long) (100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(aTurbine) - * (GT_MetaGenerated_Tool.getToolDamage(aTurbine)) + 1)); - aTurbineDamage.append(EnumChatFormatting.RED).append(GT_Utility.formatNumbers(tDura)) - .append(EnumChatFormatting.RESET).append("% | "); + (long) (100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(aTurbine) + * (GT_MetaGenerated_Tool.getToolDamage(aTurbine)) + 1)); + aTurbineDamage.append(EnumChatFormatting.RED) + .append(GT_Utility.formatNumbers(tDura)) + .append(EnumChatFormatting.RESET) + .append("% | "); } 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(); } - boolean aIsSteam = this.getClass().getName().toLowerCase().contains("steam"); + boolean aIsSteam = this.getClass() + .getName() + .toLowerCase() + .contains("steam"); String[] ret = new String[] { - // 8 Lines available for information panels - tRunning + ": " - + EnumChatFormatting.RED - + GT_Utility.formatNumbers(((lEUt * mEfficiency) / 10000)) - + EnumChatFormatting.RESET - + " EU/t", - tMaintenance, - StatCollector.translateToLocal("GT5U.turbine.efficiency") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers((mEfficiency / 100F)) - + EnumChatFormatting.RESET - + "%", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(storedEnergy) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEnergy) - + EnumChatFormatting.RESET - + " EU", - StatCollector.translateToLocal("GT5U.turbine.flow") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(MathUtils.safeInt((long) realOptFlow)) - + EnumChatFormatting.RESET - + " L/s" - + EnumChatFormatting.YELLOW - + " (" - + (isLooseMode() ? StatCollector.translateToLocal("GT5U.turbine.loose") - : StatCollector.translateToLocal("GT5U.turbine.tight")) - + ")", - StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " - + EnumChatFormatting.GOLD - + GT_Utility.formatNumbers(storedFluid) - + EnumChatFormatting.RESET - + "L", - StatCollector.translateToLocal("GT5U.turbine.dmg") + ": " + aTurbineDamage, - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mPollutionReduction) - + EnumChatFormatting.RESET - + " %" }; - if (!aIsSteam) ret[4] = StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + // 8 Lines available for information panels + tRunning + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(((lEUt * mEfficiency) / 10000)) + + EnumChatFormatting.RESET + + " EU/t", + tMaintenance, + StatCollector.translateToLocal("GT5U.turbine.efficiency") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers((mEfficiency / 100F)) + + EnumChatFormatting.RESET + + "%", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(MathUtils.safeInt((long) realOptFlow)) + EnumChatFormatting.RESET - + " L/t"; + + " L/s" + + EnumChatFormatting.YELLOW + + " (" + + (isLooseMode() ? StatCollector.translateToLocal("GT5U.turbine.loose") + : StatCollector.translateToLocal("GT5U.turbine.tight")) + + ")", + StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " + + EnumChatFormatting.GOLD + + GT_Utility.formatNumbers(storedFluid) + + EnumChatFormatting.RESET + + "L", + StatCollector.translateToLocal("GT5U.turbine.dmg") + ": " + aTurbineDamage, + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mPollutionReduction) + + EnumChatFormatting.RESET + + " %" }; + if (!aIsSteam) ret[4] = StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(MathUtils.safeInt((long) realOptFlow)) + + EnumChatFormatting.RESET + + " L/t"; return ret; } @@ -720,10 +734,10 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends } public final ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, - ForgeDirection facing, int aColorIndex, boolean aActive, boolean aRedstone) { + ForgeDirection facing, int aColorIndex, boolean aActive, boolean aRedstone) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], - facing == side ? getFrontFacingTurbineTexture(aActive) - : Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex()) }; + facing == side ? getFrontFacingTurbineTexture(aActive) + : Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex()) }; } protected ITexture getFrontFacingTurbineTexture(boolean isActive) { @@ -737,7 +751,8 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isServerSide()) { - if (this.maxProgresstime() > 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) { + if (this.maxProgresstime() > 0 || this.getBaseMetaTileEntity() + .hasWorkJustBeenEnabled()) { enableAllTurbineHatches(); } if (this.maxProgresstime() <= 0) { @@ -841,12 +856,14 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends ampsOnCurrentHatch = (int) Math.min(aDynamo.maxAmperesOut(), aAmpsToInject); // add full amps - aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aVoltage * ampsOnCurrentHatch, false); + aDynamo.getBaseMetaTileEntity() + .increaseStoredEnergyUnits(aVoltage * ampsOnCurrentHatch, false); injected += aVoltage * ampsOnCurrentHatch; // add reminder if (aRemainder > 0 && ampsOnCurrentHatch < aDynamo.maxAmperesOut()) { - aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aRemainder, false); + aDynamo.getBaseMetaTileEntity() + .increaseStoredEnergyUnits(aRemainder, false); injected += aRemainder; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java index 8d56d35265..67244cb399 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java @@ -79,9 +79,8 @@ import gtPlusPlus.preloader.asm.AsmConfig; import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; -public class GregtechMetaTileEntity_PowerSubStationController - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_PowerSubStationController> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_PowerSubStationController extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_PowerSubStationController> implements ISurvivalConstructable { private static enum TopState { MayBeTop, @@ -106,7 +105,7 @@ public class GregtechMetaTileEntity_PowerSubStationController private static IStructureDefinition<GregtechMetaTileEntity_PowerSubStationController> STRUCTURE_DEFINITION = null; public GregtechMetaTileEntity_PowerSubStationController(final int aID, final String aName, - final String aNameRegional) { + final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -123,36 +122,38 @@ public class GregtechMetaTileEntity_PowerSubStationController protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType(getMachineType()) - .addInfo("Consumes " + this.ENERGY_TAX + "% of the average voltage of all energy type hatches") - .addInfo("Does not require maintenance") - .addInfo( - "Can be built with variable height between " + (CELL_HEIGHT_MIN + 2) - + "-" - + (CELL_HEIGHT_MAX + 2) - + "") - .addInfo("Hatches can be placed nearly anywhere") - .addInfo("HV Energy/Dynamo Hatches are the lowest tier you can use") - .addInfo("Supports voltages >= UHV using MAX tier components.").addSeparator() - .addController("Bottom Center").addCasingInfoMin("Sub-Station External Casings", 10, false) - .addDynamoHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1) - .addSubChannelUsage("capacitor", "Vanadium Capacitor Cell Tier") - .addSubChannelUsage("height", "Height of structure").toolTipFinisher(CORE.GT_Tooltip_Builder.get()); + .addInfo("Consumes " + this.ENERGY_TAX + "% of the average voltage of all energy type hatches") + .addInfo("Does not require maintenance") + .addInfo( + "Can be built with variable height between " + (CELL_HEIGHT_MIN + 2) + "-" + (CELL_HEIGHT_MAX + 2) + "") + .addInfo("Hatches can be placed nearly anywhere") + .addInfo("HV Energy/Dynamo Hatches are the lowest tier you can use") + .addInfo("Supports voltages >= UHV using MAX tier components.") + .addSeparator() + .addController("Bottom Center") + .addCasingInfoMin("Sub-Station External Casings", 10, false) + .addDynamoHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addSubChannelUsage("capacitor", "Vanadium Capacitor Cell Tier") + .addSubChannelUsage("height", "Height of structure") + .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); return tt; } @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { + final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { if (side == facing) { return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(24)), - new GT_RenderedTexture( - aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE - : Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER) }; + new GT_RenderedTexture( + aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE + : Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER) }; } - if (side == this.getBaseMetaTileEntity().getBackFacing()) { + if (side == this.getBaseMetaTileEntity() + .getBackFacing()) { return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(24)), - mIsOutputtingPower ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[(int) this.getOutputTier()] - : Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[(int) this.getInputTier()] }; + mIsOutputtingPower ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[(int) this.getOutputTier()] + : Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[(int) this.getInputTier()] }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(23)) }; } @@ -233,68 +234,66 @@ public class GregtechMetaTileEntity_PowerSubStationController public IStructureDefinition<GregtechMetaTileEntity_PowerSubStationController> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_PowerSubStationController>builder() - .addShape( - mName + "bottom", - transpose(new String[][] { { "BB~BB", "BBBBB", "BBBBB", "BBBBB", "BBBBB" } })) - .addShape( - mName + "layer", - transpose(new String[][] { { "CCCCC", "CIIIC", "CIIIC", "CIIIC", "CCCCC" } })) - .addShape( - mName + "mid", - transpose(new String[][] { { "CCCCC", "CHHHC", "CHHHC", "CHHHC", "CCCCC" } })) - .addShape( - mName + "top", - transpose(new String[][] { { "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT" } })) - .addElement( - 'C', - buildHatchAdder(GregtechMetaTileEntity_PowerSubStationController.class) - .atLeast(Energy.or(TTEnergy), Dynamo.or(TTDynamo), Maintenance) - .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) - .casingIndex(TAE.GTPP_INDEX(24)).dot(1).buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 8)))) - .addElement( - 'B', - buildHatchAdder(GregtechMetaTileEntity_PowerSubStationController.class) - .atLeast(Energy.or(TTEnergy), Dynamo.or(TTDynamo), Maintenance) - .disallowOnly(ForgeDirection.UP).casingIndex(TAE.GTPP_INDEX(24)).dot(1) - .buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 8)))) - .addElement( - 'T', - buildHatchAdder(GregtechMetaTileEntity_PowerSubStationController.class) - .atLeast(Energy.or(TTEnergy), Dynamo.or(TTDynamo), Maintenance) - .disallowOnly(ForgeDirection.DOWN).casingIndex(TAE.GTPP_INDEX(24)).dot(1) - .buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 8)))) - .addElement( - 'I', - withChannel( - "cell", + .addShape( + mName + "bottom", + transpose(new String[][] { { "BB~BB", "BBBBB", "BBBBB", "BBBBB", "BBBBB" } })) + .addShape( + mName + "layer", + transpose(new String[][] { { "CCCCC", "CIIIC", "CIIIC", "CIIIC", "CCCCC" } })) + .addShape(mName + "mid", transpose(new String[][] { { "CCCCC", "CHHHC", "CHHHC", "CHHHC", "CCCCC" } })) + .addShape(mName + "top", transpose(new String[][] { { "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT" } })) + .addElement( + 'C', + buildHatchAdder(GregtechMetaTileEntity_PowerSubStationController.class) + .atLeast(Energy.or(TTEnergy), Dynamo.or(TTDynamo), Maintenance) + .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) + .casingIndex(TAE.GTPP_INDEX(24)) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 8)))) + .addElement( + 'B', + buildHatchAdder(GregtechMetaTileEntity_PowerSubStationController.class) + .atLeast(Energy.or(TTEnergy), Dynamo.or(TTDynamo), Maintenance) + .disallowOnly(ForgeDirection.UP) + .casingIndex(TAE.GTPP_INDEX(24)) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 8)))) + .addElement( + 'T', + buildHatchAdder(GregtechMetaTileEntity_PowerSubStationController.class) + .atLeast(Energy.or(TTEnergy), Dynamo.or(TTDynamo), Maintenance) + .disallowOnly(ForgeDirection.DOWN) + .casingIndex(TAE.GTPP_INDEX(24)) + .dot(1) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 8)))) + .addElement( + 'I', + withChannel( + "cell", + ofChain( + onlyIf( + x -> x.topState != TopState.NotTop, + onElementPass( + x -> x.topState = TopState.Top, + ofHatchAdderOptional( + GregtechMetaTileEntity_PowerSubStationController::addPowerSubStationList, + TAE.GTPP_INDEX(24), + 1, + ModBlocks.blockCasings2Misc, + 8))), + onlyIf( + x -> x.topState != TopState.Top, + onElementPass( + x -> x.topState = TopState.NotTop, ofChain( - onlyIf( - x -> x.topState != TopState.NotTop, - onElementPass( - x -> x.topState = TopState.Top, - ofHatchAdderOptional( - GregtechMetaTileEntity_PowerSubStationController::addPowerSubStationList, - TAE.GTPP_INDEX(24), - 1, - ModBlocks.blockCasings2Misc, - 8))), - onlyIf( - x -> x.topState != TopState.Top, - onElementPass( - x -> x.topState = TopState.NotTop, - ofChain( - onElementPass(x -> ++x.cellCount[0], ofCell(4)), - onElementPass(x -> ++x.cellCount[1], ofCell(5)), - onElementPass(x -> ++x.cellCount[2], ofCell(6)), - onElementPass(x -> ++x.cellCount[3], ofCell(7)), - onElementPass(x -> ++x.cellCount[4], ofCell(8)), - onElementPass( - x -> ++x.cellCount[5], - ofCell(9)))))))) - .addElement('H', ofCell(4)).build(); + onElementPass(x -> ++x.cellCount[0], ofCell(4)), + onElementPass(x -> ++x.cellCount[1], ofCell(5)), + onElementPass(x -> ++x.cellCount[2], ofCell(6)), + onElementPass(x -> ++x.cellCount[3], ofCell(7)), + onElementPass(x -> ++x.cellCount[4], ofCell(8)), + onElementPass(x -> ++x.cellCount[5], ofCell(9)))))))) + .addElement('H', ofCell(4)) + .build(); } return STRUCTURE_DEFINITION; } @@ -318,50 +317,50 @@ public class GregtechMetaTileEntity_PowerSubStationController @Override public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { StructureLibAPI.hintParticle( - world, - x, - y, - z, - getBlockFromTier(getIndex(trigger.stackSize)), - getMetaFromTier(getIndex(trigger.stackSize))); + world, + x, + y, + z, + getBlockFromTier(getIndex(trigger.stackSize)), + getMetaFromTier(getIndex(trigger.stackSize))); return true; } @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { return world.setBlock( - x, - y, - z, - getBlockFromTier(getIndex(trigger.stackSize)), - getMetaFromTier(getIndex(trigger.stackSize)), - 3); + x, + y, + z, + getBlockFromTier(getIndex(trigger.stackSize)), + getMetaFromTier(getIndex(trigger.stackSize)), + 3); } @Nullable @Override public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { return BlocksToPlace.create(getBlockFromTier(trigger.stackSize), getMetaFromTier(trigger.stackSize)); } @Override public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, - AutoPlaceEnvironment env) { + AutoPlaceEnvironment env) { Block block = world.getBlock(x, y, z); int meta = world.getBlockMetadata(x, y, z); int tier = getCellTier(block, meta); if (tier >= 0) return PlaceResult.SKIP; return StructureUtility.survivalPlaceBlock( - getBlockFromTier(getIndex(trigger.stackSize)), - getMetaFromTier(getIndex(trigger.stackSize)), - world, - x, - y, - z, - env.getSource(), - env.getActor(), - env.getChatter()); + getBlockFromTier(getIndex(trigger.stackSize)), + getMetaFromTier(getIndex(trigger.stackSize)), + world, + x, + y, + z, + env.getSource(), + env.getActor(), + env.getChatter()); } }; } @@ -578,7 +577,8 @@ public class GregtechMetaTileEntity_PowerSubStationController return 0; } - if (this.getBaseMetaTileEntity().increaseStoredEnergyUnits(voltage, false)) { + if (this.getBaseMetaTileEntity() + .increaseStoredEnergyUnits(voltage, false)) { aHatch.setEUVar((stored - voltage)); this.mTotalEnergyAdded += voltage; return voltage; @@ -593,8 +593,10 @@ public class GregtechMetaTileEntity_PowerSubStationController return 0; } - if (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(voltage, false)) { - aHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(voltage, false); + if (this.getBaseMetaTileEntity() + .decreaseStoredEnergyUnits(voltage, false)) { + aHatch.getBaseMetaTileEntity() + .increaseStoredEnergyUnits(voltage, false); this.mTotalEnergyConsumed += voltage; return voltage; } @@ -689,53 +691,54 @@ public class GregtechMetaTileEntity_PowerSubStationController String storedEnergyText; if (this.getEUVar() > this.mBatteryCapacity) { storedEnergyText = EnumChatFormatting.RED + GT_Utility.formatNumbers(this.getEUVar()) - + EnumChatFormatting.RESET; + + EnumChatFormatting.RESET; } else { storedEnergyText = EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.getEUVar()) - + EnumChatFormatting.RESET; + + EnumChatFormatting.RESET; } - int errorCode = this.getBaseMetaTileEntity().getErrorDisplayID(); + int errorCode = this.getBaseMetaTileEntity() + .getErrorDisplayID(); boolean mMaint = (errorCode != 0); return new String[] { "Ergon Energy - District Sub-Station", "Stored EU: " + storedEnergyText, - "Capacity: " + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(this.maxEUStore()) - + EnumChatFormatting.RESET, - "Running Costs: " + EnumChatFormatting.RED - + GT_Utility.formatNumbers(this.computeEnergyTax()) - + EnumChatFormatting.RESET - + " EU/t", - "Controller Mode: " + mode, - "Requires Maintenance: " + (!mMaint ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) - + mMaint - + EnumChatFormatting.RESET - + " | Code: [" - + (!mMaint ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) - + errorCode - + EnumChatFormatting.RESET - + "]", - "----------------------", "Stats for Nerds", - "Average Input: " + EnumChatFormatting.BLUE - + GT_Utility.formatNumbers(this.getAverageEuAdded()) - + EnumChatFormatting.RESET - + " EU", - "Average Output: " + EnumChatFormatting.GOLD - + GT_Utility.formatNumbers(this.getAverageEuConsumed()) - + EnumChatFormatting.RESET - + " EU", - "Total Input: " + EnumChatFormatting.BLUE - + GT_Utility.formatNumbers(this.mTotalEnergyAdded) - + EnumChatFormatting.RESET - + " EU", - "Total Output: " + EnumChatFormatting.GOLD - + GT_Utility.formatNumbers(this.mTotalEnergyConsumed) - + EnumChatFormatting.RESET - + " EU", - "Total Costs: " + EnumChatFormatting.RED - + GT_Utility.formatNumbers(this.mTotalEnergyLost) - + EnumChatFormatting.RESET - + " EU", }; + "Capacity: " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(this.maxEUStore()) + + EnumChatFormatting.RESET, + "Running Costs: " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(this.computeEnergyTax()) + + EnumChatFormatting.RESET + + " EU/t", + "Controller Mode: " + mode, + "Requires Maintenance: " + (!mMaint ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + + mMaint + + EnumChatFormatting.RESET + + " | Code: [" + + (!mMaint ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + + errorCode + + EnumChatFormatting.RESET + + "]", + "----------------------", "Stats for Nerds", + "Average Input: " + EnumChatFormatting.BLUE + + GT_Utility.formatNumbers(this.getAverageEuAdded()) + + EnumChatFormatting.RESET + + " EU", + "Average Output: " + EnumChatFormatting.GOLD + + GT_Utility.formatNumbers(this.getAverageEuConsumed()) + + EnumChatFormatting.RESET + + " EU", + "Total Input: " + EnumChatFormatting.BLUE + + GT_Utility.formatNumbers(this.mTotalEnergyAdded) + + EnumChatFormatting.RESET + + " EU", + "Total Output: " + EnumChatFormatting.GOLD + + GT_Utility.formatNumbers(this.mTotalEnergyConsumed) + + EnumChatFormatting.RESET + + " EU", + "Total Costs: " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(this.mTotalEnergyLost) + + EnumChatFormatting.RESET + + " EU", }; } @Override @@ -772,12 +775,14 @@ public class GregtechMetaTileEntity_PowerSubStationController @Override public boolean isInputFacing(ForgeDirection side) { - return (side == this.getBaseMetaTileEntity().getBackFacing() && !mIsOutputtingPower); + return (side == this.getBaseMetaTileEntity() + .getBackFacing() && !mIsOutputtingPower); } @Override public boolean isOutputFacing(ForgeDirection side) { - return (side == this.getBaseMetaTileEntity().getBackFacing() && mIsOutputtingPower); + return (side == this.getBaseMetaTileEntity() + .getBackFacing() && mIsOutputtingPower); } @Override @@ -836,8 +841,9 @@ public class GregtechMetaTileEntity_PowerSubStationController @Override public void addGregTechLogo(ModularWindow.Builder builder) { builder.widget( - new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17) - .setPos(175, 166)); + new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) + .setSize(17, 17) + .setPos(175, 166)); } private long clientEUIn, clientEUOut, clientEULoss, clientEUStored; @@ -848,64 +854,83 @@ public class GregtechMetaTileEntity_PowerSubStationController @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(4, 4).setSize(149, 149)) - .widget(new SlotWidget(inventoryHandler, 0).setPos(154, 4)) - .widget(new SlotWidget(inventoryHandler, 1).setAccess(true, false).setPos(154, 22)) - .widget( - SlotGroup.ofItemHandler(new PlayerMainInvWrapper(buildContext.getPlayer().inventory), 9) - .endAtSlot(8).build().setPos(7, 166)) - .widget( - TextWidget - .dynamicString( - () -> getBaseMetaTileEntity().getErrorDisplayID() == 0 - ? getBaseMetaTileEntity().isActive() ? "Running perfectly" - : "Turn on with Mallet" - : "") - .setSynced(false).setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 8)) - .widget( - new FakeSyncWidget.BooleanSyncer( - () -> getBaseMetaTileEntity().isActive(), - val -> getBaseMetaTileEntity().setActive(val))) - .widget( - new FakeSyncWidget.IntegerSyncer( - () -> getBaseMetaTileEntity().getErrorDisplayID(), - val -> getBaseMetaTileEntity().setErrorDisplayID(val))) - .widget(new TextWidget("In").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(178, 10)) - .widget(new TextWidget("Out").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(176, 28)) - .widget(new FakeSyncWidget.LongSyncer(this::getAverageEuAdded, val -> clientEUIn = val)) - .widget( - new TextWidget().setStringSupplier(() -> "Avg In: " + numberFormat.format(clientEUIn) + " EU") - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 20)) - .widget(new FakeSyncWidget.LongSyncer(this::getAverageEuConsumed, val -> clientEUOut = val)) - .widget( - new TextWidget().setStringSupplier(() -> "Avg Out: " + numberFormat.format(clientEUOut) + " EU") - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 30)) - .widget(new FakeSyncWidget.LongSyncer(this::computeEnergyTax, val -> clientEULoss = val)) - .widget( - new TextWidget() - .setStringSupplier( - () -> "Powerloss: " + numberFormat.format(clientEULoss) + " EU per tick") - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 40)) - .widget( - new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_ENERGY_FRAME).setPos(4, 155) - .setSize(149, 7)) - .widget(new FakeSyncWidget.FloatSyncer(this::getProgress, val -> clientProgress = val)) - .widget( - new ProgressBar().setProgress(this::getProgress) - .setTexture(GTPP_UITextures.PROGRESSBAR_PSS_ENERGY, 147) - .setDirection(ProgressBar.Direction.RIGHT).setPos(5, 156).setSize(147, 5)) - .widget(new TextWidget("Stored:").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 132)) - .widget( - new FakeSyncWidget.LongSyncer( - () -> getBaseMetaTileEntity().getStoredEU(), - val -> clientEUStored = val)) - .widget(new TextWidget().setTextSupplier(() -> { - int colorScale = (int) (clientProgress * 100 * 2.55); - return new Text(numberFormat.format(clientEUStored) + " EU") - .color(Utils.rgbtoHexValue((255 - colorScale), colorScale, 0)); - }).setPos(10, 142)).widget( - new TextWidget().setStringSupplier(() -> numberFormat.format(clientProgress * 100) + "%") - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(70, 155)); + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + .setPos(4, 4) + .setSize(149, 149)) + .widget(new SlotWidget(inventoryHandler, 0).setPos(154, 4)) + .widget( + new SlotWidget(inventoryHandler, 1).setAccess(true, false) + .setPos(154, 22)) + .widget( + SlotGroup.ofItemHandler(new PlayerMainInvWrapper(buildContext.getPlayer().inventory), 9) + .endAtSlot(8) + .build() + .setPos(7, 166)) + .widget( + TextWidget + .dynamicString( + () -> getBaseMetaTileEntity().getErrorDisplayID() == 0 + ? getBaseMetaTileEntity().isActive() ? "Running perfectly" : "Turn on with Mallet" + : "") + .setSynced(false) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(10, 8)) + .widget( + new FakeSyncWidget.BooleanSyncer( + () -> getBaseMetaTileEntity().isActive(), + val -> getBaseMetaTileEntity().setActive(val))) + .widget( + new FakeSyncWidget.IntegerSyncer( + () -> getBaseMetaTileEntity().getErrorDisplayID(), + val -> getBaseMetaTileEntity().setErrorDisplayID(val))) + .widget( + new TextWidget("In").setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(178, 10)) + .widget( + new TextWidget("Out").setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(176, 28)) + .widget(new FakeSyncWidget.LongSyncer(this::getAverageEuAdded, val -> clientEUIn = val)) + .widget( + new TextWidget().setStringSupplier(() -> "Avg In: " + numberFormat.format(clientEUIn) + " EU") + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(10, 20)) + .widget(new FakeSyncWidget.LongSyncer(this::getAverageEuConsumed, val -> clientEUOut = val)) + .widget( + new TextWidget().setStringSupplier(() -> "Avg Out: " + numberFormat.format(clientEUOut) + " EU") + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(10, 30)) + .widget(new FakeSyncWidget.LongSyncer(this::computeEnergyTax, val -> clientEULoss = val)) + .widget( + new TextWidget() + .setStringSupplier(() -> "Powerloss: " + numberFormat.format(clientEULoss) + " EU per tick") + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(10, 40)) + .widget( + new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_ENERGY_FRAME) + .setPos(4, 155) + .setSize(149, 7)) + .widget(new FakeSyncWidget.FloatSyncer(this::getProgress, val -> clientProgress = val)) + .widget( + new ProgressBar().setProgress(this::getProgress) + .setTexture(GTPP_UITextures.PROGRESSBAR_PSS_ENERGY, 147) + .setDirection(ProgressBar.Direction.RIGHT) + .setPos(5, 156) + .setSize(147, 5)) + .widget( + new TextWidget("Stored:").setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(10, 132)) + .widget( + new FakeSyncWidget.LongSyncer(() -> getBaseMetaTileEntity().getStoredEU(), val -> clientEUStored = val)) + .widget(new TextWidget().setTextSupplier(() -> { + int colorScale = (int) (clientProgress * 100 * 2.55); + return new Text(numberFormat.format(clientEUStored) + " EU") + .color(Utils.rgbtoHexValue((255 - colorScale), colorScale, 0)); + }) + .setPos(10, 142)) + .widget( + new TextWidget().setStringSupplier(() -> numberFormat.format(clientProgress * 100) + "%") + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(70, 155)); } private float getProgress() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java index 720fcbffff..141f4bbc43 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java @@ -27,12 +27,12 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock private Byte mRequiredFacing; public TileEntitySolarHeater(final int aID, final String aName, final String aNameRegional, final int aTier, - final String aDescription, final int aSlotCount) { + final String aDescription, final int aSlotCount) { super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); } public TileEntitySolarHeater(final String aName, final int aTier, final String[] aDescription, - final ITexture[][][] aTextures, final int aSlotCount) { + final ITexture[][][] aTextures, final int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } @@ -61,17 +61,15 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { - return this.mTextures[(aActive ? 5 : 0) - + (side == facing ? 0 - : side == facing.getOpposite() ? 1 - : side == ForgeDirection.DOWN ? 2 : side == ForgeDirection.UP ? 3 : 4)][aColorIndex - + 1]; + final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (side == facing ? 0 + : side == facing.getOpposite() ? 1 + : side == ForgeDirection.DOWN ? 2 : side == ForgeDirection.UP ? 3 : 4)][aColorIndex + 1]; } public ITexture[] getFront(final byte aColor) { return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) }; + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) }; } public ITexture[] getBack(final byte aColor) { @@ -84,17 +82,17 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock public ITexture[] getTop(final byte aColor) { return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV) }; + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV) }; } public ITexture[] getSides(final byte aColor) { return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) }; + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) }; } public ITexture[] getFrontActive(final byte aColor) { return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) }; + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) }; } public ITexture[] getBackActive(final byte aColor) { @@ -107,12 +105,12 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock public ITexture[] getTopActive(final byte aColor) { return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV) }; + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV) }; } public ITexture[] getSidesActive(final byte aColor) { return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) }; + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) }; } @Override @@ -122,13 +120,13 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock @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; } @@ -268,10 +266,15 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock } public boolean canSeeSky() { - if (this.getBaseMetaTileEntity().getWorld().canBlockSeeTheSky( - this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getYCoord() + 1, - this.getBaseMetaTileEntity().getZCoord())) { + if (this.getBaseMetaTileEntity() + .getWorld() + .canBlockSeeTheSky( + this.getBaseMetaTileEntity() + .getXCoord(), + this.getBaseMetaTileEntity() + .getYCoord() + 1, + this.getBaseMetaTileEntity() + .getZCoord())) { return true; } return false; @@ -279,9 +282,12 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock public boolean setSolarTower(GregtechMetaTileEntity_SolarTower aTowerTile) { if (!hasSolarTower()) { - this.mTX = aTowerTile.getBaseMetaTileEntity().getXCoord(); - this.mTY = (int) aTowerTile.getBaseMetaTileEntity().getYCoord(); - this.mTZ = aTowerTile.getBaseMetaTileEntity().getZCoord(); + this.mTX = aTowerTile.getBaseMetaTileEntity() + .getXCoord(); + this.mTY = (int) aTowerTile.getBaseMetaTileEntity() + .getYCoord(); + this.mTZ = aTowerTile.getBaseMetaTileEntity() + .getZCoord(); this.mHasTower = true; this.mTower = aTowerTile; return true; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java index 41262b46ff..07a63a6ba4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java @@ -34,13 +34,13 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi public GT_MetaTileEntity_TieredChest(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 3, - "This Chest stores " + (int) (Math.pow(6.0D, (double) aTier) * mStorageFactor) + " Items", - new ITexture[0]); + aID, + aName, + aNameRegional, + aTier, + 3, + "This Chest stores " + (int) (Math.pow(6.0D, (double) aTier) * mStorageFactor) + " Items", + new ITexture[0]); } public GT_MetaTileEntity_TieredChest(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { @@ -84,7 +84,10 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { - if (this.getBaseMetaTileEntity().isServerSide() && this.getBaseMetaTileEntity().isAllowedToWork()) { + if (this.getBaseMetaTileEntity() + .isServerSide() + && this.getBaseMetaTileEntity() + .isAllowedToWork()) { if (this.getItemCount() <= 0) { this.mItemStack = null; this.mItemCount = 0; @@ -95,7 +98,7 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi } if (this.mInventory[0] != null && this.mItemCount < this.getMaxItemCount() - && GT_Utility.areStacksEqual(this.mInventory[0], this.mItemStack)) { + && GT_Utility.areStacksEqual(this.mInventory[0], this.mItemStack)) { this.mItemCount += this.mInventory[0].stackSize; if (this.mItemCount > this.getMaxItemCount()) { this.mInventory[0].stackSize = this.mItemCount - this.getMaxItemCount(); @@ -110,13 +113,12 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi this.mInventory[1].stackSize = Math.min(this.mItemStack.getMaxStackSize(), this.mItemCount); this.mItemCount -= this.mInventory[1].stackSize; } else if (this.mItemCount > 0 && GT_Utility.areStacksEqual(this.mInventory[1], this.mItemStack) - && this.mInventory[1].getMaxStackSize() > this.mInventory[1].stackSize) { - int tmp = Math.min( - this.mItemCount, - this.mInventory[1].getMaxStackSize() - this.mInventory[1].stackSize); - this.mInventory[1].stackSize += tmp; - this.mItemCount -= tmp; - } + && this.mInventory[1].getMaxStackSize() > this.mInventory[1].stackSize) { + int tmp = Math + .min(this.mItemCount, this.mInventory[1].getMaxStackSize() - this.mInventory[1].stackSize); + this.mInventory[1].stackSize += tmp; + this.mItemCount -= tmp; + } if (this.mItemStack != null) { this.mInventory[2] = this.mItemStack.copy(); @@ -139,7 +141,7 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi @Override public int getProgresstime() { return this.mItemCount + (this.mInventory[0] == null ? 0 : this.mInventory[0].stackSize) - + (this.mInventory[1] == null ? 0 : this.mInventory[1].stackSize); + + (this.mInventory[1] == null ? 0 : this.mInventory[1].stackSize); } @Override @@ -153,22 +155,22 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi } public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { + ItemStack aStack) { return aIndex == 1; } public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { + ItemStack aStack) { return aIndex == 0 && (this.mInventory[0] == null || GT_Utility.areStacksEqual(this.mInventory[0], aStack)); } @Override public String[] getInfoData() { return this.mItemStack == null - ? new String[] { "Super Storage Chest", "Stored Items:", "No Items", Integer.toString(0), - Integer.toString(this.getMaxItemCount()) } - : new String[] { "Super Storage Chest", "Stored Items:", this.mItemStack.getDisplayName(), - Integer.toString(this.mItemCount), Integer.toString(this.getMaxItemCount()) }; + ? new String[] { "Super Storage Chest", "Stored Items:", "No Items", Integer.toString(0), + Integer.toString(this.getMaxItemCount()) } + : new String[] { "Super Storage Chest", "Stored Items:", this.mItemStack.getDisplayName(), + Integer.toString(this.mItemCount), Integer.toString(this.getMaxItemCount()) }; } @Override @@ -196,14 +198,14 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int aColorIndex, boolean aActive, boolean aRedstone) { + int aColorIndex, boolean aActive, boolean aRedstone) { return aBaseMetaTileEntity.getFrontFacing() == ForgeDirection.DOWN && side == ForgeDirection.WEST + ? new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], + new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST) } + : (side == aBaseMetaTileEntity.getFrontFacing() ? new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], - new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST) } - : (side == aBaseMetaTileEntity.getFrontFacing() - ? new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], - new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST) } - : new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1] }); + new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST) } + : new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1] }); } @Override @@ -221,20 +223,28 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(7, 16).setSize(71, 45)) - .widget( - new SlotWidget(inventoryHandler, 0) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN) - .setPos(79, 16)) - .widget( - new SlotWidget(inventoryHandler, 1).setAccess(true, false) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT) - .setPos(79, 52)) - .widget( - SlotWidget.phantom(inventoryHandler, 2).disableInteraction() - .setBackground(GT_UITextures.TRANSPARENT).setPos(59, 42)) - .widget(new TextWidget("Item Amount").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 20)).widget( - new TextWidget().setStringSupplier(() -> numberFormat.format(mItemCount)) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 30)); + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + .setPos(7, 16) + .setSize(71, 45)) + .widget( + new SlotWidget(inventoryHandler, 0) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN) + .setPos(79, 16)) + .widget( + new SlotWidget(inventoryHandler, 1).setAccess(true, false) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT) + .setPos(79, 52)) + .widget( + SlotWidget.phantom(inventoryHandler, 2) + .disableInteraction() + .setBackground(GT_UITextures.TRANSPARENT) + .setPos(59, 42)) + .widget( + new TextWidget("Item Amount").setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(10, 20)) + .widget( + new TextWidget().setStringSupplier(() -> numberFormat.format(mItemCount)) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(10, 30)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java index e360f1d4b7..a9fc7a3fd4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java @@ -28,18 +28,18 @@ import gtPlusPlus.core.lib.CORE; public class GT_MetaTileEntity_TieredTank extends GT_MetaTileEntity_BasicTank { public GT_MetaTileEntity_TieredTank(final int aID, final String aName, final String aNameRegional, - final int aTier) { + final int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 3, - "Stores " + GT_Utility.formatNumbers(((int) (Math.pow(2, aTier) * 32000))) + "L of fluid"); + aID, + aName, + aNameRegional, + aTier, + 3, + "Stores " + GT_Utility.formatNumbers(((int) (Math.pow(2, aTier) * 32000))) + "L of fluid"); } public GT_MetaTileEntity_TieredTank(final String aName, final int aTier, final String[] aDescription, - final ITexture[][][] aTextures) { + final ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } @@ -61,35 +61,35 @@ public class GT_MetaTileEntity_TieredTank extends GT_MetaTileEntity_BasicTank { @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { + final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { return side == ForgeDirection.UP - ? new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER_ACTIVE) } - : new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER) }; + ? new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER_ACTIVE) } + : new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER) }; } @Override public void addAdditionalTooltipInformation(ItemStack stack, List<String> tooltip) { if (stack.hasTagCompound() && stack.stackTagCompound.hasKey("mFluid")) { final FluidStack tContents = FluidStack - .loadFluidStackFromNBT(stack.stackTagCompound.getCompoundTag("mFluid")); + .loadFluidStackFromNBT(stack.stackTagCompound.getCompoundTag("mFluid")); if (tContents != null && tContents.amount > 0) { tooltip.add( - GT_LanguageManager.addStringLocalization( - "TileEntity_TANK_INFO", - "Contains Fluid: ", - !GregTech_API.sPostloadFinished) + EnumChatFormatting.YELLOW - + tContents.getLocalizedName() - + EnumChatFormatting.GRAY); + GT_LanguageManager.addStringLocalization( + "TileEntity_TANK_INFO", + "Contains Fluid: ", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.YELLOW + + tContents.getLocalizedName() + + EnumChatFormatting.GRAY); tooltip.add( - GT_LanguageManager.addStringLocalization( - "TileEntity_TANK_AMOUNT", - "Fluid Amount: ", - !GregTech_API.sPostloadFinished) + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(tContents.amount) - + " L" - + EnumChatFormatting.GRAY); + GT_LanguageManager.addStringLocalization( + "TileEntity_TANK_AMOUNT", + "Fluid Amount: ", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(tContents.amount) + + " L" + + EnumChatFormatting.GRAY); } } } @@ -139,10 +139,10 @@ public class GT_MetaTileEntity_TieredTank extends GT_MetaTileEntity_BasicTank { if (this.mFluid == null) { return new String[] { GT_Values.VOLTAGE_NAMES[this.mTier] + " Fluid Tank", "Stored Fluid:", "No Fluid", - 0 + "L", this.getCapacity() + "L" }; + 0 + "L", this.getCapacity() + "L" }; } return new String[] { GT_Values.VOLTAGE_NAMES[this.mTier] + " Fluid Tank", "Stored Fluid:", - this.mFluid.getLocalizedName(), this.mFluid.amount + "L", this.getCapacity() + "L" }; + this.mFluid.getLocalizedName(), this.mFluid.amount + "L", this.getCapacity() + "L" }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java index 7d87d186b5..17b2d77756 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java @@ -26,24 +26,25 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { protected byte aCurrentOutputAmperage = 4; public GregtechMetaEnergyBuffer(final int aID, final String aName, final String aNameRegional, final int aTier, - final String aDescription, final int aSlotCount) { + final String aDescription, final int aSlotCount) { super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); } public GregtechMetaEnergyBuffer(final String aName, final int aTier, final String aDescription, - final ITexture[][][] aTextures, final int aSlotCount) { + final ITexture[][][] aTextures, final int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } @Override public String[] getDescription() { return new String[] { this.mDescription, "Defaults 4A In/Out", "Change output Amperage with a screwdriver", - "Now Portable!", CORE.GT_Tooltip.get() }; + "Now Portable!", CORE.GT_Tooltip.get() }; } @Override public boolean allowCoverOnSide(ForgeDirection side, GT_ItemStack aCover) { - if (side != this.getBaseMetaTileEntity().getFrontFacing()) { + if (side != this.getBaseMetaTileEntity() + .getFrontFacing()) { return true; } return super.allowCoverOnSide(side, aCover); @@ -73,72 +74,70 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { - return this.mTextures[(aActive ? 5 : 0) - + (side == facing ? 0 - : side == facing.getOpposite() ? 1 - : side == ForgeDirection.DOWN ? 2 : side == ForgeDirection.UP ? 3 : 4)][aColorIndex - + 1]; + final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (side == facing ? 0 + : side == facing.getOpposite() ? 1 + : side == ForgeDirection.DOWN ? 2 : side == ForgeDirection.UP ? 3 : 4)][aColorIndex + 1]; } public ITexture[] getFront(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; } public ITexture[] getBack(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; } public ITexture[] getBottom(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; } public ITexture[] getTop(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo) }; + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo) }; } public ITexture[] getSides(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; } public ITexture[] getFrontActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; } public ITexture[] getBackActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; } public ITexture[] getBottomActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; } public ITexture[] getTopActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo) }; + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo) }; } public ITexture[] getSidesActive(final byte aColor) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; } @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMetaEnergyBuffer( - this.mName, - this.mTier, - this.mDescription, - this.mTextures, - this.mInventory.length); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mInventory.length); } @Override @@ -173,12 +172,14 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { @Override public boolean isInputFacing(final ForgeDirection side) { - return side != this.getBaseMetaTileEntity().getFrontFacing(); + return side != this.getBaseMetaTileEntity() + .getFrontFacing(); } @Override public boolean isOutputFacing(final ForgeDirection side) { - return side == this.getBaseMetaTileEntity().getFrontFacing(); + return side == this.getBaseMetaTileEntity() + .getFrontFacing(); } @Override @@ -238,12 +239,14 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { @Override public int getProgresstime() { - return (int) this.getBaseMetaTileEntity().getUniversalEnergyStored(); + return (int) this.getBaseMetaTileEntity() + .getUniversalEnergyStored(); } @Override public int maxProgresstime() { - return (int) this.getBaseMetaTileEntity().getUniversalEnergyCapacity(); + return (int) this.getBaseMetaTileEntity() + .getUniversalEnergyCapacity(); } @Override @@ -254,7 +257,8 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { @Override public void saveNBTData(final NBTTagCompound aNBT) { aNBT.setByte("aCurrentOutputAmperage", aCurrentOutputAmperage); - long aEU = this.getBaseMetaTileEntity().getStoredEU(); + long aEU = this.getBaseMetaTileEntity() + .getStoredEU(); if (aEU > 0) { aNBT.setLong("aStoredEU", aEU); if (aNBT.hasKey("aStoredEU")) { @@ -284,13 +288,13 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { } protected void showEnergy(final World worldIn, final EntityPlayer playerIn) { - final long tempStorage = this.getBaseMetaTileEntity().getStoredEU(); + final long tempStorage = this.getBaseMetaTileEntity() + .getStoredEU(); final double c = ((double) tempStorage / this.maxEUStore()) * 100; final double roundOff = Math.round(c * 100.00) / 100.00; PlayerUtils.messagePlayer( - playerIn, - "Energy: " + GT_Utility - .formatNumbers(tempStorage) + " EU at " + V[this.mTier] + "v (" + roundOff + "%)"); + playerIn, + "Energy: " + GT_Utility.formatNumbers(tempStorage) + " EU at " + V[this.mTier] + "v (" + roundOff + "%)"); PlayerUtils.messagePlayer(playerIn, "Amperage: " + GT_Utility.formatNumbers(maxAmperesOut()) + "A"); } // Utils.LOG_WARNING("Begin Show Energy"); @@ -310,20 +314,24 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { @Override public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { + final ForgeDirection side, final ItemStack aStack) { return false; } @Override public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { + final ForgeDirection side, final ItemStack aStack) { return false; } @Override public String[] getInfoData() { - String cur = GT_Utility.formatNumbers(this.getBaseMetaTileEntity().getStoredEU()); - String max = GT_Utility.formatNumbers(this.getBaseMetaTileEntity().getEUCapacity()); + String cur = GT_Utility.formatNumbers( + this.getBaseMetaTileEntity() + .getStoredEU()); + String max = GT_Utility.formatNumbers( + this.getBaseMetaTileEntity() + .getEUCapacity()); // Right-align current storage with maximum storage String fmt = String.format("%%%ds", max.length()); @@ -409,7 +417,8 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { @Override public void setItemNBT(NBTTagCompound aNBT) { aNBT.setByte("aCurrentOutputAmperage", aCurrentOutputAmperage); - long aEU = this.getBaseMetaTileEntity().getStoredEU(); + long aEU = this.getBaseMetaTileEntity() + .getStoredEU(); if (aEU > 0) { aNBT.setLong("aStoredEU", aEU); if (aNBT.hasKey("aStoredEU")) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java index 53892cd841..2dca8d5c30 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java @@ -18,7 +18,7 @@ public class GT_MetaTileEntity_InfiniteItemHolder extends GT_MetaTileEntity_Tier } public GT_MetaTileEntity_InfiniteItemHolder(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -31,12 +31,13 @@ public class GT_MetaTileEntity_InfiniteItemHolder extends GT_MetaTileEntity_Tier if (!KeyboardUtils.isShiftKeyDown()) { if (this.mItemStack == null) { if (aPlayer.getHeldItem() != null) { - this.mItemStack = aPlayer.getHeldItem().copy(); + this.mItemStack = aPlayer.getHeldItem() + .copy(); this.mItemCount = Short.MAX_VALUE; aPlayer.setCurrentItemOrArmor(0, null); PlayerUtils.messagePlayer( - aPlayer, - "Now holding " + this.mItemStack.getDisplayName() + " x" + Short.MAX_VALUE + "."); + aPlayer, + "Now holding " + this.mItemStack.getDisplayName() + " x" + Short.MAX_VALUE + "."); return true; } } else { @@ -51,10 +52,10 @@ public class GT_MetaTileEntity_InfiniteItemHolder extends GT_MetaTileEntity_Tier } PlayerUtils.messagePlayer( - aPlayer, - "Currently holding: " + (this.mItemStack != null ? this.mItemStack.getDisplayName() : "Nothing") - + " x" - + this.mItemCount); + aPlayer, + "Currently holding: " + (this.mItemStack != null ? this.mItemStack.getDisplayName() : "Nothing") + + " x" + + this.mItemCount); return true; // return super.onRightclick(aBaseMetaTileEntity, aPlayer); } @@ -74,13 +75,13 @@ public class GT_MetaTileEntity_InfiniteItemHolder extends GT_MetaTileEntity_Tier @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { + ItemStack aStack) { return true; } @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { + ItemStack aStack) { return false; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java index 1dbe200f6f..6af3a61487 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java @@ -28,12 +28,13 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools; public class TOOL_Gregtech_AngleGrinder extends GT_Tool { public static final List<String> mEffectiveList = Arrays - .asList(new String[] { EntityIronGolem.class.getName(), "EntityTowerGuardian" }); + .asList(new String[] { EntityIronGolem.class.getName(), "EntityTowerGuardian" }); @Override public float getNormalDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, - final EntityPlayer aPlayer) { - String tName = aEntity.getClass().getName(); + final EntityPlayer aPlayer) { + String tName = aEntity.getClass() + .getName(); tName = tName.substring(tName.lastIndexOf(".") + 1); return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage; } @@ -121,8 +122,8 @@ public class TOOL_Gregtech_AngleGrinder extends GT_Tool { @Override public int convertBlockDrops(final List<ItemStack> aDrops, final ItemStack aStack, final EntityPlayer aPlayer, - final Block aBlock, final int aX, final int aY, final int aZ, final byte aMetaData, final int aFortune, - final boolean aSilkTouch, final BlockEvent.HarvestDropsEvent aEvent) { + final Block aBlock, final int aX, final int aY, final int aZ, final byte aMetaData, final int aFortune, + final boolean aSilkTouch, final BlockEvent.HarvestDropsEvent aEvent) { return 0; } @@ -154,12 +155,12 @@ public class TOOL_Gregtech_AngleGrinder extends GT_Tool { @Override public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) { return new ChatComponentText( - EnumChatFormatting.RED + aEntity.getCommandSenderName() - + EnumChatFormatting.WHITE - + " has been Ground out of existence by " - + EnumChatFormatting.GREEN - + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " has been Ground out of existence by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java index fc9acdb3c8..25ad03548a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java @@ -86,11 +86,11 @@ public class TOOL_Gregtech_ElectricSnips extends GT_Tool_WireCutter { @Override public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) { return new ChatComponentText( - EnumChatFormatting.RED + aEntity.getCommandSenderName() - + EnumChatFormatting.WHITE - + " has been Snipped out of existence by " - + EnumChatFormatting.GREEN - + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " has been Snipped out of existence by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } |