From 55f64675b42ac8d3c557cc850f78664bee006f6f Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Sat, 28 Jan 2023 19:32:44 -0800 Subject: [ci skip] spotlessApply with the new settings --- .../xmod/gregtech/common/Meta_GT_Proxy.java | 324 +++-- .../xmod/gregtech/common/StaticFields59.java | 41 +- .../common/blocks/GTPP_Block_Machines.java | 119 +- .../gregtech/common/blocks/GTPP_Item_Machines.java | 211 +-- .../common/blocks/GregtechMetaCasingBlocks.java | 26 +- .../common/blocks/GregtechMetaCasingBlocks2.java | 25 +- .../common/blocks/GregtechMetaCasingBlocks3.java | 74 +- .../common/blocks/GregtechMetaCasingBlocks4.java | 21 +- .../common/blocks/GregtechMetaCasingBlocks5.java | 47 +- .../blocks/GregtechMetaCasingBlocksAbstract.java | 31 +- .../GregtechMetaCasingBlocksPipeGearbox.java | 12 +- .../common/blocks/GregtechMetaCasingItems.java | 1 + .../common/blocks/GregtechMetaItemCasings1.java | 6 +- .../blocks/GregtechMetaItemCasingsAbstract.java | 32 +- .../blocks/GregtechMetaSpecialMachineCasings.java | 24 +- .../blocks/GregtechMetaSpecialMultiCasings.java | 50 +- .../blocks/GregtechMetaSpecialMultiCasings2.java | 18 +- .../blocks/GregtechMetaTieredCasingBlocks1.java | 12 +- .../common/blocks/fluid/GregtechFluidHandler.java | 50 +- .../blocks/textures/CasingTextureHandler.java | 51 +- .../blocks/textures/CasingTextureHandler2.java | 3 +- .../blocks/textures/CasingTextureHandler3.java | 3 +- .../textures/TexturesCentrifugeMultiblock.java | 70 +- .../common/blocks/textures/TexturesGregtech58.java | 113 +- .../common/blocks/textures/TexturesGregtech59.java | 149 +- .../blocks/textures/TexturesGrinderMultiblock.java | 58 +- .../common/blocks/textures/TexturesGtBlock.java | 654 ++++----- .../blocks/textures/TexturesGtCutomCovers.java | 15 +- .../common/blocks/textures/TexturesGtTools.java | 8 +- .../turbine/LargeTurbineTextureHandler.java | 171 +-- .../common/computer/GT_ComputerCube_Setup.java | 76 +- .../computer/GT_Computercube_Description.java | 754 ++++------ .../common/computer/GT_Computercube_Simulator.java | 72 +- .../xmod/gregtech/common/covers/CoverManager.java | 158 +- .../common/covers/GTPP_Cover_Overflow.java | 103 +- .../common/covers/GTPP_Cover_Overflow_Item.java | 56 +- .../common/covers/GTPP_Cover_ToggleVisual.java | 57 +- .../gregtech/common/helpers/ChargingHelper.java | 152 +- .../gregtech/common/helpers/CraftingHelper.java | 5 +- .../common/helpers/FlotationRecipeHandler.java | 8 +- .../gregtech/common/helpers/GT_MethodHelper.java | 37 +- .../common/helpers/MachineUpdateHandler.java | 6 +- .../gregtech/common/helpers/TreeFarmHelper.java | 230 +-- .../common/helpers/VolumetricFlaskHelper.java | 24 +- .../helpers/autocrafter/AC_Helper_Container.java | 7 +- .../helpers/autocrafter/AC_Helper_Utils.java | 8 +- .../common/helpers/tesseract/TesseractHelper.java | 54 +- .../common/helpers/treefarm/TreeGenerator.java | 107 +- .../gregtech/common/items/MetaCustomCoverItem.java | 49 +- .../common/items/MetaGeneratedGregtechItems.java | 1534 +++++++++++--------- .../common/items/MetaGeneratedGregtechTools.java | 64 +- .../items/behaviours/Behaviour_Choocher.java | 54 +- .../behaviours/Behaviour_Electric_Lighter.java | 86 +- .../common/items/behaviours/Behaviour_Grinder.java | 44 +- .../items/behaviours/Behaviour_Prospecting_Ex.java | 73 +- .../common/items/covers/MetaItemCoverCasings.java | 13 +- .../gregtech/common/render/GTPP_CapeRenderer.java | 127 +- .../gregtech/common/render/GTPP_FlaskRenderer.java | 10 +- .../common/render/GTPP_Render_MachineBlock.java | 184 +-- .../GT_MetaTileEntity_ElectricAutoWorkbench.java | 295 ++-- ...GT_MetaTileEntity_ElectricInventoryManager.java | 640 ++++---- .../GT_MetaTileEntity_TesseractGenerator.java | 179 +-- .../GT_MetaTileEntity_TesseractTerminal.java | 161 +- .../generators/GT_MetaTileEntity_Boiler_Base.java | 55 +- .../generators/GT_MetaTileEntity_Boiler_HV.java | 19 +- .../generators/GT_MetaTileEntity_Boiler_LV.java | 19 +- .../generators/GT_MetaTileEntity_Boiler_MV.java | 19 +- .../generators/GT_MetaTileEntity_Boiler_Solar.java | 78 +- .../generators/GT_MetaTileEntity_RfConvertor.java | 192 ++- .../GT_MetaTileEntity_SemiFluidGenerator.java | 79 +- ...gtechMetaTileEntityDoubleFuelGeneratorBase.java | 92 +- .../GregtechMetaTileEntityGeothermalGenerator.java | 88 +- .../GregtechMetaTileEntityRocketFuelGenerator.java | 75 +- .../GregtechMetaTileEntitySolarGenerator.java | 175 +-- .../generators/GregtechMetaTileEntity_RTG.java | 141 +- .../GT_MetaTileEntity_ULV_CombustionGenerator.java | 17 +- .../ULV/GT_MetaTileEntity_ULV_GasTurbine.java | 19 +- .../ULV/GT_MetaTileEntity_ULV_SteamTurbine.java | 19 +- .../creative/GregtechMetaCreativeEnergyBuffer.java | 86 +- .../basic/GT_MetaTileEntity_CropHarvestor.java | 237 ++- .../basic/GT_MetaTileEntity_WorldAccelerator.java | 95 +- .../GregtechMetaAtmosphericReconditioner.java | 315 ++-- .../machines/basic/GregtechMetaCondensor.java | 171 ++- .../basic/GregtechMetaGarbageCollector.java | 113 +- .../basic/GregtechMetaPollutionCreator.java | 133 +- .../basic/GregtechMetaPollutionDetector.java | 159 +- .../basic/GregtechMetaTileEntityChunkLoader.java | 179 +-- ...GregtechMetaTileEntityThaumcraftResearcher.java | 86 +- .../basic/GregtechMetaTileEntity_AutoChisel.java | 72 +- .../basic/GregtechMetaTileEntity_BasicWasher.java | 44 +- .../GregtechMetaTileEntity_ChemicalReactor.java | 186 +-- ...regtechMetaTileEntity_CompactFusionReactor.java | 187 ++- .../basic/GregtechMetaTileEntity_PocketFusion.java | 188 ++- .../GregtechMetaTileEntity_ReactorColdTrap.java | 47 +- ...egtechMetaTileEntity_ReactorProcessingUnit.java | 36 +- .../basic/GregtechMetaWirelessCharger.java | 202 +-- .../machines/multi/misc/GMTE_AmazonPackager.java | 89 +- .../multi/misc/GregtechMTE_TeslaTower.java | 118 +- ...gtechMetaTileEntity_IndustrialAlloySmelter.java | 111 +- ...regtechMetaTileEntity_IndustrialArcFurnace.java | 113 +- ...regtechMetaTileEntity_IndustrialCentrifuge.java | 54 +- .../GregtechMetaTileEntity_IndustrialChisel.java | 81 +- .../GregtechMetaTileEntity_IndustrialCokeOven.java | 67 +- ...echMetaTileEntity_IndustrialCuttingMachine.java | 55 +- ...regtechMetaTileEntity_IndustrialDehydrator.java | 103 +- ...gtechMetaTileEntity_IndustrialElectrolyzer.java | 49 +- .../GregtechMetaTileEntity_IndustrialExtruder.java | 52 +- ...egtechMetaTileEntity_IndustrialFluidHeater.java | 66 +- ...egtechMetaTileEntity_IndustrialForgeHammer.java | 63 +- ...GregtechMetaTileEntity_IndustrialMacerator.java | 89 +- .../GregtechMetaTileEntity_IndustrialMixer.java | 58 +- ...aTileEntity_IndustrialMolecularTransformer.java | 70 +- ...gtechMetaTileEntity_IndustrialMultiMachine.java | 125 +- ...regtechMetaTileEntity_IndustrialPlatePress.java | 55 +- .../GregtechMetaTileEntity_IndustrialSifter.java | 73 +- .../GregtechMetaTileEntity_IndustrialSinter.java | 329 ++--- ...MetaTileEntity_IndustrialThermalCentrifuge.java | 38 +- ...techMetaTileEntity_IndustrialVacuumFreezer.java | 86 +- ...GregtechMetaTileEntity_IndustrialWashPlant.java | 88 +- .../GregtechMetaTileEntity_IndustrialWireMill.java | 81 +- .../GregtechMetaTileEntity_IronBlastFurnace.java | 280 ++-- .../processing/GregtechMetaTileEntity_IsaMill.java | 113 +- .../GregtechMetaTileEntity_SpargeTower.java | 115 +- .../GregtechMetaTileEntity_Adv_AssemblyLine.java | 201 ++- ...egtechMetaTileEntity_Adv_DistillationTower.java | 137 +- .../advanced/GregtechMetaTileEntity_Adv_EBF.java | 130 +- .../GregtechMetaTileEntity_Adv_Fusion_MK4.java | 70 +- .../GregtechMetaTileEntity_Adv_HeatExchanger.java | 228 +-- .../GregtechMetaTileEntity_Adv_Implosion.java | 31 +- .../GregtechMetaTileEntity_SteamCompressor.java | 41 +- .../GregtechMetaTileEntity_SteamMacerator.java | 41 +- .../multi/production/GT4Entity_AutoCrafter.java | 265 ++-- .../multi/production/GT4Entity_ThermalBoiler.java | 63 +- .../GregtechMTE_ElementalDuplicator.java | 301 ++-- .../production/GregtechMTE_FastNeutronReactor.java | 254 +--- .../production/GregtechMTE_FrothFlotationCell.java | 87 +- .../production/GregtechMTE_LargeNaqReactor.java | 623 +++----- .../production/GregtechMTE_MiniFusionPlant.java | 444 ++---- .../production/GregtechMTE_NuclearReactor.java | 201 +-- .../GregtechMetaTileEntityGeneratorArray.java | 205 +-- .../production/GregtechMetaTileEntityTreeFarm.java | 198 ++- .../GregtechMetaTileEntity_AlloyBlastSmelter.java | 76 +- .../GregtechMetaTileEntity_Cyclotron.java | 164 +-- ...egtechMetaTileEntity_IndustrialFishingPond.java | 226 ++- ...egtechMetaTileEntity_IndustrialRockBreaker.java | 111 +- .../GregtechMetaTileEntity_LargeRocketEngine.java | 112 +- ...techMetaTileEntity_LargeSemifluidGenerator.java | 74 +- .../GregtechMetaTileEntity_MassFabricator.java | 189 +-- ...techMetaTileEntity_QuantumForceTransformer.java | 719 +++------ .../GregtechMetaTileEntity_Refinery.java | 61 +- .../GregtechMetaTileEntity_SolarTower.java | 597 +++----- .../algae/GregtechMTE_AlgaePondBase.java | 126 +- ...gtechMetaTileEntity_BedrockMiningPlatform1.java | 51 +- ...gtechMetaTileEntity_BedrockMiningPlatform2.java | 51 +- ...chMetaTileEntity_BedrockMiningPlatformBase.java | 68 +- .../chemplant/GregtechMTE_ChemicalPlant.java | 202 ++- ...egTechMetaTileEntity_MegaAlloyBlastSmelter.java | 517 +++---- .../turbines/GT_MTE_LargeTurbine_Gas.java | 25 +- .../turbines/GT_MTE_LargeTurbine_Plasma.java | 63 +- .../turbines/GT_MTE_LargeTurbine_SCSteam.java | 14 +- .../turbines/GT_MTE_LargeTurbine_SHSteam.java | 35 +- .../turbines/GT_MTE_LargeTurbine_Steam.java | 33 +- .../GregtechMetaTileEntity_LargerTurbineBase.java | 333 +++-- .../storage/GregtechMetaTileEntity_MultiTank.java | 850 ++++------- ...chMetaTileEntity_PowerSubStationController.java | 306 ++-- .../misc/GT_TileEntity_ComputerCube.java | 1035 ++++++------- .../tileentities/misc/TileEntitySolarHeater.java | 126 +- .../redstone/GT_MetaTileEntity_RedstoneBase.java | 37 +- .../GT_MetaTileEntity_RedstoneButtonPanel.java | 109 +- .../GT_MetaTileEntity_RedstoneCircuitBlock.java | 360 ++--- .../redstone/GT_MetaTileEntity_RedstoneLamp.java | 16 +- .../GT_MetaTileEntity_RedstoneStrengthDisplay.java | 93 +- .../GT_MetaTileEntity_RedstoneStrengthScale.java | 33 +- .../GT_MetaTileEntity_AdvancedCraftingTable.java | 480 +++--- .../GT_MetaTileEntity_BronzeCraftingTable.java | 12 +- .../GT_MetaTileEntity_ConnectableCrate.java | 155 +- .../storage/GT_MetaTileEntity_TieredChest.java | 119 +- .../storage/GT_MetaTileEntity_TieredTank.java | 63 +- .../storage/GregtechMetaEnergyBuffer.java | 229 ++- .../storage/GregtechMetaSafeBlock.java | 46 +- .../GT_MetaTileEntity_InfiniteItemHolder.java | 17 +- .../storage/shelving/GT4Entity_Shelf.java | 98 +- .../shelving/GT4Entity_Shelf_Compartment.java | 9 +- .../storage/shelving/GT4Entity_Shelf_Desk.java | 14 +- .../shelving/GT4Entity_Shelf_FileCabinet.java | 17 +- .../storage/shelving/GT4Entity_Shelf_Iron.java | 14 +- .../storage/shelving/GT4Entity_Shelf_Large.java | 99 +- .../common/tools/TOOL_Gregtech_AngleGrinder.java | 86 +- .../gregtech/common/tools/TOOL_Gregtech_Base.java | 41 +- .../common/tools/TOOL_Gregtech_Choocher.java | 76 +- .../tools/TOOL_Gregtech_ElectricButcherKnife.java | 43 +- .../tools/TOOL_Gregtech_ElectricLighter.java | 41 +- .../common/tools/TOOL_Gregtech_ElectricSnips.java | 28 +- 193 files changed, 10861 insertions(+), 15248 deletions(-) (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common') 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 535b4b7169..2ae449e012 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 @@ -1,5 +1,23 @@ package gtPlusPlus.xmod.gregtech.common; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.util.*; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import org.apache.commons.lang3.ArrayUtils; + import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.Side; @@ -27,21 +45,6 @@ import gtPlusPlus.xmod.gregtech.common.helpers.MachineUpdateHandler; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_WorldAccelerator; import ic2.core.init.BlocksItems; import ic2.core.init.InternalName; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.util.*; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import org.apache.commons.lang3.ArrayUtils; public class Meta_GT_Proxy { @@ -60,8 +63,7 @@ public class Meta_GT_Proxy { public static AchievementHandler mAssemblyAchievements; - public static final Map mCustomGregtechMetaTooltips = - new LinkedHashMap(); + public static final Map mCustomGregtechMetaTooltips = new LinkedHashMap(); /** * Does this feature exist within GT? Saves loading useless content if not. @@ -152,32 +154,13 @@ 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", - }; - 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", - "热水", - "热水", - }; + 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", }; + 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", "热水", "热水", }; for (int i = 0; i < aLangs.length; i++) { Logger.REFLECTION( "Trying to inject new lang data for " + aLangs[i] + ", using value: " + aLangValues[i]); @@ -248,9 +231,12 @@ public class Meta_GT_Proxy { // Skip this material if (aMoltenFluid == null || aPlasma == null || aPlasma.isFluidEqual(NULL_PLASMA)) { - Logger.INFO("Could not generate Advanced Vacuum Freezer recipe. Cooling " + s - + " plasma. Molten Form Exists? " + (aMoltenFluid != null) + " | Plasma Exists? " - + (aPlasma != null)); + Logger.INFO( + "Could not generate Advanced Vacuum Freezer recipe. Cooling " + s + + " plasma. Molten Form Exists? " + + (aMoltenFluid != null) + + " | Plasma Exists? " + + (aPlasma != null)); continue; } else { // Build a new plasma recipe @@ -260,9 +246,9 @@ public class Meta_GT_Proxy { new ItemStack[] {}, new ItemStack[] {}, null, - new int[] {10000}, - new FluidStack[] {aPlasma, FluidUtils.getFluidStack("cryotheum", aTotalTickTime)}, - new FluidStack[] {aMoltenFluid}, + new int[] { 10000 }, + new FluidStack[] { aPlasma, FluidUtils.getFluidStack("cryotheum", aTotalTickTime) }, + new FluidStack[] { aMoltenFluid }, aTotalTickTime, (int) GT_Values.V[4 + aAtomicTier], aAtomicMass); @@ -316,12 +302,8 @@ public class Meta_GT_Proxy { Constructor g = BaseCustomTileEntity.class.getConstructors()[0]; g.setAccessible(true); return (BaseCustomTileEntity) g.newInstance(); - } catch (InstantiationException - | IllegalAccessException - | IllegalArgumentException - | InvocationTargetException - | SecurityException e) { - } + } catch (InstantiationException | IllegalAccessException | IllegalArgumentException + | InvocationTargetException | SecurityException e) {} } } try { @@ -332,13 +314,10 @@ public class Meta_GT_Proxy { Constructor g = BaseCustomTileEntity.class.getConstructors()[0]; g.setAccessible(true); return (BaseCustomTileEntity) g.newInstance(); - } catch (InstantiationException - | IllegalAccessException - | IllegalArgumentException - | InvocationTargetException - | SecurityException e) { - GT_Log.err.println( - "GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft."); + } catch (InstantiationException | IllegalAccessException | IllegalArgumentException + | InvocationTargetException | SecurityException e) { + GT_Log.err + .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft."); e.printStackTrace(GT_Log.err); CORE.crash( "GT++ Mod: Fatal Error ocurred while initializing custom BaseMetaTileEntities, crashing Minecraft."); @@ -357,11 +336,8 @@ public class Meta_GT_Proxy { Constructor g = BaseCustomPower_MTE.class.getConstructors()[0]; g.setAccessible(true); return (BaseCustomPower_MTE) g.newInstance(); - } catch (InstantiationException - | IllegalAccessException - | IllegalArgumentException - | InvocationTargetException - | SecurityException e) { + } catch (InstantiationException | IllegalAccessException | IllegalArgumentException + | InvocationTargetException | SecurityException e) { // e.printStackTrace(); } } @@ -375,13 +351,10 @@ public class Meta_GT_Proxy { Constructor g = BaseCustomPower_MTE.class.getConstructors()[0]; g.setAccessible(true); return (BaseCustomPower_MTE) g.newInstance(); - } catch (InstantiationException - | IllegalAccessException - | IllegalArgumentException - | InvocationTargetException - | SecurityException e) { - GT_Log.err.println( - "GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft."); + } catch (InstantiationException | IllegalAccessException | IllegalArgumentException + | InvocationTargetException | SecurityException e) { + GT_Log.err + .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft."); e.printStackTrace(GT_Log.err); CORE.crash( "GT++ Mod: Fatal Error ocurred while initializing custom BaseMetaTileEntities, crashing Minecraft."); @@ -410,8 +383,8 @@ public class Meta_GT_Proxy { } } } else { - GT_MetaTileEntity_WorldAccelerator.BlacklistedTileEntiyClassNames = - ArrayUtils.add(GT_MetaTileEntity_WorldAccelerator.BlacklistedTileEntiyClassNames, aClassName); + GT_MetaTileEntity_WorldAccelerator.BlacklistedTileEntiyClassNames = ArrayUtils + .add(GT_MetaTileEntity_WorldAccelerator.BlacklistedTileEntiyClassNames, aClassName); return true; } return false; @@ -452,8 +425,8 @@ public class Meta_GT_Proxy { mCustomGregtechMetaTooltips.put(aNbtTagName, aData); } - public static void conStructGtTileBlockTooltip( - ItemStack aStack, EntityPlayer aPlayer, List aList, boolean par4) { + public static void conStructGtTileBlockTooltip(ItemStack aStack, EntityPlayer aPlayer, List aList, + boolean par4) { try { int tDamage = aStack.getItemDamage(); if ((tDamage <= 0) || (tDamage >= GregTech_API.METATILEENTITIES.length)) { @@ -471,18 +444,18 @@ public class Meta_GT_Proxy { if (tString.length >= 2) { StringBuffer tBuffer = new StringBuffer(); Object tRep[] = new String[tString.length / 2]; - for (int j = 0; j < tString.length; j++) - if (j % 2 == 0) tBuffer.append(tString[j]); - else { - tBuffer.append(" %s"); - tRep[j / 2] = tString[j]; - } - aList.add(String.format( - GT_LanguageManager.addStringLocalization( - "TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, - tBuffer.toString(), - !GregTech_API.sPostloadFinished), - tRep)); + for (int j = 0; j < tString.length; j++) if (j % 2 == 0) tBuffer.append(tString[j]); + else { + tBuffer.append(" %s"); + tRep[j / 2] = tString[j]; + } + aList.add( + String.format( + GT_LanguageManager.addStringLocalization( + "TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, + tBuffer.toString(), + !GregTech_API.sPostloadFinished), + tRep)); } } else { String tTranslated = GT_LanguageManager.addStringLocalization( @@ -506,26 +479,37 @@ public class Meta_GT_Proxy { if ((aOffset) <= 10) { tTier -= 2; aList.add(EnumChatFormatting.BOLD + "16" + " Fuse Slots" + EnumChatFormatting.GRAY); - aList.add("Per each fuse, you may insert " + EnumChatFormatting.YELLOW - + (GT_Values.V[tTier]) + EnumChatFormatting.GRAY + " EU/t"); - aList.add("However this " + EnumChatFormatting.ITALIC + EnumChatFormatting.RED + "MUST" - + EnumChatFormatting.GRAY + " be in a single Amp"); - aList.add("This machine can accept upto a single amp of " - + GT_Values.VN[Math.min(tTier + 2, 12)] + " as a result"); - aList.add(GT_LanguageManager.addStringLocalization( + aList.add( + "Per each fuse, you may insert " + EnumChatFormatting.YELLOW + + (GT_Values.V[tTier]) + + EnumChatFormatting.GRAY + + " EU/t"); + aList.add( + "However this " + EnumChatFormatting.ITALIC + + EnumChatFormatting.RED + + "MUST" + + EnumChatFormatting.GRAY + + " be in a single Amp"); + aList.add( + "This machine can accept upto a single amp of " + + GT_Values.VN[Math.min(tTier + 2, 12)] + + " as a result"); + aList.add( + GT_LanguageManager.addStringLocalization( "TileEntity_Breaker_Loss", - "Breaker Loss: " + EnumChatFormatting.RED + "" + "Breaker Loss: " + EnumChatFormatting.RED + + "" + (GT_Values.V[Math.max(tTier - 1, 0)] / 10) - + EnumChatFormatting.GRAY + " EU/t", - !GregTech_API.sPostloadFinished) - + EnumChatFormatting.GRAY); + + EnumChatFormatting.GRAY + + " EU/t", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); } - aList.add(GT_LanguageManager.addStringLocalization( + aList.add( + GT_LanguageManager.addStringLocalization( "TileEntity_Special_Power_1", EnumChatFormatting.RED + "Special Power Handling, please read manual", - !GregTech_API.sPostloadFinished) - + EnumChatFormatting.GRAY); + !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); // aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_2", // EnumChatFormatting.RED+"Special Power Handling, please read manual", // !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); @@ -537,92 +521,126 @@ public class Meta_GT_Proxy { if (tTileEntity.getInputVoltage() > 0L) { String inA = "0"; if (tTileEntity.getInputAmperage() >= 1L) { - inA = " at " + EnumChatFormatting.YELLOW + tTileEntity.getInputAmperage() - + EnumChatFormatting.GRAY + " Amps"; + inA = " at " + EnumChatFormatting.YELLOW + + tTileEntity.getInputAmperage() + + EnumChatFormatting.GRAY + + " Amps"; } else { - inA = " at " + EnumChatFormatting.WHITE + tTileEntity.getInputAmperage() - + EnumChatFormatting.GRAY + " Amps"; + inA = " at " + EnumChatFormatting.WHITE + + tTileEntity.getInputAmperage() + + EnumChatFormatting.GRAY + + " Amps"; } - String a1 = "Voltage IN: " + EnumChatFormatting.GREEN + tTileEntity.getInputVoltage() - + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")" - + EnumChatFormatting.GRAY + inA; + String a1 = "Voltage IN: " + EnumChatFormatting.GREEN + + tTileEntity.getInputVoltage() + + " (" + + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + + ")" + + EnumChatFormatting.GRAY + + inA; aList.add(a1); } if (tTileEntity.getOutputVoltage() > 0L) { String outA = "0"; if (tTileEntity.getOutputAmperage() >= 1L) { - outA = " at " + EnumChatFormatting.YELLOW + tTileEntity.getOutputAmperage() - + EnumChatFormatting.GRAY + " Amps"; + outA = " at " + EnumChatFormatting.YELLOW + + tTileEntity.getOutputAmperage() + + EnumChatFormatting.GRAY + + " Amps"; } else { - outA = " at " + EnumChatFormatting.WHITE + tTileEntity.getOutputAmperage() - + EnumChatFormatting.GRAY + " Amps"; + outA = " at " + EnumChatFormatting.WHITE + + tTileEntity.getOutputAmperage() + + EnumChatFormatting.GRAY + + " Amps"; } - String a1 = "Voltage OUT: " + EnumChatFormatting.GREEN + tTileEntity.getOutputVoltage() - + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getOutputVoltage())] + ")" - + EnumChatFormatting.GRAY + outA; + String a1 = "Voltage OUT: " + EnumChatFormatting.GREEN + + tTileEntity.getOutputVoltage() + + " (" + + GT_Values.VN[GT_Utility.getTier(tTileEntity.getOutputVoltage())] + + ")" + + EnumChatFormatting.GRAY + + outA; aList.add(a1); } if (tTileEntity.getOutputVoltage() > 0L) { - aList.add(GT_LanguageManager.addStringLocalization( + aList.add( + GT_LanguageManager.addStringLocalization( "TileEntity_Lossess_EU", - "Transmission Loss: " + EnumChatFormatting.DARK_BLUE + "" + "Transmission Loss: " + EnumChatFormatting.DARK_BLUE + + "" + (tDamage < 30500 && tDamage >= 30400 ? 0 : 1), - !GregTech_API.sPostloadFinished) - + EnumChatFormatting.GRAY); + !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); } if (tTileEntity.getEUCapacity() > 0) { - aList.add(GT_LanguageManager.addStringLocalization( - "TileEntity_EUp_STORE2", "Internal Capacity: ", !GregTech_API.sPostloadFinished) - + EnumChatFormatting.BLUE - + tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY + " EU"); + aList.add( + GT_LanguageManager.addStringLocalization( + "TileEntity_EUp_STORE2", + "Internal Capacity: ", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.BLUE + + tTileEntity.getEUCapacity() + + EnumChatFormatting.GRAY + + " EU"); } } - /*if (tTileEntity.getEUCapacity() > 0L) { - if (tTileEntity.getInputVoltage() > 0L) { - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_IN", "Voltage IN: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getInputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")" + EnumChatFormatting.GRAY); - } - if (tTileEntity.getOutputVoltage() > 0L) { - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_OUT", "Voltage OUT: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getOutputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getOutputVoltage())] + ")" + EnumChatFormatting.GRAY); - } - if (tTileEntity.getOutputAmperage() > 1L) { - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_AMOUNT", "Amperage: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.YELLOW + tTileEntity.getOutputAmperage() + EnumChatFormatting.GRAY); - } - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.BLUE + tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY); - }*/ + /* + * if (tTileEntity.getEUCapacity() > 0L) { if (tTileEntity.getInputVoltage() > 0L) { + * aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_IN", "Voltage IN: ", + * !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getInputVoltage() + " (" + + * GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")" + EnumChatFormatting.GRAY); } + * if (tTileEntity.getOutputVoltage() > 0L) { + * aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_OUT", "Voltage OUT: ", + * !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getOutputVoltage() + " (" + * + GT_Values.VN[GT_Utility.getTier(tTileEntity.getOutputVoltage())] + ")" + EnumChatFormatting.GRAY); + * } if (tTileEntity.getOutputAmperage() > 1L) { + * aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_AMOUNT", "Amperage: ", + * !GregTech_API.sPostloadFinished ) + EnumChatFormatting.YELLOW + tTileEntity.getOutputAmperage() + + * EnumChatFormatting.GRAY); } + * aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: ", + * !GregTech_API.sPostloadFinished ) + EnumChatFormatting.BLUE + tTileEntity.getEUCapacity() + + * EnumChatFormatting.GRAY); } + */ } NBTTagCompound aNBT = aStack.getTagCompound(); if (aNBT != null) { if (aNBT.getBoolean("mMuffler")) { - aList.add(GT_LanguageManager.addStringLocalization( - "GT_TileEntity_MUFFLER", "has Muffler Upgrade", !GregTech_API.sPostloadFinished)); + aList.add( + GT_LanguageManager.addStringLocalization( + "GT_TileEntity_MUFFLER", + "has Muffler Upgrade", + !GregTech_API.sPostloadFinished)); } if (aNBT.getBoolean("mSteamConverter")) { - aList.add(GT_LanguageManager.addStringLocalization( - "GT_TileEntity_STEAMCONVERTER", "has Steam Upgrade", !GregTech_API.sPostloadFinished)); + aList.add( + GT_LanguageManager.addStringLocalization( + "GT_TileEntity_STEAMCONVERTER", + "has Steam Upgrade", + !GregTech_API.sPostloadFinished)); } int tAmount = 0; if ((tAmount = aNBT.getByte("mSteamTanks")) > 0) { - aList.add(tAmount + " " - + GT_LanguageManager.addStringLocalization( - "GT_TileEntity_STEAMTANKS", - "Steam Tank Upgrades", - !GregTech_API.sPostloadFinished)); + aList.add( + tAmount + " " + + GT_LanguageManager.addStringLocalization( + "GT_TileEntity_STEAMTANKS", + "Steam Tank Upgrades", + !GregTech_API.sPostloadFinished)); } - FluidStack afluid = - net.minecraftforge.fluids.FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid")); + FluidStack afluid = net.minecraftforge.fluids.FluidStack + .loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid")); if (afluid != null) { int tFluidAmount = afluid.amount; if (tFluidAmount > 0) { - aList.add(GT_LanguageManager.addStringLocalization( - "GT_TileEntity_FLUIDTANK", - "Tank Fluid: " + tFluidAmount + "L " + afluid.getLocalizedName() + "", - !GregTech_API.sPostloadFinished)); + aList.add( + GT_LanguageManager.addStringLocalization( + "GT_TileEntity_FLUIDTANK", + "Tank Fluid: " + tFluidAmount + "L " + afluid.getLocalizedName() + "", + !GregTech_API.sPostloadFinished)); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java index 0f98d8ab55..502674fb18 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java @@ -1,5 +1,17 @@ package gtPlusPlus.xmod.gregtech.common; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; @@ -17,16 +29,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.reflect.ProxyFinder; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; public class StaticFields59 { @@ -88,14 +90,19 @@ public class StaticFields59 { mPyrolyseRecipes = null; } - mCalculatePollutionReduction = - getMethod(GT_MetaTileEntity_Hatch_Muffler.class, "calculatePollutionReduction", int.class); + mCalculatePollutionReduction = getMethod( + GT_MetaTileEntity_Hatch_Muffler.class, + "calculatePollutionReduction", + int.class); Logger.INFO("[SH] Got Method: calculatePollutionReduction"); // Yep... if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { mAddFurnaceRecipe = getMethod( - GT_ModHandler.class, "addSmeltingAndAlloySmeltingRecipe", ItemStack.class, ItemStack.class); + GT_ModHandler.class, + "addSmeltingAndAlloySmeltingRecipe", + ItemStack.class, + ItemStack.class); Logger.INFO("[SH] Got Method: addSmeltingAndAlloySmeltingRecipe"); } else { mAddFurnaceRecipe = getMethod( @@ -182,7 +189,7 @@ public class StaticFields59 { try { return (String[]) mDescriptionArray.get(aTile); } catch (IllegalArgumentException | IllegalAccessException e) { - return new String[] {aTile.mDescription}; + return new String[] { aTile.mDescription }; } } @@ -211,8 +218,7 @@ public class StaticFields59 { proxyGT = Meta_GT_Proxy.mProxies[1]; } else { try { - proxyGT = (client - ? ProxyFinder.getClientProxy(GT_Mod.instance) + proxyGT = (client ? ProxyFinder.getClientProxy(GT_Mod.instance) : ProxyFinder.getServerProxy(GT_Mod.instance)); } catch (final ReflectiveOperationException e1) { proxyGT = null; @@ -228,8 +234,7 @@ public class StaticFields59 { if (proxyGT != null && proxyGT instanceof GT_Proxy) { try { return ReflectionUtils.getField(proxyGT.getClass(), fieldName).get(proxyGT); - } catch (IllegalArgumentException | IllegalAccessException e) { - } + } catch (IllegalArgumentException | IllegalAccessException e) {} } return null; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java index 83cbc0065c..a408663ee0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java @@ -1,24 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures.BlockIcons; -import gregtech.api.interfaces.IDebugableBlock; -import gregtech.api.interfaces.tileentity.ICoverable; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.items.GT_Generic_Block; -import gregtech.api.metatileentity.BaseMetaPipeEntity; -import gregtech.api.metatileentity.BaseMetaTileEntity; -import gregtech.api.metatileentity.BaseTileEntity; -import gregtech.api.util.GT_Utility; -import gregtech.common.blocks.GT_Material_Machines; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.random.XSTR; -import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; -import gtPlusPlus.xmod.gregtech.common.render.GTPP_Render_MachineBlock; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.client.renderer.texture.IIconRegister; @@ -41,7 +25,26 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures.BlockIcons; +import gregtech.api.interfaces.IDebugableBlock; +import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.items.GT_Generic_Block; +import gregtech.api.metatileentity.BaseMetaPipeEntity; +import gregtech.api.metatileentity.BaseMetaTileEntity; +import gregtech.api.metatileentity.BaseTileEntity; +import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Material_Machines; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.random.XSTR; +import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; +import gtPlusPlus.xmod.gregtech.common.render.GTPP_Render_MachineBlock; + public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableBlock, ITileEntityProvider { + public static ThreadLocal mTemporaryTileEntity = new ThreadLocal(); public GTPP_Block_Machines() { @@ -104,8 +107,7 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB } public String getLocalizedName() { - String aName = StatCollector.translateToLocal(this.getUnlocalizedName() + ".name"); - ; + String aName = StatCollector.translateToLocal(this.getUnlocalizedName() + ".name");; if (aName.toLowerCase().contains(".name")) { aName = StatCollector.translateToLocal(getUnlocalizedName() + ".name"); } @@ -128,8 +130,7 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB } public int getRenderType() { - return GTPP_Render_MachineBlock.INSTANCE == null - ? super.getRenderType() + return GTPP_Render_MachineBlock.INSTANCE == null ? super.getRenderType() : GTPP_Render_MachineBlock.INSTANCE.mRenderID; } @@ -195,8 +196,8 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB return tTileEntity != null ? tTileEntity.receiveClientEvent(aData1, aData2) : false; } - public void addCollisionBoxesToList( - World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider) { + public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, + Entity collider) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) { @@ -210,18 +211,18 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); return tTileEntity instanceof IGregTechTileEntity - && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null - ? ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) - : super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); + && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null + ? ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) + : super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); } @SideOnly(Side.CLIENT) public AxisAlignedBB getSelectedBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); return tTileEntity instanceof IGregTechTileEntity - && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null - ? ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) - : super.getSelectedBoundingBoxFromPool(aWorld, aX, aY, aZ); + && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null + ? ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) + : super.getSelectedBoundingBoxFromPool(aWorld, aX, aY, aZ); } public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int aX, int aY, int aZ) { @@ -264,15 +265,13 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB public float getPlayerRelativeBlockHardness(EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - return tTileEntity instanceof BaseMetaTileEntity - && ((BaseMetaTileEntity) tTileEntity).privateAccess() - && !((BaseMetaTileEntity) tTileEntity).playerOwnsThis(aPlayer, true) - ? -1.0F - : super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ); + return tTileEntity instanceof BaseMetaTileEntity && ((BaseMetaTileEntity) tTileEntity).privateAccess() + && !((BaseMetaTileEntity) tTileEntity).playerOwnsThis(aPlayer, true) ? -1.0F + : super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ); } - public boolean onBlockActivated( - World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, float par1, float par2, float par3) { + public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, float par1, + float par2, float par3) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity == null) { return false; @@ -289,13 +288,11 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB } } - return tTileEntity instanceof IGregTechTileEntity - ? (((IGregTechTileEntity) tTileEntity).getTimer() < 50L - ? false - : (!aWorld.isRemote && !((IGregTechTileEntity) tTileEntity).isUseableByPlayer(aPlayer) - ? true - : ((IGregTechTileEntity) tTileEntity) - .onRightclick(aPlayer, (byte) aSide, par1, par2, par3))) + return tTileEntity instanceof IGregTechTileEntity ? (((IGregTechTileEntity) tTileEntity).getTimer() < 50L + ? false + : (!aWorld.isRemote && !((IGregTechTileEntity) tTileEntity).isUseableByPlayer(aPlayer) ? true + : ((IGregTechTileEntity) tTileEntity) + .onRightclick(aPlayer, (byte) aSide, par1, par2, par3))) : false; } } @@ -339,8 +336,7 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB (double) ((float) aZ + tRandom.nextFloat() * 0.8F + 0.1F), new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage())); if (tItem.hasTagCompound()) { - tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) - tItem.getTagCompound().copy()); + tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy()); } tItemEntity.motionX = tRandom.nextGaussian() * 0.0500000007450581D; @@ -359,10 +355,8 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB public ArrayList getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - return tTileEntity instanceof IGregTechTileEntity - ? ((IGregTechTileEntity) tTileEntity).getDrops() - : (mTemporaryTileEntity.get() == null - ? new ArrayList() + return tTileEntity instanceof IGregTechTileEntity ? ((IGregTechTileEntity) tTileEntity).getDrops() + : (mTemporaryTileEntity.get() == null ? new ArrayList() : ((IGregTechTileEntity) mTemporaryTileEntity.get()).getDrops()); } @@ -436,10 +430,8 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB public int getLightOpacity(IBlockAccess aWorld, int aX, int aY, int aZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - return tTileEntity == null - ? 0 - : (tTileEntity instanceof IGregTechTileEntity - ? ((IGregTechTileEntity) tTileEntity).getLightOpacity() + return tTileEntity == null ? 0 + : (tTileEntity instanceof IGregTechTileEntity ? ((IGregTechTileEntity) tTileEntity).getLightOpacity() : (aWorld.getBlockMetadata(aX, aY, aZ) == 0 ? 255 : 0)); } @@ -449,21 +441,12 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB } public TileEntity createTileEntity(World aWorld, int aMeta) { - return (TileEntity) - (aMeta >= 4 - ? Meta_GT_Proxy.constructBaseMetaTileEntity() - : Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower()); - } - - public float getExplosionResistance( - Entity par1Entity, - World aWorld, - int aX, - int aY, - int aZ, - double explosionX, - double explosionY, - double explosionZ) { + return (TileEntity) (aMeta >= 4 ? Meta_GT_Proxy.constructBaseMetaTileEntity() + : Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower()); + } + + public float getExplosionResistance(Entity par1Entity, World aWorld, int aX, int aY, int aZ, double explosionX, + double explosionY, double explosionZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); return tTileEntity instanceof IGregTechTileEntity ? ((IGregTechTileEntity) tTileEntity).getBlastResistance((byte) 6) diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java index 9e732d2443..0a4c5bd4a4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java @@ -1,14 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.blocks; -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_ItsNotMyFaultException; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.Logger; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; @@ -17,7 +10,17 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_ItsNotMyFaultException; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; + public class GTPP_Item_Machines extends ItemBlock { + public GTPP_Item_Machines(Block par1) { super(par1); this.setMaxDamage(0); @@ -40,33 +43,12 @@ public class GTPP_Item_Machines extends ItemBlock { final long tVoltage = aNBT.getInputVoltage(); byte tTier = (byte) ((byte) Math.max(1, GT_Utility.getTier(tVoltage))); - /*if (aNBT.getDescription() != null) { - int tAmount = 0; - String[] arg7 = aNBT.getDescription(); - int arg8 = arg7.length-1; - - if (arg7 != null && arg7.length > 0) { - for (String t : arg7) { - aList.add(t); - } - - } - else { - aList.add("ERROR"); - } - - for (int y = 0; y < arg8; y++) { - String tDescription = arg7[y]; - - if (tDescription != null) { - aList.add(tDescription+"|"+arg8); - continue; - } - else { - continue; - } - } - }*/ + /* + * if (aNBT.getDescription() != null) { int tAmount = 0; String[] arg7 = aNBT.getDescription(); int arg8 + * = arg7.length-1; if (arg7 != null && arg7.length > 0) { for (String t : arg7) { aList.add(t); } } + * else { aList.add("ERROR"); } for (int y = 0; y < arg8; y++) { String tDescription = arg7[y]; if + * (tDescription != null) { aList.add(tDescription+"|"+arg8); continue; } else { continue; } } } + */ if (aNBT.getEUCapacity() > 0L) { @@ -76,26 +58,37 @@ public class GTPP_Item_Machines extends ItemBlock { if ((e - 30400) <= 10) { tTier -= 2; aList.add(EnumChatFormatting.BOLD + "16" + " Fuse Slots" + EnumChatFormatting.GRAY); - aList.add("Per each fuse, you may insert " + EnumChatFormatting.YELLOW - + (GT_Values.V[tTier]) + EnumChatFormatting.GRAY + " EU/t"); - aList.add("However this " + EnumChatFormatting.ITALIC + EnumChatFormatting.RED + "MUST" - + EnumChatFormatting.GRAY + " be in a single Amp"); - aList.add("This machine can accept upto a single amp of " - + GT_Values.VN[Math.min(tTier + 2, 12)] + " as a result"); - aList.add(GT_LanguageManager.addStringLocalization( + aList.add( + "Per each fuse, you may insert " + EnumChatFormatting.YELLOW + + (GT_Values.V[tTier]) + + EnumChatFormatting.GRAY + + " EU/t"); + aList.add( + "However this " + EnumChatFormatting.ITALIC + + EnumChatFormatting.RED + + "MUST" + + EnumChatFormatting.GRAY + + " be in a single Amp"); + aList.add( + "This machine can accept upto a single amp of " + + GT_Values.VN[Math.min(tTier + 2, 12)] + + " as a result"); + aList.add( + GT_LanguageManager.addStringLocalization( "TileEntity_Breaker_Loss", - "Breaker Loss: " + EnumChatFormatting.RED + "" + "Breaker Loss: " + EnumChatFormatting.RED + + "" + (GT_Values.V[Math.max(tTier - 1, 0)] / 10) - + EnumChatFormatting.GRAY + " EU/t", - !GregTech_API.sPostloadFinished) - + EnumChatFormatting.GRAY); + + EnumChatFormatting.GRAY + + " EU/t", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); } - aList.add(GT_LanguageManager.addStringLocalization( + aList.add( + GT_LanguageManager.addStringLocalization( "TileEntity_Special_Power_1", EnumChatFormatting.RED + "Special Power Handling, please read manual", - !GregTech_API.sPostloadFinished) - + EnumChatFormatting.GRAY); + !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); // aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_2", // EnumChatFormatting.RED+"Special Power Handling, please read manual", // !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); @@ -107,66 +100,93 @@ public class GTPP_Item_Machines extends ItemBlock { if (aNBT.getInputVoltage() > 0L) { String inA = "0"; if (aNBT.getInputAmperage() >= 1L) { - inA = " at " + EnumChatFormatting.YELLOW + aNBT.getInputAmperage() + EnumChatFormatting.GRAY + inA = " at " + EnumChatFormatting.YELLOW + + aNBT.getInputAmperage() + + EnumChatFormatting.GRAY + " Amps"; } else { -