From 9c10b4c63b9c4ea551719c8a059d36ea01c5b89e Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 6 Feb 2022 11:08:29 +0100 Subject: Update TT_Utility --- .../dreamcraft/NoDreamCraftMachineLoader.java | 34 +- .../definitions/EMComplexAspectDefinition.java | 16 +- .../tectech/mechanics/anomaly/AnomalyHandler.java | 10 +- .../tectech/mechanics/commands/ConvertFloat.java | 4 +- .../tectech/mechanics/commands/ConvertInteger.java | 4 +- .../tectech/mechanics/data/ChunkDataMessage.java | 4 +- .../tectech/mechanics/data/PlayerPersistence.java | 6 +- .../elementalMatter/core/commands/EMList.java | 4 +- .../core/definitions/EMPrimitiveTemplate.java | 2 +- .../core/maps/EMInstanceStackMap.java | 20 +- .../elementalMatter/core/maps/EMStackMap.java | 13 +- .../elementalMatter/core/maps/IEMMapRead.java | 2 +- .../core/stacks/EMInstanceStack.java | 20 +- .../definitions/complex/EMAtomDefinition.java | 18 +- .../definitions/complex/EMHadronDefinition.java | 16 +- .../definitions/complex/EMNuclideIAEA.java | 2 +- .../tectech/nei/TT_NEI_ResearchHandler.java | 4 +- .../technus/tectech/nei/TT_NEI_ScannerHandler.java | 4 +- .../thing/cover/GT_Cover_TM_EnderFluidLink.java | 3 +- .../item/DebugElementalInstanceContainer_EM.java | 6 +- .../item/ElementalDefinitionContainer_EM.java | 6 +- .../item/ElementalDefinitionScanStorage_EM.java | 6 +- .../tectech/thing/item/ParametrizerMemoryCard.java | 6 +- .../hatch/GT_MetaTileEntity_Hatch_Capacitor.java | 6 +- .../GT_MetaTileEntity_Hatch_CreativeData.java | 4 +- ...T_MetaTileEntity_Hatch_CreativeMaintenance.java | 4 +- .../GT_MetaTileEntity_Hatch_DataConnector.java | 4 +- .../hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java | 4 +- .../GT_MetaTileEntity_Hatch_DynamoTunnel.java | 4 +- ...GT_MetaTileEntity_Hatch_ElementalContainer.java | 9 +- .../hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java | 6 +- .../GT_MetaTileEntity_Hatch_EnergyTunnel.java | 8 +- .../hatch/GT_MetaTileEntity_Hatch_Holder.java | 4 +- .../hatch/GT_MetaTileEntity_Hatch_InputData.java | 4 +- .../GT_MetaTileEntity_Hatch_InputDataItems.java | 4 +- .../GT_MetaTileEntity_Hatch_InputElemental.java | 4 +- .../hatch/GT_MetaTileEntity_Hatch_OutputData.java | 4 +- .../GT_MetaTileEntity_Hatch_OutputDataItems.java | 4 +- .../GT_MetaTileEntity_Hatch_OutputElemental.java | 4 +- .../GT_MetaTileEntity_Hatch_OverflowElemental.java | 15 +- .../hatch/GT_MetaTileEntity_Hatch_Param.java | 4 +- .../hatch/GT_MetaTileEntity_Hatch_Rack.java | 6 +- .../hatch/GT_MetaTileEntity_Hatch_Uncertainty.java | 4 +- .../hatch/TextParametersMessage.java | 6 +- .../hatch/gui/GT_Container_Param.java | 22 +- .../hatch/gui/GT_Container_ParamAdv.java | 26 +- .../hatch/gui/GT_Container_ParamText.java | 22 +- .../hatch/gui/GT_GUIContainer_Param.java | 17 +- .../hatch/gui/GT_GUIContainer_ParamAdv.java | 17 +- .../hatch/gui/GT_GUIContainer_ParamText.java | 20 +- .../multi/GT_MetaTileEntity_EM_computer.java | 4 +- .../multi/GT_MetaTileEntity_EM_quantizer.java | 2 +- .../multi/GT_MetaTileEntity_EM_scanner.java | 2 +- .../multi/base/GT_Container_MultiMachineEM.java | 10 +- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 8 +- .../em_machine/GT_MetaTileEntity_EM_machine.java | 10 +- .../single/GT_MetaTileEntity_BuckConverter.java | 6 +- .../single/GT_MetaTileEntity_DataReader.java | 22 +- .../single/GT_MetaTileEntity_DebugPollutor.java | 6 +- .../GT_MetaTileEntity_DebugPowerGenerator.java | 6 +- .../GT_MetaTileEntity_DebugStructureWriter.java | 10 +- .../single/GT_MetaTileEntity_MicroController.java | 6 +- .../single/GT_MetaTileEntity_OwnerDetector.java | 6 +- .../single/GT_MetaTileEntity_TT_Transformer.java | 6 +- .../single/GT_MetaTileEntity_TeslaCoil.java | 5 +- .../single/gui/GT_Container_DebugPollutor.java | 10 +- .../single/gui/GT_GUIContainer_BuckConverter.java | 4 +- .../single/gui/GT_GUIContainer_DataReader.java | 9 +- .../gui/GT_GUIContainer_DebugPowerGenerator.java | 4 +- .../github/technus/tectech/util/TT_Utility.java | 613 +++++++++++++++++++++ .../java/com/github/technus/tectech/util/Util.java | 596 -------------------- 71 files changed, 896 insertions(+), 895 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/util/TT_Utility.java delete mode 100644 src/main/java/com/github/technus/tectech/util/Util.java (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/NoDreamCraftMachineLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/NoDreamCraftMachineLoader.java index 798ffec36c..c8eda64bea 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/NoDreamCraftMachineLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/NoDreamCraftMachineLoader.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.compatibility.dreamcraft; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import com.github.technus.tectech.thing.CustomItemList; import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_TT_Transformer; import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_WetTransformer; @@ -105,7 +105,7 @@ public class NoDreamCraftMachineLoader implements Runnable { temp = new GT_MetaTileEntity_BasicHull( 11230, "hull.tier.10", "UEV Machine Hull", 10, imagination); - Util.setTier(10, temp); + TT_Utility.setTier(10, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } @@ -114,7 +114,7 @@ public class NoDreamCraftMachineLoader implements Runnable { temp = new GT_MetaTileEntity_BasicHull( 11231, "hull.tier.11", "UIV Machine Hull", 11, imagination); - Util.setTier(11, temp); + TT_Utility.setTier(11, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } @@ -123,7 +123,7 @@ public class NoDreamCraftMachineLoader implements Runnable { temp = new GT_MetaTileEntity_BasicHull( 11232, "hull.tier.12", "UMV Machine Hull", 12, imagination); - Util.setTier(12, temp); + TT_Utility.setTier(12, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } @@ -132,7 +132,7 @@ public class NoDreamCraftMachineLoader implements Runnable { temp = new GT_MetaTileEntity_BasicHull( 11233, "hull.tier.13", "UXV Machine Hull", 13, imagination); - Util.setTier(13, temp); + TT_Utility.setTier(13, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } @@ -141,7 +141,7 @@ public class NoDreamCraftMachineLoader implements Runnable { temp = new GT_MetaTileEntity_BasicHull( 11234, "hull.tier.14", "OPV Machine Hull", 14, imagination); - Util.setTier(14, temp); + TT_Utility.setTier(14, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } @@ -150,7 +150,7 @@ public class NoDreamCraftMachineLoader implements Runnable { temp = new GT_MetaTileEntity_BasicHull( 11235, "hull.tier.15", "MAX Machine Hull", 15, imagination); - Util.setTier(15, temp); + TT_Utility.setTier(15, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } @@ -162,7 +162,7 @@ public class NoDreamCraftMachineLoader implements Runnable { temp = new GT_MetaTileEntity_TT_Transformer( 11221, "tt.transformer.tier.10", "Extremely Ultimate Transformer", 10);//UIV -> UEV (Use Soft Mallet to invert) - Util.setTier(10, temp); + TT_Utility.setTier(10, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } @@ -170,7 +170,7 @@ public class NoDreamCraftMachineLoader implements Runnable { temp = new GT_MetaTileEntity_TT_Transformer( 11222, "tt.transformer.tier.11", "Insanely Ultimate Transformer", 11);//UMV -> UIV (Use Soft Mallet to invert) - Util.setTier(11, temp); + TT_Utility.setTier(11, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } @@ -178,7 +178,7 @@ public class NoDreamCraftMachineLoader implements Runnable { temp = new GT_MetaTileEntity_TT_Transformer( 11223, "tt.transformer.tier.12", "Mega Ultimate Transformer", 12);//UXV -> UMV (Use Soft Mallet to invert) - Util.setTier(12, temp); + TT_Utility.setTier(12, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } @@ -186,7 +186,7 @@ public class NoDreamCraftMachineLoader implements Runnable { temp = new GT_MetaTileEntity_TT_Transformer( 11224, "tt.transformer.tier.13", "Extended Mega Ultimate Transformer", 13);//OPV -> UXV (Use Soft Mallet to invert) - Util.setTier(13, temp); + TT_Utility.setTier(13, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } @@ -194,7 +194,7 @@ public class NoDreamCraftMachineLoader implements Runnable { temp = new GT_MetaTileEntity_TT_Transformer( 11225, "tt.transformer.tier.14", "Overpowered Transformer", 14);//MAX -> OPV (Use Soft Mallet to invert) - Util.setTier(14, temp); + TT_Utility.setTier(14, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } @@ -215,7 +215,7 @@ public class NoDreamCraftMachineLoader implements Runnable { 11910, "transformer.ha.tier.10", "Extremely Ultimate Hi-Amp Transformer", 10, //UIV -> UEV (Use Soft Mallet to invert) translateToLocal("gt.blockmachines.transformer.ha.tier.10.desc")); - Util.setTier(10, temp); + TT_Utility.setTier(10, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } @@ -225,7 +225,7 @@ public class NoDreamCraftMachineLoader implements Runnable { 11911, "transformer.ha.tier.11", "Insanely Ultimate Hi-Amp Transformer", 11, //UMV -> UIV (Use Soft Mallet to invert) translateToLocal("gt.blockmachines.transformer.ha.tier.11.desc")); - Util.setTier(11, temp); + TT_Utility.setTier(11, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } @@ -235,7 +235,7 @@ public class NoDreamCraftMachineLoader implements Runnable { 11912, "transformer.ha.tier.12", "Mega Ultimate Hi-Amp Transformer", 12, //UXV -> UMV (Use Soft Mallet to invert) translateToLocal("gt.blockmachines.transformer.ha.tier.12.desc")); - Util.setTier(12, temp); + TT_Utility.setTier(12, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } @@ -245,7 +245,7 @@ public class NoDreamCraftMachineLoader implements Runnable { 11913, "transformer.ha.tier.13", "Extended Mega Ultimate Hi-Amp Transformer", 13, //OPV -> UXV (Use Soft Mallet to invert) translateToLocal("gt.blockmachines.transformer.ha.tier.13.desc")); - Util.setTier(13, temp); + TT_Utility.setTier(13, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } @@ -255,7 +255,7 @@ public class NoDreamCraftMachineLoader implements Runnable { 11914, "transformer.ha.tier.14", "Overpowered Hi-Amp Transformer", 14, //MAX -> OPV (Use Soft Mallet to invert) translateToLocal("gt.blockmachines.transformer.ha.tier.14.desc")); - Util.setTier(14, temp); + TT_Utility.setTier(14, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/EMComplexAspectDefinition.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/EMComplexAspectDefinition.java index 8c90dc939c..be1ed9bd51 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/EMComplexAspectDefinition.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/EMComplexAspectDefinition.java @@ -10,7 +10,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.reg import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMDefinitionsRegistry; import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMConstantStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMDefinitionStack; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import java.util.ArrayList; @@ -233,30 +233,30 @@ public final class EMComplexAspectDefinition extends EMComplexTemplate { @Override public void addScanShortSymbols(ArrayList lines, int capabilities, long energyLevel) { - if (Util.areBitsSet(SCAN_GET_NOMENCLATURE | SCAN_GET_CHARGE | SCAN_GET_MASS, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_NOMENCLATURE | SCAN_GET_CHARGE | SCAN_GET_MASS, capabilities)) { lines.add(getShortSymbol()); } } @Override public void addScanResults(ArrayList lines, int capabilities, long energyLevel) { - if (Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) { lines.add(translateToLocal("tt.keyword.CLASS") + " = " + nbtType + ' ' + getMatterMassType()); } - if (Util.areBitsSet(SCAN_GET_NOMENCLATURE | SCAN_GET_CHARGE | SCAN_GET_MASS, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_NOMENCLATURE | SCAN_GET_CHARGE | SCAN_GET_MASS, capabilities)) { lines.add(translateToLocal("tt.keyword.NAME") + " = " + getLocalizedName()); //lines.add("SYMBOL = "+getSymbol()); } - if (Util.areBitsSet(SCAN_GET_CHARGE, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_CHARGE, capabilities)) { lines.add(translateToLocal("tt.keyword.CHARGE") + " = " + getCharge() / 3f + " e"); } - if (Util.areBitsSet(SCAN_GET_COLOR, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_COLOR, capabilities)) { lines.add(hasColor() ? translateToLocal("tt.keyword.COLORLESS") : translateToLocal("tt.keyphrase.CARRIES_COLOR")); } - if (Util.areBitsSet(SCAN_GET_MASS, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_MASS, capabilities)) { lines.add(translateToLocal("tt.keyword.MASS") + " = " + getMass() + " eV/c\u00b2"); } - if (Util.areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)) { lines.add(translateToLocal("tt.keyphrase.LIFE_TIME") + " = " + getRawTimeSpan(energyLevel) + " s"); lines.add(" " + translateToLocal("tt.keyphrase.At_current_energy_level")); } diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index a61490b162..bd25b05a0c 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -8,7 +8,7 @@ import com.github.technus.tectech.mechanics.data.ChunkDataMessage; import com.github.technus.tectech.mechanics.data.IChunkMetaDataHandler; import com.github.technus.tectech.mechanics.data.PlayerDataMessage; import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.EMAtomDefinition; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import cpw.mods.fml.common.gameevent.TickEvent; import gregtech.api.GregTech_API; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -33,8 +33,8 @@ import java.util.Map; import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.EM_COUNT_PER_MATERIAL_AMOUNT; import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.EM_COUNT_PER_MATERIAL_AMOUNT_DIMINISHED; -import static com.github.technus.tectech.util.Util.crossProduct3D; -import static com.github.technus.tectech.util.Util.normalize3D; +import static com.github.technus.tectech.util.TT_Utility.crossProduct3D; +import static com.github.technus.tectech.util.TT_Utility.normalize3D; public class AnomalyHandler implements IChunkMetaDataHandler { private static final double SWAP_THRESHOLD = EMAtomDefinition.getSomethingHeavy().getMass() * 1000D * EM_COUNT_PER_MATERIAL_AMOUNT_DIMINISHED;//can be const as it is computed later... @@ -171,8 +171,8 @@ public class AnomalyHandler implements IChunkMetaDataHandler { } int x = (b.xPosition - a.xPosition) << 4; int z = (b.xPosition - a.xPosition) << 4; - List aE = a.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, Util.fromChunk(a)); - List bE = b.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, Util.fromChunk(b)); + List aE = a.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, TT_Utility.fromChunk(a)); + List bE = b.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, TT_Utility.fromChunk(b)); for (EntityLivingBase entityLivingBase : aE) { if (TecTech.RANDOM.nextBoolean()) { if (entityLivingBase instanceof EntityPlayer) { diff --git a/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertFloat.java b/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertFloat.java index 5885226f6f..ff515ab7d3 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertFloat.java +++ b/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertFloat.java @@ -1,6 +1,6 @@ package com.github.technus.tectech.mechanics.commands; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; @@ -25,7 +25,7 @@ public class ConvertFloat implements ICommand { float value=Float.parseFloat(args[0]); sender.addChatMessage(new ChatComponentText( EnumChatFormatting.AQUA.toString()+ EnumChatFormatting.BOLD + - Util.intBitsToShortString(Float.floatToIntBits(value))+" "+ + TT_Utility.intBitsToShortString(Float.floatToIntBits(value))+" "+ EnumChatFormatting.RESET+EnumChatFormatting.BLUE +value)); }catch (Exception e){ sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED+"Invalid Float "+args[0])); diff --git a/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertInteger.java b/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertInteger.java index 41edd66684..37651e7478 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertInteger.java +++ b/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertInteger.java @@ -1,6 +1,6 @@ package com.github.technus.tectech.mechanics.commands; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; @@ -25,7 +25,7 @@ public class ConvertInteger implements ICommand { int value=Integer.parseInt(args[0]); sender.addChatMessage(new ChatComponentText( EnumChatFormatting.AQUA.toString()+ EnumChatFormatting.BOLD + - Util.intBitsToShortString(value)+" "+ + TT_Utility.intBitsToShortString(value)+" "+ EnumChatFormatting.RESET+EnumChatFormatting.BLUE +value)); }catch (Exception e){ sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED+"Invalid Integer "+args[0])); diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataMessage.java b/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataMessage.java index 6094d08ba4..216c4057ef 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataMessage.java +++ b/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataMessage.java @@ -1,7 +1,7 @@ package com.github.technus.tectech.mechanics.data; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import cpw.mods.fml.common.network.ByteBufUtils; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.MessageContext; @@ -80,7 +80,7 @@ public class ChunkDataMessage implements IMessage { public static class ClientHandler extends AbstractClientMessageHandler { @Override public IMessage handleClientMessage(EntityPlayer pPlayer, ChunkDataData pMessage, MessageContext pCtx) { - if(Util.checkChunkExist(pPlayer.worldObj,pMessage.chunk)){ + if(TT_Utility.checkChunkExist(pPlayer.worldObj,pMessage.chunk)){ TecTech.chunkDataHandler.putChunkData(pMessage.handler, pMessage.worldId,pMessage.chunk, pMessage.data); } return null; diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/PlayerPersistence.java b/src/main/java/com/github/technus/tectech/mechanics/data/PlayerPersistence.java index f69bccc871..beda03fe0a 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/data/PlayerPersistence.java +++ b/src/main/java/com/github/technus/tectech/mechanics/data/PlayerPersistence.java @@ -1,6 +1,6 @@ package com.github.technus.tectech.mechanics.data; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import com.github.technus.tectech.loader.NetworkDispatcher; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent; @@ -32,7 +32,7 @@ public class PlayerPersistence { if(tag!=null){ return tag; } - tag=Util.getPlayerData(uuid1,uuid2,extension); + tag= TT_Utility.getPlayerData(uuid1,uuid2,extension); if(tag==null){ tag=new NBTTagCompound(); } @@ -58,7 +58,7 @@ public class PlayerPersistence { } public void saveData(EntityPlayer player){ - Util.savePlayerFile(player,extension,getDataOrSetToNewTag(player)); + TT_Utility.savePlayerFile(player,extension,getDataOrSetToNewTag(player)); } @SubscribeEvent diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/EMList.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/EMList.java index fe542abbde..0f71a24d82 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/EMList.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/EMList.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.mechanics.elementalMatter.core.commands; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMType; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; @@ -28,7 +28,7 @@ public class EMList implements ICommand { if(args.length == 0) { listClasses(sender); }else { - String concated = Util.getConcated(args, " "); + String concated = TT_Utility.getConcated(args, " "); listDefinitions(sender,concated, concated.replaceAll(" ","_"),concated.replaceAll("_"," ")); } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/EMPrimitiveTemplate.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/EMPrimitiveTemplate.java index a1f606c3c2..edf1827a07 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/EMPrimitiveTemplate.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/EMPrimitiveTemplate.java @@ -9,7 +9,7 @@ import net.minecraft.nbt.NBTTagCompound; import java.util.ArrayList; import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_scanner.*; -import static com.github.technus.tectech.util.Util.areBitsSet; +import static com.github.technus.tectech.util.TT_Utility.areBitsSet; import static net.minecraft.util.StatCollector.translateToLocal; /** diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMInstanceStackMap.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMInstanceStackMap.java index 265d219168..bfaad77c33 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMInstanceStackMap.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMInstanceStackMap.java @@ -7,6 +7,8 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.reg import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMDefinitionStack; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMInstanceStack; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.IEMStack; +import com.github.technus.tectech.util.TT_Utility; +import gregtech.api.util.GT_Utility; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -94,9 +96,9 @@ public final class EMInstanceStackMap extends EMStackMap implem for (EMInstanceStack instance : getBackingMap().values()) { info[i++] = EnumChatFormatting.BLUE + instance.getDefinition().getLocalizedName()+ " "+ EnumChatFormatting.AQUA + instance.getDefinition().getSymbol()+ EnumChatFormatting.RESET+ - " #: " + EnumChatFormatting.GREEN + String.format("%.3E", instance.getAmount() /AVOGADRO_CONSTANT) +" "+translateToLocal("tt.keyword.mol")+ EnumChatFormatting.RESET+ - " E: " + EnumChatFormatting.GREEN + instance.getEnergy() + EnumChatFormatting.RESET+ - " T: " + EnumChatFormatting.GREEN + (instance.getLifeTime()<0?"STABLE":String.format("%.3E",instance.getLifeTime())); + " #: " + EnumChatFormatting.GREEN + TT_Utility.formatNumberExp(instance.getAmount() /AVOGADRO_CONSTANT) +" "+translateToLocal("tt.keyword.mol")+ EnumChatFormatting.RESET+ + " E: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(instance.getEnergy()) + EnumChatFormatting.RESET+ + " T: " + EnumChatFormatting.GREEN + (instance.getLifeTime()<0?translateToLocal("tt.keyword.stable"):TT_Utility.formatNumberShortExp(instance.getLifeTime())); } return info; } @@ -165,17 +167,6 @@ public final class EMInstanceStackMap extends EMStackMap implem return new EMInstanceStackMap(false, instances); } - @Override - public boolean equals(Object obj) { - if (obj instanceof EMInstanceStackMap) { - return compareTo((EMInstanceStackMap) obj) == 0; - } - if (obj instanceof EMStackMap) { - return toDefinitionMapForComparison().compareTo((EMStackMap) obj) == 0; - } - return false; - } - @Override public String toString() { StringBuilder build=new StringBuilder("Instance Stack Map\n"); @@ -197,6 +188,7 @@ public final class EMInstanceStackMap extends EMStackMap implem return newStack; } + @Deprecated public EMDefinitionStackMap toDefinitionMapForComparison() { EMDefinitionStack[] list = new EMDefinitionStack[size()]; int i = 0; diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMStackMap.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMStackMap.java index 795ac3d3bf..3765fe6098 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMStackMap.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMStackMap.java @@ -30,11 +30,11 @@ abstract class EMStackMap implements IEMMapRead { @Override public boolean equals(Object obj) { - if (obj instanceof EMInstanceStackMap) { - return compareTo(((EMInstanceStackMap) obj).toDefinitionMapForComparison()) == 0; + if(this == obj){ + return true; } - if (obj instanceof EMStackMap) { - return compareTo((EMStackMap) obj) == 0; + if (obj instanceof IEMMapRead) { + return compareTo((IEMMapRead) obj) == 0; } return false; } @@ -47,4 +47,9 @@ abstract class EMStackMap implements IEMMapRead { } return hash; } + + @Override + public int compareTo(IEMMapRead o) { + return IEMMapRead.super.compareTo(o); + } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/IEMMapRead.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/IEMMapRead.java index c0420fa2b2..86ca6de8a8 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/IEMMapRead.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/IEMMapRead.java @@ -14,7 +14,7 @@ import static com.github.technus.tectech.mechanics.elementalMatter.core.transfor import static com.github.technus.tectech.util.DoubleCount.ulpSigned; import static net.minecraft.util.StatCollector.translateToLocal; -public interface IEMMapRead extends Comparable>, Cloneable { +public interface IEMMapRead extends Comparable>, Cloneable { NavigableMap getBackingMap(); IEMMapRead clone(); diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/EMInstanceStack.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/EMInstanceStack.java index b67d2ce121..d37a8bd099 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/EMInstanceStack.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/EMInstanceStack.java @@ -7,7 +7,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEM import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMDefinitionsRegistry; import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMConstantStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import net.minecraft.client.Minecraft; import net.minecraft.crash.CrashReport; import net.minecraft.nbt.NBTTagCompound; @@ -505,26 +505,26 @@ public final class EMInstanceStack implements IEMStack { public void addScanResults(ArrayList lines, int[] detailsOnDepthLevels) { int capabilities = detailsOnDepthLevels[0]; - if (Util.areBitsSet(SCAN_GET_DEPTH_LEVEL, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_DEPTH_LEVEL, capabilities)) { lines.add("DEPTH = " + 0); } getDefinition().addScanResults(lines, capabilities, energy); - if (Util.areBitsSet(SCAN_GET_TIMESPAN_MULT, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_TIMESPAN_MULT, capabilities)) { lines.add("TIME MULT = " + lifeTimeMult); - if (Util.areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)) { lines.add("TIME SPAN = " + lifeTime + " s"); } } - if (Util.areBitsSet(SCAN_GET_AGE, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_AGE, capabilities)) { lines.add("AGE = " + getAge() + " s"); } - if (Util.areBitsSet(SCAN_GET_COLOR, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_COLOR, capabilities)) { lines.add("COLOR = " + color + " RGB or CMY"); } - if (Util.areBitsSet(SCAN_GET_ENERGY_LEVEL, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_ENERGY_LEVEL, capabilities)) { lines.add("ENERGY = " + energy); } - if (Util.areBitsSet(SCAN_GET_AMOUNT, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_AMOUNT, capabilities)) { lines.add("AMOUNT = " + getAmount() /AVOGADRO_CONSTANT + " "+translateToLocal("tt.keyword.mol")); } scanContents(lines, getDefinition().getSubParticles(), 1, detailsOnDepthLevels); @@ -535,11 +535,11 @@ public final class EMInstanceStack implements IEMStack { int deeper = depth + 1; for (EMDefinitionStack definitionStack : definitions.valuesToArray()) { lines.add("");//def separator - if (Util.areBitsSet(SCAN_GET_DEPTH_LEVEL, detailsOnDepthLevels[depth])) { + if (TT_Utility.areBitsSet(SCAN_GET_DEPTH_LEVEL, detailsOnDepthLevels[depth])) { lines.add("DEPTH = " + depth); } getDefinition().addScanResults(lines, detailsOnDepthLevels[depth], energy); - if (Util.areBitsSet(SCAN_GET_AMOUNT, detailsOnDepthLevels[depth])) { + if (TT_Utility.areBitsSet(SCAN_GET_AMOUNT, detailsOnDepthLevels[depth])) { lines.add("AMOUNT = " + definitionStack.getAmount()); } scanContents(lines, definitionStack.getDefinition().getSubParticles(), deeper, detailsOnDepthLevels); diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMAtomDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMAtomDefinition.java index 0eced7bd3c..20e58216c1 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMAtomDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMAtomDefinition.java @@ -14,7 +14,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.transformations import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMGaugeBosonDefinition; import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMLeptonDefinition; import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMNeutrinoDefinition; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import com.github.technus.tectech.util.XSTR; import java.util.*; @@ -1676,35 +1676,35 @@ public class EMAtomDefinition extends EMComplexTemplate { @Override public void addScanShortSymbols(ArrayList lines, int capabilities, long energyLevel) { - if (Util.areBitsSet(SCAN_GET_NOMENCLATURE | SCAN_GET_CHARGE | SCAN_GET_MASS | SCAN_GET_TIMESPAN_INFO, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_NOMENCLATURE | SCAN_GET_CHARGE | SCAN_GET_MASS | SCAN_GET_TIMESPAN_INFO, capabilities)) { lines.add(getShortSymbol()); } } @Override public void addScanResults(ArrayList lines, int capabilities, long energyLevel) { - if (Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) { lines.add("CLASS = " + getIndirectTagValue() + ' ' + getMatterMassType()); } - if (Util.areBitsSet(SCAN_GET_NOMENCLATURE | SCAN_GET_CHARGE | SCAN_GET_MASS | SCAN_GET_TIMESPAN_INFO, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_NOMENCLATURE | SCAN_GET_CHARGE | SCAN_GET_MASS | SCAN_GET_TIMESPAN_INFO, capabilities)) { lines.add("NAME = " + getLocalizedName()); lines.add("SYMBOL = " + getSymbol()); } - if (Util.areBitsSet(SCAN_GET_CHARGE, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_CHARGE, capabilities)) { lines.add("CHARGE = " + getCharge() / 3D + " e"); } - if (Util.areBitsSet(SCAN_GET_COLOR, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_COLOR, capabilities)) { lines.add(hasColor() ? "COLORLESS" : "CARRIES COLOR"); } - if (Util.areBitsSet(SCAN_GET_MASS, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_MASS, capabilities)) { lines.add("MASS = " + getMass() + " eV/c\u00b2"); } - if (iaeaDefinitionExistsAndHasEnergyLevels && Util.areBitsSet(SCAN_GET_ENERGY_STATES, capabilities)) { + if (iaeaDefinitionExistsAndHasEnergyLevels && TT_Utility.areBitsSet(SCAN_GET_ENERGY_STATES, capabilities)) { for (int i = 1; i < getIaea().getEnergeticStatesArray().length; i++) { lines.add("E LEVEL " + i + " = " + getIaea().getEnergeticStatesArray()[i].energy + " eV"); } } - if (Util.areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)) { lines.add("HALF LIFE = " + getRawTimeSpan(energyLevel) + " s"); lines.add(" At current energy level"); } diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMHadronDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMHadronDefinition.java index 19208fbf4a..85cb07ea33 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMHadronDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMHadronDefinition.java @@ -15,7 +15,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.transformations import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry; import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.OreDictionaryStack; import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMQuarkDefinition; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import net.minecraftforge.oredict.OreDictionary; @@ -461,30 +461,30 @@ public class EMHadronDefinition extends EMComplexTemplate {//TODO Optimize map i @Override public void addScanShortSymbols(ArrayList lines, int capabilities, long energyLevel) { - if (Util.areBitsSet(SCAN_GET_NOMENCLATURE | SCAN_GET_CHARGE | SCAN_GET_MASS | SCAN_GET_TIMESPAN_INFO, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_NOMENCLATURE | SCAN_GET_CHARGE | SCAN_GET_MASS | SCAN_GET_TIMESPAN_INFO, capabilities)) { lines.add(getShortSymbol()); } } @Override public void addScanResults(ArrayList lines, int capabilities, long energyLevel) { - if (Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) { lines.add("CLASS = " + getIndirectTagValue() + ' ' + getMatterMassType()); } - if (Util.areBitsSet(SCAN_GET_NOMENCLATURE | SCAN_GET_CHARGE | SCAN_GET_MASS | SCAN_GET_TIMESPAN_INFO, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_NOMENCLATURE | SCAN_GET_CHARGE | SCAN_GET_MASS | SCAN_GET_TIMESPAN_INFO, capabilities)) { lines.add("NAME = " + getLocalizedTypeName()); //lines.add("SYMBOL = "+getSymbol()); } - if (Util.areBitsSet(SCAN_GET_CHARGE, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_CHARGE, capabilities)) { lines.add("CHARGE = " + getCharge() / 3D + " e"); } - if (Util.areBitsSet(SCAN_GET_COLOR, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_COLOR, capabilities)) { lines.add(hasColor() ? "COLORLESS" : "CARRIES COLOR"); } - if (Util.areBitsSet(SCAN_GET_MASS, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_MASS, capabilities)) { lines.add("MASS = " + getMass() + " eV/c\u00b2"); } - if (Util.areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)) { + if (TT_Utility.areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)) { lines.add("HALF LIFE = " + getRawTimeSpan(energyLevel) + " s"); lines.add(" " + "At current energy level"); } diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMNuclideIAEA.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMNuclideIAEA.java index bd34733cb6..e5fab5e6bf 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMNuclideIAEA.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMNuclideIAEA.java @@ -8,7 +8,7 @@ import java.util.HashSet; import java.util.TreeMap; import static com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition.STABLE_RAW_LIFE_TIME; -import static com.github.technus.tectech.util.Util.splitButDifferent; +import static com.github.technus.tectech.util.TT_Utility.splitButDifferent; public final class EMNuclideIAEA { public static final double AMU_TO_EV_DIV_C_C=9.31494061E08D,MICRO_AMU_TO_EV_DIV_C_C=9.31494061E02D; diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java index 114dc7399f..85e9fa26ec 100644 --- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java +++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java @@ -215,8 +215,8 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { int tSpecial = ((CachedDefaultRecipe) arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; short ampere=(short) (tSpecial & 0xFFFF),minComputationPerSec=(short)(tSpecial>>>16); if (tEUt != 0) { - drawText(10, 73, trans("152","Max Total: ") + GT_Utility.formatNumbers((1+ (computation-minComputationPerSec) /minComputationPerSec) * (long)tEUt * ampere * 20) + " EU", -16777216); - drawText(10, 83, trans("153","Usage: ") + GT_Utility.formatNumbers((long)tEUt*ampere) + " EU/t", -16777216); + drawText(10, 73, trans("152","Max Total: ") + GT_Utility.formatNumbers((1 + (computation - minComputationPerSec) / minComputationPerSec) * (long) tEUt * ampere * 20) + " EU", -16777216); + drawText(10, 83, trans("153","Usage: ") + GT_Utility.formatNumbers((long) tEUt * ampere) + " EU/t", -16777216); if (mRecipeMap.mShowVoltageAmperageInNEI) { drawText(10, 93, trans("154","Voltage: ") + GT_Utility.formatNumbers(tEUt) + " EU", -16777216); drawText(10, 103, trans("155","Amperage: ") + GT_Utility.formatNumbers(ampere), -16777216); diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java index 2dc4604fd5..50035be554 100644 --- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java +++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java @@ -215,8 +215,8 @@ public class TT_NEI_ScannerHandler extends TemplateRecipeHandler { int tSpecial = ((CachedDefaultRecipe) arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; short ampere=(short) (tSpecial & 0xFFFF),minComputationPerSec=(short)(tSpecial>>>16); if (tEUt != 0) { - drawText(10, 73, trans("152","Max Total: ") + GT_Utility.formatNumbers((1+ (computation-minComputationPerSec) /minComputationPerSec) * (long)tEUt * ampere * 20) + " EU", -16777216); - drawText(10, 83, trans("153","Usage: ") + GT_Utility.formatNumbers((long)tEUt*ampere) + " EU/t", -16777216); + drawText(10, 73, trans("152","Max Total: ") + GT_Utility.formatNumbers((1 + (computation - minComputationPerSec) / minComputationPerSec) * (long) tEUt * ampere * 20) + " EU", -16777216); + drawText(10, 83, trans("153","Usage: ") + GT_Utility.formatNumbers((long) tEUt * ampere) + " EU/t", -16777216); if (mRecipeMap.mShowVoltageAmperageInNEI) { drawText(10, 93, trans("154","Voltage: ") + GT_Utility.formatNumbers(tEUt) + " EU", -16777216); drawText(10, 103, trans("155","Amperage: ") + GT_Utility.formatNumbers(ampere), -16777216); diff --git a/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_EnderFluidLink.java b/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_EnderFluidLink.java index d6b5e28b18..7266611b20 100644 --- a/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_EnderFluidLink.java +++ b/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_EnderFluidLink.java @@ -3,6 +3,7 @@ package com.github.technus.tectech.thing.cover; import com.github.technus.tectech.loader.NetworkDispatcher; import com.github.technus.tectech.mechanics.enderStorage.EnderLinkCoverMessage; import com.github.technus.tectech.mechanics.enderStorage.EnderLinkTag; +import com.github.technus.tectech.util.TT_Utility; import eu.usrv.yamcore.auxiliary.PlayerChatHelper; import gregtech.api.enums.GT_Values; import gregtech.api.gui.GT_GUICover; @@ -325,7 +326,7 @@ public class GT_Cover_TM_EnderFluidLink extends GT_CoverBehavior { @Override public void resetTextBox(GT_GuiIntegerTextBox box) { //Solid White becomes: #FFFFFFFF - box.setText("#" + String.format("%08X", tag.getColorInt())); + box.setText("#" + TT_Utility.formatNumberIntHex(tag.getColorInt())); } public void resetColorField() { diff --git a/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java b/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java index b8ce40b180..7d7880adca 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java @@ -9,7 +9,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstance import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMInstanceStack; import com.github.technus.tectech.thing.item.renderElemental.IElementalItem; import com.github.technus.tectech.util.CommonValues; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -120,7 +120,7 @@ public final class DebugElementalInstanceContainer_EM extends Item implements IE NBTTagCompound tNBT = aStack.getTagCompound(); if (tNBT != null && tNBT.hasKey("info")) { aList.add(translateToLocal("item.em.debugContainer.desc.0") + ": ");//Contains - Collections.addAll(aList, Util.infoFromNBT(tNBT.getCompoundTag("info"))); + Collections.addAll(aList, TT_Utility.infoFromNBT(tNBT.getCompoundTag("info"))); } else { aList.add(translateToLocal("item.em.debugContainer.desc.1"));//Container for elemental matter aList.add(EnumChatFormatting.BLUE + translateToLocal("item.em.debugContainer.desc.2"));//Right click on elemental hatches @@ -155,7 +155,7 @@ public final class DebugElementalInstanceContainer_EM extends Item implements IE try { NBTTagCompound tNBT = aStack.getTagCompound(); if (tNBT != null && tNBT.hasKey("symbols")) { - String[] strings=Util.infoFromNBT(tNBT.getCompoundTag("symbols")); + String[] strings= TT_Utility.infoFromNBT(tNBT.getCompoundTag("symbols")); return strings[index%strings.length]; } else { return null; diff --git a/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionContainer_EM.java b/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionContainer_EM.java index 0de8bb007a..dede2e36ce 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionContainer_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionContainer_EM.java @@ -6,7 +6,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.EMException; import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMConstantStackMap; import com.github.technus.tectech.thing.item.renderElemental.IElementalItem; import com.github.technus.tectech.util.CommonValues; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.gui.FontRenderer; @@ -114,7 +114,7 @@ public final class ElementalDefinitionContainer_EM extends Item implements IElem NBTTagCompound tNBT = aStack.getTagCompound(); if (tNBT != null && tNBT.hasKey("info")) { aList.add(translateToLocal("item.em.definitionContainer.desc.0") + ": ");//Should Contain - Collections.addAll(aList, Util.infoFromNBT(tNBT.getCompoundTag("info"))); + Collections.addAll(aList, TT_Utility.infoFromNBT(tNBT.getCompoundTag("info"))); } else { aList.add(translateToLocal("item.em.definitionContainer.desc.1"));//Recipe Hint } @@ -140,7 +140,7 @@ public final class ElementalDefinitionContainer_EM extends Item implements IElem try { NBTTagCompound tNBT = aStack.getTagCompound(); if (tNBT != null && tNBT.hasKey("symbols")) { - String[] strings=Util.infoFromNBT(tNBT.getCompoundTag("symbols")); + String[] strings= TT_Utility.infoFromNBT(tNBT.getCompoundTag("symbols")); return strings[index%strings.length]; } else { return null; diff --git a/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java b/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java index 1cb6de1df6..22fc6e65a9 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java @@ -7,7 +7,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstance import com.github.technus.tectech.thing.CustomItemList; import com.github.technus.tectech.thing.item.renderElemental.IElementalItem; import com.github.technus.tectech.util.CommonValues; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -65,7 +65,7 @@ public final class ElementalDefinitionScanStorage_EM extends Item implements IEl public static String[] getLines(ItemStack containerItem){ if(containerItem.stackTagCompound!=null && containerItem.stackTagCompound.hasKey("elementalInfo")) { - return Util.infoFromNBT(containerItem.stackTagCompound.getCompoundTag("elementalInfo")); + return TT_Utility.infoFromNBT(containerItem.stackTagCompound.getCompoundTag("elementalInfo")); } return null; } @@ -142,7 +142,7 @@ public final class ElementalDefinitionScanStorage_EM extends Item implements IEl try { NBTTagCompound tNBT = aStack.getTagCompound(); if (tNBT != null && tNBT.hasKey("symbols")) { - String[] strings=Util.infoFromNBT(tNBT.getCompoundTag("symbols")); + String[] strings= TT_Utility.infoFromNBT(tNBT.getCompoundTag("symbols")); return strings[index%strings.length]; } else { return null; diff --git a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java index 7f9e0f0a4a..aff84c9b4b 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java @@ -1,7 +1,7 @@ package com.github.technus.tectech.thing.item; import com.github.technus.tectech.util.CommonValues; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Param; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_ParamText; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; @@ -146,13 +146,13 @@ public final class ParametrizerMemoryCard extends Item { aList.add("Hatch ID: "+EnumChatFormatting.AQUA + tNBT.getInteger("param")); temp=tNBT.getInteger("value0D"); aList.add("Value 0D: "+EnumChatFormatting.AQUA + temp); - aList.add("Value 0B: "+EnumChatFormatting.AQUA + Util.longBitsToShortString(Double.doubleToLongBits(temp))); + aList.add("Value 0B: "+EnumChatFormatting.AQUA + TT_Utility.longBitsToShortString(Double.doubleToLongBits(temp))); if(tNBT.hasKey("value0s")) { aList.add("Value 0s: " + EnumChatFormatting.AQUA + tNBT.getString("value0s")); } temp=tNBT.getInteger("value1D"); aList.add("Value 1D: "+EnumChatFormatting.AQUA + temp); - aList.add("Value 1B: "+EnumChatFormatting.AQUA + Util.longBitsToShortString(Double.doubleToLongBits(temp))); + aList.add("Value 1B: "+EnumChatFormatting.AQUA + TT_Utility.longBitsToShortString(Double.doubleToLongBits(temp))); if(tNBT.hasKey("value1s")) { aList.add("Value 1s: " + EnumChatFormatting.AQUA + tNBT.getString("value1s")); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java index 4e07622c25..1e90535224 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java @@ -3,7 +3,7 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Capacitor; import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Capacitor; import cpw.mods.fml.relauncher.Side; @@ -24,7 +24,7 @@ import java.util.HashMap; import java.util.Map; import static com.github.technus.tectech.util.CommonValues.V; -import static com.github.technus.tectech.util.Util.getUniqueIdentifier; +import static com.github.technus.tectech.util.TT_Utility.getUniqueIdentifier; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static net.minecraft.util.StatCollector.translateToLocal; @@ -38,7 +38,7 @@ public class GT_MetaTileEntity_Hatch_Capacitor extends GT_MetaTileEntity_Hatch { public GT_MetaTileEntity_Hatch_Capacitor(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 16, ""); - Util.setTier(aTier, this); + TT_Utility.setTier(aTier, this); } public GT_MetaTileEntity_Hatch_Capacitor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeData.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeData.java index 815f8006c4..eb9ce2af30 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeData.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeData.java @@ -1,7 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.util.CommonValues; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket; import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Data; import com.github.technus.tectech.mechanics.pipe.IConnectsToDataPipe; @@ -22,7 +22,7 @@ import static net.minecraft.util.StatCollector.translateToLocal; public class GT_MetaTileEntity_Hatch_CreativeData extends GT_MetaTileEntity_Hatch_DataConnector { public GT_MetaTileEntity_Hatch_CreativeData(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, ""); - Util.setTier(aTier,this); + TT_Utility.setTier(aTier,this); } public GT_MetaTileEntity_Hatch_CreativeData(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java index 42817f473e..5279da2b00 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java @@ -1,7 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.util.CommonValues; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -22,7 +22,7 @@ public class GT_MetaTileEntity_Hatch_CreativeMaintenance extends GT_MetaTileEnti public GT_MetaTileEntity_Hatch_CreativeMaintenance(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier); - Util.setTier(aTier,this); + TT_Utility.setTier(aTier,this); } public GT_MetaTileEntity_Hatch_CreativeMaintenance(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java index 4aa90339cc..3385447861 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java @@ -1,7 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.util.CommonValues; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.util.TT_Utility; import com.github.technus.tectech.mechanics.dataTransport.DataPacket; import com.github.technus.tectech.mechanics.pipe.IConnectsToDataPipe; import cpw.mods.fml.relauncher.Side; @@ -41,7 +41,7 @@ public abstract class GT_MetaTileEntity_Hatch_DataConnector