aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Robertz <dream-master@gmx.net>2022-02-08 22:15:43 +0100
committerMartin Robertz <dream-master@gmx.net>2022-02-08 22:15:43 +0100
commit539c60bb8df31a972b023751a4710c3d949e2845 (patch)
treef9d23730b5c36995fb0adb94bb29b52cdeff7101
parent044967421a6b2f4b01a09d4b80d7704db56e14be (diff)
parentda2529429f0745600a9e4afa2b7f358397271ae2 (diff)
downloadGT5-Unofficial-539c60bb8df31a972b023751a4710c3d949e2845.tar.gz
GT5-Unofficial-539c60bb8df31a972b023751a4710c3d949e2845.tar.bz2
GT5-Unofficial-539c60bb8df31a972b023751a4710c3d949e2845.zip
Merge remote-tracking branch 'Technus/master' into upstream
# Conflicts: # dependencies.gradle
-rw-r--r--dependencies.gradle8
-rw-r--r--dependencies/WorldEditCuiFe-v1.0.7-mf-1.7.10-10.13.4.1566.jarbin0 -> 93851 bytes
-rw-r--r--src/main/java/com/github/technus/tectech/TecTech.java2
-rw-r--r--src/main/java/com/github/technus/tectech/compatibility/dreamcraft/NoDreamCraftMachineLoader.java2
-rw-r--r--src/main/java/com/github/technus/tectech/compatibility/openComputers/AvrArchitecture.java2
-rw-r--r--src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretheads/TurretHeadItemEM.java2
-rw-r--r--src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/EMComplexAspectDefinition.java39
-rw-r--r--src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/transformations/AspectDefinitionCompatEnabled.java2
-rw-r--r--src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java8
-rw-r--r--src/main/java/com/github/technus/tectech/font/TecTechFontRender.java90
-rw-r--r--src/main/java/com/github/technus/tectech/loader/MainLoader.java5
-rw-r--r--src/main/java/com/github/technus/tectech/loader/TecTechConfig.java3
-rw-r--r--src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java2
-rw-r--r--src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java5
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/anomaly/CancerCommand.java14
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/anomaly/ChargeCommand.java6
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/anomaly/MassCommand.java6
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/data/PlayerPersistence.java2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/EMGive.java2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/decay/EMDecay.java2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/EMComplexTemplate.java4
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/EMPrimitiveTemplate.java40
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/IEMDefinition.java68
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMConstantStackMap.java15
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMDefinitionStackMap.java15
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMInstanceStackMap.java124
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMStackMap.java9
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/IEMMapRead.java61
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/IEMMapWrite.java16
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/IEMMapWriteExact.java24
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/recipes/EMRecipeMap.java3
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/EMDefinitionStack.java2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/EMInstanceStack.java56
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMAtomDefinition.java48
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMHadronDefinition.java35
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMGaugeBosonDefinition.java3
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMLeptonDefinition.java3
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMNeutrinoDefinition.java12
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMPrimitiveDefinition.java4
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMScalarBosonDefinition.java3
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/spark/RendererMessage.java1
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/tesla/TeslaCoverConnection.java1
-rw-r--r--src/main/java/com/github/technus/tectech/proxy/ClientProxy.java1
-rw-r--r--src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsBA0.java1
-rw-r--r--src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsTT.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_EnderFluidLink.java3
-rw-r--r--src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_TeslaCoil.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java69
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionContainer_EM.java52
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java71
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/EuMeterGT.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java32
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCapacitor.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/TeslaStaff.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/gui/ScanDisplayScreen.java126
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/renderElemental/IElementalItem.java16
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/renderElemental/RenderElementalName.java8
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeData.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputData.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputDataItems.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java10
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java8
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/TextParametersMessage.java12
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamText.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java60
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java118
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedExtendedFacingTexture.java894
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_collider/GT_MetaTileEntity_EM_collider.java3
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_MicroController.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_OwnerDetector.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java8
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java2
-rw-r--r--src/main/java/com/github/technus/tectech/util/CommonValues.java49
-rw-r--r--src/main/java/com/github/technus/tectech/util/DoubleCount.java3
-rw-r--r--src/main/java/com/github/technus/tectech/util/TT_Utility.java335
-rw-r--r--src/main/resources/assets/tectech/lang/en_US.lang54
99 files changed, 926 insertions, 1882 deletions
diff --git a/dependencies.gradle b/dependencies.gradle
index 6fbbce96c2..5dd7cef74e 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -5,9 +5,11 @@ dependencies {
compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.31:dev")
compile("com.github.GTNewHorizons:Yamcl:0.5.82:dev")
- compile('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev') {
- transitive = false
- }
+ compile("com.github.GTNewHorizons:NotEnoughItems:2.1.22-GTNH:dev")
+ compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.1:dev")
+ compile("com.github.GTNewHorizons:CodeChickenCore:1.1.3:dev")
+ compile("com.github.GTNewHorizons:StructureLib:1.0.14:dev")
+ compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
compileOnly("com.github.GTNewHorizons:OpenComputers:1.7.5.21-GTNH:dev") {
transitive = false
diff --git a/dependencies/WorldEditCuiFe-v1.0.7-mf-1.7.10-10.13.4.1566.jar b/dependencies/WorldEditCuiFe-v1.0.7-mf-1.7.10-10.13.4.1566.jar
new file mode 100644
index 0000000000..2891f1480f
--- /dev/null
+++ b/dependencies/WorldEditCuiFe-v1.0.7-mf-1.7.10-10.13.4.1566.jar
Binary files differ
diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java
index c281304205..fe85fc08c5 100644
--- a/src/main/java/com/github/technus/tectech/TecTech.java
+++ b/src/main/java/com/github/technus/tectech/TecTech.java
@@ -2,8 +2,8 @@ package com.github.technus.tectech;
import com.github.technus.tectech.loader.MainLoader;
import com.github.technus.tectech.loader.TecTechConfig;
-import com.github.technus.tectech.loader.gui.CreativeTabTecTech;
import com.github.technus.tectech.loader.gui.CreativeTabEM;
+import com.github.technus.tectech.loader.gui.CreativeTabTecTech;
import com.github.technus.tectech.mechanics.anomaly.AnomalyHandler;
import com.github.technus.tectech.mechanics.anomaly.CancerCommand;
import com.github.technus.tectech.mechanics.anomaly.ChargeCommand;
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 c8eda64bea..90274c69e6 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,10 +2,10 @@ 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.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;
+import com.github.technus.tectech.util.TT_Utility;
import cpw.mods.fml.common.Loader;
import gregtech.api.enums.GT_Values;
import gregtech.api.interfaces.ITexture;
diff --git a/src/main/java/com/github/technus/tectech/compatibility/openComputers/AvrArchitecture.java b/src/main/java/com/github/technus/tectech/compatibility/openComputers/AvrArchitecture.java
index 595d814fc5..ceadce9d6d 100644
--- a/src/main/java/com/github/technus/tectech/compatibility/openComputers/AvrArchitecture.java
+++ b/src/main/java/com/github/technus/tectech/compatibility/openComputers/AvrArchitecture.java
@@ -8,8 +8,8 @@ import com.github.technus.avrClone.instructions.exceptions.DelayEvent;
import com.github.technus.avrClone.memory.EepromMemory;
import com.github.technus.avrClone.memory.RemovableMemory;
import com.github.technus.avrClone.memory.program.ProgramMemory;
-import com.github.technus.tectech.util.Converter;
import com.github.technus.tectech.TecTech;
+import com.github.technus.tectech.util.Converter;
import li.cil.oc.Settings;
import li.cil.oc.api.Driver;
import li.cil.oc.api.driver.Item;
diff --git a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretheads/TurretHeadItemEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretheads/TurretHeadItemEM.java
index f4ad25f053..ce11976020 100644
--- a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretheads/TurretHeadItemEM.java
+++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretheads/TurretHeadItemEM.java
@@ -37,7 +37,7 @@ public class TurretHeadItemEM extends ItemBlock {
list.add(EnumChatFormatting.DARK_PURPLE + "--" + translateToLocal("tooltip.damage.label") + "--");
list.add(translateToLocal("tooltip.damage.stat") + ": " + EnumChatFormatting.WHITE + (float)ConfigHandler.getLaserTurretSettings().getDamage() / 2.0F + ' ' + translateToLocal("tooltip.health"));
list.add(translateToLocal("tooltip.aoe") + ": " + EnumChatFormatting.WHITE + '0');
- list.add(translateToLocal("tooltip.firerate") + ": " + EnumChatFormatting.WHITE + df.format((double)(20.0F / (float)ConfigHandler.getLaserTurretSettings().getFireRate())));
+ list.add(translateToLocal("tooltip.firerate") + ": " + EnumChatFormatting.WHITE + df.format(20.0F / (float)ConfigHandler.getLaserTurretSettings().getFireRate()));
list.add(translateToLocal("tooltip.energy.stat") + ": " + EnumChatFormatting.WHITE + ConfigHandler.getLaserTurretSettings().getPowerUsage() + " RF");
list.add("");
list.add(EnumChatFormatting.DARK_GRAY + translateToLocal("flavour.turret.4"));
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 be1ed9bd51..c2d93cf0fd 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
@@ -6,18 +6,14 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.EMException;
import com.github.technus.tectech.mechanics.elementalMatter.core.decay.EMDecay;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.EMComplexTemplate;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition;
-import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMIndirectType;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMDefinitionsRegistry;
+import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMIndirectType;
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.TT_Utility;
-
-import java.util.ArrayList;
import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
import static com.github.technus.tectech.mechanics.elementalMatter.core.decay.EMDecay.NO_DECAY;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMGaugeBosonDefinition.deadEnd;
-import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_scanner.*;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -125,7 +121,7 @@ public final class EMComplexAspectDefinition extends EMComplexTemplate {
}
@Override
- protected String getIndirectTagValue() {
+ protected String getTagValue() {
return nbtType;
}
@@ -230,35 +226,4 @@ public final class EMComplexAspectDefinition extends EMComplexTemplate {
public int hashCode() {
return hash;
}
-
- @Override
- public void addScanShortSymbols(ArrayList<String> lines, int capabilities, long energyLevel) {
- if (TT_Utility.areBitsSet(SCAN_GET_NOMENCLATURE | SCAN_GET_CHARGE | SCAN_GET_MASS, capabilities)) {
- lines.add(getShortSymbol());
- }
- }
-
- @Override
- public void addScanResults(ArrayList<String> lines, int capabilities, long energyLevel) {
- if (TT_Utility.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) {
- lines.add(translateToLocal("tt.keyword.CLASS") + " = " + nbtType + ' ' + getMatterMassType());
- }
- 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 (TT_Utility.areBitsSet(SCAN_GET_CHARGE, capabilities)) {
- lines.add(translateToLocal("tt.keyword.CHARGE") + " = " + getCharge() / 3f + " e");
- }
- if (TT_Utility.areBitsSet(SCAN_GET_COLOR, capabilities)) {
- lines.add(hasColor() ? translateToLocal("tt.keyword.COLORLESS") : translateToLocal("tt.keyphrase.CARRIES_COLOR"));
- }
- if (TT_Utility.areBitsSet(SCAN_GET_MASS, capabilities)) {
- lines.add(translateToLocal("tt.keyword.MASS") + " = " + getMass() + " eV/c\u00b2");
- }
- 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/compatibility/thaumcraft/elementalMatter/transformations/AspectDefinitionCompatEnabled.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/transformations/AspectDefinitionCompatEnabled.java
index ccccff7c3d..5b47414dc0 100644
--- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/transformations/AspectDefinitionCompatEnabled.java
+++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/transformations/AspectDefinitionCompatEnabled.java
@@ -2,8 +2,8 @@ package com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.tran
import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.EMComplexAspectDefinition;
import com.github.technus.tectech.mechanics.elementalMatter.core.EMException;
-import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMDefinitionsRegistry;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition;
+import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMDefinitionsRegistry;
import thaumcraft.api.aspects.Aspect;
import java.util.ArrayList;
diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java
index e91dd2c4af..2a9f7ec6d2 100644
--- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java
+++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java
@@ -65,7 +65,7 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_
.addElement('*', ofTileAdder(essentiaContainerCompat::check, StructureLibAPI.getBlockHint(),12))
.build();
- private String outputEssentiaName;
+ private String outputEssentiaName= "";
//endregion
public GT_MetaTileEntity_EM_essentiaDequantizer(int aID, String aName, String aNameRegional) {
@@ -107,7 +107,7 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_
outputEssentiaName = essentiaContainerCompat.getEssentiaName(stack.getDefinition());
Aspect aspect = Aspect.getAspect(outputEssentiaName);
if (aspect == null) {
- outputEssentiaName = null;
+ outputEssentiaName = "";
cleanStackEM_EM(inputHatchContainer.removeKey(stack.getDefinition()));
mEUt = (int) -V[7];
} else {
@@ -135,7 +135,7 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_
stopMachine();
}
}
- outputEssentiaName = null;
+ outputEssentiaName = "";
}
@Override
@@ -166,7 +166,7 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_
@Override
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
- aNBT.setString("eOutputEssentia",outputEssentiaName);
+ aNBT.setString("eOutputEssentia", outputEssentiaName);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/font/TecTechFontRender.java b/src/main/java/com/github/technus/tectech/font/TecTechFontRender.java
index 826ed3af5d..60c3df47f9 100644
--- a/src/main/java/com/github/technus/tectech/font/TecTechFontRender.java
+++ b/src/main/java/com/github/technus/tectech/font/TecTechFontRender.java
@@ -7,9 +7,13 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
+import java.io.IOException;
+import java.io.InputStream;
+
@SideOnly(Side.CLIENT)
public class TecTechFontRender extends FontRenderer {
public static final TecTechFontRender INSTANCE = new TecTechFontRender();
@@ -52,15 +56,15 @@ public class TecTechFontRender extends FontRenderer {
p_78258_4_ = (p_78258_4_ & 16579836) >> 2 | p_78258_4_ & -16777216;
}
- this.red = (float)(p_78258_4_ >> 16 & 255) / 255.0F;
- this.blue = (float)(p_78258_4_ >> 8 & 255) / 255.0F;
- this.green = (float)(p_78258_4_ & 255) / 255.0F;
- this.alpha = (float)(p_78258_4_ >> 24 & 255) / 255.0F;
+ this.red = (float) (p_78258_4_ >> 16 & 255) / 255.0F;
+ this.blue = (float) (p_78258_4_ >> 8 & 255) / 255.0F;
+ this.green = (float) (p_78258_4_ & 255) / 255.0F;
+ this.alpha = (float) (p_78258_4_ >> 24 & 255) / 255.0F;
this.setColor(this.red, this.blue, this.green, this.alpha);
- this.posX = (float)p_78258_2_;
- this.posY = (float)p_78258_3_;
+ this.posX = (float) p_78258_2_;
+ this.posY = (float) p_78258_3_;
this.renderStringAtPos(p_78258_1_, p_78258_5_);
- return (int)this.posX;
+ return (int) this.posX;
}
}
@@ -75,10 +79,10 @@ public class TecTechFontRender extends FontRenderer {
}
private void renderStringAtPos(String p_78255_1_, boolean p_78255_2_) {
- for(int i = 0; i < p_78255_1_.length(); ++i) {
+ for (int i = 0; i < p_78255_1_.length(); ++i) {
char c0 = p_78255_1_.charAt(i);
- int j;
- int k;
+ int j;
+ int k;
if (c0 == 167 && i + 1 < p_78255_1_.length()) {
j = "0123456789abcdefklmnor".indexOf(p_78255_1_.toLowerCase().charAt(i + 1));
if (j < 16) {
@@ -97,7 +101,7 @@ public class TecTechFontRender extends FontRenderer {
k = this.colorCode[j];
this.textColor = k;
- this.setColor((float)(k >> 16) / 255.0F, (float)(k >> 8 & 255) / 255.0F, (float)(k & 255) / 255.0F, this.alpha);
+ this.setColor((float) (k >> 16) / 255.0F, (float) (k >> 8 & 255) / 255.0F, (float) (k & 255) / 255.0F, this.alpha);
} else if (j == 16) {
this.randomStyle = true;
} else if (j == 17) {
@@ -123,12 +127,12 @@ public class TecTechFontRender extends FontRenderer {
if (this.randomStyle && j != -1) {
do {
k = this.fontRandom.nextInt(this.charWidth.length);
- } while(this.charWidth[j] != this.charWidth[k]);
+ } while (this.charWidth[j] != this.charWidth[k]);
j = k;
}
- float f1 = this.unicodeFlag ? 0.5F : 1.0F;
+ float f1 = this.unicodeFlag ? 0.5F : 1.0F;
boolean flag1 = (c0 == 0 || j == -1 || this.unicodeFlag) && p_78255_2_;
if (flag1) {
this.posX -= f1;
@@ -164,11 +168,51 @@ public class TecTechFontRender extends FontRenderer {
}
+ @Override
+ protected void doDraw(float f) {
+ Tessellator tessellator = Tessellator.instance;
+
+ if (this.strikethroughStyle) {
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ tessellator.startDrawingQuads();
+ tessellator.addVertex(this.posX, this.posY + (float) (this.FONT_HEIGHT / 2), 0.0D);
+ tessellator.addVertex(this.posX + f, this.posY + (float) (this.FONT_HEIGHT / 2), 0.0D);
+ tessellator.addVertex(this.posX + f, this.posY + (float) (this.FONT_HEIGHT / 2) - 1.0F, 0.0D);
+ tessellator.addVertex(this.posX, this.posY + (float) (this.FONT_HEIGHT / 2) - 1.0F, 0.0D);
+ tessellator.draw();
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ }
+
+ if (this.underlineStyle) {
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ tessellator.startDrawingQuads();
+ int l = this.underlineStyle ? -1 : 0;
+ tessellator.addVertex(this.posX + (float) l, this.posY + (float) this.FONT_HEIGHT, 0.0D);
+ tessellator.addVertex(this.posX + f, this.posY + (float) this.FONT_HEIGHT, 0.0D);
+ tessellator.addVertex(this.posX + f, this.posY + (float) this.FONT_HEIGHT - 1.0F, 0.0D);
+ tessellator.addVertex(this.posX + (float) l, this.posY + (float) this.FONT_HEIGHT - 1.0F, 0.0D);
+ tessellator.draw();
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ }
+
+ this.posX += (float) ((int) f);
+ }
+
private float renderCharAtPos(int p_78278_1_, char p_78278_2_, boolean p_78278_3_) {
return p_78278_2_ == ' ' ? 4.0F : ("\u00C0\u00C1\u00C2\u00C8\u00CA\u00CB\u00CD\u00D3\u00D4\u00D5\u00DA\u00DF\u00E3\u00F5\u011F\u0130\u0131\u0152\u0153\u015E\u015F\u0174\u0175\u017E\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00C7\u00FC\u00E9\u00E2\u00E4\u00E0\u00E5\u00E7\u00EA\u00EB\u00E8\u00EF\u00EE\u00EC\u00C4\u00C5\u00C9\u00E6\u00C6\u00F4\u00F6\u00F2\u00FB\u00F9\u00FF\u00D6\u00DC\u00F8\u00A3\u00D8\u00D7\u0192\u00E1\u00ED\u00F3\u00FA\u00F1\u00D1\u00AA\u00BA\u00BF\u00AE\u00AC\u00BD\u00BC\u00A1\u00AB\u00BB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\u03B2\u0393\u03C0\u03A3\u03C3\u03BC\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u2205\u2208\u2229\u2261\u00B1\u2265\u2264\u2320\u2321\u00F7\u2248\u00B0\u2219\u00B7\u221A\u207F\u00B2\u25A0\u0000".indexOf(p_78278_2_) != -1 && !this.unicodeFlag ? this.renderDefaultChar(p_78278_1_, p_78278_3_) : this.renderUnicodeChar(p_78278_2_, p_78278_3_));
}
@Override
+ protected float renderDefaultChar(int p_78266_1_, boolean p_78266_2_) {
+ return super.renderDefaultChar(p_78266_1_, p_78266_2_);
+ }
+
+ @Override
+ protected float renderUnicodeChar(char p_78277_1_, boolean p_78277_2_) {
+ return super.renderUnicodeChar(p_78277_1_, p_78277_2_);
+ }
+
+ @Override
public int drawString(String str, int x, int y, int color, boolean dropShadow) {
switch (Minecraft.getMinecraft().gameSettings.guiScale) {
case 0:
@@ -306,6 +350,26 @@ public class TecTechFontRender extends FontRenderer {
}
}
+ @Override
+ protected void setColor(float r, float g, float b, float a) {
+ super.setColor(r, g, b, a);
+ }
+
+ @Override
+ protected void enableAlpha() {
+ super.enableAlpha();
+ }
+
+ @Override
+ protected void bindTexture(ResourceLocation location) {
+ super.bindTexture(location);
+ }
+
+ @Override
+ protected InputStream getResourceInputStream(ResourceLocation location) throws IOException {
+ return super.getResourceInputStream(location);
+ }
+
private int drawStringFront(String p_85187_1_, int p_85187_2_, int p_85187_3_, int p_85187_4_) {
GL11.glEnable(3008);
resetStyles();
diff --git a/src/main/java/com/github/technus/tectech/loader/MainLoader.java b/src/main/java/com/github/technus/tectech/loader/MainLoader.java
index 2a1bd59357..7965f09aff 100644
--- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java
+++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java
@@ -6,8 +6,8 @@ import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.trans
import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.transformations.AspectDefinitionCompatEnabled;
import com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat;
import com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompatEnabled;
-import com.github.technus.tectech.loader.gui.CreativeTabTecTech;
import com.github.technus.tectech.loader.gui.CreativeTabEM;
+import com.github.technus.tectech.loader.gui.CreativeTabTecTech;
import com.github.technus.tectech.loader.gui.ModGuiHandler;
import com.github.technus.tectech.loader.recipe.BaseRecipeLoader;
import com.github.technus.tectech.loader.thing.ComponentLoader;
@@ -41,12 +41,11 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
-import static com.github.technus.tectech.util.CommonValues.*;
import static com.github.technus.tectech.TecTech.*;
import static com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.transformations.AspectDefinitionCompat.aspectDefinitionCompat;
import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat.essentiaContainerCompat;
import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
-import static com.github.technus.tectech.TecTech.creativeTabTecTech;
+import static com.github.technus.tectech.util.CommonValues.*;
import static gregtech.api.enums.GT_Values.W;
public final class MainLoader {
diff --git a/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java b/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java
index 66e549ddb1..aa6d1e5e9f 100644
--- a/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java
+++ b/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java
@@ -11,6 +11,7 @@ public class TecTechConfig extends ConfigManager {
//final static to allow compiler to remove the debug code when this is false
public static boolean DEBUG_MODE = false;
+ public static boolean POWERLESS_MODE = false;
public boolean DISABLE_MATERIAL_LOADING_FFS;
public boolean BOOM_ENABLE;
@@ -82,6 +83,8 @@ public class TecTechConfig extends ConfigManager {
protected void Init() {
DEBUG_MODE = _mainConfig.getBoolean("DebugMode", "debug", DEBUG_MODE,
"Enables logging and other purely debug features");
+ POWERLESS_MODE = _mainConfig.getBoolean("PowerlessMode", "debug", POWERLESS_MODE,
+ "Enables 0EU/t multi block machinery");
DISABLE_MATERIAL_LOADING_FFS = _mainConfig.getBoolean("DisableMaterialLoading", "debug",
DISABLE_MATERIAL_LOADING_FFS, "Set to true to disable gregtech material processing");
diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java
index 4dd9d3422d..65cba0a2b7 100644
--- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java
+++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java
@@ -17,8 +17,8 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.EM_COUNT_PER_MATERIAL_AMOUNT;
-import static com.github.technus.tectech.util.CommonValues.V;
import static com.github.technus.tectech.thing.CustomItemList.*;
+import static com.github.technus.tectech.util.CommonValues.V;
/**
* Created by danie_000 on 16.11.2016.
diff --git a/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java
index d144d74618..7c32bb70d2 100644
--- a/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java
+++ b/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java
@@ -7,7 +7,10 @@ import com.github.technus.tectech.compatibility.openmodularturrets.blocks.turret
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.block.QuantumStuffBlock;
import com.github.technus.tectech.thing.block.ReactorSimBlock;
-import com.github.technus.tectech.thing.casing.*;
+import com.github.technus.tectech.thing.casing.GT_Block_CasingsBA0;
+import com.github.technus.tectech.thing.casing.GT_Block_CasingsNH;
+import com.github.technus.tectech.thing.casing.GT_Block_CasingsTT;
+import com.github.technus.tectech.thing.casing.TT_Container_Casings;
import com.github.technus.tectech.thing.item.*;
import cpw.mods.fml.common.Loader;
import gregtech.api.enums.Textures;
diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/CancerCommand.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/CancerCommand.java
index bb61f50aab..fdbd98fee0 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/CancerCommand.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/CancerCommand.java
@@ -15,13 +15,20 @@ public class CancerCommand implements ICommand {
public CancerCommand(){
aliases.add("cancer_EM");
aliases.add("cancer");
+ aliases.add("sanser_EM");
aliases.add("sanser");
+ aliases.add("sancer_EM");
aliases.add("sancer");
}
@Override
public void processCommand(ICommandSender sender, String[] args) {
if (sender instanceof EntityPlayerMP && !sender.getEntityWorld().isRemote) {
+ EntityPlayerMP player=(EntityPlayerMP)sender;
+ if(args==null || args.length==0){
+ sender.addChatMessage(new ChatComponentText("Cancer amount: "+TecTech.anomalyHandler.getCancer(player)));
+ return;
+ }
double amount;
try {
amount = Double.parseDouble(args[0]);
@@ -29,11 +36,6 @@ public class CancerCommand implements ICommand {
sender.addChatMessage(new ChatComponentText("Cannot parse amount!"));
return;
}
- if(amount<0||amount>2){
- sender.addChatMessage(new ChatComponentText("Invalid amount provided!"));
- return;
- }
- EntityPlayerMP player=(EntityPlayerMP)sender;
if(player.capabilities.isCreativeMode){
sender.addChatMessage(new ChatComponentText("Doesn't really work in creative mode!"));
}else {
@@ -65,7 +67,7 @@ public class CancerCommand implements ICommand {
@Override
public String getCommandUsage(ICommandSender p_71518_1_) {
- return "cancer_EM [Amount 0.0-2.0]";
+ return "cancer_EM [Amount]";
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/ChargeCommand.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/ChargeCommand.java
index 4190cd0dba..b486b73295 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/ChargeCommand.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/ChargeCommand.java
@@ -20,6 +20,11 @@ public class ChargeCommand implements ICommand {
@Override
public void processCommand(ICommandSender sender, String[] args) {
if (sender instanceof EntityPlayerMP && !sender.getEntityWorld().isRemote) {
+ EntityPlayerMP player=(EntityPlayerMP)sender;
+ if(args==null || args.length==0){
+ sender.addChatMessage(new ChatComponentText("Charge amount: "+TecTech.anomalyHandler.getCharge(player)));
+ return;
+ }
double amount;
try {
amount = Double.parseDouble(args[0]);
@@ -27,7 +32,6 @@ public class ChargeCommand implements ICommand {
sender.addChatMessage(new ChatComponentText("Cannot parse amount!"));
return;
}
- EntityPlayerMP player=(EntityPlayerMP)sender;
if(player.capabilities.isCreativeMode){
sender.addChatMessage(new ChatComponentText("Doesn't really work in creative mode!"));
}else {
diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/MassCommand.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/MassCommand.java
index 3d0ade5082..05bba9433b 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/MassCommand.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/MassCommand.java
@@ -20,6 +20,11 @@ public class MassCommand implements ICommand {
@Override
public void processCommand(ICommandSender sender, String[] args) {
if (sender instanceof EntityPlayerMP && !sender.getEntityWorld().isRemote) {
+ EntityPlayerMP player=(EntityPlayerMP)sender;
+ if(args==null || args.length==0){
+ sender.addChatMessage(new ChatComponentText("Msdd amount: "+TecTech.anomalyHandler.getMass(player)));
+ return;
+ }
double amount;
try {
amount = Double.parseDouble(args[0]);
@@ -27,7 +32,6 @@ public class MassCommand implements ICommand {
sender.addChatMessage(new ChatComponentText("Cannot parse amount!"));
return;
}
- EntityPlayerMP player=(EntityPlayerMP)sender;
if(player.capabilities.isCreativeMode){
sender.addChatMessage(new ChatComponentText("Doesn't really work in creative mode!"));
}else {
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 beda03fe0a..b31b1a6b76 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,7 +1,7 @@
package com.github.technus.tectech.mechanics.data;
-import com.github.technus.tectech.util.TT_Utility;
import com.github.technus.tectech.loader.NetworkDispatcher;
+import com.github.technus.tectech.util.TT_Utility;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
import net.minecraft.entity.player.EntityPlayer;
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/EMGive.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/EMGive.java
index 4824053668..eed30a7974 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/EMGive.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/EMGive.java
@@ -1,13 +1,13 @@
package com.github.technus.tectech.mechanics.elementalMatter.core.commands;
import com.github.technus.tectech.TecTech;
+import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMDefinitionsRegistry;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMIndirectType;
import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMDefinitionStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap;
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.definitions.IEMDefinition;
import com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/decay/EMDecay.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/decay/EMDecay.java
index a6bd623414..dfd1551c49 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/decay/EMDecay.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/decay/EMDecay.java
@@ -1,10 +1,10 @@
package com.github.technus.tectech.mechanics.elementalMatter.core.decay;
+import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition;
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.mechanics.elementalMatter.core.stacks.EMDefinitionStack;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMInstanceStack;
-import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition;
import static com.github.technus.tectech.util.DoubleCount.mul;
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/EMComplexTemplate.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/EMComplexTemplate.java
index 13838cf443..be22092163 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/EMComplexTemplate.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/EMComplexTemplate.java
@@ -60,8 +60,8 @@ public abstract class EMComplexTemplate implements IEMDefinition {
}
public NBTTagCompound toNBT(EMDefinitionsRegistry registry) {
- return registry.indirectToNBT(getIndirectTagValue(),getSubParticles());
+ return registry.indirectToNBT(getTagValue(),getSubParticles());
}
- protected abstract String getIndirectTagValue();
+ protected abstract String getTagValue();
}
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 edf1827a07..272e7cffc0 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
@@ -1,15 +1,10 @@
package com.github.technus.tectech.mechanics.elementalMatter.core.definitions;
-import com.github.technus.tectech.mechanics.elementalMatter.core.EMException;
import com.github.technus.tectech.mechanics.elementalMatter.core.decay.EMDecay;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMDefinitionsRegistry;
import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMConstantStackMap;
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.TT_Utility.areBitsSet;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -169,8 +164,8 @@ public abstract class EMPrimitiveTemplate extends EMComplexTemplate {
}
@Override
- protected final String getIndirectTagValue() {
- throw new EMException("This class should only be used directly!");
+ protected final String getTagValue() {
+ return bind;
}
@Override
@@ -183,37 +178,6 @@ public abstract class EMPrimitiveTemplate extends EMComplexTemplate {
}
@Override
- public void addScanShortSymbols(ArrayList<String> lines, int capabilities, long energyLevel) {
- if(areBitsSet(SCAN_GET_NOMENCLATURE|SCAN_GET_CHARGE|SCAN_GET_MASS|SCAN_GET_TIMESPAN_INFO, capabilities)) {
- lines.add(getShortSymbol());
- }
- }
-
- @Override
- public void addScanResults(ArrayList<String> lines, int capabilities, long energyLevel) {
- if(areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) {
- lines.add("DIRECT = " + bind + ' ' + getMatterMassType());
- }
- if(areBitsSet(SCAN_GET_NOMENCLATURE|SCAN_GET_CHARGE|SCAN_GET_MASS|SCAN_GET_TIMESPAN_INFO, capabilities)) {
- lines.add("NAME = "+ getLocalizedName());
- lines.add("SYMBOL = "+getSymbol());
- }
- if(areBitsSet(SCAN_GET_CHARGE,capabilities)) {
- lines.add("CHARGE = " + getCharge() / 3D + " e");
- }
- if(areBitsSet(SCAN_GET_COLOR,capabilities)) {
- lines.add(hasColor() ? "COLORLESS" : "CARRIES COLOR");
- }
- if(areBitsSet(SCAN_GET_MASS,capabilities)) {
- lines.add("MASS = " + getMass() + " eV/c\u00b2");
- }
- if(areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)){
- lines.add((isTimeSpanHalfLife()?"HALF LIFE = ":"LIFE TIME = ")+getRawTimeSpan(energyLevel)+ " s");
- lines.add(" "+"At current energy level");
- }
- }
-
- @Override
public final int compareTo(IEMDefinition o) {
if (getMatterMassType() == o.getMatterMassType()) {
int oID = ((EMPrimitiveTemplate) o).ID;
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/IEMDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/IEMDefinition.java
index aae5a8caca..ee123735f8 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/IEMDefinition.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/IEMDefinition.java
@@ -4,18 +4,23 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.decay.EMDecay;
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.TT_Utility;
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.TT_Utility.areBitsSet;
+import static net.minecraft.util.StatCollector.translateToLocal;
+
/**
* Created by danie_000 on 11.11.2016.
*/
-public interface IEMDefinition extends Comparable<IEMDefinition>,Cloneable {//IMMUTABLE
- double STABLE_RAW_LIFE_TIME =1.5e36D;
- double NO_DECAY_RAW_LIFE_TIME =-1D;
- long DEFAULT_ENERGY_LEVEL =0;
- double DEFAULT_ENERGY_REQUIREMENT =25000D;//legit cuz normal atoms should only emit a gamma if they don't have defined energy levels
+public interface IEMDefinition extends Comparable<IEMDefinition>, Cloneable {//IMMUTABLE
+ double STABLE_RAW_LIFE_TIME = 1.5e36D;
+ double NO_DECAY_RAW_LIFE_TIME = -1D;
+ long DEFAULT_ENERGY_LEVEL = 0;
+ double DEFAULT_ENERGY_REQUIREMENT = 25000D;//legit cuz normal atoms should only emit a gamma if they don't have defined energy levels
//add text based creators for recipe formula input?
//Nomenclature
@@ -23,17 +28,52 @@ public interface IEMDefinition extends Comparable<IEMDefinition>,Cloneable {//IM
String getShortLocalizedName();
- default String getLocalizedName(){
- return getLocalizedTypeName()+": "+getShortLocalizedName();
+ default String getLocalizedName() {
+ return getLocalizedTypeName() + ": " + getShortLocalizedName();
}
String getShortSymbol();
String getSymbol();
- void addScanShortSymbols(ArrayList<String> lines, int capabilities, long energyLevel);
+ default void addScanShortSymbols(ArrayList<String> lines, int capabilities, long energyLevel, EMDefinitionsRegistry registry) {
+ if (areBitsSet(SCAN_GET_NOMENCLATURE | SCAN_GET_CLASS_TYPE | SCAN_GET_CHARGE | SCAN_GET_MASS | SCAN_GET_TIMESPAN_INFO, capabilities)) {
+ lines.add(getShortSymbol());
+ }
+ }
- void addScanResults(ArrayList<String> lines, int capabilities, long energyLevel);
+ default void addScanResults(ArrayList<String> lines, int capabilities, long energyLevel, EMDefinitionsRegistry registry) {
+ if (TT_Utility.areBitsSet(SCAN_GET_CLASS_TYPE | SCAN_GET_CHARGE | SCAN_GET_MASS | SCAN_GET_TIMESPAN_INFO, capabilities)) {
+ lines.add(translateToLocal("tt.keyword.scan.class") +
+ " = " + registry.getTypes().get(getClass()).getLocalizedName());
+ if (areBitsSet(SCAN_GET_NOMENCLATURE, capabilities)) {
+ lines.add(translateToLocal("tt.keyword.scan.name") +
+ " = " + getLocalizedName());
+ lines.add(translateToLocal("tt.keyword.scan.symbol") +
+ " = " + getSymbol());
+ }
+ }
+ if (areBitsSet(SCAN_GET_CHARGE, capabilities)) {
+ lines.add(translateToLocal("tt.keyword.scan.charge") +
+ " = " + getCharge() / 3D + " " + translateToLocal("tt.keyword.unit.charge"));
+ }
+ if (areBitsSet(SCAN_GET_COLORABLE, capabilities)) {
+ lines.add(hasColor() ?
+ translateToLocal("tt.keyword.scan.colored") :
+ translateToLocal("tt.keyword.scan.colorless"));
+ }
+ if (areBitsSet(SCAN_GET_MASS, capabilities)) {
+ lines.add(translateToLocal("tt.keyword.scan.mass") +
+ " = " + getMass() + " " + translateToLocal("tt.keyword.unit.mass"));
+ }
+ if (areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)) {
+ lines.add((isTimeSpanHalfLife() ?
+ translateToLocal("tt.keyword.scan.half_life") :
+ translateToLocal("tt.keyword.scan.life_time")) +
+ " = " + getRawTimeSpan(energyLevel) + " " + translateToLocal("tt.keyword.unit.time"));
+ lines.add(" " + translateToLocal("tt.keyphrase.scan.at_current_energy_level"));
+ }
+ }
int getMatterMassType();//bigger number means bigger things usually, but it is just used to differentiate between classes of iED
@@ -65,8 +105,8 @@ public interface IEMDefinition extends Comparable<IEMDefinition>,Cloneable {//IM
//dynamically changing stuff
int getMaxColors();
- default boolean hasColor(){
- return getMaxColors()>0;
+ default boolean hasColor() {
+ return getMaxColors() > 0;
}
double getRawTimeSpan(long currentEnergy);//defined in static fields or generated
@@ -77,11 +117,11 @@ public interface IEMDefinition extends Comparable<IEMDefinition>,Cloneable {//IM
NBTTagCompound toNBT(EMDefinitionsRegistry registry);
- default EMDefinitionStack getStackForm(double amount){
- return new EMDefinitionStack(this,amount);
+ default EMDefinitionStack getStackForm(double amount) {
+ return new EMDefinitionStack(this, amount);
}
- default IEMDefinition clone(){
+ default IEMDefinition clone() {
return this;
}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMConstantStackMap.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMConstantStackMap.java
index f6bef9910e..ed2ebbab57 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMConstantStackMap.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMConstantStackMap.java
@@ -1,16 +1,16 @@
package com.github.technus.tectech.mechanics.elementalMatter.core.maps;
-import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMDefinitionsRegistry;
-import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMDefinitionStack;
import com.github.technus.tectech.mechanics.elementalMatter.core.EMException;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition;
+import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMDefinitionsRegistry;
+import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMDefinitionStack;
import net.minecraft.nbt.NBTTagCompound;
import java.util.Collections;
import java.util.NavigableMap;
import java.util.TreeMap;
-import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMPrimitiveDefinition.nbtE__;
+import static com.github.technus.tectech.util.TT_Utility.unpackNBT;
/**
* Created by Tec on 12.05.2017.
@@ -47,13 +47,6 @@ public final class EMConstantStackMap/*IMMUTABLE*/ extends EMStackMap<EMDefiniti
}
public static EMConstantStackMap fromNBT(EMDefinitionsRegistry registry, NBTTagCompound nbt) throws EMException {
- EMDefinitionStack[] defStacks = new EMDefinitionStack[nbt.getInteger("i")];
- for (int i = 0; i < defStacks.length; i++) {
- defStacks[i] = EMDefinitionStack.fromNBT(registry,nbt.getCompoundTag(Integer.toString(i)));
- if (defStacks[i].getDefinition().equals(nbtE__)) {
- throw new EMException("Something went Wrong");
- }
- }
- return new EMConstantStackMap(defStacks);
+ return new EMConstantStackMap(unpackNBT(EMDefinitionStack.class,inner -> EMDefinitionStack.fromNBT(registry, inner),nbt));
}
}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMDefinitionStackMap.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMDefinitionStackMap.java
index 57b8f7bf1c..6892e2cd59 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMDefinitionStackMap.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/EMDefinitionStackMap.java
@@ -1,15 +1,15 @@
package com.github.technus.tectech.mechanics.elementalMatter.core.maps;
-import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMDefinitionsRegistry;
-import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMDefinitionStack;
import com.github.technus.tectech.mechanics.elementalMatter.core.EMException;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition;
+import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMDefinitionsRegistry;
+import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMDefinitionStack;
import net.minecraft.nbt.NBTTagCompound;
import java.util.NavigableMap;
import java.util.TreeMap;
-import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMPrimitiveDefinition.nbtE__;
+import static com.github.technus.tectech.util.TT_Utility.unpackNBT;
/**
* Created by danie_000 on 22.01.2017.
@@ -45,13 +45,6 @@ public final class EMDefinitionStackMap extends EMStackMap<EMDefinitionStack> im
}
public static EMDefinitionStackMap fromNBT(EMDefinitionsRegistry registry, NBTTagCompound nbt) throws EMException {
- EMDefinitionStack[] defStacks = new EMDefinitionStack[nbt.getInteger("i")];
- for (int i = 0; i < defStacks.length; i++) {
- defStacks[i] = EMDefinitionStack.fromNBT(registry,nbt.getCompoundTag(Integer.toString(i)));
- if (defStacks[i].getDefinition().equals(nbtE__)) {
- throw new EMException("Something went Wrong");
- }
- }
- return new EMDefinitionStackMap(defStacks);
+ return new EMDefinitionStackMap(unpackNBT(EMDefinitionStack.class,inner -> EMDefinitionStack.fromNBT(registry, inner),nbt));
}
}
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 bfaad77c33..8a92c819df 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
@@ -18,8 +18,8 @@ import java.util.NavigableMap;
import java.util.TreeMap;
import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.AVOGADRO_CONSTANT;
-import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMPrimitiveDefinition.nbtE__;
import static com.github.technus.tectech.util.DoubleCount.add;
+import static com.github.technus.tectech.util.TT_Utility.unpackNBT;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -27,7 +27,8 @@ import static net.minecraft.util.StatCollector.translateToLocal;
*/
public final class EMInstanceStackMap extends EMStackMap<EMInstanceStack> implements IEMMapWrite<EMInstanceStack> {
//Constructors
- public EMInstanceStackMap() {}
+ public EMInstanceStackMap() {
+ }
public EMInstanceStackMap(EMInstanceStack... inSafe) {
this(true, inSafe);
@@ -35,8 +36,8 @@ public final class EMInstanceStackMap extends EMStackMap<EMInstanceStack> implem
public EMInstanceStackMap(boolean clone, EMInstanceStack... in) {
if (clone) {
- EMInstanceStack[] stacks =new EMInstanceStack[in.length];
- for(int i=0;i<stacks.length;i++) {
+ EMInstanceStack[] stacks = new EMInstanceStack[in.length];
+ for (int i = 0; i < stacks.length; i++) {
stacks[i] = in[i].clone();
}
putUnifyAll(stacks);
@@ -50,9 +51,9 @@ public final class EMInstanceStackMap extends EMStackMap<EMInstanceStack> implem
}
private EMInstanceStackMap(boolean clone, NavigableMap<IEMDefinition, EMInstanceStack> in) {
- super(clone?new TreeMap<>():in);
+ super(clone ? new TreeMap<>() : in);
if (clone) {
- for(EMInstanceStack stack:in.values()) {
+ for (EMInstanceStack stack : in.values()) {
putUnify(stack.clone());
}
}
@@ -72,11 +73,11 @@ public final class EMInstanceStackMap extends EMStackMap<EMInstanceStack> implem
public double removeOverflow(int stacksCount, double stackCapacity) {
double massRemoved = 0;
- if (getBackingMap().size() > stacksCount) {
+ if (size() > stacksCount) {
IEMDefinition[] keys = keySetToArray();
for (int i = stacksCount; i < keys.length; i++) {
- massRemoved += getBackingMap().get(keys[i]).getDefinitionStack().getMass();
- getBackingMap().remove(keys[i]);
+ massRemoved += get(keys[i]).getDefinitionStack().getMass();
+ removeKey(keys[i]);
}
}
@@ -91,44 +92,38 @@ public final class EMInstanceStackMap extends EMStackMap<EMInstanceStack> implem
//Getters
public String[] getElementalInfo() {
- String[] info = new String[getBackingMap().size()];
- int i = 0;
- for (EMInstanceStack instance : getBackingMap().values()) {
- info[i++] = EnumChatFormatting.BLUE + instance.getDefinition().getLocalizedName()+
- " "+ EnumChatFormatting.AQUA + instance.getDefinition().getSymbol()+ EnumChatFormatting.RESET+
- " #: " + 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()));
+ String[] info = new String[size()];
+ int i = 0;
+ for (Map.Entry<IEMDefinition, EMInstanceStack> entry : entrySet()) {
+ EMInstanceStack instance = entry.getValue();
+ info[i++] = EnumChatFormatting.BLUE + instance.getDefinition().getLocalizedName() + " " + EnumChatFormatting.AQUA + instance.getDefinition().getSymbol() + EnumChatFormatting.RESET +
+ " " + translateToLocal("tt.keyword.short.amount") + ": " + EnumChatFormatting.GREEN + TT_Utility.formatNumberExp(instance.getAmount() / AVOGADRO_CONSTANT) + " " + translateToLocal("tt.keyword.unit.mol") + EnumChatFormatting.RESET +
+ " " + translateToLocal("tt.keyword.short.energy") + ": " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(instance.getDefinition().getEnergyDiffBetweenStates(0, instance.getEnergy())) + " " + translateToLocal("tt.keyword.unit.energy") + EnumChatFormatting.RESET +
+ " " + translateToLocal("tt.keyword.short.charge") + ": " + EnumChatFormatting.GREEN + TT_Utility.formatNumberExp(instance.getCharge()) + " " + translateToLocal("tt.keyword.unit.charge") + EnumChatFormatting.RESET +
+ " " + translateToLocal("tt.keyword.short.time") + ": " + EnumChatFormatting.GREEN + (instance.getLifeTime() < 0 ?
+ translateToLocal("tt.keyword.stable") : TT_Utility.formatNumberShortExp(instance.getLifeTime()) + " " + translateToLocal("tt.keyword.unit.time")) + EnumChatFormatting.RESET;
}
return info;
}
- public ArrayList<String> getScanShortSymbols(int[] capabilities) {
- ArrayList<String> list=new ArrayList<>(16);
- for(Map.Entry<IEMDefinition, EMInstanceStack> e: getBackingMap().entrySet()){
- e.getValue().addScanShortSymbols(list,capabilities);
- }
- return list;
- }
-
public ArrayList<String> getScanInfo(int[] capabilities) {
- ArrayList<String> list=new ArrayList<>(16);
- for(Map.Entry<IEMDefinition, EMInstanceStack> e: getBackingMap().entrySet()){
- e.getValue().addScanResults(list,capabilities);
+ ArrayList<String> list = new ArrayList<>(16);
+ for (Map.Entry<IEMDefinition, EMInstanceStack> e : entrySet()) {
+ e.getValue().addScanResults(list, capabilities);
}
return list;
}
- public double tickContent(double lifeTimeMult, int postEnergize, double seconds){
+ public double tickContent(double lifeTimeMult, int postEnergize, double seconds) {
//cleanUp();
- double diff=0;
+ double diff = 0;
for (EMInstanceStack instance : takeAllToArray()) {
instance.setAge(instance.getAge() + seconds);
EMDecayResult newInstances = instance.decay(lifeTimeMult, instance.getAge(), postEnergize);
if (newInstances == null) {
putUnify(instance);
} else {
- diff=add(diff,newInstances.getMassDiff());
+ diff = add(diff, newInstances.getMassDiff());
putUnifyAll(newInstances.getOutput());
}
}
@@ -136,55 +131,28 @@ public final class EMInstanceStackMap extends EMStackMap<EMInstanceStack> implem
}
//NBT
- public NBTTagCompound getScanShortSymbolsNBT(int[] capabilities) {
- NBTTagCompound nbt = new NBTTagCompound();
- ArrayList<String> info = getScanShortSymbols(capabilities);
- nbt.setInteger("i", info.size());
- for (int i = 0; i < info.size(); i++) {
- nbt.setString(Integer.toString(i), info.get(i));
- }
- return nbt;
- }
-
- public NBTTagCompound getScanInfoNBT(int[] capabilities) {
- NBTTagCompound nbt = new NBTTagCompound();
- ArrayList<String> info = getScanInfo(capabilities);
- nbt.setInteger("i", info.size());
- for (int i = 0; i < info.size(); i++) {
- nbt.setString(Integer.toString(i), info.get(i));
- }
- return nbt;
- }
-
public static EMInstanceStackMap fromNBT(EMDefinitionsRegistry registry, NBTTagCompound nbt) throws EMException {
- EMInstanceStack[] instances = new EMInstanceStack[nbt.getInteger("i")];
- for (int i = 0; i < instances.length; i++) {
- instances[i] = EMInstanceStack.fromNBT(registry,nbt.getCompoundTag(Integer.toString(i)));
- if (instances[i].getDefinition().equals(nbtE__)) {
- throw new EMException("Something went Wrong");
- }
- }
- return new EMInstanceStackMap(false, instances);
+ return new EMInstanceStackMap(false, unpackNBT(EMInstanceStack.class, inner -> EMInstanceStack.fromNBT(registry, inner), nbt));
}
@Override
public String toString() {
- StringBuilder build=new StringBuilder("Instance Stack Map\n");
- for(EMInstanceStack stack: getBackingMap().values()){
- build.append(stack.toString()).append('\n');
+ StringBuilder build = new StringBuilder("Instance Stack Map\n");
+ for (Map.Entry<IEMDefinition, EMInstanceStack> stack : entrySet()) {
+ build.append(stack.getValue().toString()).append('\n');
}
return build.toString();
}
- public EMInstanceStack[] takeAllToArray(){
+ public EMInstanceStack[] takeAllToArray() {
EMInstanceStack[] newStack = valuesToArray();//just in case to uncouple The map
- this.getBackingMap().clear();
+ clear();
return newStack;
}
- public EMInstanceStackMap takeAll(){
- EMInstanceStackMap newStack =new EMInstanceStackMap(false,new TreeMap<>(this.getBackingMap()));//just in case to uncouple The map
- this.getBackingMap().clear();
+ public EMInstanceStackMap takeAll() {
+ EMInstanceStackMap newStack = new EMInstanceStackMap(false, new TreeMap<>(getBackingMap()));//just in case to uncouple The map
+ clear();
return newStack;
}
@@ -201,36 +169,36 @@ public final class EMInstanceStackMap extends EMStackMap<EMInstanceStack> implem
@Override
public EMInstanceStack putUnify(EMInstanceStack stack) {
- EMInstanceStack target =get(stack.getDefinition());
- if(target==null) {
+ EMInstanceStack target = get(stack.getDefinition());
+ if (target == null) {
putReplace(stack);
return stack;
}
double newAmount = add(target.getAmount(), stack.getAmount());
if (IEMStack.isValidAmount(newAmount)) {
- stack=target.unifyIntoThis(stack);
+ stack = target.unifyIntoThis(stack);
putReplace(stack);
return stack;
- }else {
- removeKey(stack);
+ } else {
+ removeKey(stack.getDefinition());
return null;
}
}
@Override
public EMInstanceStack putUnifyExact(EMInstanceStack stack) {
- EMInstanceStack target =get(stack.getDefinition());
- if(target==null) {
+ EMInstanceStack target = get(stack.getDefinition());
+ if (target == null) {
putReplace(stack);
return stack;
}
- double newAmount = target.getAmount()+stack.getAmount();
+ double newAmount = target.getAmount() + stack.getAmount();
if (IEMStack.isValidAmount(newAmount)) {
- stack=target.unifyIntoThis(stack);
+ stack = target.unifyIntoThis(stack);
putReplace(stack);
return stack;
- }else {
- removeKey(stack);
+ } else {
+ removeKey(stack.getDefinition());
return null;
}
}
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 3765fe6098..84b4123f32 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
@@ -1,8 +1,9 @@
package com.github.technus.tectech.mechanics.elementalMatter.core.maps;
-import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.IEMStack;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition;
+import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.IEMStack;
+import java.util.Map;
import java.util.NavigableMap;
import java.util.TreeMap;
@@ -41,9 +42,9 @@ abstract class EMStackMap<T extends IEMStack> implements IEMMapRead<T> {
@Override
public int hashCode() {//Hash only definitions to compare contents not amounts or data
- int hash = -(getBackingMap().size() << 4);
- for (T stack : getBackingMap().values()) {
- hash += stack.getDefinition().hashCode();
+ int hash = -(size() << 4);
+ for (Map.Entry<IEMDefinition, T> entry : entrySet()) {
+ hash += entry.getValue().getDefinition().hashCode();
}
return hash;
}
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 86ca6de8a8..6bd12a849b 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
@@ -1,17 +1,20 @@
package com.github.technus.tectech.mechanics.elementalMatter.core.maps;
import com.github.technus.tectech.TecTech;
+import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMDefinitionsRegistry;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.IEMStack;
-import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition;
+import com.github.technus.tectech.util.TT_Utility;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import java.lang.reflect.Array;
import java.util.*;
-import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.*;
+import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.AVOGADRO_CONSTANT;
+import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.EM_COUNT_EPSILON;
import static com.github.technus.tectech.util.DoubleCount.ulpSigned;
+import static com.github.technus.tectech.util.TT_Utility.packNBT;
import static net.minecraft.util.StatCollector.translateToLocal;
public interface IEMMapRead<T extends IEMStack> extends Comparable<IEMMapRead<? extends IEMStack>>, Cloneable {
@@ -87,53 +90,27 @@ public interface IEMMapRead<T extends IEMStack> extends Comparable<IEMMapRead<?
default String[] getShortSymbolsInfo() {
String[] info = new String[size()];
int i = 0;
- for (T instance : values()) {
- info[i++] = instance.getDefinition().getShortSymbol();
+ for (Map.Entry<IEMDefinition, T> instance : entrySet()) {
+ info[i++] = instance.getValue().getDefinition().getShortSymbol();
}
return info;
}
default String[] getElementalInfo() {
- String[] info = new String[size() * 3];
- int i = 0;
- for (T defStack : values()) {
- info[i] = EnumChatFormatting.BLUE + defStack.getDefinition().getLocalizedName();
- info[i + 1] = EnumChatFormatting.AQUA + defStack.getDefinition().getSymbol();
- info[i + 2] = "Amount " + EnumChatFormatting.GREEN + defStack.getAmount()/AVOGADRO_CONSTANT+" "+translateToLocal("tt.keyword.mol");
- i += 3;
+ String[] info = new String[size()];
+ int i = 0;
+ for (Map.Entry<IEMDefinition, T> entry : entrySet()) {
+ T instance = entry.getValue();
+ info[i++] = EnumChatFormatting.BLUE + instance.getDefinition().getLocalizedName() + " " + EnumChatFormatting.AQUA + instance.getDefinition().getSymbol() + EnumChatFormatting.RESET +
+ " " + translateToLocal("tt.keyword.short.amount") + ": " + EnumChatFormatting.GREEN + TT_Utility.formatNumberExp(instance.getAmount() / AVOGADRO_CONSTANT) + " " + translateToLocal("tt.keyword.unit.mol") + EnumChatFormatting.RESET +
+ " " + translateToLocal("tt.keyword.short.charge") + ": " + EnumChatFormatting.GREEN + TT_Utility.formatNumberExp(instance.getCharge()) + " " + translateToLocal("tt.keyword.unit.charge") + EnumChatFormatting.RESET;
}
return info;
}
//NBT
- default NBTTagCompound getShortSymbolsNBT() {
- NBTTagCompound nbt = new NBTTagCompound();
- String[] info = getShortSymbolsInfo();
- nbt.setInteger("i", info.length);
- for (int i = 0; i < info.length; i++) {
- nbt.setString(Integer.toString(i), info[i]);
- }
- return nbt;
- }
-
- default NBTTagCompound getInfoNBT() {
- NBTTagCompound nbt = new NBTTagCompound();
- String[] info = getElementalInfo();
- nbt.setInteger("i", info.length);
- for (int i = 0; i < info.length; i++) {
- nbt.setString(Integer.toString(i), info[i]);
- }
- return nbt;
- }
-
default NBTTagCompound toNBT(EMDefinitionsRegistry registry) {
- NBTTagCompound nbt = new NBTTagCompound();
- nbt.setInteger("i", size());
- int i = 0;
- for (Map.Entry<IEMDefinition, T> entry : entrySet()) {
- nbt.setTag(Integer.toString(i++), entry.getValue().toNBT(registry));
- }
- return nbt;
+ return packNBT(t -> t.toNBT(registry),valuesToArray());
}
@Override
@@ -143,11 +120,11 @@ public interface IEMMapRead<T extends IEMStack> extends Comparable<IEMMapRead<?
return sizeDiff;
}
- Iterator<T> iterator = values().iterator();
- Iterator<? extends IEMStack> iteratorO = o.values().iterator();
+ Iterator<Map.Entry<IEMDefinition, T>> iterator = entrySet().iterator();
+ Iterator<? extends Map.Entry<IEMDefinition, ? extends IEMStack>> iteratorO = o.entrySet().iterator();
while (iterator.hasNext()) {
- int result = iterator.next().compareTo(iteratorO.next());
+ int result = iterator.next().getValue().compareTo(iteratorO.next().getValue());
if (result != 0) {
return result;
}
@@ -232,7 +209,7 @@ public interface IEMMapRead<T extends IEMStack> extends Comparable<IEMMapRead<?
}
default boolean containsAmountExact(IEMDefinition def, double amount) {
- T target = getBackingMap().get(def);
+ T target = get(def);
return target != null && target.getAmount() >= amount;
}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/IEMMapWrite.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/IEMMapWrite.java
index 15815f2ee0..5f5581183d 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/IEMMapWrite.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/IEMMapWrite.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.mechanics.elementalMatter.core.maps;
-import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.IEMStack;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition;
+import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.IEMStack;
import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry;
import java.util.Map;
@@ -27,15 +27,15 @@ public interface IEMMapWrite<T extends IEMStack> extends IEMMapWriteExact<T> {
}
default boolean removeAmount(IEMDefinition def, double amountToConsume, double amountRequired){
- T current=getBackingMap().get(def);
+ T current=get(def);
if(current!=null){
if(current.getAmount()>=amountRequired){
double newAmount=sub(current.getAmount(),amountToConsume);
if(IEMStack.isValidAmount(newAmount)){
current=(T)current.mutateAmount(newAmount);
- getBackingMap().put(current.getDefinition(),current);
+ putReplace(current);
}else {
- getBackingMap().remove(current.getDefinition());
+ removeKey(current.getDefinition());
}
return true;
}
@@ -82,7 +82,7 @@ public interface IEMMapWrite<T extends IEMStack> extends IEMMapWriteExact<T> {
* @return new mapping or null if merging actually removed stuff
*/
default T putUnify(T stack) {
- T target=getBackingMap().get(stack.getDefinition());
+ T target=get(stack.getDefinition());
if(target==null) {
putReplace(stack);
return stack;
@@ -93,7 +93,7 @@ public interface IEMMapWrite<T extends IEMStack> extends IEMMapWriteExact<T> {
putReplace(stack);
return stack;
}else {
- removeKey(stack);
+ removeKey(stack.getDefinition());
return null;
}
}
@@ -105,8 +105,8 @@ public interface IEMMapWrite<T extends IEMStack> extends IEMMapWriteExact<T> {
}
default void putUnifyAll(IEMMapRead<T> inTreeUnsafe) {
- for (T in : inTreeUnsafe.values()) {
- putUnify(in);
+ for (Map.Entry<IEMDefinition, T> in : inTreeUnsafe.entrySet()) {
+ putUnify(in.getValue());
}
}
}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/IEMMapWriteExact.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/IEMMapWriteExact.java
index 9da971944c..ef1bc5a4f6 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/IEMMapWriteExact.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/maps/IEMMapWriteExact.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.mechanics.elementalMatter.core.maps;
-import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.IEMStack;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition;
+import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.IEMStack;
import java.util.Map;
@@ -21,10 +21,6 @@ public interface IEMMapWriteExact<T extends IEMStack> extends IEMMapRead<T> {
return getBackingMap().remove(def);
}
- default T removeKey(IEMStack has) {
- return removeKey(has.getDefinition());
- }
-
default boolean removeKeys(IEMDefinition... definitions) {
boolean hadAll=true;
for (IEMDefinition def : definitions) {
@@ -36,7 +32,7 @@ public interface IEMMapWriteExact<T extends IEMStack> extends IEMMapRead<T> {
default boolean removeKeys(IEMStack... hasElementalDefinition) {
boolean hadAll=true;
for (IEMStack has : hasElementalDefinition) {
- hadAll&=removeKey(has)!=null;
+ hadAll&=removeKey(has.getDefinition())!=null;
}
return hadAll;
}
@@ -55,7 +51,7 @@ public interface IEMMapWriteExact<T extends IEMStack> extends IEMMapRead<T> {
boolean hadAll=containsAllKeys(hasElementalDefinition);
if(hadAll){
for (IEMStack stack : hasElementalDefinition) {
- removeKey(stack);
+ removeKey(stack.getDefinition());
}
}
return hadAll;
@@ -91,15 +87,15 @@ public interface IEMMapWriteExact<T extends IEMStack> extends IEMMapRead<T> {
* @return
*/
default boolean removeAmountExact(IEMDefinition def, double amountToConsume){
- T current=getBackingMap().get(def);
+ T current=get(def);
if(current!=null){
double newAmount=current.getAmount()-amountToConsume;
if(newAmount>=0){
if(current.isValidAmount()){
current=(T)current.mutateAmount(newAmount);
- getBackingMap().put(current.getDefinition(),current);
+ putReplace(current);
} else {
- getBackingMap().remove(current.getDefinition());
+ removeKey(current.getDefinition());
}
return true;
}
@@ -136,7 +132,7 @@ public interface IEMMapWriteExact<T extends IEMStack> extends IEMMapRead<T> {
}
default T putUnifyExact(T stack) {
- T target=getBackingMap().get(stack.getDefinition());
+ T target=get(stack.getDefinition());
if(target==null) {
putReplace(stack);
return stack;
@@ -147,7 +143,7 @@ public interface IEMMapWriteExact<T extends IEMStack> extends IEMMapRead<T> {
putReplace(stack);
return stack;
}else {
- removeKey(stack);
+ removeKey(stack.getDefinition());
return null;
}
}
@@ -159,8 +155,8 @@ public interface IEMMapWriteExact<T extends IEMStack> extends IEMMapRead<T> {
}
default void putUnifyAllExact(IEMMapRead<T> inTreeUnsafe) {
- for (T in : inTreeUnsafe.values()) {
- putUnifyExact(in);
+ for (Map.Entry<IEMDefinition, T> in : inTreeUnsafe.entrySet()) {
+ putUnifyExact(in.getValue());
}
}
}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/recipes/EMRecipeMap.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/recipes/EMRecipeMap.java
index 811a9bc370..95a4aaf595 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/recipes/EMRecipeMap.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/recipes/EMRecipeMap.java
@@ -1,6 +1,7 @@
package com.github.technus.tectech.mechanics.elementalMatter.core.recipes;
-import com.github.technus.tectech.mechanics.elementalMatter.core.maps.*;
+import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMConstantStackMap;
+import com.github.technus.tectech.mechanics.elementalMatter.core.maps.IEMMapRead;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMDefinitionStack;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.IEMStack;
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/EMDefinitionStack.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/EMDefinitionStack.java
index c1e6a729f8..2abee4c36e 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/EMDefinitionStack.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/EMDefinitionStack.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.mechanics.elementalMatter.core.stacks;
-import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMDefinitionsRegistry;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition;
+import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMDefinitionsRegistry;
import net.minecraft.nbt.NBTTagCompound;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMPrimitiveDefinition.null__;
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 d37a8bd099..0dbd56609e 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
@@ -38,7 +38,7 @@ public final class EMInstanceStack implements IEMStack {
//energy - if positive then particle should try to decay
private long energy;
//byte color; 0=Red 1=Green 2=Blue 0=Cyan 1=Magenta 2=Yellow, else ignored (-1 - uncolorable)
- private int color;
+ private int color;
private double lifeTime;
private double lifeTimeMult;
@@ -487,46 +487,32 @@ public final class EMInstanceStack implements IEMStack {
return this;
}
- public void addScanShortSymbols(ArrayList<String> lines, int[] detailsOnDepthLevels) {
- int capabilities = detailsOnDepthLevels[0];
- getDefinition().addScanShortSymbols(lines, capabilities, energy);
- //scanShortSymbolsContents(lines,definition.getSubParticles(),1,detailsOnDepthLevels);
- }
-
- //private void scanShortSymbolsContents(ArrayList<String> lines, cElementalDefinitionStackMap definitions, int depth, int[] detailsOnDepthLevels){
- // if(definitions!=null && depth<detailsOnDepthLevels.length){
- // int deeper=depth+1;
- // for(cElementalDefinitionStack definitionStack:definitions.values()) {
- // definition.addScanShortSymbols(lines,detailsOnDepthLevels[depth],energy);
- // scanSymbolsContents(lines,definitionStack.definition.getSubParticles(),deeper,detailsOnDepthLevels);
- // }
- // }
- //}
-
public void addScanResults(ArrayList<String> lines, int[] detailsOnDepthLevels) {
int capabilities = detailsOnDepthLevels[0];
if (TT_Utility.areBitsSet(SCAN_GET_DEPTH_LEVEL, capabilities)) {
- lines.add("DEPTH = " + 0);
+ lines.add(translateToLocal("tt.keyword.scan.depth") + " = " + 0);
}
- getDefinition().addScanResults(lines, capabilities, energy);
+ getDefinition().addScanResults(lines, capabilities, energy, TecTech.definitionsRegistry);
+
if (TT_Utility.areBitsSet(SCAN_GET_TIMESPAN_MULT, capabilities)) {
- lines.add("TIME MULT = " + lifeTimeMult);
- if (TT_Utility.areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)) {
- lines.add("TIME SPAN = " + lifeTime + " s");
- }
+ lines.add(translateToLocal("tt.keyword.scan.life_mult") + " = " + lifeTimeMult);
}
if (TT_Utility.areBitsSet(SCAN_GET_AGE, capabilities)) {
- lines.add("AGE = " + getAge() + " s");
+ lines.add(translateToLocal("tt.keyword.scan.age") + " = " + getAge() + " " + translateToLocal("tt.keyword.unit.time"));
}
- if (TT_Utility.areBitsSet(SCAN_GET_COLOR, capabilities)) {
- lines.add("COLOR = " + color + " RGB or CMY");
+ if (TT_Utility.areBitsSet(SCAN_GET_COLOR_VALUE, capabilities)) {
+ lines.add(translateToLocal("tt.keyword.scan.color") + " = " + color);
+ }
+ if (TT_Utility.areBitsSet(SCAN_GET_ENERGY, capabilities)) {
+ lines.add(translateToLocal("tt.keyword.scan.energy") + " = " + getDefinition().getEnergyDiffBetweenStates(0, energy) + " " + translateToLocal("tt.keyword.unit.energy"));
}
if (TT_Utility.areBitsSet(SCAN_GET_ENERGY_LEVEL, capabilities)) {
- lines.add("ENERGY = " + energy);
+ lines.add(translateToLocal("tt.keyword.scan.energyLevel") + " = " + energy);
}
if (TT_Utility.areBitsSet(SCAN_GET_AMOUNT, capabilities)) {
- lines.add("AMOUNT = " + getAmount() /AVOGADRO_CONSTANT + " "+translateToLocal("tt.keyword.mol"));
+ lines.add(translateToLocal("tt.keyword.scan.amount") + " = " + getAmount() / AVOGADRO_CONSTANT + " " + translateToLocal("tt.keyword.unit.mol"));
}
+
scanContents(lines, getDefinition().getSubParticles(), 1, detailsOnDepthLevels);
}
@@ -536,11 +522,11 @@ public final class EMInstanceStack implements IEMStack {
for (EMDefinitionStack definitionStack : definitions.valuesToArray()) {
lines.add("");//def separator
if (TT_Utility.areBitsSet(SCAN_GET_DEPTH_LEVEL, detailsOnDepthLevels[depth])) {
- lines.add("DEPTH = " + depth);
+ lines.add(translateToLocal("tt.keyword.scan.depth") +" = " + depth);
}
- getDefinition().addScanResults(lines, detailsOnDepthLevels[depth], energy);
+ getDefinition().addScanResults(lines, detailsOnDepthLevels[depth], energy, TecTech.definitionsRegistry);
if (TT_Utility.areBitsSet(SCAN_GET_AMOUNT, detailsOnDepthLevels[depth])) {
- lines.add("AMOUNT = " + definitionStack.getAmount());
+ lines.add(translateToLocal("tt.keyword.scan.count")+" = " + definitionStack.getAmount());
}
scanContents(lines, definitionStack.getDefinition().getSubParticles(), deeper, detailsOnDepthLevels);
}
@@ -551,10 +537,10 @@ public final class EMInstanceStack implements IEMStack {
NBTTagCompound nbt = new NBTTagCompound();
nbt.setTag("d", getDefinition().toNBT(registry));
nbt.setDouble("Q", getAmount());
- nbt.setDouble("M", lifeTimeMult);
+ nbt.setDouble("M", getLifeTimeMultiplier());
nbt.setDouble("A", getAge());
- nbt.setLong("e", energy);
- nbt.setInteger("c", color);
+ nbt.setLong("e", getEnergy());
+ nbt.setInteger("c", getColor());
return nbt;
}
@@ -588,7 +574,7 @@ public final class EMInstanceStack implements IEMStack {
@Override
public String toString() {
- return getDefinition().toString() + ' ' + getAmount() /AVOGADRO_CONSTANT + " "+translateToLocal("tt.keyword.mol")+" " + getMass()+" eV/c^2";
+ return getDefinition().toString() + ' ' + getAmount() / AVOGADRO_CONSTANT + " " + translateToLocal("tt.keyword.unit.mol") + " " + getMass() + " "+translateToLocal("tt.keyword.unit.mass");
}
public void setAmount(double amount) {
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 20e58216c1..03c57a754e 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
@@ -23,7 +23,6 @@ import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.EM_COUNT_PER_MATERIAL_AMOUNT_DIMINISHED;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMGaugeBosonDefinition.boson_Y__;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMGaugeBosonDefinition.deadEnd;
-import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_scanner.*;
import static com.github.technus.tectech.util.XSTR.XSTR_INSTANCE;
import static gregtech.api.enums.Materials.*;
import static gregtech.api.enums.OrePrefixes.dust;
@@ -372,7 +371,14 @@ public class EMAtomDefinition extends EMComplexTemplate {
@Override
public String getSymbol() {
- return getShortSymbol() + " N:" + getNeutralCount() + " I:" + (getNeutralCount() + getElement()) + " C:" + getCharge();
+ String ionName = "";
+ int ionization = getCharge() / 3;
+ if(ionization>0){
+ ionName = ionization == 1 ? TT_Utility.toSuperscript("+") : TT_Utility.toSuperscript(ionization + "+");
+ }else if(ionization<0) {
+ ionName = ionization == -1 ? TT_Utility.toSuperscript("-") : TT_Utility.toSuperscript(-ionization + "-");
+ }
+ return TT_Utility.toSuperscript(Long.toString(getNeutralCount() + (long)getElement())) +getShortSymbol()+ ionName;
}
@Override
@@ -1366,7 +1372,7 @@ public class EMAtomDefinition extends EMComplexTemplate {
}
@Override
- protected String getIndirectTagValue() {
+ protected String getTagValue() {
return nbtType;
}
@@ -1673,40 +1679,4 @@ public class EMAtomDefinition extends EMComplexTemplate {
public int hashCode() {
return hash;
}
-
- @Override
- public void addScanShortSymbols(ArrayList<String> lines, int capabilities, long energyLevel) {
- 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<String> lines, int capabilities, long energyLevel) {
- if (TT_Utility.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) {
- lines.add("CLASS = " + getIndirectTagValue() + ' ' + getMatterMassType());
- }
- 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 (TT_Utility.areBitsSet(SCAN_GET_CHARGE, capabilities)) {
- lines.add("CHARGE = " + getCharge() / 3D + " e");
- }
- if (TT_Utility.areBitsSet(SCAN_GET_COLOR, capabilities)) {
- lines.add(hasColor() ? "COLORLESS" : "CARRIES COLOR");
- }
- if (TT_Utility.areBitsSet(SCAN_GET_MASS, capabilities)) {
- lines.add("MASS = " + getMass() + " eV/c\u00b2");
- }
- 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 (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 85cb07ea33..9fb551e45c 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,6 @@ 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.TT_Utility;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import net.minecraftforge.oredict.OreDictionary;
@@ -28,7 +27,6 @@ import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.EM_COUNT_PER_MATERIAL_AMOUNT_DIMINISHED;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMGaugeBosonDefinition.boson_Y__;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMGaugeBosonDefinition.deadEnd;
-import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_scanner.*;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -371,7 +369,7 @@ public class EMHadronDefinition extends EMComplexTemplate {//TODO Optimize map i
}
@Override
- protected String getIndirectTagValue() {
+ protected String getTagValue() {
return nbtType;
}
@@ -459,37 +457,6 @@ public class EMHadronDefinition extends EMComplexTemplate {//TODO Optimize map i
return hash;
}
- @Override
- public void addScanShortSymbols(ArrayList<String> lines, int capabilities, long energyLevel) {
- 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<String> lines, int capabilities, long energyLevel) {
- if (TT_Utility.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) {
- lines.add("CLASS = " + getIndirectTagValue() + ' ' + getMatterMassType());
- }
- 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 (TT_Utility.areBitsSet(SCAN_GET_CHARGE, capabilities)) {
- lines.add("CHARGE = " + getCharge() / 3D + " e");
- }
- if (TT_Utility.areBitsSet(SCAN_GET_COLOR, capabilities)) {
- lines.add(hasColor() ? "COLORLESS" : "CARRIES COLOR");
- }
- if (TT_Utility.areBitsSet(SCAN_GET_MASS, capabilities)) {
- lines.add("MASS = " + getMass() + " eV/c\u00b2");
- }
- if (TT_Utility.areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)) {
- lines.add("HALF LIFE = " + getRawTimeSpan(energyLevel) + " s");
- lines.add(" " + "At current energy level");
- }
- }
-
public double getRawLifeTime() {
return rawLifeTime;
}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMGaugeBosonDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMGaugeBosonDefinition.java
index cf59c1fffd..8b1e1d556b 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMGaugeBosonDefinition.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMGaugeBosonDefinition.java
@@ -4,6 +4,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.decay.EMDecay;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMDefinitionsRegistry;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMType;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMDefinitionStack;
+import com.github.technus.tectech.util.TT_Utility;
import static com.github.technus.tectech.mechanics.elementalMatter.core.decay.EMDecay.NO_DECAY;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMLeptonDefinition.*;
@@ -27,7 +28,7 @@ public class EMGaugeBosonDefinition extends EMBosonDefinition {
public static final EMDecay deadEndHalf = new EMDecay(boson_Y__1);
protected EMGaugeBosonDefinition(String name, String symbol, double mass, int charge, int color, int ID, String bind) {
- super(name, symbol, 0, mass, charge, color, ID, bind);
+ super(name, TT_Utility.toSuperscript(symbol), 0, mass, charge, color, ID, bind);
}
public static void run(EMDefinitionsRegistry registry) {
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMLeptonDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMLeptonDefinition.java
index 324d790de6..0926b34425 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMLeptonDefinition.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMLeptonDefinition.java
@@ -4,6 +4,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.decay.EMDecay;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMDefinitionsRegistry;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMType;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMDefinitionStack;
+import com.github.technus.tectech.util.TT_Utility;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMGaugeBosonDefinition.boson_Y__;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMGaugeBosonDefinition.deadEnd;
@@ -29,7 +30,7 @@ public class EMLeptonDefinition extends EMFermionDefinition {
public static final EMDefinitionStack lepton_e_2 = new EMDefinitionStack(lepton_e_, 2);
protected EMLeptonDefinition(String name, String symbol, int type, double mass, int charge, int ID,String bind) {
- super(name, symbol, type, mass, charge, -1, ID,bind);
+ super(name, TT_Utility.toSuperscript(symbol), type, mass, charge, -1, ID,bind);
//this.itemThing=null;
//this.fluidThing=null;
}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMNeutrinoDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMNeutrinoDefinition.java
index 9bb05d2cbf..fee5774e15 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMNeutrinoDefinition.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMNeutrinoDefinition.java
@@ -14,12 +14,12 @@ import static net.minecraft.util.StatCollector.translateToLocal;
*/
public class EMNeutrinoDefinition extends EMLeptonDefinition {
public static final EMNeutrinoDefinition
- lepton_Ve = new EMNeutrinoDefinition("tt.keyword.ElectronNeutrino", "\u03bd\u03b2", 1, 2e0D, 21,"Ve-"),
- lepton_Vm = new EMNeutrinoDefinition("tt.keyword.MuonNeutrino", "\u03bd\u03bc", 2, 0.15e6D, 23,"Vm-"),
- lepton_Vt = new EMNeutrinoDefinition("tt.keyword.TauonNeutrino", "\u03bd\u03c4", 3, 15e6D, 25,"Vt-"),
- lepton_Ve_ = new EMNeutrinoDefinition("tt.keyword.PositronNeutrino", "~\u03bd\u03b2", -1, 2e0D, 22,"Ve+"),
- lepton_Vm_ = new EMNeutrinoDefinition("tt.keyword.AntimuonNeutrino", "~\u03bd\u03bc", -2, 0.15e6D, 24,"Vm+"),
- lepton_Vt_ = new EMNeutrinoDefinition("tt.keyword.AntitauonNeutrino", "~\u03bd\u03c4", -3, 15e6D, 26,"Vt+");
+ lepton_Ve = new EMNeutrinoDefinition("tt.keyword.ElectronNeutrino", "\u03bd\u03b2", 1, 2e0D, 21,"Ve"),
+ lepton_Vm = new EMNeutrinoDefinition("tt.keyword.MuonNeutrino", "\u03bd\u03bc", 2, 0.15e6D, 23,"Vm"),
+ lepton_Vt = new EMNeutrinoDefinition("tt.keyword.TauonNeutrino", "\u03bd\u03c4", 3, 15e6D, 25,"Vt"),
+ lepton_Ve_ = new EMNeutrinoDefinition("tt.keyword.PositronNeutrino", "~\u03bd\u03b2", -1, 2e0D, 22,"~Ve"),
+ lepton_Vm_ = new EMNeutrinoDefinition("tt.keyword.AntimuonNeutrino", "~\u03bd\u03bc", -2, 0.15e6D, 24,"~Vm"),
+ lepton_Vt_ = new EMNeutrinoDefinition("tt.keyword.AntitauonNeutrino", "~\u03bd\u03c4", -3, 15e6D, 26,"~Vt");
public static final EMDefinitionStack lepton_Ve1 = new EMDefinitionStack(lepton_Ve, 1);
public static final EMDefinitionStack lepton_Ve2 = new EMDefinitionStack(lepton_Ve, 2);
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMPrimitiveDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMPrimitiveDefinition.java
index 785d426a0b..c2b77f7704 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMPrimitiveDefinition.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMPrimitiveDefinition.java
@@ -16,8 +16,8 @@ public class EMPrimitiveDefinition extends EMPrimitiveTemplate {
null__ = new EMPrimitiveDefinition ( "tt.keyword.PrimitiveNULLPOINTER" , "." , 0 , 0D , -3 , Integer.MIN_VALUE+1 , "." ),
space = new EMPrimitiveDefinition ( "tt.keyword.PrimitiveSpace" , "_" , 0 , 0D , -4 , Integer.MIN_VALUE + 2 , "_" ),
space_ = new EMPrimitiveDefinition ( "tt.keyword.PrimitivePresence" , "~_" , 0 , 0D , -4 , Integer.MIN_VALUE + 3 , "~_" ),
- mass = new EMPrimitiveDefinition ( "tt.keyword.PrimitiveMass" , "#" , 0 , 1 , -4 , Integer.MIN_VALUE + 4 , "#" ),
- mass_ = new EMPrimitiveDefinition ( "tt.keyword.PrimitiveDarkMass" , "~#" , 0 , 1 , -4 , Integer.MIN_VALUE + 5 , "~#" ),
+ mass = new EMPrimitiveDefinition ( "tt.keyword.PrimitiveMass" , "*" , 0 , 1 , -4 , Integer.MIN_VALUE + 4 , "*" ),
+ mass_ = new EMPrimitiveDefinition ( "tt.keyword.PrimitiveDarkMass" , "~*" , 0 , 1 , -4 , Integer.MIN_VALUE + 5 , "~*" ),
energy = new EMPrimitiveDefinition ( "tt.keyword.PrimitiveEnergy" , "E" , 4 , 0D , -4 , Integer.MIN_VALUE + 6 , "E" ),
energy_ = new EMPrimitiveDefinition ( "tt.keyword.PrimitiveDarkEnergy" , "~E" , -4 , 0 , -4 , Integer.MIN_VALUE + 7 , "~E" ),
magic = new EMPrimitiveDefinition ( "tt.keyword.PrimitiveMagic" , "Ma" , 5 , 1e5D , 0 , Integer.MIN_VALUE + 8 , "Ma" ),
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMScalarBosonDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMScalarBosonDefinition.java
index 760ce48068..c90e89108b 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMScalarBosonDefinition.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMScalarBosonDefinition.java
@@ -3,6 +3,7 @@ package com.github.technus.tectech.mechanics.elementalMatter.definitions.primiti
import com.github.technus.tectech.mechanics.elementalMatter.core.decay.EMDecay;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMDefinitionsRegistry;
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.registry.EMType;
+import com.github.technus.tectech.util.TT_Utility;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMGaugeBosonDefinition.*;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMLeptonDefinition.*;
@@ -17,7 +18,7 @@ public class EMScalarBosonDefinition extends EMBosonDefinition {
boson_H__ = new EMScalarBosonDefinition("tt.keyword.Higgs", "H0", 125.09e9D, -2, 32,"H0");
private EMScalarBosonDefinition(String name, String symbol, double mass, int color, int ID,String bind) {
- super(name, symbol, 0, mass, 0, color, ID,bind);
+ super(name,TT_Utility.toSuperscript(symbol), 0, mass, 0, color, ID,bind);
}
public static void run(EMDefinitionsRegistry registry) {
diff --git a/src/main/java/com/github/technus/tectech/mechanics/spark/RendererMessage.java b/src/main/java/com/github/technus/tectech/mechanics/spark/RendererMessage.java
index 7fdce41ef9..dcc9bfd8fd 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/spark/RendererMessage.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/spark/RendererMessage.java
@@ -10,7 +10,6 @@ import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
-import net.minecraftforge.common.DimensionManager;
import thaumcraft.client.fx.bolt.FXLightningBolt;
import java.io.*;
diff --git a/src/main/java/com/github/technus/tectech/mechanics/tesla/TeslaCoverConnection.java b/src/main/java/com/github/technus/tectech/mechanics/tesla/TeslaCoverConnection.java
index 0b84236709..87ad7d7443 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/tesla/TeslaCoverConnection.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/tesla/TeslaCoverConnection.java
@@ -4,7 +4,6 @@ import com.google.common.base.Objects;
import com.gtnewhorizon.structurelib.util.Vec3Impl;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import static com.github.technus.tectech.mechanics.tesla.ITeslaConnectable.TeslaUtil.teslaSimpleNodeSetAdd;
import static com.github.technus.tectech.mechanics.tesla.ITeslaConnectable.TeslaUtil.teslaSimpleNodeSetRemove;
public class TeslaCoverConnection implements ITeslaConnectableSimple {
diff --git a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java
index d7baec4ef5..043bd87a21 100644
--- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java
+++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java
@@ -38,6 +38,7 @@ public class ClientProxy extends CommonProxy {
MinecraftForgeClient.registerItemRenderer(ElementalDefinitionContainer_EM.INSTANCE, RenderElementalName.INSTANCE);
MinecraftForgeClient.registerItemRenderer(DebugElementalInstanceContainer_EM.INSTANCE, RenderElementalName.INSTANCE);
+ //MinecraftForgeClient.registerItemRenderer(ElementalDefinitionScanStorage_EM.INSTANCE, RenderElementalName.INSTANCE);
if(Loader.isModLoaded("openmodularturrets")) {
new TT_turret_loader().run();
diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java
index 5f6fe08b5b..5e1b808255 100644
--- a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java
+++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java
@@ -1,9 +1,9 @@
package com.github.technus.tectech.recipe;
import com.github.technus.tectech.TecTech;
+import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition;
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.mechanics.elementalMatter.core.definitions.IEMDefinition;
import com.github.technus.tectech.thing.CustomItemList;
import com.github.technus.tectech.thing.item.ElementalDefinitionContainer_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_crafting;
diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsBA0.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsBA0.java
index d2c34941ef..62221d5bd4 100644
--- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsBA0.java
+++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsBA0.java
@@ -17,7 +17,6 @@ import net.minecraft.world.IBlockAccess;
import java.util.List;
-import static com.github.technus.tectech.TecTech.tectechTexturePage1;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
/**
diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsTT.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsTT.java
index f3574007f2..de72db417e 100644
--- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsTT.java
+++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsTT.java
@@ -17,8 +17,8 @@ import net.minecraft.world.IBlockAccess;
import java.util.List;
-import static com.github.technus.tectech.TecTech.tectechTexturePage1;
import static com.github.technus.tectech.TecTech.creativeTabTecTech;
+import static com.github.technus.tectech.TecTech.tectechTexturePage1;
/**
* Created by danie_000 on 03.10.2016.
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 7266611b20..315c5e5fff 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
@@ -26,7 +26,8 @@ import net.minecraftforge.fluids.IFluidHandler;
import java.awt.*;
import java.util.UUID;
-import static com.github.technus.tectech.mechanics.enderStorage.EnderWorldSavedData.*;
+import static com.github.technus.tectech.mechanics.enderStorage.EnderWorldSavedData.getEnderFluidContainer;
+import static com.github.technus.tectech.mechanics.enderStorage.EnderWorldSavedData.getEnderLinkTag;
public class GT_Cover_TM_EnderFluidLink extends GT_CoverBehavior {
private static final int L_PER_TICK = 8000;
diff --git a/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_TeslaCoil.java b/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_TeslaCoil.java
index a573ed740b..33330b521a 100644
--- a/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_TeslaCoil.java
+++ b/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_TeslaCoil.java
@@ -6,7 +6,7 @@ import gregtech.api.util.GT_CoverBehavior;
import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer;
-import static com.github.technus.tectech.mechanics.tesla.ITeslaConnectable.TeslaUtil.*;
+import static com.github.technus.tectech.mechanics.tesla.ITeslaConnectable.TeslaUtil.teslaSimpleNodeSetAdd;
import static ic2.api.info.Info.DMG_ELECTRIC;
public class GT_Cover_TM_TeslaCoil extends GT_CoverBehavior {
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 7d7880adca..c19ec6dda1 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
@@ -51,8 +51,8 @@ public final class DebugElementalInstanceContainer_EM extends Item implements IE
@Override
public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
- NBTTagCompound tNBT = aStack.getTagCompound();
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if (aPlayer instanceof EntityPlayerMP) {
aStack.stackSize = 1;
if (tTileEntity instanceof IGregTechTileEntity) {
@@ -61,7 +61,7 @@ public final class DebugElementalInstanceContainer_EM extends Item implements IE
EMInstanceStackMap content = ((IEMContainer) metaTE).getContentHandler();
if (tNBT.hasKey("content")) {
try {
- content.putUnifyAll(EMInstanceStackMap.fromNBT(TecTech.definitionsRegistry,tNBT.getCompoundTag("content")));
+ content.putUnifyAll(EMInstanceStackMap.fromNBT(TecTech.definitionsRegistry, tNBT.getCompoundTag("content")));
} catch (EMException e) {
if (DEBUG_MODE) {
e.printStackTrace();
@@ -71,12 +71,10 @@ public final class DebugElementalInstanceContainer_EM extends Item implements IE
((IEMContainer) metaTE).purgeOverflow();
tNBT.removeTag("content");
tNBT.removeTag("symbols");
- tNBT.removeTag("info");
} else if (content.hasStacks()) {
((IEMContainer) metaTE).purgeOverflow();
- tNBT.setTag("info", content.getInfoNBT());
tNBT.setTag("content", content.toNBT(TecTech.definitionsRegistry));
- tNBT.setTag("symbols", content.getShortSymbolsNBT());
+ tNBT.setTag("symbols", TT_Utility.packStrings(content.getShortSymbolsInfo()));
content.clear();
}
return true;
@@ -86,30 +84,14 @@ public final class DebugElementalInstanceContainer_EM extends Item implements IE
return aPlayer instanceof EntityPlayerMP;
}
- public ItemStack setContent(ItemStack aStack, EMInstanceStackMap content){
+ public ItemStack setContent(ItemStack aStack, EMInstanceStackMap content) {
NBTTagCompound tNBT = aStack.getTagCompound();
- if(tNBT==null){
- tNBT=new NBTTagCompound();
+ if (tNBT == null) {
+ tNBT = new NBTTagCompound();
aStack.setTagCompound(tNBT);
}
- if (tNBT.hasKey("content")) {
- try {
- content.putUnifyAll(EMInstanceStackMap.fromNBT(TecTech.definitionsRegistry,tNBT.getCompoundTag("content")));
- } catch (EMException e) {
- if (DEBUG_MODE) {
- e.printStackTrace();
- }
- return aStack;
- }
- tNBT.removeTag("content");
- tNBT.removeTag("info");
- tNBT.removeTag("symbols");
- } else if (content.hasStacks()) {
- tNBT.setTag("info", content.getInfoNBT());
- tNBT.setTag("content", content.toNBT(TecTech.definitionsRegistry));
- tNBT.setTag("symbols", content.getShortSymbolsNBT());
- content.clear();
- }
+ tNBT.setTag("content", content.toNBT(TecTech.definitionsRegistry));
+ tNBT.setTag("symbols", TT_Utility.packStrings(content.getShortSymbolsInfo()));
return aStack;
}
@@ -118,14 +100,18 @@ public final class DebugElementalInstanceContainer_EM extends Item implements IE
aList.add(CommonValues.TEC_MARK_EM);
try {
NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT != null && tNBT.hasKey("info")) {
+ if (tNBT != null && tNBT.hasKey("content")) {
aList.add(translateToLocal("item.em.debugContainer.desc.0") + ": ");//Contains
- Collections.addAll(aList, TT_Utility.infoFromNBT(tNBT.getCompoundTag("info")));
+ EMInstanceStackMap content = EMInstanceStackMap.fromNBT(TecTech.definitionsRegistry, tNBT.getCompoundTag("content"));
+ Collections.addAll(aList, content.getElementalInfo());
} 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
}
+ aList.add(EnumChatFormatting.BLUE + translateToLocal("item.em.debugContainer.desc.2"));//Right click on elemental hatches
} catch (Exception e) {
+ if (DEBUG_MODE) {
+ e.printStackTrace();
+ }
aList.add(translateToLocal("item.em.debugContainer.desc.3"));//---Unexpected Termination---
}
}
@@ -140,32 +126,17 @@ public final class DebugElementalInstanceContainer_EM extends Item implements IE
ItemStack that = new ItemStack(this, 1);
that.setTagCompound(new NBTTagCompound());
list.add(that);
- for(IEMDefinition definition: TecTech.definitionsRegistry.getStacksRegisteredForDisplay()){
- list.add(setContent(new ItemStack(this).setStackDisplayName(definition.getLocalizedName()+" "+1+" "+translateToLocal("tt.keyword.mbMols")),
+ for (IEMDefinition definition : TecTech.definitionsRegistry.getStacksRegisteredForDisplay()) {
+ list.add(setContent(new ItemStack(this).setStackDisplayName(definition.getLocalizedName() + " " + 1 + " " + translateToLocal("tt.keyword.unit.mbMols")),
new EMInstanceStackMap(new EMInstanceStack(definition, EM_COUNT_PER_MATERIAL_AMOUNT))));
- list.add(setContent(new ItemStack(this).setStackDisplayName(definition.getLocalizedName()+" "+1+" "+translateToLocal("tt.keyword.itemMols")),
+ list.add(setContent(new ItemStack(this).setStackDisplayName(definition.getLocalizedName() + " " + 1 + " " + translateToLocal("tt.keyword.unit.itemMols")),
new EMInstanceStackMap(new EMInstanceStack(definition, EM_COUNT_PER_ITEM))));
- list.add(setContent(new ItemStack(this).setStackDisplayName(definition.getLocalizedName()+" "+1000+" "+translateToLocal("tt.keyword.mbMols")),
+ list.add(setContent(new ItemStack(this).setStackDisplayName(definition.getLocalizedName() + " " + 1000 + " " + translateToLocal("tt.keyword.unit.mbMols")),
new EMInstanceStackMap(new EMInstanceStack(definition, EM_COUNT_PER_1k))));
}
}
@Override
- public String getSymbol(ItemStack aStack, int index) {
- try {
- NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT != null && tNBT.hasKey("symbols")) {
- String[] strings= TT_Utility.infoFromNBT(tNBT.getCompoundTag("symbols"));
- return strings[index%strings.length];
- } else {
- return null;
- }
- } catch (Exception e) {
- return "#!";
- }
- }
-
- @Override
@SideOnly(CLIENT)
public FontRenderer getFontRenderer(ItemStack stack) {
return TecTechFontRender.INSTANCE;
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 dede2e36ce..85a853e8aa 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
@@ -4,6 +4,7 @@ import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.font.TecTechFontRender;
import com.github.technus.tectech.mechanics.elementalMatter.core.EMException;
import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMConstantStackMap;
+import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMDefinitionStackMap;
import com.github.technus.tectech.thing.item.renderElemental.IElementalItem;
import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.util.TT_Utility;
@@ -38,30 +39,14 @@ public final class ElementalDefinitionContainer_EM extends Item implements IElem
setCreativeTab(creativeTabEM);
}
- //return previous thing
- public static EMConstantStackMap setContent(ItemStack containerItem, EMConstantStackMap definitions){
- if(containerItem.getItem() instanceof ElementalDefinitionContainer_EM) {
- NBTTagCompound tNBT = containerItem.stackTagCompound;
- if (tNBT == null) {
- tNBT = containerItem.stackTagCompound = new NBTTagCompound();
- }
-
- EMConstantStackMap oldMap =null;
- if (tNBT.hasKey("content")) {
- try {
- oldMap= EMConstantStackMap.fromNBT(TecTech.definitionsRegistry,tNBT.getCompoundTag("content"));
- } catch (EMException e) {
- if (DEBUG_MODE) {
- e.printStackTrace();
- }
- }
- }
- tNBT.setTag("info", definitions.getInfoNBT());
- tNBT.setTag("content", definitions.toNBT(TecTech.definitionsRegistry));
- tNBT.setTag("symbols",definitions.getShortSymbolsNBT());
- return oldMap;
+ public static void setContent(ItemStack aStack, EMConstantStackMap definitions){
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ if (tNBT == null) {
+ tNBT = new NBTTagCompound();
+ aStack.setTagCompound(tNBT);
}
- return null;
+ tNBT.setTag("content", definitions.toNBT(TecTech.definitionsRegistry));
+ tNBT.setTag("symbols", TT_Utility.packStrings(definitions.getShortSymbolsInfo()));
}
public static EMConstantStackMap getContent(ItemStack containerItem){
@@ -99,7 +84,6 @@ public final class ElementalDefinitionContainer_EM extends Item implements IElem
}
}
}
- tNBT.removeTag("info");
tNBT.removeTag("content");
tNBT.removeTag("symbols");
return oldMap;
@@ -112,9 +96,10 @@ public final class ElementalDefinitionContainer_EM extends Item implements IElem
aList.add(CommonValues.TEC_MARK_EM);
try {
NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT != null && tNBT.hasKey("info")) {
+ if (tNBT != null && tNBT.hasKey("content")) {
aList.add(translateToLocal("item.em.definitionContainer.desc.0") + ": ");//Should Contain
- Collections.addAll(aList, TT_Utility.infoFromNBT(tNBT.getCompoundTag("info")));
+ EMDefinitionStackMap content = EMDefinitionStackMap.fromNBT(TecTech.definitionsRegistry, tNBT.getCompoundTag("content"));
+ Collections.addAll(aList, content.getElementalInfo());
} else {
aList.add(translateToLocal("item.em.definitionContainer.desc.1"));//Recipe Hint
}
@@ -136,21 +121,6 @@ public final class ElementalDefinitionContainer_EM extends Item implements IElem
}
@Override
- public String getSymbol(ItemStack aStack, int index) {
- try {
- NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT != null && tNBT.hasKey("symbols")) {
- String[] strings= TT_Utility.infoFromNBT(tNBT.getCompoundTag("symbols"));
- return strings[index%strings.length];
- } else {
- return null;
- }
- } catch (Exception e) {
- return "#!";
- }
- }
-
- @Override
@SideOnly(CLIENT)
public FontRenderer getFontRenderer(ItemStack stack) {
return TecTechFontRender.INSTANCE;
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 22fc6e65a9..976b034455 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
@@ -5,9 +5,7 @@ import com.github.technus.tectech.font.TecTechFontRender;
import com.github.technus.tectech.loader.gui.ModGuiHandler;
import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap;
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.TT_Utility;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -22,6 +20,7 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
+import java.util.ArrayList;
import java.util.List;
import static com.github.technus.tectech.Reference.MODID;
@@ -32,7 +31,7 @@ import static net.minecraft.util.StatCollector.translateToLocal;
/**
* Created by Tec on 15.03.2017.
*/
-public final class ElementalDefinitionScanStorage_EM extends Item implements IElementalItem {
+public final class ElementalDefinitionScanStorage_EM extends Item {
public static ElementalDefinitionScanStorage_EM INSTANCE;
public static IIcon offline, online;
@@ -44,14 +43,14 @@ public final class ElementalDefinitionScanStorage_EM extends Item implements IEl
}
//return previous thing
- public static void setContent(ItemStack containerItem, EMInstanceStackMap definitions, int[] detailsOnDepthLevels){
- if(containerItem.getItem() instanceof ElementalDefinitionScanStorage_EM) {
- if (containerItem.stackTagCompound == null) {
- containerItem.stackTagCompound = new NBTTagCompound();
- }
- containerItem.stackTagCompound.setTag("elementalInfo", definitions.getScanInfoNBT(detailsOnDepthLevels));
- containerItem.stackTagCompound.setTag("symbols",definitions.getScanShortSymbolsNBT(detailsOnDepthLevels));
+ public static void setContent(ItemStack aStack, EMInstanceStackMap instances, int[] detailsOnDepthLevels){
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ if (tNBT == null) {
+ tNBT = new NBTTagCompound();
+ aStack.setTagCompound(tNBT);
}
+ tNBT.setTag("content", instances.toNBT(TecTech.definitionsRegistry));
+ tNBT.setIntArray("scanConfiguration", detailsOnDepthLevels);
}
public static void clearContent(ItemStack containerItem){
@@ -63,9 +62,10 @@ public final class ElementalDefinitionScanStorage_EM extends Item implements IEl
}
}
- public static String[] getLines(ItemStack containerItem){
- if(containerItem.stackTagCompound!=null && containerItem.stackTagCompound.hasKey("elementalInfo")) {
- return TT_Utility.infoFromNBT(containerItem.stackTagCompound.getCompoundTag("elementalInfo"));
+ public static ArrayList<String> getLines(ItemStack containerItem){
+ if(containerItem.stackTagCompound!=null && containerItem.stackTagCompound.hasKey("content")) {
+ EMInstanceStackMap contenet = EMInstanceStackMap.fromNBT(TecTech.definitionsRegistry, containerItem.stackTagCompound.getCompoundTag("contenet"));
+ return contenet.getScanInfo(containerItem.stackTagCompound.getIntArray("scanConfiguration"));
}
return null;
}
@@ -73,19 +73,11 @@ public final class ElementalDefinitionScanStorage_EM extends Item implements IEl
@Override
public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) {
aList.add(CommonValues.TEC_MARK_EM);
- try {
- if (aStack.stackTagCompound != null && aStack.stackTagCompound.hasKey("elementalInfo")) {
- aList.add(EnumChatFormatting.BLUE + translateToLocal("item.em.definitionScanStorage.desc.0"));//Contains scan result
- aList.add(translateToLocal("item.em.definitionScanStorage.desc.1"));//Use to read
- //if(DEBUG_MODE) {
- // aList.add("DEBUG MODE INFO - U CHEATER");
- // Collections.addAll(aList, Util.infoFromNBT(aStack.stackTagCompound.getCompoundTag("elementalInfo")));
- //}
- } else {
- aList.add(translateToLocal("item.em.definitionScanStorage.desc.2"));//Storage for matter scan data
- }
- } catch (Exception e) {
- aList.add(translateToLocal("item.em.definitionScanStorage.desc.3"));//---Unexpected Termination---
+ if (aStack.stackTagCompound != null && aStack.stackTagCompound.hasKey("content")) {
+ aList.add(EnumChatFormatting.BLUE + translateToLocal("item.em.definitionScanStorage.desc.0"));//Contains scan result
+ aList.add(translateToLocal("item.em.definitionScanStorage.desc.1"));//Use to read
+ } else {
+ aList.add(translateToLocal("item.em.definitionScanStorage.desc.2"));//Storage for matter scan data
}
}
@@ -105,19 +97,13 @@ public final class ElementalDefinitionScanStorage_EM extends Item implements IEl
@Override
public IIcon getIconIndex(ItemStack itemStack) {
NBTTagCompound tagCompound=itemStack.stackTagCompound;
- if(tagCompound!=null && tagCompound.hasKey("elementalInfo")) {
- return online;
- }
- return offline;
+ return tagCompound != null && tagCompound.hasKey("content") ? online : offline;
}
@Override
public IIcon getIcon(ItemStack itemStack, int pass) {
NBTTagCompound tagCompound=itemStack.stackTagCompound;
- if(tagCompound!=null && tagCompound.hasKey("elementalInfo")) {
- return online;
- }
- return offline;
+ return tagCompound != null && tagCompound.hasKey("content") ? online : offline;
}
@Override
@@ -130,7 +116,7 @@ public final class ElementalDefinitionScanStorage_EM extends Item implements IEl
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
if(world.isRemote){
NBTTagCompound tagCompound=itemStack.stackTagCompound;
- if(tagCompound!=null && tagCompound.hasKey("elementalInfo")) {
+ if(tagCompound!=null && tagCompound.hasKey("content")) {
player.openGui(TecTech.instance, ModGuiHandler.SCAN_DISPLAY_SCREEN_ID, world, 0, 0, 0);
}
}
@@ -138,21 +124,6 @@ public final class ElementalDefinitionScanStorage_EM extends Item implements IEl
}
@Override
- public String getSymbol(ItemStack aStack, int index) {
- try {
- NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT != null && tNBT.hasKey("symbols")) {
- String[] strings= TT_Utility.infoFromNBT(tNBT.getCompoundTag("symbols"));
- return strings[index%strings.length];
- } else {
- return null;
- }
- } catch (Exception e) {
- return "#!";
- }
- }
-
- @Override
@SideOnly(CLIENT)
public FontRenderer getFontRenderer(ItemStack stack) {
return TecTechFontRender.INSTANCE;
diff --git a/src/main/java/com/github/technus/tectech/thing/item/EuMeterGT.java b/src/main/java/com/github/technus/tectech/thing/item/EuMeterGT.java
index 4fca682268..735b2ef0f5 100644
--- a/src/main/java/com/github/technus/tectech/thing/item/EuMeterGT.java
+++ b/src/main/java/com/github/technus/tectech/thing/item/EuMeterGT.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.thing.item;
-import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.Reference;
+import com.github.technus.tectech.util.CommonValues;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
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 aff84c9b4b..a384d3998a 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,10 +1,10 @@
package com.github.technus.tectech.thing.item;
-import com.github.technus.tectech.util.CommonValues;
-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;
+import com.github.technus.tectech.util.CommonValues;
+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;
@@ -33,8 +33,8 @@ import static net.minecraft.util.StatCollector.translateToLocal;
* Created by Tec on 15.03.2017.
*/
public final class ParametrizerMemoryCard extends Item {
- public static ParametrizerMemoryCard INSTANCE;
- private static IIcon locked, unlocked;
+ public static ParametrizerMemoryCard INSTANCE;
+ private static IIcon locked, unlocked;
private ParametrizerMemoryCard() {
setMaxStackSize(1);
@@ -142,20 +142,16 @@ public final class ParametrizerMemoryCard extends Item {
aList.add(EnumChatFormatting.BLUE + translateToLocal("item.em.parametrizerMemoryCard.desc.3"));//Sneak right click to lock/unlock
double temp;
- if(tNBT!=null && tNBT.hasKey("param")) {
- 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 + 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 + TT_Utility.longBitsToShortString(Double.doubleToLongBits(temp)));
- if(tNBT.hasKey("value1s")) {
- aList.add("Value 1s: " + EnumChatFormatting.AQUA + tNBT.getString("value1s"));
- }
+ if (tNBT != null && tNBT.hasKey("param")) {
+ 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 + TT_Utility.longBitsToShortString(Double.doubleToLongBits(temp)));
+ 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 + TT_Utility.longBitsToShortString(Double.doubleToLongBits(temp)));
+ aList.add("Value 1s: " + EnumChatFormatting.AQUA + tNBT.getString("value1s"));
}
}
diff --git a/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCapacitor.java b/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCapacitor.java
index 86982e7c09..16be66255d 100644
--- a/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCapacitor.java
+++ b/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCapacitor.java
@@ -14,9 +14,9 @@ import net.minecraft.util.IIcon;
import java.util.List;
-import static com.github.technus.tectech.util.CommonValues.V;
import static com.github.technus.tectech.Reference.MODID;
import static com.github.technus.tectech.thing.CustomItemList.teslaCapacitor;
+import static com.github.technus.tectech.util.CommonValues.V;
import static net.minecraft.util.StatCollector.translateToLocal;
diff --git a/src/main/java/com/github/technus/tectech/thing/item/TeslaStaff.java b/src/main/java/com/github/technus/tectech/thing/item/TeslaStaff.java
index 9d998953e8..ba080f8603 100644
--- a/src/main/java/com/github/technus/tectech/thing/item/TeslaStaff.java
+++ b/src/main/java/com/github/technus/tectech/thing/item/TeslaStaff.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.thing.item;
-import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.Reference;
+import com.github.technus.tectech.util.CommonValues;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.util.GT_Utility;
import net.minecraft.entity.Entity;
diff --git a/src/main/java/com/github/technus/tectech/thing/item/gui/ScanDisplayScreen.java b/src/main/java/com/github/technus/tectech/thing/item/gui/ScanDisplayScreen.java
index 20f59b56e2..b4300c763c 100644
--- a/src/main/java/com/github/technus/tectech/thing/item/gui/ScanDisplayScreen.java
+++ b/src/main/java/com/github/technus/tectech/thing/item/gui/ScanDisplayScreen.java
@@ -11,6 +11,8 @@ import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
+import java.util.Objects;
+
import static com.github.technus.tectech.Reference.MODID;
import static org.lwjgl.opengl.GL11.*;
@@ -18,24 +20,26 @@ import static org.lwjgl.opengl.GL11.*;
* Created by danie_000 on 17.12.2017.
*/
public class ScanDisplayScreen extends GuiScreen {
- private static final int sizeX=240,sizeY=220, renderedLines =10;
- private int baseX,baseY;
- private Button up,down,pgUp,pgDown;
+ private static final int sizeX = 240, sizeY = 220, renderedLines = 10;
+ private int baseX, baseY;
+ private Button up, down, pgUp, pgDown;
private final String[] lines;
- private int firstLine;
+ private int firstLine;
- private static final ResourceLocation[] BACKGROUNDS =new ResourceLocation[]{new ResourceLocation(MODID+":textures/gui/scanDisplayScreen1.png"),
- new ResourceLocation(MODID+":textures/gui/scanDisplayScreen2.png"),
- new ResourceLocation(MODID+":textures/gui/scanDisplayScreen3.png"),
- new ResourceLocation(MODID+":textures/gui/scanDisplayScreen4.png"),
- new ResourceLocation(MODID+":textures/gui/scanDisplayScreen5.png"),
- new ResourceLocation(MODID+":textures/gui/scanDisplayScreen6.png"),
- new ResourceLocation(MODID+":textures/gui/scanDisplayScreen7.png"),
- new ResourceLocation(MODID+":textures/gui/scanDisplayScreen8.png")};
- private static final ResourceLocation ITEM =new ResourceLocation(MODID+":textures/gui/scanDisplayItem.png");
+ private static final ResourceLocation[] BACKGROUNDS = new ResourceLocation[]{
+ new ResourceLocation(MODID + ":textures/gui/scanDisplayScreen1.png"),
+ new ResourceLocation(MODID + ":textures/gui/scanDisplayScreen2.png"),
+ new ResourceLocation(MODID + ":textures/gui/scanDisplayScreen3.png"),
+ new ResourceLocation(MODID + ":textures/gui/scanDisplayScreen4.png"),
+ new ResourceLocation(MODID + ":textures/gui/scanDisplayScreen5.png"),
+ new ResourceLocation(MODID + ":textures/gui/scanDisplayScreen6.png"),
+ new ResourceLocation(MODID + ":textures/gui/scanDisplayScreen7.png"),
+ new ResourceLocation(MODID + ":textures/gui/scanDisplayScreen8.png")};
+ private static final ResourceLocation ITEM =
+ new ResourceLocation(MODID + ":textures/gui/scanDisplayItem.png");
- public ScanDisplayScreen(EntityPlayer player){
- lines=ElementalDefinitionScanStorage_EM.getLines(player.getHeldItem());
+ public ScanDisplayScreen(EntityPlayer player) {
+ lines = Objects.requireNonNull(ElementalDefinitionScanStorage_EM.getLines(player.getHeldItem())).toArray(new String[0]);
}
@Override
@@ -43,48 +47,48 @@ public class ScanDisplayScreen extends GuiScreen {
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
mc.getTextureManager().bindTexture(ITEM);
- long tick=System.currentTimeMillis()/150;
- int itick=(int)(tick%12);
- drawTexturedModalRect(baseX+99,baseY+189,32*(itick/6),32*(itick%6), 32, 32);
- mc.getTextureManager().bindTexture(BACKGROUNDS[(int)(tick%8)]);
- drawTexturedModalRect(baseX,baseY,0,0, sizeX, sizeY);
+ long tick = System.currentTimeMillis() / 150;
+ int itick = (int) (tick % 12);
+ drawTexturedModalRect(baseX + 99, baseY + 189, 32 * (itick / 6), 32 * (itick % 6), 32, 32);
+ mc.getTextureManager().bindTexture(BACKGROUNDS[(int) (tick % 8)]);
+ drawTexturedModalRect(baseX, baseY, 0, 0, sizeX, sizeY);
glDisable(GL_BLEND);
- super.drawScreen(x,y,partialTicks);
+ super.drawScreen(x, y, partialTicks);
- itick=(TecTech.RANDOM.nextInt(0x66)<<16)+0x77EEFF;
- int textBaseX=baseX+20;
- int textBaseXX=baseX+95;
- int textBaseY=baseY+28;
- for(int i=firstLine-1, j=8;i>=0 && j!=0;i--,j/=2){
- int equalPos=lines[i].indexOf('=');
- if(equalPos>=0){
- TecTechFontRender.INSTANCE.drawSplitString(lines[i].substring(0,equalPos), textBaseX, textBaseY - 8 + j, 200, itick);
+ itick = (TecTech.RANDOM.nextInt(0x66) << 16) + 0x77EEFF;
+ int textBaseX = baseX + 20;
+ int textBaseXX = baseX + 95;
+ int textBaseY = baseY + 28;
+ for (int i = firstLine - 1, j = 8; i >= 0 && j != 0; i--, j /= 2) {
+ int equalPos = lines[i].indexOf('=');
+ if (equalPos >= 0) {
+ TecTechFontRender.INSTANCE.drawSplitString(lines[i].substring(0, equalPos), textBaseX, textBaseY - 8 + j, 200, itick);
TecTechFontRender.INSTANCE.drawSplitString(lines[i].substring(equalPos), textBaseXX, textBaseY - 8 + j, 200, itick);
- }else {
+ } else {
TecTechFontRender.INSTANCE.drawSplitString(lines[i], textBaseX, textBaseY - 8 + j, 200, itick);
}
}
- for(int i = firstLine, j = 0; i<lines.length && j< renderedLines; i++,j++){
+ for (int i = firstLine, j = 0; i < lines.length && j < renderedLines; i++, j++) {
textBaseY += 9;
- int equalPos=lines[i].indexOf('=');
- if(equalPos>=0){
- TecTechFontRender.INSTANCE.drawSplitString(lines[i].substring(0,equalPos), textBaseX, textBaseY, 200, itick);
+ int equalPos = lines[i].indexOf('=');
+ if (equalPos >= 0) {
+ TecTechFontRender.INSTANCE.drawSplitString(lines[i].substring(0, equalPos), textBaseX, textBaseY, 200, itick);
TecTechFontRender.INSTANCE.drawSplitString(lines[i].substring(equalPos), textBaseXX, textBaseY, 200, itick);
- }else {
+ } else {
TecTechFontRender.INSTANCE.drawSplitString(lines[i], textBaseX, textBaseY, 200, itick);
}
}
- for(int i = firstLine+ renderedLines, j = 8; i<lines.length && j!=0; i++,j/=2){
- int equalPos=lines[i].indexOf('=');
- if(equalPos>=0){
- TecTechFontRender.INSTANCE.drawSplitString(lines[i].substring(0,equalPos), textBaseX, textBaseY + 17 - j, 200, itick);
+ for (int i = firstLine + renderedLines, j = 8; i < lines.length && j != 0; i++, j /= 2) {
+ int equalPos = lines[i].indexOf('=');
+ if (equalPos >= 0) {
+ TecTechFontRender.INSTANCE.drawSplitString(lines[i].substring(0, equalPos), textBaseX, textBaseY + 17 - j, 200, itick);
TecTechFontRender.INSTANCE.drawSplitString(lines[i].substring(equalPos), textBaseXX, textBaseY + 17 - j, 200, itick);
- }else {
+ } else {
TecTechFontRender.INSTANCE.drawSplitString(lines[i], textBaseX, textBaseY + 17 - j, 200, itick);
}
}
- TecTechFontRender.INSTANCE.drawSplitString(Integer.toString(firstLine), textBaseX, baseY+146, 200, itick);
- TecTechFontRender.INSTANCE.drawSplitString(Integer.toString(lines.length), textBaseX, baseY+157, 200, itick);
+ TecTechFontRender.INSTANCE.drawSplitString(Integer.toString(firstLine), textBaseX, baseY + 146, 200, itick);
+ TecTechFontRender.INSTANCE.drawSplitString(Integer.toString(lines.length), textBaseX, baseY + 157, 200, itick);
}
@Override
@@ -94,13 +98,13 @@ public class ScanDisplayScreen extends GuiScreen {
@Override
public void initGui() {
- baseX=(width- sizeX)/2;
- baseY=(height- sizeY)/2-12;
- int buttonBaseY=baseY+145;
- buttonList.add(pgUp= new Button(0, baseX + 77, buttonBaseY, 0, 220));
- buttonList.add(up= new Button(1, baseX + 99, buttonBaseY, 20, 220));
- buttonList.add(down= new Button(2, baseX + 121, buttonBaseY, 40, 220));
- buttonList.add(pgDown= new Button(3, baseX + 143, buttonBaseY, 60, 220));
+ baseX = (width - sizeX) / 2;
+ baseY = (height - sizeY) / 2 - 12;
+ int buttonBaseY = baseY + 145;
+ buttonList.add(pgUp = new Button(0, baseX + 77, buttonBaseY, 0, 220));
+ buttonList.add(up = new Button(1, baseX + 99, buttonBaseY, 20, 220));
+ buttonList.add(down = new Button(2, baseX + 121, buttonBaseY, 40, 220));
+ buttonList.add(pgDown = new Button(3, baseX + 143, buttonBaseY, 60, 220));
}
@Override
@@ -125,19 +129,18 @@ public class ScanDisplayScreen extends GuiScreen {
}
}
- private static class Button extends GuiButton{
- int u,v;
- Button(int id,int x,int y,int u,int v){
- super(id,x,y,20,20,"");
- this.u=u;
- this.v=v;
+ private static class Button extends GuiButton {
+ int u, v;
+
+ Button(int id, int x, int y, int u, int v) {
+ super(id, x, y, 20, 20, "");
+ this.u = u;
+ this.v = v;
}
@Override
- public void drawButton(Minecraft mc, int xPos, int yPos)
- {
- if (visible)
- {
+ public void drawButton(Minecraft mc, int xPos, int yPos) {
+ if (visible) {
field_146123_n = xPos >= xPosition && yPos >= yPosition && xPos < xPosition + width && yPos < yPosition + height;
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -150,9 +153,8 @@ public class ScanDisplayScreen extends GuiScreen {
//play cool sound fx
@Override
- public void func_146113_a(SoundHandler soundHandler)
- {
- soundHandler.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation(MODID+":fx_click"), 1.0F));
+ public void func_146113_a(SoundHandler soundHandler) {
+ soundHandler.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation(MODID + ":fx_click"), 1.0F));
}
}
}
diff --git a/src/main/java/com/github/technus/tectech/thing/item/renderElemental/IElementalItem.java b/src/main/java/com/github/technus/tectech/thing/item/renderElemental/IElementalItem.java
index ab68691eaa..37dce47e5f 100644
--- a/src/main/java/com/github/technus/tectech/thing/item/renderElemental/IElementalItem.java
+++ b/src/main/java/com/github/technus/tectech/thing/item/renderElemental/IElementalItem.java
@@ -1,7 +1,21 @@
package com.github.technus.tectech.thing.item.renderElemental;
import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+
+import static com.github.technus.tectech.util.TT_Utility.getSomeString;
public interface IElementalItem {
- String getSymbol(ItemStack stack,int index);
+ default String getSymbol(ItemStack stack,int index){
+ try {
+ NBTTagCompound tNBT = stack.getTagCompound();
+ if (tNBT != null && tNBT.hasKey("symbols")) {
+ return getSomeString(tNBT.getCompoundTag("symbols"),index);
+ } else {
+ return null;
+ }
+ } catch (Exception e) {
+ return "#!";
+ }
+ }
}
diff --git a/src/main/java/com/github/technus/tectech/thing/item/renderElemental/RenderElementalName.java b/src/main/java/com/github/technus/tectech/thing/item/renderElemental/RenderElementalName.java
index bfb1a188d8..e897f615ad 100644
--- a/src/main/java/com/github/technus/tectech/thing/item/renderElemental/RenderElementalName.java
+++ b/src/main/java/com/github/technus/tectech/thing/item/renderElemental/RenderElementalName.java
@@ -32,10 +32,10 @@ public class RenderElementalName implements IItemRenderer {
for (int i = 0; i < item.getRenderPasses(itemStack.getItemDamage()); i++) {
IIcon icon = item.getIcon(itemStack, i);
tessellator.startDrawingQuads();
- tessellator.addVertexWithUV(0.0, 0.0, 0.0, (double)icon.getMinU(), (double)icon.getMinV());
- tessellator.addVertexWithUV(0.0, 16, 0.0, (double)icon.getMinU(), (double)icon.getMaxV());
- tessellator.addVertexWithUV(16, 16, 0.0, (double)icon.getMaxU(), (double)icon.getMaxV());
- tessellator.addVertexWithUV(16, 0.0, 0.0, (double)icon.getMaxU(), (double)icon.getMinV());
+ tessellator.addVertexWithUV(0.0, 0.0, 0.0, icon.getMinU(), icon.getMinV());
+ tessellator.addVertexWithUV(0.0, 16, 0.0, icon.getMinU(), icon.getMaxV());
+ tessellator.addVertexWithUV(16, 16, 0.0, icon.getMaxU(), icon.getMaxV());
+ tessellator.addVertexWithUV(16, 0.0, 0.0, icon.getMaxU(), icon.getMinV());
tessellator.draw();
//ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 0.0625f);
}
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 1e90535224..c74691d0a1 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
@@ -1,11 +1,11 @@
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.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 com.github.technus.tectech.util.CommonValues;
+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;
@@ -23,9 +23,9 @@ import net.minecraft.util.EnumChatFormatting;
import java.util.HashMap;
import java.util.Map;
+import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
import static com.github.technus.tectech.util.CommonValues.V;
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;
/**
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 eb9ce2af30..9311e34662 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,10 +1,10 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.util.CommonValues;
-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;
+import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Data;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.TT_Utility;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
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 3385447861..9e4f6cba93 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,9 +1,9 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.util.CommonValues;
-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 com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.TT_Utility;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Dyes;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java
index 026ba46882..406a9ee56f 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java
@@ -9,8 +9,8 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
-import static com.github.technus.tectech.util.CommonValues.V;
import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_POWER_TT;
+import static com.github.technus.tectech.util.CommonValues.V;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java
index c247121e0e..595f45f8d2 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java
@@ -1,9 +1,9 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
+import com.github.technus.tectech.mechanics.pipe.IConnectsToEnergyTunnel;
+import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Energy;
import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.util.TT_Utility;
-import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Energy;
-import com.github.technus.tectech.mechanics.pipe.IConnectsToEnergyTunnel;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -13,9 +13,9 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
+import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT;
import static com.github.technus.tectech.util.CommonValues.TRANSFER_AT;
import static com.github.technus.tectech.util.CommonValues.V;
-import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java
index a6806ddb2f..8b8bcaaa1d 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java
@@ -1,9 +1,9 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap;
-import com.github.technus.tectech.mechanics.elementalMatter.core.IEMContainer;
import com.github.technus.tectech.mechanics.elementalMatter.core.EMException;
+import com.github.technus.tectech.mechanics.elementalMatter.core.IEMContainer;
+import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap;
import com.github.technus.tectech.mechanics.pipe.IConnectsToElementalPipe;
import com.github.technus.tectech.util.TT_Utility;
import cpw.mods.fml.relauncher.Side;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java
index 96dc4261dd..e9631cfb3e 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java
@@ -1,9 +1,9 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.util.CommonValues;
-import com.github.technus.tectech.util.TT_Utility;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Holder;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Holder;
+import com.github.technus.tectech.util.CommonValues;
+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;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputData.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputData.java
index 183758b756..ff5669e0cb 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputData.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputData.java
@@ -1,9 +1,9 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.util.CommonValues;
-import com.github.technus.tectech.util.TT_Utility;
import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket;
import com.github.technus.tectech.mechanics.pipe.IConnectsToDataPipe;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.TT_Utility;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputDataItems.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputDataItems.java
index 187fa1f631..ee619ac5ec 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputDataItems.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputDataItems.java
@@ -1,9 +1,9 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.util.CommonValues;
-import com.github.technus.tectech.util.TT_Utility;
import com.github.technus.tectech.mechanics.dataTransport.InventoryDataPacket;
import com.github.technus.tectech.mechanics.pipe.IConnectsToDataPipe;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.TT_Utility;
import gregtech.api.enums.Dyes;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -20,9 +20,9 @@ import org.apache.commons.lang3.reflect.FieldUtils;
import java.util.ArrayList;
-import static com.github.technus.tectech.util.CommonValues.MOVE_AT;
import static com.github.technus.tectech.recipe.TT_recipeAdder.nullItem;
import static com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DataConnector.*;
+import static com.github.technus.tectech.util.CommonValues.MOVE_AT;
import static gregtech.api.enums.Dyes.MACHINE_METAL;
import static net.minecraft.util.StatCollector.translateToLocal;
import static net.minecraft.util.StatCollector.translateToLocalFormatted;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java
index 55cbf24d04..d625911702 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java
@@ -1,10 +1,10 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.util.CommonValues;
-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;
+import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Data;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.TT_Utility;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java
index 5fe3fd3170..1c70ccd469 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java
@@ -1,10 +1,10 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.util.CommonValues;
-import com.github.technus.tectech.util.TT_Utility;
import com.github.technus.tectech.mechanics.dataTransport.InventoryDataPacket;
-import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Data;
import com.github.technus.tectech.mechanics.pipe.IConnectsToDataPipe;
+import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Data;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.TT_Utility;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java
index 4b62965dba..25ed1e6c47 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.util.TT_Utility;
import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_EM;
+import com.github.technus.tectech.util.TT_Utility;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java
index 5223ca5b5b..0d5347a87e 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java
@@ -88,8 +88,8 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity
return new String[]{
CommonValues.TEC_MARK_EM,
mDescription,
- translateToLocal("gt.blockmachines.hatch.emmuffler.desc.1") + ": " + EnumChatFormatting.AQUA + TT_Utility.formatNumberShortExp(overflowMax) + " eV/c\u00b2",
- translateToLocal("gt.blockmachines.hatch.emmuffler.desc.2") + ": " + EnumChatFormatting.AQUA + TT_Utility.formatNumberShortExp(overflowDisperse) + " (eV/c\u00b2)/s",
+ translateToLocal("gt.blockmachines.hatch.emmuffler.desc.1") + ": " + EnumChatFormatting.AQUA + TT_Utility.formatNumberShortExp(overflowMax) + " "+translateToLocal("tt.keyword.unit.mass"),
+ translateToLocal("gt.blockmachines.hatch.emmuffler.desc.2") + ": " + EnumChatFormatting.AQUA + TT_Utility.formatNumberShortExp(overflowDisperse) + " "+translateToLocal("tt.keyword.unit.massFlux"),
translateToLocal("gt.blockmachines.hatch.emmuffler.desc.3")
};
}
@@ -217,10 +217,10 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity
public String[] getInfoData() {
return new String[]{
translateToLocalFormatted("tt.keyphrase.Contained_mass", clientLocale) + ":",
- EnumChatFormatting.RED + TT_Utility.formatNumberExp(overflowMatter) + EnumChatFormatting.RESET + " eV/c\u00b2 /",
- EnumChatFormatting.GREEN + TT_Utility.formatNumberShortExp(overflowMax) + EnumChatFormatting.RESET + " eV/c\u00b2",
+ EnumChatFormatting.RED + TT_Utility.formatNumberExp(overflowMatter) + EnumChatFormatting.RESET + " "+translateToLocal("tt.keyword.unit.mass")+ " / ",
+ EnumChatFormatting.GREEN + TT_Utility.formatNumberShortExp(overflowMax) + EnumChatFormatting.RESET + " "+translateToLocal("tt.keyword.unit.mass"),
translateToLocalFormatted("tt.keyphrase.Mass_Disposal_speed", clientLocale) + ": " +
- EnumChatFormatting.BLUE + TT_Utility.formatNumberShortExp(overflowDisperse) + EnumChatFormatting.RESET + " (eV/c\u00b2)/s"
+ EnumChatFormatting.BLUE + TT_Utility.formatNumberShortExp(overflowDisperse) + EnumChatFormatting.RESET + " "+translateToLocal("tt.keyword.unit.massFlux")
};
}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java
index 10e6ca71d9..d53e0683cd 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java
@@ -1,11 +1,11 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.util.CommonValues;
-import com.github.technus.tectech.util.TT_Utility;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Param;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_ParamAdv;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Param;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_ParamAdv;
+import com.github.technus.tectech.util.CommonValues;
+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;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java
index bc4562307b..b50475ae59 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java
@@ -1,9 +1,9 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.loader.NetworkDispatcher;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_ParamText;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_ParamText;
+import com.github.technus.tectech.util.CommonValues;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -113,13 +113,7 @@ public class GT_MetaTileEntity_Hatch_ParamText extends GT_MetaTileEntity_Hatch_P
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
value0s = aNBT.getString("eIeValue0S");
- if (value0s==null){
- value0s="";
- }
value1s = aNBT.getString("eIeValue1S");
- if(value1s==null){
- value1s="";
- }
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java
index 975d6b516b..0ef4a38a3d 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java
@@ -1,11 +1,11 @@
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.TT_Utility;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Rack;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Rack;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.TT_Utility;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -28,9 +28,9 @@ import org.apache.commons.lang3.reflect.FieldUtils;
import java.util.HashMap;
import java.util.Map;
+import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
import static com.github.technus.tectech.util.CommonValues.MULTI_CHECK_AT;
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;
import static net.minecraft.util.StatCollector.translateToLocalFormatted;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java
index 00c1d002b6..9ce5a1c446 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java
@@ -1,11 +1,11 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.util.TT_Utility;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Uncertainty;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Uncertainty;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_UncertaintyAdv;
+import com.github.technus.tectech.util.CommonValues;
+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;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/TextParametersMessage.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/TextParametersMessage.java
index 96b54273db..9e4b81cd5b 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/TextParametersMessage.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/TextParametersMessage.java
@@ -1,8 +1,8 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.util.TT_Utility;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_ParamText;
+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;
@@ -23,8 +23,8 @@ public class TextParametersMessage implements IMessage {
int mPosY;
int mPosZ;
int mPosD;
- String mVal0;
- String mVal1;
+ String mVal0="";
+ String mVal1="";
public TextParametersMessage() {}
@@ -36,13 +36,7 @@ public class TextParametersMessage implements IMessage {
mPosZ = tTag.getInteger("posz");
mPosD = tTag.getInteger("posd");
mVal0 = tTag.getString("value0s");
- if(mVal0==null) {
- mVal0="";
- }
mVal1 = tTag.getString("value1s");
- if(mVal1==null) {
- mVal1="";
- }
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java
index cf3a164f8f..f87e44aefb 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java
@@ -1,8 +1,8 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch.gui;
import com.github.technus.tectech.TecTech;
-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.util.TT_Utility;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java
index 75abd6d4c2..44608ec204 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java
@@ -1,8 +1,8 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch.gui;
import com.github.technus.tectech.TecTech;
-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.util.TT_Utility;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamText.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamText.java
index 1d2df027f3..b4c466192f 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamText.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamText.java
@@ -1,10 +1,10 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch.gui;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.util.TT_Utility;
import com.github.technus.tectech.loader.NetworkDispatcher;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_ParamText;
import com.github.technus.tectech.thing.metaTileEntity.hatch.TextParametersMessage;
+import com.github.technus.tectech.util.TT_Utility;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java
index 474dbdab2c..12220dfe14 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java
@@ -35,14 +35,12 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.util.ForgeDirection;
import org.apache.commons.lang3.reflect.FieldUtils;
-import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
import static com.github.technus.tectech.recipe.TT_recipe.E_RECIPE_ID;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_crafting.crafter;
import static com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine.machine;
-import static com.github.technus.tectech.util.CommonValues.V;
-import static com.github.technus.tectech.util.CommonValues.VN;
+import static com.github.technus.tectech.util.CommonValues.*;
import static com.github.technus.tectech.util.TT_Utility.areBitsSet;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
@@ -56,10 +54,23 @@ import static net.minecraft.util.StatCollector.translateToLocalFormatted;
*/
public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {
//region variables
- public static final int SCAN_DO_NOTHING = 0,
- SCAN_GET_NOMENCLATURE = 1, SCAN_GET_DEPTH_LEVEL = 2, SCAN_GET_AMOUNT = 4, SCAN_GET_CHARGE = 8,
- SCAN_GET_MASS = 16, SCAN_GET_ENERGY_LEVEL = 32, SCAN_GET_TIMESPAN_INFO = 64, SCAN_GET_ENERGY_STATES = 128,
- SCAN_GET_COLOR = 256, SCAN_GET_AGE = 512, SCAN_GET_TIMESPAN_MULT = 1024, SCAN_GET_CLASS_TYPE = 2048;
+ public static final int
+ SCAN_DO_NOTHING = 0,
+ SCAN_GET_NOMENCLATURE = 1<<0,
+ SCAN_GET_DEPTH_LEVEL = 1<<1,
+ SCAN_GET_AMOUNT = 1<<2,
+ SCAN_GET_CHARGE = 1<<3,
+ SCAN_GET_MASS = 1<<4,
+ SCAN_GET_ENERGY = 1<<5,
+ SCAN_GET_ENERGY_LEVEL = 1<<6,
+ SCAN_GET_TIMESPAN_INFO = 1<<7,
+ SCAN_GET_ENERGY_STATES = 1<<8,
+ SCAN_GET_COLORABLE = 1<<9,
+ SCAN_GET_COLOR_VALUE = 1<<10,
+ SCAN_GET_AGE = 1<<11,
+ SCAN_GET_TIMESPAN_MULT = 1<<12,
+ SCAN_GET_CLASS_TYPE = 1<<13,
+ SCAN_GET_TOO_BIG = 1<<14;//should be the sum of all flags +1
private TT_recipe.TT_EMRecipe.TT_EMRecipe eRecipe;
private EMDefinitionStack objectResearched;
@@ -110,7 +121,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
}
v = (int) v;
if (v == 0) return LedStatus.STATUS_NEUTRAL;
- if (v >= SCAN_GET_CLASS_TYPE) return LedStatus.STATUS_TOO_HIGH;
+ if (v >= SCAN_GET_TOO_BIG) return LedStatus.STATUS_TOO_HIGH;
if (v < 0) return LedStatus.STATUS_TOO_LOW;
return LedStatus.STATUS_OK;
};
@@ -148,58 +159,60 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
private void addComputationRequirements(int depthPlus, int capabilities) {
if (areBitsSet(SCAN_GET_NOMENCLATURE, capabilities)) {
- computationRequired += depthPlus * 5L;
+ computationRequired += depthPlus * 3L;
eRequiredData += depthPlus;
}
if (areBitsSet(SCAN_GET_DEPTH_LEVEL, capabilities)) {
computationRequired += depthPlus * 10L;
eRequiredData += depthPlus;
-
}
if (areBitsSet(SCAN_GET_AMOUNT, capabilities)) {
computationRequired += depthPlus * 64L;
eRequiredData += depthPlus * 8L;
-
}
if (areBitsSet(SCAN_GET_CHARGE, capabilities)) {
computationRequired += depthPlus * 128L;
eRequiredData += depthPlus * 4L;
-
}
if (areBitsSet(SCAN_GET_MASS, capabilities)) {
computationRequired += depthPlus * 256L;
eRequiredData += depthPlus * 4L;
-
+ }
+ if (areBitsSet(SCAN_GET_ENERGY, capabilities)) {
+ computationRequired += depthPlus * 256L;
+ eRequiredData += depthPlus * 16L;
}
if (areBitsSet(SCAN_GET_ENERGY_LEVEL, capabilities)) {
- computationRequired += depthPlus * 512L;
+ computationRequired += depthPlus * 256L;
eRequiredData += depthPlus * 16L;
-
}
if (areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)) {
computationRequired += depthPlus * 1024L;
eRequiredData += depthPlus * 32L;
-
}
if (areBitsSet(SCAN_GET_ENERGY_STATES, capabilities)) {
computationRequired += depthPlus * 2048L;
eRequiredData += depthPlus * 32L;
-
}
- if (areBitsSet(SCAN_GET_COLOR, capabilities)) {
+ if (areBitsSet(SCAN_GET_COLORABLE, capabilities)) {
+ computationRequired += depthPlus * 512L;
+ eRequiredData += depthPlus * 48L;
+ }
+ if (areBitsSet(SCAN_GET_COLOR_VALUE, capabilities)) {
computationRequired += depthPlus * 1024L;
eRequiredData += depthPlus * 48L;
-
}
if (areBitsSet(SCAN_GET_AGE, capabilities)) {
computationRequired += depthPlus * 2048L;
eRequiredData += depthPlus * 64L;
-
}
if (areBitsSet(SCAN_GET_TIMESPAN_MULT, capabilities)) {
computationRequired += depthPlus * 2048L;
eRequiredData += depthPlus * 64L;
-
+ }
+ if (areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) {
+ computationRequired += depthPlus * 2L;
+ eRequiredData += depthPlus;
}
}
@@ -277,9 +290,6 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
for (int i = 0; i < 20; i++) {
if (scanComplexityTemp[i] != SCAN_DO_NOTHING) {
maxDepth = i;
- if (!DEBUG_MODE) {
- scanComplexityTemp[i] &= ~SCAN_GET_CLASS_TYPE;
- }
addComputationRequirements(i + 1, scanComplexityTemp[i]);
}
}
@@ -311,7 +321,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
tNBT.setString("eMachineType", machineType);
tNBT.setTag(E_RECIPE_ID, objectResearched.toNBT(TecTech.definitionsRegistry));
- tNBT.setString("author", EnumChatFormatting.BLUE + "Tec" + EnumChatFormatting.DARK_BLUE + "Tech" + EnumChatFormatting.WHITE + ' ' + machineType + " EM Recipe Generator");
+ tNBT.setString("author", TEC_MARK_SHORT + EnumChatFormatting.WHITE + ' ' + machineType + " EM Recipe Generator");
} else if (objectsScanned != null && CustomItemList.scanContainer.isStackEqual(mInventory[1], false, true)) {
ElementalDefinitionScanStorage_EM.setContent(mInventory[1], objectsScanned, scanComplexity);
}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java
index d4fe7b6e49..10377e9298 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java
@@ -44,6 +44,7 @@ import net.minecraftforge.fluids.FluidStack;
import java.util.ArrayList;
import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
+import static com.github.technus.tectech.loader.TecTechConfig.POWERLESS_MODE;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
import static com.github.technus.tectech.util.CommonValues.*;
import static com.github.technus.tectech.util.DoubleCount.div;
@@ -64,7 +65,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
//Sound resource - same as with screen but override getActivitySound
public final static ResourceLocation activitySound = new ResourceLocation(Reference.MODID + ":fx_lo_freq");
@SideOnly(Side.CLIENT)
- private SoundLoop activitySoundLoop;
+ private SoundLoop activitySoundLoop;
//endregion
//region HATCHES ARRAYS - they hold info about found hatches, add hatches to them... (auto structure magic does it tho)
@@ -72,19 +73,19 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
//HATCHES!!!, should be added and removed in check machine
//EM in/out
- protected ArrayList<GT_MetaTileEntity_Hatch_InputElemental> eInputHatches = new ArrayList<>();
- protected ArrayList<GT_MetaTileEntity_Hatch_OutputElemental> eOutputHatches = new ArrayList<>();
+ protected ArrayList<GT_MetaTileEntity_Hatch_InputElemental> eInputHatches = new ArrayList<>();
+ protected ArrayList<GT_MetaTileEntity_Hatch_OutputElemental> eOutputHatches = new ArrayList<>();
//EM overflow output
- protected ArrayList<GT_MetaTileEntity_Hatch_OverflowElemental> eMufflerHatches = new ArrayList<>();
+ protected ArrayList<GT_MetaTileEntity_Hatch_OverflowElemental> eMufflerHatches = new ArrayList<>();
//extra hatches
- protected ArrayList<GT_MetaTileEntity_Hatch_Param> eParamHatches = new ArrayList<>();
- protected ArrayList<GT_MetaTileEntity_Hatch_Uncertainty> eUncertainHatches = new ArrayList<>();
+ protected ArrayList<GT_MetaTileEntity_Hatch_Param> eParamHatches = new ArrayList<>();
+ protected ArrayList<GT_MetaTileEntity_Hatch_Uncertainty> eUncertainHatches = new ArrayList<>();
//multi amp hatches in/out
- protected ArrayList<GT_MetaTileEntity_Hatch_EnergyMulti> eEnergyMulti = new ArrayList<>();
- protected ArrayList<GT_MetaTileEntity_Hatch_DynamoMulti> eDynamoMulti = new ArrayList<>();
+ protected ArrayList<GT_MetaTileEntity_Hatch_EnergyMulti> eEnergyMulti = new ArrayList<>();
+ protected ArrayList<GT_MetaTileEntity_Hatch_DynamoMulti> eDynamoMulti = new ArrayList<>();
//data hatches
- protected ArrayList<GT_MetaTileEntity_Hatch_InputData> eInputData = new ArrayList<>();
- protected ArrayList<GT_MetaTileEntity_Hatch_OutputData> eOutputData = new ArrayList<>();
+ protected ArrayList<GT_MetaTileEntity_Hatch_InputData> eInputData = new ArrayList<>();
+ protected ArrayList<GT_MetaTileEntity_Hatch_OutputData> eOutputData = new ArrayList<>();
//endregion
@@ -142,7 +143,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
//front rotation val
private IAlignmentLimits alignmentLimits = IAlignmentLimits.UNLIMITED;
- private ExtendedFacing extendedFacing = ExtendedFacing.DEFAULT;
+ private ExtendedFacing extendedFacing = ExtendedFacing.DEFAULT;
//endregion
protected GT_MetaTileEntity_MultiblockBase_EM(int aID, String aName, String aNameRegional) {
@@ -172,8 +173,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
@Override
public void setExtendedFacing(ExtendedFacing newExtendedFacing) {
- if(extendedFacing!=newExtendedFacing){
- extendedFacing=newExtendedFacing;
+ if (extendedFacing != newExtendedFacing) {
+ extendedFacing = newExtendedFacing;
IGregTechTileEntity base = getBaseMetaTileEntity();
mMachine = false;
if (getBaseMetaTileEntity().isServerSide()) {
@@ -183,7 +184,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
StructureLibAPI.sendAlignment((IAlignmentProvider) base,
new NetworkRegistry.TargetPoint(base.getWorld().provider.dimensionId,
base.getXCoord(), base.getYCoord(), base.getZCoord(), 512));
- }else{
+ } else {
base.issueTextureUpdate();
}
}
@@ -201,20 +202,21 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
/**
* Gets structure
+ *
* @return STATIC INSTANCE OF STRUCTURE
*/
public abstract IStructureDefinition<? extends GT_MetaTileEntity_MultiblockBase_EM> getStructure_EM();
@SuppressWarnings("unchecked")
- private IStructureDefinition<GT_MetaTileEntity_MultiblockBase_EM> getStructure_EM_Internal(){
- return (IStructureDefinition<GT_MetaTileEntity_MultiblockBase_EM>)getStructure_EM();
+ private IStructureDefinition<GT_MetaTileEntity_MultiblockBase_EM> getStructure_EM_Internal() {
+ return (IStructureDefinition<GT_MetaTileEntity_MultiblockBase_EM>) getStructure_EM();
}
- public final boolean structureCheck_EM(String piece,int horizontalOffset, int verticalOffset, int depthOffset) {
+ public final boolean structureCheck_EM(String piece, int horizontalOffset, int verticalOffset, int depthOffset) {
IGregTechTileEntity baseMetaTileEntity = getBaseMetaTileEntity();
- return getStructure_EM_Internal().check(this,piece, baseMetaTileEntity.getWorld(),getExtendedFacing(),
- baseMetaTileEntity.getXCoord(),baseMetaTileEntity.getYCoord(),baseMetaTileEntity.getZCoord(),
- horizontalOffset,verticalOffset,depthOffset,!mMachine);
+ return getStructure_EM_Internal().check(this, piece, baseMetaTileEntity.getWorld(), getExtendedFacing(),
+ baseMetaTileEntity.getXCoord(), baseMetaTileEntity.getYCoord(), baseMetaTileEntity.getZCoord(),
+ horizontalOffset, verticalOffset, depthOffset, !mMachine);
}
public final boolean structureBuild_EM(String piece, int horizontalOffset, int verticalOffset, int depthOffset, ItemStack trigger, boolean hintsOnly) {
@@ -348,7 +350,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
@Override
public String[] getInfoData() {//TODO Do it
long storedEnergy = 0;
- long maxEnergy = 0;
+ long maxEnergy = 0;
for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) {
if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU();
@@ -626,9 +628,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
* @return available data
*/
protected long getAvailableData_EM() {
- long result = 0;
+ long result = 0;
IGregTechTileEntity baseMetaTileEntity = getBaseMetaTileEntity();
- Vec3Impl pos = new Vec3Impl(baseMetaTileEntity.getXCoord(),baseMetaTileEntity.getYCoord(),baseMetaTileEntity.getZCoord());
+ Vec3Impl pos = new Vec3Impl(baseMetaTileEntity.getXCoord(), baseMetaTileEntity.getYCoord(), baseMetaTileEntity.getZCoord());
for (GT_MetaTileEntity_Hatch_InputData in : eInputData) {
if (in.q != null) {
Long value = in.q.contentIfNotInTrace(pos);
@@ -700,8 +702,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
aNBT.setByte("eCertainM", eCertainMode);
aNBT.setByte("eCertainS", eCertainStatus);
aNBT.setByte("eMinRepair", minRepairStatus);
- aNBT.setByte("eRotation", (byte)extendedFacing.getRotation().getIndex());
- aNBT.setByte("eFlip", (byte)extendedFacing.getFlip().getIndex());
+ aNBT.setByte("eRotation", (byte) extendedFacing.getRotation().getIndex());
+ aNBT.setByte("eFlip", (byte) extendedFacing.getFlip().getIndex());
aNBT.setBoolean("eParam", eParameters);
aNBT.setBoolean("ePass", ePowerPass);
aNBT.setBoolean("ePowerPassCover", ePowerPassCover);
@@ -784,14 +786,14 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
eMaxAmpereGen = aNBT.getLong("eGenRating");
maxEUinputMin = aNBT.getLong("eMaxEUmin");
maxEUinputMax = aNBT.getLong("eMaxEUmax");
- eAmpereFlow = aNBT.hasKey("eRating")?aNBT.getLong("eRating"):1;
+ eAmpereFlow = aNBT.hasKey("eRating") ? aNBT.getLong("eRating") : 1;
eMaxAmpereFlow = aNBT.getLong("eMaxA");
eRequiredData = aNBT.getLong("eDataR");
eAvailableData = aNBT.getLong("eDataA");
eCertainMode = aNBT.getByte("eCertainM");
eCertainStatus = aNBT.getByte("eCertainS");
- minRepairStatus = aNBT.hasKey("eMinRepair")?aNBT.getByte("eMinRepair"):3;
- extendedFacing=ExtendedFacing.of(
+ minRepairStatus = aNBT.hasKey("eMinRepair") ? aNBT.getByte("eMinRepair") : 3;
+ extendedFacing = ExtendedFacing.of(
ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()),
Rotation.byIndex(aNBT.getByte("eRotation")),
Flip.byIndex(aNBT.getByte("eFlip")));
@@ -827,7 +829,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
for (int i = 0; i < outputEM.length; i++) {
if (compound.hasKey(Integer.toString(i))) {
try {
- outputEM[i] = EMInstanceStackMap.fromNBT(TecTech.definitionsRegistry,compound.getCompoundTag(Integer.toString(i)));
+ outputEM[i] = EMInstanceStackMap.fromNBT(TecTech.definitionsRegistry, compound.getCompoundTag(Integer.toString(i)));
} catch (EMException e) {
if (DEBUG_MODE) {
e.printStackTrace();
@@ -1202,7 +1204,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
mProgresstime = 0;
mMaxProgresstime = 0;
mEfficiencyIncrease = 0;
-
+
if (aBaseMetaTileEntity.isAllowedToWork()) {
if (checkRecipe(mInventory[1])) {
mEfficiency = Math.max(0, min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - (getIdealStatus() - getRepairStatus()) * 1000));
@@ -1304,16 +1306,16 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
}
protected void maintenance_EM() {
- for (GT_MetaTileEntity_Hatch_Maintenance tHatch : mMaintenanceHatches) {
- if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- if (GT_MetaTileEntity_MultiBlockBase.disableMaintenance) {
- mWrench = true;
- mScrewdriver = true;
- mSoftHammer = true;
- mHardHammer = true;
- mSolderingTool = true;
- mCrowbar = true;
- } else {
+ if (GT_MetaTileEntity_MultiBlockBase.disableMaintenance) {
+ mWrench = true;
+ mScrewdriver = true;
+ mSoftHammer = true;
+ mHardHammer = true;
+ mSolderingTool = true;
+ mCrowbar = true;
+ } else {
+ for (GT_MetaTileEntity_Hatch_Maintenance tHatch : mMaintenanceHatches) {
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
if (tHatch.mAuto && !(mWrench && mScrewdriver && mSoftHammer && mHardHammer && mSolderingTool && mCrowbar)) {
tHatch.autoMaintainance();
}
@@ -1520,7 +1522,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
}
protected void dischargeController_EM(IGregTechTileEntity aBaseMetaTileEntity) {
- if(ePowerPass && getEUVar() > getMinimumStoredEU()){
+ if (ePowerPass && getEUVar() > getMinimumStoredEU()) {
powerPass(aBaseMetaTileEntity);
}
}
@@ -1580,7 +1582,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
break;
}
if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- euVar = Math.min(tHatch.maxEUInput() * tHatch.maxAmperesIn(),tHatch.getEUVar());
+ euVar = Math.min(tHatch.maxEUInput() * tHatch.maxAmperesIn(), tHatch.getEUVar());
if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euVar, false)) {
setEUVar(getEUVar() + euVar);
}
@@ -1591,7 +1593,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
break;
}
if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- euVar = Math.min(tHatch.maxEUInput() * tHatch.maxAmperesIn(),tHatch.getEUVar());
+ euVar = Math.min(tHatch.maxEUInput() * tHatch.maxAmperesIn(), tHatch.getEUVar());
if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euVar, false)) {
setEUVar(getEUVar() + euVar);
}
@@ -1654,6 +1656,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
if (allowProduction && euFlow > 0) {
addEnergyOutput_EM((long) mEUt * (long) mEfficiency / getMaxEfficiency(aStack), eAmpereFlow);
} else if (euFlow < 0) {
+ if (POWERLESS_MODE) {
+ return true;
+ }
if (!drainEnergyInput_EM(mEUt, (long) mEUt * getMaxEfficiency(aStack) / Math.max(1000L, mEfficiency), eAmpereFlow)) {
criticalStopMachine();
return false;
@@ -1667,6 +1672,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
if (allowProduction && euFlow > 0) {
addEnergyOutput_EM((long) mEUt * (long) mEfficiency / getMaxEfficiency(aStack), eAmpereFlow);
} else if (euFlow < 0) {
+ if (POWERLESS_MODE) {
+ return true;
+ }
if (!drainEnergyInput((long) mEUt * getMaxEfficiency(aStack) / Math.max(1000L, mEfficiency), eAmpereFlow)) {
criticalStopMachine();
return false;
@@ -1711,7 +1719,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
@Deprecated
@Override
public final boolean addEnergyOutput(long eu) {
- return addEnergyOutput_EM(eu,1);
+ return addEnergyOutput_EM(eu, 1);
}
public boolean addEnergyOutput_EM(long EU, long Amperes) {
@@ -1764,24 +1772,24 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
@Deprecated
@Override
public final boolean drainEnergyInput(long eu) {
- return drainEnergyInput_EM(0,eu,1);
+ return drainEnergyInput_EM(0, eu, 1);
}
public boolean drainEnergyInput_EM(long EUtTierVoltage, long EUtEffective, long Amperes) {
long EUuse = EUtEffective * Amperes;
- if(EUuse==0){
+ if (EUuse == 0) {
return true;
}
- if(maxEUinputMin==0){
+ if (maxEUinputMin == 0) {
return false;
}
if (EUuse < 0) {
EUuse = -EUuse;
}
if (EUuse > getEUVar() || //not enough power
- (EUtTierVoltage==0? EUuse> getMaxInputEnergy():
+ (EUtTierVoltage == 0 ? EUuse > getMaxInputEnergy() :
(EUtTierVoltage > maxEUinputMax) || //TIER IS BASED ON BEST HATCH! not total EUtEffective input
- (EUtTierVoltage * Amperes - 1) / maxEUinputMin + 1 > eMaxAmpereFlow)) {// EUuse==0? --> (EUuse - 1) / maxEUinputMin + 1 = 1! //if not too much A
+ (EUtTierVoltage * Amperes - 1) / maxEUinputMin + 1 > eMaxAmpereFlow)) {// EUuse==0? --> (EUuse - 1) / maxEUinputMin + 1 = 1! //if not too much A
if (DEBUG_MODE) {
TecTech.LOGGER.debug("L1 " + EUuse + ' ' + getEUVar() + ' ' + (EUuse > getEUVar()));
TecTech.LOGGER.debug("L2 " + EUtEffective + ' ' + maxEUinputMax + ' ' + (EUtEffective > maxEUinputMax));
@@ -1797,10 +1805,10 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
public boolean drainEnergyInput(long EUtEffective, long Amperes) {
long EUuse = EUtEffective * Amperes;
- if(EUuse==0){
+ if (EUuse == 0) {
return true;
}
- if(maxEUinputMin==0){
+ if (maxEUinputMin == 0) {
return false;
}
if (EUuse < 0) {
@@ -1822,7 +1830,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
mMaxProgresstime = time;
return true;
}
- long tempEUt = Math.max(EU, V[1]);
+ long tempEUt = Math.max(EU, V[1]);
long tempTier = maxEUinputMax >> 2;
while (tempEUt < tempTier) {
tempEUt <<= 2;
@@ -1865,12 +1873,12 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
long energy = 0;
for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) {
if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- energy += tHatch.maxEUInput()*tHatch.maxAmperesIn();
+ energy += tHatch.maxEUInput() * tHatch.maxAmperesIn();
}
}
for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) {
if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- energy += tHatch.maxEUInput()*tHatch.maxAmperesIn();
+ energy += tHatch.maxEUInput() * tHatch.maxAmperesIn();
}
}
return energy;
@@ -1885,7 +1893,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
}
for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) {
if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
- energy += tHatch.maxEUInput()*tHatch.Amperes;
+ energy += tHatch.maxEUInput() * tHatch.Amperes;
}
}
return energy;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedExtendedFacingTexture.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedExtendedFacingTexture.java
index 5ed53634de..9795b42827 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedExtendedFacingTexture.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedExtendedFacingTexture.java
@@ -1,39 +1,16 @@
package com.github.technus.tectech.thing.metaTileEntity.multi.base.render;
-import com.github.technus.tectech.util.LightingHelper;
-import com.gtnewhorizon.structurelib.alignment.IAlignmentProvider;
-import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing;
import gregtech.api.enums.Dyes;
-import gregtech.api.interfaces.IColorModulationContainer;
import gregtech.api.interfaces.IIconContainer;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.renderer.RenderBlocks;
-import net.minecraft.client.renderer.Tessellator;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
+import gregtech.common.render.GT_RenderedTexture;
-public class TT_RenderedExtendedFacingTexture implements ITexture,IColorModulationContainer {
- private final IIconContainer mIconContainer;
- private final boolean mAllowAlpha;
- /**
- * DO NOT MANIPULATE THE VALUES INSIDE THIS ARRAY!!!
- * <p/>
- * Just set this variable to another different Array instead.
- * Otherwise some colored things will get Problems.
- */
- public short[] mRGBa;
+public class TT_RenderedExtendedFacingTexture extends GT_RenderedTexture {
+ public TT_RenderedExtendedFacingTexture(IIconContainer aIcon, short[] aRGBa, boolean allowAlpha, boolean glow, boolean stdOrient, boolean extFacing) {
+ super(aIcon, aRGBa, allowAlpha, glow, stdOrient, extFacing);
+ }
public TT_RenderedExtendedFacingTexture(IIconContainer aIcon, short[] aRGBa, boolean aAllowAlpha) {
- if (aRGBa.length != 4) throw new IllegalArgumentException("RGBa doesn't have 4 Values @ TT_RenderedTexture");
- mIconContainer = aIcon;
- mAllowAlpha = aAllowAlpha;
- mRGBa = aRGBa;
+ this(aIcon,aRGBa,aAllowAlpha,false,false,true);
}
public TT_RenderedExtendedFacingTexture(IIconContainer aIcon, short[] aRGBa) {
@@ -43,863 +20,4 @@ public class TT_RenderedExtendedFacingTexture implements ITexture,IColorModulati
public TT_RenderedExtendedFacingTexture(IIconContainer aIcon) {
this(aIcon, Dyes._NULL.mRGBa);
}
-
- @Override
- public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
- aRenderer.field_152631_f = true;
- LightingHelper lighting = new LightingHelper(aRenderer);
- lighting.setupLightingXPos(aBlock, aX, aY, aZ).setupColor(ForgeDirection.EAST.ordinal(), mRGBa);
- ExtendedFacing rotation = getExtendedFacing(aX, aY, aZ);
- renderFaceXPos(aRenderer, aX, aY, aZ, mIconContainer.getIcon(), rotation);
- if (mIconContainer.getOverlayIcon() != null) {
- lighting.setupColor(ForgeDirection.EAST.ordinal(), 0xffffff);
- renderFaceXPos(aRenderer, aX, aY, aZ, mIconContainer.getOverlayIcon(), rotation);
- }
- aRenderer.field_152631_f = false;
- }
-
- @Override
- public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
- LightingHelper lighting = new LightingHelper(aRenderer);
- lighting.setupLightingXNeg(aBlock, aX, aY, aZ).setupColor(ForgeDirection.WEST.ordinal(), mRGBa);
- ExtendedFacing rotation = getExtendedFacing(aX, aY, aZ);
- renderFaceXNeg(aRenderer, aX, aY, aZ, mIconContainer.getIcon(), rotation);
- if (mIconContainer.getOverlayIcon() != null) {
- lighting.setupColor(ForgeDirection.WEST.ordinal(), 0xffffff);
- renderFaceXNeg(aRenderer, aX, aY, aZ, mIconContainer.getOverlayIcon(), rotation);
- }
- }
-
- @Override
- public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
- LightingHelper lighting = new LightingHelper(aRenderer);
- lighting.setupLightingYPos(aBlock, aX, aY, aZ).setupColor(ForgeDirection.UP.ordinal(), mRGBa);
- ExtendedFacing rotation = getExtendedFacing(aX, aY, aZ);
- renderFaceYPos(aRenderer, aX, aY, aZ, mIconContainer.getIcon(), rotation);
- if (mIconContainer.getOverlayIcon() != null) {
- lighting.setupColor(ForgeDirection.UP.ordinal(), 0xffffff);
- renderFaceYPos(aRenderer, aX, aY, aZ, mIconContainer.getOverlayIcon(), rotation);
- }
- }
-
- @Override
- public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
- LightingHelper lighting = new LightingHelper(aRenderer);
- lighting.setupLightingYNeg(aBlock, aX, aY, aZ).setupColor(ForgeDirection.DOWN.ordinal(), mRGBa);
- ExtendedFacing rotation = getExtendedFacing(aX, aY, aZ);
- renderFaceYNeg(aRenderer, aX, aY, aZ, mIconContainer.getIcon(), rotation);
- if (mIconContainer.getOverlayIcon() != null) {
- Tessellator.instance.setColorRGBA(255, 255, 255, 255);
- renderFaceYNeg(aRenderer, aX, aY, aZ, mIconContainer.getOverlayIcon(), rotation);
- }
- }
-
- @Override
- public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
- LightingHelper lighting = new LightingHelper(aRenderer);
- lighting.setupLightingZPos(aBlock, aX, aY, aZ).setupColor(ForgeDirection.SOUTH.ordinal(), mRGBa);
- ExtendedFacing rotation = getExtendedFacing(aX, aY, aZ);
- renderFaceZPos(aRenderer, aX, aY, aZ, mIconContainer.getIcon(), rotation);
- if (mIconContainer.getOverlayIcon() != null) {
- lighting.setupColor(ForgeDirection.SOUTH.ordinal(), 0xffffff);
- renderFaceZPos(aRenderer, aX, aY, aZ, mIconContainer.getOverlayIcon(), rotation);
- }
- }
-
- @Override
- public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
- aRenderer.field_152631_f = true;
- LightingHelper lighting = new LightingHelper(aRenderer);
- lighting.setupLightingZNeg(aBlock, aX, aY, aZ).setupColor(ForgeDirection.NORTH.ordinal(), mRGBa);
- ExtendedFacing rotation = getExtendedFacing(aX, aY, aZ);
- renderFaceZNeg(aRenderer, aX, aY, aZ, mIconContainer.getIcon(), rotation);
- if (mIconContainer.getOverlayIcon() != null) {
- lighting.setupColor(ForgeDirection.NORTH.ordinal(), 0xffffff);
- renderFaceZNeg(aRenderer, aX, aY, aZ, mIconContainer.getOverlayIcon(), rotation);
- }
- aRenderer.field_152631_f = false;
- }
-
- /**
- * Renders the given texture to the bottom face of the block. Args: block, x, y, z, texture
- */
- public void renderFaceYNeg(RenderBlocks aRenderer, double x, double y, double z, IIcon icon, ExtendedFacing rotation) {
- Tessellator tessellator = Tessellator.instance;
-
- if (aRenderer.hasOverrideBlockTexture()) {
- icon = aRenderer.overrideBlockTexture;
- }
-
- double d3 = icon.getInterpolatedU(aRenderer.renderMaxX * 16.0D);
- double d4 = icon.getInterpolatedU(aRenderer.renderMinX * 16.0D);
- double d5 = icon.getInterpolatedV(aRenderer.renderMinZ * 16.0D);
- double d6 = icon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D);
-
- if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) {
- d3 = icon.getMaxU();
- d4 = icon.getMinU();
- }
-
- if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) {
- d5 = icon.getMinV();
- d6 = icon.getMaxV();
- }
-
- {
- double temp;
- switch (rotation.getFlip().ordinal()){
- case 1:
- temp=d3;
- d3=d4;
- d4=temp;
- break;
- case 2:
- temp=d5;
- d5=d6;
- d6=temp;
- case 3:
- temp=d3;
- d3=d4;
- d4=temp;
- break;
- }
- }
-
- double d7 = d4;
- double d8 = d3;
- double d9 = d5;
- double d10 = d6;
-
- switch (rotation.getRotation().ordinal()) {
- case 3:
- d3 = icon.getInterpolatedU(aRenderer.renderMaxZ * 16.0D);
- d5 = icon.getInterpolatedV(16.0D - aRenderer.renderMaxX * 16.0D);
- d4 = icon.getInterpolatedU(aRenderer.renderMinZ * 16.0D);
- d6 = icon.getInterpolatedV(16.0D - aRenderer.renderMinX * 16.0D);
- d9 = d5;
- d10 = d6;
- d7 = d3;
- d8 = d4;
- d5 = d6;
- d6 = d9;
- break;
- case 1:
- d3 = icon.getInterpolatedU(16.0D - aRenderer.renderMinZ * 16.0D);
- d5 = icon.getInterpolatedV(aRenderer.renderMinX * 16.0D);
- d4 = icon.getInterpolatedU(16.0D - aRenderer.renderMaxZ * 16.0D);
- d6 = icon.getInterpolatedV(aRenderer.renderMaxX * 16.0D);
- d7 = d4;
- d8 = d3;
- d3 = d4;
- d4 = d8;
- d9 = d6;
- d10 = d5;
- break;
- case 2:
- d3 = icon.getInterpolatedU(16.0D - aRenderer.renderMaxX * 16.0D);
- d4 = icon.getInterpolatedU(16.0D - aRenderer.renderMinX * 16.0D);
- d5 = icon.getInterpolatedV(16.0D - aRenderer.renderMinZ * 16.0D);
- d6 = icon.getInterpolatedV(16.0D - aRenderer.renderMaxZ * 16.0D);
- d7 = d4;
- d8 = d3;
- d9 = d5;
- d10 = d6;
- break;
- }
-
- double d11 = x + aRenderer.renderMinX;
- double d12 = x + aRenderer.renderMaxX;
- double d13 = y + aRenderer.renderMinY;
- double d14 = z + aRenderer.renderMinZ;
- double d15 = z + aRenderer.renderMaxZ;
-
- if (aRenderer.renderFromInside) {
- d11 = x + aRenderer.renderMaxX;
- d12 = x + aRenderer.renderMinX;
- }
-
- if (aRenderer.enableAO) {
- tessellator.setColorOpaque_F(aRenderer.colorRedTopLeft, aRenderer.colorGreenTopLeft, aRenderer.colorBlueTopLeft);
- tessellator.setBrightness(aRenderer.brightnessTopLeft);
- tessellator.addVertexWithUV(d11, d13, d15, d8, d10);
- tessellator.setColorOpaque_F(aRenderer.colorRedBottomLeft, aRenderer.colorGreenBottomLeft, aRenderer.colorBlueBottomLeft);
- tessellator.setBrightness(aRenderer.brightnessBottomLeft);
- tessellator.addVertexWithUV(d11, d13, d14, d3, d5);
- tessellator.setColorOpaque_F(aRenderer.colorRedBottomRight, aRenderer.colorGreenBottomRight, aRenderer.colorBlueBottomRight);
- tessellator.setBrightness(aRenderer.brightnessBottomRight);
- tessellator.addVertexWithUV(d12, d13, d14, d7, d9);
- tessellator.setColorOpaque_F(aRenderer.colorRedTopRight, aRenderer.colorGreenTopRight, aRenderer.colorBlueTopRight);
- tessellator.setBrightness(aRenderer.brightnessTopRight);
- tessellator.addVertexWithUV(d12, d13, d15, d4, d6);
- } else {
- tessellator.addVertexWithUV(d11, d13, d15, d8, d10);
- tessellator.addVertexWithUV(d11, d13, d14, d3, d5);
- tessellator.addVertexWithUV(d12, d13, d14, d7, d9);
- tessellator.addVertexWithUV(d12, d13, d15, d4, d6);
- }
- }
-
- /**
- * Renders the given texture to the top face of the block. Args: block, x, y, z, texture
- */
- public void renderFaceYPos(RenderBlocks aRenderer, double x, double y, double z, IIcon icon, ExtendedFacing rotation) {
- Tessellator tessellator = Tessellator.instance;
-
- if (aRenderer.hasOverrideBlockTexture()) {
- icon = aRenderer.overrideBlockTexture;
- }
-
- double d3 = icon.getInterpolatedU(aRenderer.renderMinX * 16.0D);
- double d4 = icon.getInterpolatedU(aRenderer.renderMaxX * 16.0D);
- double d5 = icon.getInterpolatedV(aRenderer.renderMinZ * 16.0D);
- double d6 = icon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D);
-
- if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) {
- d3 = icon.getMinU();
- d4 = icon.getMaxU();
- }
-
- if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) {
- d5 = icon.getMinV();
- d6 = icon.getMaxV();
- }
-
- {
- double temp;
- switch (rotation.getFlip().ordinal()){
- case 1:
- temp=d3;
- d3=d4;
- d4=temp;
- break;
- case 2:
- temp=d5;
- d5=d6;
- d6=temp;
- case 3:
- temp=d3;
- d3=d4;
- d4=temp;
- break;
- }
- }
-
- double d7 = d4;
- double d8 = d3;
- double d9 = d5;
- double d10 = d6;
-
- switch (rotation.getRotation().ordinal()) {
- case 1:
- d3 = icon.getInterpolatedU(aRenderer.renderMinZ * 16.0D);
- d5 = icon.getInterpolatedV(16.0D - aRenderer.renderMaxX * 16.0D);
- d4 = icon.getInterpolatedU(aRenderer.renderMaxZ * 16.0D);
- d6 = icon.getInterpolatedV(16.0D - aRenderer.renderMinX * 16.0D);
- d9 = d5;
- d10 = d6;
- d7 = d3;
- d8 = d4;
- d5 = d6;
- d6 = d9;
- break;
- case 3:
- d3 = icon.getInterpolatedU(16.0D - aRenderer.renderMaxZ * 16.0D);
- d5 = icon.getInterpolatedV(aRenderer.renderMinX * 16.0D);
- d4 = icon.getInterpolatedU(16.0D - aRenderer.renderMinZ * 16.0D);
- d6 = icon.getInterpolatedV(aRenderer.renderMaxX * 16.0D);
- d7 = d4;
- d8 = d3;
- d3 = d4;
- d4 = d8;
- d9 = d6;
- d10 = d5;
- break;
- case 2:
- d3 = icon.getInterpolatedU(16.0D - aRenderer.renderMinX * 16.0D);
- d4 = icon.getInterpolatedU(16.0D - aRenderer.renderMaxX * 16.0D);
- d5 = icon.getInterpolatedV(16.0D - aRenderer.renderMinZ * 16.0D);
- d6 = icon.getInterpolatedV(16.0D - aRenderer.renderMaxZ * 16.0D);
- d7 = d4;
- d8 = d3;
- d9 = d5;
- d10 = d6;
- break;
- }
-
- double d11 = x + aRenderer.renderMinX;
- double d12 = x + aRenderer.renderMaxX;
- double d13 = y + aRenderer.renderMaxY;
- double d14 = z + aRenderer.renderMinZ;
- double d15 = z + aRenderer.renderMaxZ;
-
- if (aRenderer.renderFromInside) {
- d11 = x + aRenderer.renderMaxX;
- d12 = x + aRenderer.renderMinX;
- }
-
- if (aRenderer.enableAO) {
- tessellator.setColorOpaque_F(aRenderer.colorRedTopLeft, aRenderer.colorGreenTopLeft, aRenderer.colorBlueTopLeft);
- tessellator.setBrightness(aRenderer.brightnessTopLeft);
- tessellator.addVertexWithUV(d12, d13, d15, d4, d6);
- tessellator.setColorOpaque_F(aRenderer.colorRedBottomLeft, aRenderer.colorGreenBottomLeft, aRenderer.colorBlueBottomLeft);
- tessellator.setBrightness(aRenderer.brightnessBottomLeft);
- tessellator.addVertexWithUV(d12, d13, d14, d7, d9);
- tessellator.setColorOpaque_F(aRenderer.colorRedBottomRight, aRenderer.colorGreenBottomRight, aRenderer.colorBlueBottomRight);
- tessellator.setBrightness(aRenderer.brightnessBottomRight);
- tessellator.addVertexWithUV(d11, d13, d14, d3, d5);
- tessellator.setColorOpaque_F(aRenderer.colorRedTopRight, aRenderer.colorGreenTopRight, aRenderer.colorBlueTopRight);
- tessellator.setBrightness(aRenderer.brightnessTopRight);
- tessellator.addVertexWithUV(d11, d13, d15, d8, d10);
- } else {
- tessellator.addVertexWithUV(d12, d13, d15, d4, d6);
- tessellator.addVertexWithUV(d12, d13, d14, d7, d9);
- tessellator.addVertexWithUV(d11, d13, d14, d3, d5);
- tessellator.addVertexWithUV(d11, d13, d15, d8, d10);
- }
- }
-
- /**
- * Renders the given texture to the north (z-negative) face of the block. Args: block, x, y, z, texture
- */
- public void renderFaceZNeg(RenderBlocks aRenderer, double x, double y, double z, IIcon icon, ExtendedFacing rotation) {
- Tessellator tessellator = Tessellator.instance;
-
- if (aRenderer.hasOverrideBlockTexture()) {
- icon = aRenderer.overrideBlockTexture;
- }
-
- double d3 = icon.getInterpolatedU(aRenderer.renderMinX * 16.0D);
- double d4 = icon.getInterpolatedU(aRenderer.renderMaxX * 16.0D);
-
- if (aRenderer.field_152631_f) {
- d4 = icon.getInterpolatedU((1.0D - aRenderer.renderMinX) * 16.0D);
- d3 = icon.getInterpolatedU((1.0D - aRenderer.renderMaxX) * 16.0D);
- }
-
- double d5 = icon.getInterpolatedV(16.0D - aRenderer.renderMaxY * 16.0D);
- double d6 = icon.getInterpolatedV(16.0D - aRenderer.renderMinY * 16.0D);
-
- double d7;
-
- if (aRenderer.flipTexture) {
- d7 = d3;
- d3 = d4;
- d4 = d7;
- }
-
- if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) {
- d3 = icon.getMinU();
- d4 = icon.getMaxU();
- }
-
- if (aRenderer.renderMinY < 0.0D || aRenderer.renderMaxY > 1.0D) {
- d5 = icon.getMinV();
- d6 = icon.getMaxV();
- }
-
- {
- double temp;
- switch (rotation.getFlip().ordinal()){
- case 1:
- temp=d3;
- d3=d4;
- d4=temp;
- break;
- case 2:
- temp=d5;
- d5=d6;
- d6=temp;
- case 3:
- temp=d3;
- d3=d4;
- d4=temp;
- break;
- }
- }
-
- d7 = d4;
- double d8 = d3;
- double d9 = d5;
- double d10 = d6;
-
- switch (rotation.getRotation().ordinal()) {
- case 3:
- d3 = icon.getInterpolatedU(aRenderer.renderMaxY * 16.0D);
- d4 = icon.getInterpolatedU(aRenderer.renderMinY * 16.0D);
- d5 = icon.getInterpolatedV(16.0D - aRenderer.renderMinX * 16.0D);
- d6 = icon.getInterpolatedV(16.0D - aRenderer.renderMaxX * 16.0D);
- d9 = d5;
- d10 = d6;
- d7 = d3;
- d8 = d4;
- d5 = d6;
- d6 = d9;
- break;
- case 1:
- d3 = icon.getInterpolatedU(16.0D - aRenderer.renderMinY * 16.0D);
- d4 = icon.getInterpolatedU(16.0D - aRenderer.renderMaxY * 16.0D);
- d5 = icon.getInterpolatedV(aRenderer.renderMaxX * 16.0D);
- d6 = icon.getInterpolatedV(aRenderer.renderMinX * 16.0D);
- d7 = d4;
- d8 = d3;
- d3 = d4;
- d4 = d8;
- d9 = d6;
- d10 = d5;
- break;
- case 2:
- d3 = icon.getInterpolatedU(16.0D - aRenderer.renderMinX * 16.0D);
- d4 = icon.getInterpolatedU(16.0D - aRenderer.renderMaxX * 16.0D);
- d5 = icon.getInterpolatedV(aRenderer.renderMaxY * 16.0D);
- d6 = icon.getInterpolatedV(aRenderer.renderMinY * 16.0D);
- d7 = d4;
- d8 = d3;
- d9 = d5;
- d10 = d6;
- break;
- }
-
- double d11 = x + aRenderer.renderMinX;
- double d12 = x + aRenderer.renderMaxX;
- double d13 = y + aRenderer.renderMinY;
- double d14 = y + aRenderer.renderMaxY;
- double d15 = z + aRenderer.renderMinZ;
-
- if (aRenderer.renderFromInside) {
- d11 = x + aRenderer.renderMaxX;
- d12 = x + aRenderer.renderMinX;
- }
-
- if (aRenderer.enableAO) {
- tessellator.setColorOpaque_F(aRenderer.colorRedTopLeft, aRenderer.colorGreenTopLeft, aRenderer.colorBlueTopLeft);
- tessellator.setBrightness(aRenderer.brightnessTopLeft);
- tessellator.addVertexWithUV(d11, d14, d15, d7, d9);
- tessellator.setColorOpaque_F(aRenderer.colorRedBottomLeft, aRenderer.colorGreenBottomLeft, aRenderer.colorBlueBottomLeft);
- tessellator.setBrightness(aRenderer.brightnessBottomLeft);
- tessellator.addVertexWithUV(d12, d14, d15, d3, d5);
- tessellator.setColorOpaque_F(aRenderer.colorRedBottomRight, aRenderer.colorGreenBottomRight, aRenderer.colorBlueBottomRight);
- tessellator.setBrightness(aRenderer.brightnessBottomRight);
- tessellator.addVertexWithUV(d12, d13, d15, d8, d10);
- tessellator.setColorOpaque_F(aRenderer.colorRedTopRight, aRenderer.colorGreenTopRight, aRenderer.colorBlueTopRight);
- tessellator.setBrightness(aRenderer.brightnessTopRight);
- tessellator.addVertexWithUV(d11, d13, d15, d4, d6);
- } else {
- tessellator.addVertexWithUV(d11, d14, d15, d7, d9);
- tessellator.addVertexWithUV(d12, d14, d15, d3, d5);
- tessellator.addVertexWithUV(d12, d13, d15, d8, d10);
- tessellator.addVertexWithUV(d11, d13, d15, d4, d6);
- }
- }
-
- /**
- * Renders the given texture to the south (z-positive) face of the block. Args: block, x, y, z, texture
- */
- public void renderFaceZPos(RenderBlocks aRenderer, double x, double y, double z, IIcon icon, ExtendedFacing rotation) {
- Tessellator tessellator = Tessellator.instance;
-
- if (aRenderer.hasOverrideBlockTexture()) {
- icon = aRenderer.overrideBlockTexture;
- }
-
- double d3 = icon.getInterpolatedU(aRenderer.renderMinX * 16.0D);
- double d4 = icon.getInterpolatedU(aRenderer.renderMaxX * 16.0D);
- double d5 = icon.getInterpolatedV(16.0D - aRenderer.renderMaxY * 16.0D);
- double d6 = icon.getInterpolatedV(16.0D - aRenderer.renderMinY * 16.0D);
- double d7;
-
- if (aRenderer.flipTexture) {
- d7 = d3;
- d3 = d4;
- d4 = d7;
- }
-
- if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) {
- d3 = icon.getMinU();
- d4 = icon.getMaxU();
- }
-
- if (aRenderer.renderMinY < 0.0D || aRenderer.renderMaxY > 1.0D) {
- d5 = icon.getMinV();
- d6 = icon.getMaxV();
- }
-
- {
- double temp;
- switch (rotation.getFlip().ordinal()){
- case 1:
- temp=d3;
- d3=d4;
- d4=temp;
- break;
- case 2:
- temp=d5;
- d5=d6;
- d6=temp;
- case 3:
- temp=d3;
- d3=d4;
- d4=temp;
- break;
- }
- }
-
- d7 = d4;
- double d8 = d3;
- double d9 = d5;
- double d10 = d6;
-
- switch (rotation.getRotation().ordinal()) {
- case 1:
- d3 = icon.getInterpolatedU(aRenderer.renderMinY * 16.0D);
- d6 = icon.getInterpolatedV(16.0D - aRenderer.renderMinX * 16.0D);
- d4 = icon.getInterpolatedU(aRenderer.renderMaxY * 16.0D);
- d5 = icon.getInterpolatedV(16.0D - aRenderer.renderMaxX * 16.0D);
- d9 = d5;
- d10 = d6;
- d7 = d3;
- d8 = d4;
- d5 = d6;
- d6 = d9;
- break;
- case 3:
- d3 = icon.getInterpolatedU(16.0D - aRenderer.renderMaxY * 16.0D);
- d5 = icon.getInterpolatedV(aRenderer.renderMinX * 16.0D);
- d4 = icon.getInterpolatedU(16.0D - aRenderer.renderMinY * 16.0D);
- d6 = icon.getInterpolatedV(aRenderer.renderMaxX * 16.0D);
- d7 = d4;
- d8 = d3;
- d3 = d4;
- d4 = d8;
- d9 = d6;
- d10 = d5;
- break;
- case 2:
- d3 = icon.getInterpolatedU(16.0D - aRenderer.renderMinX * 16.0D);
- d4 = icon.getInterpolatedU(16.0D - aRenderer.renderMaxX * 16.0D);
- d5 = icon.getInterpolatedV(aRenderer.renderMaxY * 16.0D);
- d6 = icon.getInterpolatedV(aRenderer.renderMinY * 16.0D);
- d7 = d4;
- d8 = d3;
- d9 = d5;
- d10 = d6;
- break;
- }
-
- double d11 = x + aRenderer.renderMinX;
- double d12 = x + aRenderer.renderMaxX;
- double d13 = y + aRenderer.renderMinY;
- double d14 = y + aRenderer.renderMaxY;
- double d15 = z + aRenderer.renderMaxZ;
-
- if (aRenderer.renderFromInside) {
- d11 = x + aRenderer.renderMaxX;
- d12 = x + aRenderer.renderMinX;
- }
-
- if (aRenderer.enableAO) {
- tessellator.setColorOpaque_F(aRenderer.colorRedTopLeft, aRenderer.colorGreenTopLeft, aRenderer.colorBlueTopLeft);
- tessellator.setBrightness(aRenderer.brightnessTopLeft);
- tessellator.addVertexWithUV(d11, d14, d15, d3, d5);
- tessellator.setColorOpaque_F(aRenderer.colorRedBottomLeft, aRenderer.colorGreenBottomLeft, aRenderer.colorBlueBottomLeft);
- tessellator.setBrightness(aRenderer.brightnessBottomLeft);
- tessellator.addVertexWithUV(d11, d13, d15, d8, d10);
- tessellator.setColorOpaque_F(aRenderer.colorRedBottomRight, aRenderer.colorGreenBottomRight, aRenderer.colorBlueBottomRight);
- tessellator.setBrightness(aRenderer.brightnessBottomRight);
- tessellator.addVertexWithUV(d12, d13, d15, d4, d6);
- tessellator.setColorOpaque_F(aRenderer.colorRedTopRight, aRenderer.colorGreenTopRight, aRenderer.colorBlueTopRight);
- tessellator.setBrightness(aRenderer.brightnessTopRight);
- tessellator.addVertexWithUV(d12, d14, d15, d7, d9);
- } else {
- tessellator.addVertexWithUV(d11, d14, d15, d3, d5);
- tessellator.addVertexWithUV(d11, d13, d15, d8, d10);
- tessellator.addVertexWithUV(d12, d13, d15, d4, d6);
- tessellator.addVertexWithUV(d12, d14, d15, d7, d9);
- }
- }
-
- /**
- * Renders the given texture to the west (x-negative) face of the block. Args: block, x, y, z, texture
- */
- public void renderFaceXNeg(RenderBlocks aRenderer, double x, double y, double z, IIcon icon, ExtendedFacing rotation) {
- Tessellator tessellator = Tessellator.instance;
-
- if (aRenderer.hasOverrideBlockTexture()) {
- icon = aRenderer.overrideBlockTexture;
- }
-
- double d3 = icon.getInterpolatedU(aRenderer.renderMinZ * 16.0D);
- double d4 = icon.getInterpolatedU(aRenderer.renderMaxZ * 16.0D);
- double d5 = icon.getInterpolatedV(16.0D - aRenderer.renderMaxY * 16.0D);
- double d6 = icon.getInterpolatedV(16.0D - aRenderer.renderMinY * 16.0D);
- double d7;
-
- if (aRenderer.flipTexture) {
- d7 = d3;
- d3 = d4;
- d4 = d7;
- }
-
- if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) {
- d3 = icon.getMinU();
- d4 = icon.getMaxU();
- }
-
- if (aRenderer.renderMinY < 0.0D || aRenderer.renderMaxY > 1.0D) {
- d5 = icon.getMinV();
- d6 = icon.getMaxV();
- }
-
- {
- double temp;
- switch (rotation.getFlip().ordinal()){
- case 1:
- temp=d3;
- d3=d4;
- d4=temp;
- break;
- case 2:
- temp=d5;
- d5=d6;
- d6=temp;
- case 3:
- temp=d3;
- d3=d4;
- d4=temp;
- break;
- }
- }
-
- d7 = d4;
- double d8 = d3;
- double d9 = d5;
- double d10 = d6;
-
- switch (rotation.getRotation().ordinal()) {
- case 1:
- d3 = icon.getInterpolatedU(aRenderer.renderMinY * 16.0D);
- d5 = icon.getInterpolatedV(16.0D - aRenderer.renderMaxZ * 16.0D);
- d4 = icon.getInterpolatedU(aRenderer.renderMaxY * 16.0D);
- d6 = icon.getInterpolatedV(16.0D - aRenderer.renderMinZ * 16.0D);
- d9 = d5;
- d10 = d6;
- d7 = d3;
- d8 = d4;
- d5 = d6;
- d6 = d9;
- break;
- case 3:
- d3 = icon.getInterpolatedU(16.0D - aRenderer.renderMaxY * 16.0D);
- d5 = icon.getInterpolatedV(aRenderer.renderMinZ * 16.0D);
- d4 = icon.getInterpolatedU(16.0D - aRenderer.renderMinY * 16.0D);
- d6 = icon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D);
- d7 = d4;
- d8 = d3;
- d3 = d4;
- d4 = d8;
- d9 = d6;
- d10 = d5;
- break;
- case 2:
- d3 = icon.getInterpolatedU(16.0D - aRenderer.renderMinZ * 16.0D);
- d4 = icon.getInterpolatedU(16.0D - aRenderer.renderMaxZ * 16.0D);
- d5 = icon.getInterpolatedV(aRenderer.renderMaxY * 16.0D);
- d6 = icon.getInterpolatedV(aRenderer.renderMinY * 16.0D);
- d7 = d4;
- d8 = d3;
- d9 = d5;
- d10 = d6;
- break;
- }
-
- double d11 = x + aRenderer.renderMinX;
- double d12 = y + aRenderer.renderMinY;
- double d13 = y + aRenderer.renderMaxY;
- double d14 = z + aRenderer.renderMinZ;
- double d15 = z + aRenderer.renderMaxZ;
-
- if (aRenderer.renderFromInside) {
- d14 = z + aRenderer.renderMaxZ;
- d15 = z + aRenderer.renderMinZ;
- }
-
- if (aRenderer.enableAO) {
- tessellator.setColorOpaque_F(aRenderer.colorRedTopLeft, aRenderer.colorGreenTopLeft, aRenderer.colorBlueTopLeft);
- tessellator.setBrightness(aRenderer.brightnessTopLeft);
- tessellator.addVertexWithUV(d11, d13, d15, d7, d9);
- tessellator.setColorOpaque_F(aRenderer.colorRedBottomLeft, aRenderer.colorGreenBottomLeft, aRenderer.colorBlueBottomLeft);
- tessellator.setBrightness(aRenderer.brightnessBottomLeft);
- tessellator.addVertexWithUV(d11, d13, d14, d3, d5);
- tessellator.setColorOpaque_F(aRenderer.colorRedBottomRight, aRenderer.colorGreenBottomRight, aRenderer.colorBlueBottomRight);
- tessellator.setBrightness(aRenderer.brightnessBottomRight);
- tessellator.addVertexWithUV(d11, d12, d14, d8, d10);
- tessellator.setColorOpaque_F(aRenderer.colorRedTopRight, aRenderer.colorGreenTopRight, aRenderer.colorBlueTopRight);
- tessellator.setBrightness(aRenderer.brightnessTopRight);
- tessellator.addVertexWithUV(d11, d12, d15, d4, d6);
- } else {
- tessellator.addVertexWithUV(d11, d13, d15, d7, d9);
- tessellator.addVertexWithUV(d11, d13, d14, d3, d5);
- tessellator.addVertexWithUV(d11, d12, d14, d8, d10);
- tessellator.addVertexWithUV(d11, d12, d15, d4, d6);
- }
- }
-
- /**
- * Renders the given texture to the east (x-positive) face of the block. Args: block, x, y, z, texture
- */
- public void renderFaceXPos(RenderBlocks aRenderer, double x, double y, double z, IIcon icon, ExtendedFacing rotation) {
- Tessellator tessellator = Tessellator.instance;
-
- if (aRenderer.hasOverrideBlockTexture()) {
- icon = aRenderer.overrideBlockTexture;
- }
-
- double d3 = icon.getInterpolatedU(aRenderer.renderMinZ * 16.0D);
- double d4 = icon.getInterpolatedU(aRenderer.renderMaxZ * 16.0D);
-
- if (aRenderer.field_152631_f) {
- d4 = icon.getInterpolatedU((1.0D - aRenderer.renderMinZ) * 16.0D);
- d3 = icon.getInterpolatedU((1.0D - aRenderer.renderMaxZ) * 16.0D);
- }
-
- double d5 = icon.getInterpolatedV(16.0D - aRenderer.renderMaxY * 16.0D);
- double d6 = icon.getInterpolatedV(16.0D - aRenderer.renderMinY * 16.0D);
- double d7;
-
- if (aRenderer.flipTexture) {
- d7 = d3;
- d3 = d4;
- d4 = d7;
- }
-
- if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) {
- d3 = icon.getMinU();
- d4 = icon.getMaxU();
- }
-
- if (aRenderer.renderMinY < 0.0D || aRenderer.renderMaxY > 1.0D) {
- d5 = icon.getMinV();
- d6 = icon.getMaxV();
- }
-
- {
- double temp;
- switch (rotation.getFlip().ordinal()){
- case 1:
- temp=d3;
- d3=d4;
- d4=temp;
- break;
- case 2:
- temp=d5;
- d5=d6;
- d6=temp;
- case 3:
- temp=d3;
- d3=d4;
- d4=temp;
- break;
- }
- }
-
- d7 = d4;
- double d8 = d3;
- double d9 = d5;
- double d10 = d6;
-
- switch (rotation.getRotation().ordinal()) {
- case 3:
- d3 = icon.getInterpolatedU(aRenderer.renderMaxY * 16.0D);
- d5 = icon.getInterpolatedV(16.0D - aRenderer.renderMinZ * 16.0D);
- d4 = icon.getInterpolatedU(aRenderer.renderMinY * 16.0D);
- d6 = icon.getInterpolatedV(16.0D - aRenderer.renderMaxZ * 16.0D);
- d9 = d5;
- d10 = d6;
- d7 = d3;
- d8 = d4;
- d5 = d6;
- d6 = d9;
- break;
- case 1:
- d3 = icon.getInterpolatedU(16.0D - aRenderer.renderMinY * 16.0D);
- d5 = icon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D);
- d4 = icon.getInterpolatedU(16.0D - aRenderer.renderMaxY * 16.0D);
- d6 = icon.getInterpolatedV(aRenderer.renderMinZ * 16.0D);
- d7 = d4;
- d8 = d3;
- d3 = d4;
- d4 = d8;
- d9 = d6;
- d10 = d5;
- break;
- case 2:
- d3 = icon.getInterpolatedU(16.0D - aRenderer.renderMinZ * 16.0D);
- d4 = icon.getInterpolatedU(16.0D - aRenderer.renderMaxZ * 16.0D);
- d5 = icon.getInterpolatedV(aRenderer.renderMaxY * 16.0D);
- d6 = icon.getInterpolatedV(aRenderer.renderMinY * 16.0D);
- d7 = d4;
- d8 = d3;
- d9 = d5;
- d10 = d6;
- break;
- }
-
- double d11 = x + aRenderer.renderMaxX;
- double d12 = y + aRenderer.renderMinY;
- double d13 = y + aRenderer.renderMaxY;
- double d14 = z + aRenderer.renderMinZ;
- double d15 = z + aRenderer.renderMaxZ;
-
- if (aRenderer.renderFromInside) {
- d14 = z + aRenderer.renderMaxZ;
- d15 = z + aRenderer.renderMinZ;
- }
-
- if (aRenderer.enableAO) {
- tessellator.setColorOpaque_F(aRenderer.colorRedTopLeft, aRenderer.colorGreenTopLeft, aRenderer.colorBlueTopLeft);
- tessellator.setBrightness(aRenderer.brightnessTopLeft);
- tessellator.addVertexWithUV(d11, d12, d15, d8, d10);
- tessellator.setColorOpaque_F(aRenderer.colorRedBottomLeft, aRenderer.colorGreenBottomLeft, aRenderer.colorBlueBottomLeft);
- tessellator.setBrightness(aRenderer.brightnessBottomLeft);
- tessellator.addVertexWithUV(d11, d12, d14, d4, d6);
- tessellator.setColorOpaque_F(aRenderer.colorRedBottomRight, aRenderer.colorGreenBottomRight, aRenderer.colorBlueBottomRight);
- tessellator.setBrightness(aRenderer.brightnessBottomRight);
- tessellator.addVertexWithUV(d11, d13, d14, d7, d9);
- tessellator.setColorOpaque_F(aRenderer.colorRedTopRight, aRenderer.colorGreenTopRight, aRenderer.colorBlueTopRight);
- tessellator.setBrightness(aRenderer.brightnessTopRight);
- tessellator.addVertexWithUV(d11, d13, d15, d3, d5);
- } else {
- tessellator.addVertexWithUV(d11, d12, d15, d8, d10);
- tessellator.addVertexWithUV(d11, d12, d14, d4, d6);
- tessellator.addVertexWithUV(d11, d13, d14, d7, d9);
- tessellator.addVertexWithUV(d11, d13, d15, d3, d5);
- }
- }
-
- @Override
- public short[] getRGBA() {
- return mRGBa;
- }
-
- @Override
- public boolean isValidTexture() {
- return mIconContainer != null;
- }
-
- private static ExtendedFacing getExtendedFacing(int x, int y, int z) {
- World w = Minecraft.getMinecraft().theWorld;
- if (w != null) {
- TileEntity te = w.getTileEntity(x, y, z);
- if (te instanceof IGregTechTileEntity) {
- IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity();
- if (meta instanceof IAlignmentProvider) {
- return ((IAlignmentProvider) meta).getAlignment().getExtendedFacing();
- }else{
- return ExtendedFacing.of(ForgeDirection.getOrientation(meta.getBaseMetaTileEntity().getFrontFacing()));
- }
- } else if (te instanceof IAlignmentProvider) {
- return ((IAlignmentProvider) te).getAlignment().getExtendedFacing();
- }
- }
- return ExtendedFacing.DEFAULT;
- }
}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_collider/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_collider/GT_MetaTileEntity_EM_collider.java
index a2a9eab3a1..34fdba402b 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_collider/GT_MetaTileEntity_EM_collider.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_collider/GT_MetaTileEntity_EM_collider.java
@@ -43,7 +43,8 @@ import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texture
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*;
import static com.github.technus.tectech.util.DoubleCount.add;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java
index ee6f469d59..1cc3123528 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java
@@ -1,11 +1,11 @@
package com.github.technus.tectech.thing.metaTileEntity.pipe;
+import com.github.technus.tectech.TecTech;
+import com.github.technus.tectech.loader.NetworkDispatcher;
import com.github.technus.tectech.mechanics.pipe.IActivePipe;
import com.github.technus.tectech.mechanics.pipe.IConnectsToDataPipe;
import com.github.technus.tectech.mechanics.pipe.PipeActivityMessage;
import com.github.technus.tectech.util.CommonValues;
-import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.loader.NetworkDispatcher;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.GT_Mod;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java
index 55a7f23b6a..d19fec6f05 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java
@@ -1,11 +1,11 @@
package com.github.technus.tectech.thing.metaTileEntity.pipe;
+import com.github.technus.tectech.TecTech;
+import com.github.technus.tectech.loader.NetworkDispatcher;
import com.github.technus.tectech.mechanics.pipe.IActivePipe;
import com.github.technus.tectech.mechanics.pipe.IConnectsToElementalPipe;
import com.github.technus.tectech.mechanics.pipe.PipeActivityMessage;
import com.github.technus.tectech.util.CommonValues;
-import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.loader.NetworkDispatcher;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.GT_Mod;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java
index ef767dacdd..1f4fd71a39 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java
@@ -1,11 +1,11 @@
package com.github.technus.tectech.thing.metaTileEntity.pipe;
+import com.github.technus.tectech.TecTech;
+import com.github.technus.tectech.loader.NetworkDispatcher;
import com.github.technus.tectech.mechanics.pipe.IActivePipe;
import com.github.technus.tectech.mechanics.pipe.IConnectsToEnergyTunnel;
import com.github.technus.tectech.mechanics.pipe.PipeActivityMessage;
import com.github.technus.tectech.util.CommonValues;
-import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.loader.NetworkDispatcher;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.GT_Mod;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java
index 8d9c245d98..20b690a3e8 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java
@@ -1,9 +1,9 @@
package com.github.technus.tectech.thing.metaTileEntity.single;
-import com.github.technus.tectech.util.CommonValues;
-import com.github.technus.tectech.util.TT_Utility;
import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_BuckConverter;
import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_BuckConverter;
+import com.github.technus.tectech.util.CommonValues;
+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;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java
index fe300f7ed2..9b177dd1ce 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java
@@ -1,9 +1,9 @@
package com.github.technus.tectech.thing.metaTileEntity.single;
-import com.github.technus.tectech.util.CommonValues;
-import com.github.technus.tectech.util.TT_Utility;
import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_DataReader;
import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_DataReader;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.TT_Utility;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java
index 82f8c77536..c68b9fc395 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java
@@ -1,11 +1,11 @@
package com.github.technus.tectech.thing.metaTileEntity.single;
-import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.util.TT_Utility;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OverflowElemental;
import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_DebugPollutor;
import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_DebugPollutor;
+import com.github.technus.tectech.util.CommonValues;
+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;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java
index 327f66ecf6..1be2173bfc 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java
@@ -1,9 +1,9 @@
package com.github.technus.tectech.thing.metaTileEntity.single;
-import com.github.technus.tectech.util.CommonValues;
-import com.github.technus.tectech.util.TT_Utility;
import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_DebugPowerGenerator;
import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_DebugPowerGenerator;
+import com.github.technus.tectech.util.CommonValues;
+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;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_MicroController.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_MicroController.java
index 0ab08c356e..4c4e035d44 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_MicroController.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_MicroController.java
@@ -10,8 +10,8 @@ import com.github.technus.avrClone.memory.EepromMemory;
import com.github.technus.avrClone.memory.RemovableMemory;
import com.github.technus.avrClone.memory.program.ProgramMemory;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.util.TT_Utility;
import com.github.technus.tectech.mechanics.avr.SidedRedstone;
+import com.github.technus.tectech.util.TT_Utility;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_OwnerDetector.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_OwnerDetector.java
index 3ba7bcf885..57009c2e35 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_OwnerDetector.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_OwnerDetector.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.single;
-import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.TecTech;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.util.TT_Utility;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -21,8 +21,8 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import org.apache.commons.lang3.reflect.FieldUtils;
-import static com.github.technus.tectech.util.CommonValues.RECIPE_AT;
import static com.github.technus.tectech.thing.metaTileEntity.Textures.MACHINE_CASINGS_TT;
+import static com.github.technus.tectech.util.CommonValues.RECIPE_AT;
import static net.minecraft.util.StatCollector.translateToLocal;
import static net.minecraft.util.StatCollector.translateToLocalFormatted;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java
index 475e8ac10a..8ca4844043 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java
@@ -1,12 +1,12 @@
package com.github.technus.tectech.thing.metaTileEntity.single;
-import com.github.technus.tectech.mechanics.tesla.ITeslaConnectable;
-import com.github.technus.tectech.mechanics.tesla.ITeslaConnectableSimple;
-import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.loader.NetworkDispatcher;
import com.github.technus.tectech.mechanics.spark.RendererMessage;
import com.github.technus.tectech.mechanics.spark.ThaumSpark;
+import com.github.technus.tectech.mechanics.tesla.ITeslaConnectable;
+import com.github.technus.tectech.mechanics.tesla.ITeslaConnectableSimple;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.util.TT_Utility;
import com.google.common.collect.Multimap;
import com.google.common.collect.MultimapBuilder;
@@ -27,8 +27,8 @@ import java.util.Arrays;
import java.util.HashSet;
import static com.github.technus.tectech.mechanics.tesla.ITeslaConnectable.TeslaUtil.*;
-import static com.github.technus.tectech.util.CommonValues.V;
import static com.github.technus.tectech.thing.metaTileEntity.Textures.*;
+import static com.github.technus.tectech.util.CommonValues.V;
import static java.lang.Math.round;
import static net.minecraft.util.StatCollector.translateToLocal;
import static net.minecraft.util.StatCollector.translateToLocalFormatted;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java
index 4e4a235ca4..e74c51ab90 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.single.gui;
-import com.github.technus.tectech.util.TT_Utility;
import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_DebugPollutor;
+import com.github.technus.tectech.util.TT_Utility;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java
index 4731374c31..738587941e 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.single.gui;
-import com.github.technus.tectech.util.TT_Utility;
import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_DataReader;
+import com.github.technus.tectech.util.TT_Utility;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.gui.GT_Slot_Holo;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
diff --git a/src/main/java/com/github/technus/tectech/util/CommonValues.java b/src/main/java/com/github/technus/tectech/util/CommonValues.java
index f5d5ce6900..603644bcde 100644
--- a/src/main/java/com/github/technus/tectech/util/CommonValues.java
+++ b/src/main/java/com/github/technus/tectech/util/CommonValues.java
@@ -6,38 +6,33 @@ import net.minecraft.util.EnumChatFormatting;
* Created by danie_000 on 11.01.2017.
*/
public final class CommonValues {
- public static final String TEC_MARK_GENERAL =
- EnumChatFormatting.BLUE + "Tec" +
- EnumChatFormatting.DARK_BLUE + "Tech" +
- EnumChatFormatting.BLUE + ": Interdimensional";
- public static final String TEC_MARK_EM =
- EnumChatFormatting.BLUE + "Tec" +
- EnumChatFormatting.DARK_BLUE + "Tech" +
- EnumChatFormatting.BLUE + ": Elemental Matter";
- public static final String BASS_MARK =
- EnumChatFormatting.BLUE + "Tec" +
- EnumChatFormatting.DARK_BLUE + "Tech" +
- EnumChatFormatting.BLUE + ": Theta Movement";
- public static final String COSMIC_MARK =
- EnumChatFormatting.BLUE + "Tec" +
- EnumChatFormatting.DARK_BLUE + "Tech" +
- EnumChatFormatting.BLUE + ": Cosmic";//TODO get a better name than cosmic for *UNDEFINED* thing
+ public static final String TEC_MARK_SHORT =
+ EnumChatFormatting.BLUE + "Tec" + EnumChatFormatting.DARK_BLUE + "Tech";
+ public static final String TEC_MARK_GENERAL = TEC_MARK_SHORT +
+ EnumChatFormatting.BLUE + ": Interdimensional";
+ public static final String TEC_MARK_EM = TEC_MARK_SHORT +
+ EnumChatFormatting.BLUE + ": Elemental Matter";
+ public static final String BASS_MARK = TEC_MARK_SHORT +
+ EnumChatFormatting.BLUE + ": Theta Movement";
+ public static final String COSMIC_MARK = TEC_MARK_SHORT +
+ EnumChatFormatting.BLUE + ": Cosmic";//TODO get a better name than cosmic for *UNDEFINED* thing
- public static final byte DECAY_AT = 0;// hatches compute decays
+ public static final byte DECAY_AT = 0;// hatches compute decays
public static final byte MULTI_PURGE_1_AT = 2;// multiblocks clean their hatches 1
- public static final byte MOVE_AT = 4;// move stuff around
- public static final byte RECIPE_AT = 6;// move stuff around
+ public static final byte MOVE_AT = 4;// move stuff around
+ public static final byte RECIPE_AT = 6;// move stuff around
public static final byte MULTI_PURGE_2_AT = 8;// multiblocks clean their hatches 2
- public static final byte OVERFLOW_AT = 10;// then hatches clean themselves
+ public static final byte OVERFLOW_AT = 10;// then hatches clean themselves
// - in case some hatches are not in multiblock structure
- public static final byte MULTI_CHECK_AT = 12;// multiblock checks it's state
- public static final byte DISPERSE_AT = 14;// overflow hatches perform disperse
- public static final byte TRANSFER_AT = 16;
+ public static final byte MULTI_CHECK_AT = 12;// multiblock checks it's state
+ public static final byte DISPERSE_AT = 14;// overflow hatches perform disperse
+ public static final byte TRANSFER_AT = 16;
- public static final long[] AatV = new long[]{268435455,67108863,16777215,4194303,1048575,262143,65535,16383,4095,1023,255,63,15,3,1,1};
+ public static final long[] AatV = new long[]{268435455, 67108863, 16777215, 4194303, 1048575, 262143, 65535, 16383, 4095, 1023, 255, 63, 15, 3, 1, 1};
public static final String[] VOLTAGE_NAMES = new String[]{"Ultra Low Voltage", "Low Voltage", "Medium Voltage", "High Voltage", "Extreme Voltage", "Insane Voltage", "Ludicrous Voltage", "ZPM Voltage", "Ultimate Voltage", "Ultimate High Voltage", "Ultimate Extreme Voltage", "Ultimate Insane Voltage", "Ultimate Mega Voltage", "Ultimate Extended Mega Voltage", "Overpowered Voltage", "Maximum Voltage"};
- public static final String[] VN = new String[]{"ULV", "LV", "MV", "HV", "EV", "IV", "LuV", "ZPM", "UV", "UHV", "UEV", "UIV", "UMV", "UXV", "OpV", "MAX"};
- public static final long[] V = new long[]{8L, 32L, 128L, 512L, 2048L, 8192L, 32768L, 131072L, 524288L, 2097152L, 8388608L, 33554432L, 134217728L, 536870912L, 1073741824L, Integer.MAX_VALUE - 7};
+ public static final String[] VN = new String[]{"ULV", "LV", "MV", "HV", "EV", "IV", "LuV", "ZPM", "UV", "UHV", "UEV", "UIV", "UMV", "UXV", "OpV", "MAX"};
+ public static final long[] V = new long[]{8L, 32L, 128L, 512L, 2048L, 8192L, 32768L, 131072L, 524288L, 2097152L, 8388608L, 33554432L, 134217728L, 536870912L, 1073741824L, Integer.MAX_VALUE - 7};
- private CommonValues() {}
+ private CommonValues() {
+ }
}
diff --git a/src/main/java/com/github/technus/tectech/util/DoubleCount.java b/src/main/java/com/github/technus/tectech/util/DoubleCount.java
index f5c391ab43..cd86480be9 100644
--- a/src/main/java/com/github/technus/tectech/util/DoubleCount.java
+++ b/src/main/java/com/github/technus/tectech/util/DoubleCount.java
@@ -2,7 +2,8 @@ package com.github.technus.tectech.util;
import java.util.Arrays;
-import static java.lang.Math.*;
+import static java.lang.Math.abs;
+import static java.lang.Math.ulp;
public class DoubleCount {
/**
diff --git a/src/main/java/com/github/technus/tectech/util/TT_Utility.java b/src/main/java/com/github/technus/tectech/util/TT_Utility.java
index c989fe1e1f..2b67f72ff0 100644
--- a/src/main/java/com/github/technus/tectech/util/TT_Utility.java
+++ b/src/main/java/com/github/technus/tectech/util/TT_Utility.java
@@ -29,9 +29,11 @@ import org.apache.commons.lang3.StringUtils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
+import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.nio.charset.StandardCharsets;
import java.util.*;
+import java.util.function.Function;
/**
* Created by Tec on 21.03.2017.
@@ -39,21 +41,24 @@ import java.util.*;
public final class TT_Utility {
private TT_Utility() {
}
- private static final Map<Locale, Formatter> formaters=new HashMap<>();
- private static Formatter getFormatter(){
- return formaters.computeIfAbsent(Locale.getDefault(Locale.Category.FORMAT), Formatter::new);
+ private static final StringBuilder STRING_BUILDER = new StringBuilder();
+ private static final Map<Locale, Formatter> FORMATTER_MAP = new HashMap<>();
+
+ private static Formatter getFormatter() {
+ STRING_BUILDER.setLength(0);
+ return FORMATTER_MAP.computeIfAbsent(Locale.getDefault(Locale.Category.FORMAT), locale -> new Formatter(STRING_BUILDER, locale));
}
- public static String formatNumberShortExp(double value){
+ public static String formatNumberShortExp(double value) {
return getFormatter().format("%.3E", value).toString();
}
- public static String formatNumberExp(double value){
+ public static String formatNumberExp(double value) {
return getFormatter().format("%+.5E", value).toString();
}
- public static String formatNumberIntHex(int value){
+ public static String formatNumberIntHex(int value) {
return getFormatter().format("%08X", value).toString();
}
@@ -69,33 +74,63 @@ public final class TT_Utility {
return sortedEntries;
}
- public static int bitStringToInt(String bits){
- if(bits==null){
+ public static int bitStringToInt(String bits) {
+ if (bits == null) {
return 0;
}
- if(bits.length() > 32){
+ if (bits.length() > 32) {
throw new NumberFormatException("Too long!");
}
- return Integer.parseInt(bits,2);
+ return Integer.parseInt(bits, 2);
}
- public static int hexStringToInt(String hex){
- if(hex==null){
+ public static int hexStringToInt(String hex) {
+ if (hex == null) {
return 0;
}
- if(hex.length()>8){
+ if (hex.length() > 8) {
throw new NumberFormatException("Too long!");
}
- return Integer.parseInt(hex,16);
+ return Integer.parseInt(hex, 16);
}
- public static double stringToDouble(String str){
- if(str==null){
+ public static double stringToDouble(String str) {
+ if (str == null) {
return 0;
}
return Double.parseDouble(str);
}
+ private static final String SUPER_SCRIPT = "\u207D\u207E*\u207A,\u207B./\u2070\u00B9\u00B2\u00B3\u2074\u2075\u2076\u2077\u2078\u2079:;<\u207C";
+ private static final String SUB_SCRIPT = "\u208D\u208E*\u208A,\u208B./\u2080\u2081\u2082\u2083\u2084\u2085\u2086\u2087\u2088\u2089:;<\u208C";
+
+ public static String toSubscript(String s) {
+ STRING_BUILDER.setLength(0);
+ for (int i = 0; i <s.length(); i++) {
+ char c=s.charAt(i);
+ if(c>='('&&c<='='){
+ STRING_BUILDER.append(SUB_SCRIPT.charAt(c-'('));
+ }else {
+ STRING_BUILDER.append(c);
+ }
+ }
+ return STRING_BUILDER.toString();
+ }
+
+ public static String toSuperscript(String s) {
+ STRING_BUILDER.setLength(0);
+ for (int i = 0; i <s.length(); i++) {
+ char c=s.charAt(i);
+ if(c>='('&&c<='='){
+ STRING_BUILDER.append(SUPER_SCRIPT.charAt(c-'('));
+ }else {
+ STRING_BUILDER.append(c);
+ }
+ }
+ return STRING_BUILDER.toString();
+ }
+
+
public static double getValue(String in1) {
String str = in1.toLowerCase();
double val;
@@ -295,7 +330,7 @@ public final class TT_Utility {
public static String[] splitButDifferent(String string, String delimiter) {
String[] strings = new String[StringUtils.countMatches(string, delimiter) + 1];
- int lastEnd = 0;
+ int lastEnd = 0;
for (int i = 0; i < strings.length - 1; i++) {
int nextEnd = string.indexOf(delimiter, lastEnd);
strings[i] = string.substring(lastEnd, nextEnd);
@@ -305,7 +340,7 @@ public final class TT_Utility {
return strings;
}
- public static String[] infoFromNBT(NBTTagCompound nbt) {
+ public static String[] unpackStrings(NBTTagCompound nbt) {
String[] strings = new String[nbt.getInteger("i")];
for (int i = 0; i < strings.length; i++) {
strings[i] = nbt.getString(Integer.toString(i));
@@ -313,14 +348,45 @@ public final class TT_Utility {
return strings;
}
+ public static String getSomeString(NBTTagCompound nbt, int index) {
+ return nbt.getString(Integer.toString(index % nbt.getInteger("i")));
+ }
+
+ public static NBTTagCompound packStrings(String... info) {
+ NBTTagCompound nbt = new NBTTagCompound();
+ nbt.setInteger("i", info.length);
+ for (int i = 0; i < info.length; i++) {
+ nbt.setString(Integer.toString(i), info[i]);
+ }
+ return nbt;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T> T[] unpackNBT(Class<T> tClass, Function<NBTTagCompound, T> converter, NBTTagCompound nbt) {
+ T[] objects = (T[]) Array.newInstance(tClass, nbt.getInteger("i"));
+ for (int i = 0; i < objects.length; i++) {
+ objects[i] = converter.apply(nbt.getCompoundTag(Integer.toString(i)));
+ }
+ return objects;
+ }
+
+ public static <T> NBTTagCompound packNBT(Function<T, NBTTagCompound> converter, T... info) {
+ NBTTagCompound nbt = new NBTTagCompound();
+ nbt.setInteger("i", info.length);
+ for (int i = 0; i < info.length; i++) {
+ nbt.setTag(Integer.toString(i), converter.apply(info[i]));
+ }
+ return nbt;
+ }
+
public static boolean areBitsSet(int setBits, int testedValue) {
return (testedValue & setBits) == setBits;
}
public static class ItemStack_NoNBT implements Comparable<ItemStack_NoNBT> {
public final Item mItem;
- public final int mStackSize;
- public final int mMetaData;
+ public final int mStackSize;
+ public final int mMetaData;
public ItemStack_NoNBT(Item aItem, long aStackSize, long aMetaData) {
this.mItem = aItem;
@@ -372,240 +438,239 @@ public final class TT_Utility {
}
}
- public static void setTier(int tier,Object me){
- try{
- Field field=GT_MetaTileEntity_TieredMachineBlock.class.getField("mTier");
+ public static void setTier(int tier, Object me) {
+ try {
+ Field field = GT_MetaTileEntity_TieredMachineBlock.class.getField("mTier");
field.setAccessible(true);
- field.set(me,(byte)tier);
- }catch (Exception e){
+ field.set(me, (byte) tier);
+ } catch (Exception e) {
//e.printStackTrace();
}
}
- public static StringBuilder receiveString(StringBuilder previousValue, int startIndex, int index, int value){
- int sizeReq=index-startIndex;
- if(value==0){
- previousValue.setLength(Math.min(previousValue.length(),sizeReq));
- }else {
- previousValue.setLength(Math.max(previousValue.length(),sizeReq));
- previousValue.setCharAt(sizeReq,(char)value);
+ public static StringBuilder receiveString(StringBuilder previousValue, int startIndex, int index, int value) {
+ int sizeReq = index - startIndex;
+ if (value == 0) {
+ previousValue.setLength(Math.min(previousValue.length(), sizeReq));
+ } else {
+ previousValue.setLength(Math.max(previousValue.length(), sizeReq));
+ previousValue.setCharAt(sizeReq, (char) value);
}
return previousValue;
}
@Deprecated
- public static double receiveDouble(double previousValue, int startIndex, int index, int value){
- return Double.longBitsToDouble(receiveLong(Double.doubleToLongBits(previousValue),startIndex,index,value));
+ public static double receiveDouble(double previousValue, int startIndex, int index, int value) {
+ return Double.longBitsToDouble(receiveLong(Double.doubleToLongBits(previousValue), startIndex, index, value));
}
- public static long receiveLong(long previousValue, int startIndex, int index, int value){
- value &=0xFFFF;
- switch (index-startIndex){
+ public static long receiveLong(long previousValue, int startIndex, int index, int value) {
+ value &= 0xFFFF;
+ switch (index - startIndex) {
case 0:
- previousValue&= 0xFFFF_FFFF_FFFF_0000L;
- previousValue|=value;
+ previousValue &= 0xFFFF_FFFF_FFFF_0000L;
+ previousValue |= value;
break;
case 1:
- previousValue&=0xFFFF_FFFF_0000_FFFFL;
- previousValue|=(long)value<<16;
+ previousValue &= 0xFFFF_FFFF_0000_FFFFL;
+ previousValue |= (long) value << 16;
break;
case 2:
- previousValue&=0xFFFF_0000_FFFF_FFFFL;
- previousValue|=(long)value<<32;
+ previousValue &= 0xFFFF_0000_FFFF_FFFFL;
+ previousValue |= (long) value << 32;
break;
case 3:
- previousValue&=0x0000_FFFF_FFFF_FFFFL;
- previousValue|=(long)value<<48;
+ previousValue &= 0x0000_FFFF_FFFF_FFFFL;
+ previousValue |= (long) value << 48;
break;
}
return previousValue;
}
- public static void sendString(StringBuilder string,Container container, ICrafting crafter,int startIndex){
+ public static void sendString(StringBuilder string, Container container, ICrafting crafter, int startIndex) {
for (int i = 0; i < string.length(); i++) {
- crafter.sendProgressBarUpdate(container,startIndex++,string.charAt(i));
+ crafter.sendProgressBarUpdate(container, startIndex++, string.charAt(i));
}
- crafter.sendProgressBarUpdate(container,startIndex,0);
+ crafter.sendProgressBarUpdate(container, startIndex, 0);
}
- public static void sendDouble(double value,Container container, ICrafting crafter,int startIndex){
- sendLong(Double.doubleToLongBits(value),container,crafter,startIndex);
+ public static void sendDouble(double value, Container container, ICrafting crafter, int startIndex) {
+ sendLong(Double.doubleToLongBits(value), container, crafter, startIndex);
}
- public static void sendLong(long value,Container container, ICrafting crafter,int startIndex){
- crafter.sendProgressBarUpdate(container, startIndex++, (int)(value & 0xFFFFL));
- crafter.sendProgressBarUpdate(container, startIndex++, (int)((value & 0xFFFF0000L)>>>16));
- crafter.sendProgressBarUpdate(container, startIndex++, (int)((value & 0xFFFF00000000L)>>>32));
- crafter.sendProgressBarUpdate(container, startIndex, (int)((value & 0xFFFF000000000000L)>>>48));
+ public static void sendLong(long value, Container container, ICrafting crafter, int startIndex) {
+ crafter.sendProgressBarUpdate(container, startIndex++, (int) (value & 0xFFFFL));
+ crafter.sendProgressBarUpdate(container, startIndex++, (int) ((value & 0xFFFF0000L) >>> 16));
+ crafter.sendProgressBarUpdate(container, startIndex++, (int) ((value & 0xFFFF00000000L) >>> 32));
+ crafter.sendProgressBarUpdate(container, startIndex, (int) ((value & 0xFFFF000000000000L) >>> 48));
}
@Deprecated
- public static float receiveFloat(float previousValue, int startIndex, int index, int value){
- return Float.intBitsToFloat(receiveInteger(Float.floatToIntBits(previousValue),startIndex,index,value));
+ public static float receiveFloat(float previousValue, int startIndex, int index, int value) {
+ return Float.intBitsToFloat(receiveInteger(Float.floatToIntBits(previousValue), startIndex, index, value));
}
- public static int receiveInteger(int previousValue, int startIndex, int index, int value){
- value &=0xFFFF;
- switch (index-startIndex){
+ public static int receiveInteger(int previousValue, int startIndex, int index, int value) {
+ value &= 0xFFFF;
+ switch (index - startIndex) {
case 0:
- previousValue&= 0xFFFF_0000;
- previousValue|=value;
+ previousValue &= 0xFFFF_0000;
+ previousValue |= value;
break;
case 1:
- previousValue&=0x0000_FFFF;
- previousValue|=value<<16;
+ previousValue &= 0x0000_FFFF;
+ previousValue |= value << 16;
break;
}
return previousValue;
}
- public static void sendFloat(float value,Container container, ICrafting crafter,int startIndex){
- sendInteger(Float.floatToIntBits(value),container,crafter,startIndex);
+ public static void sendFloat(float value, Container container, ICrafting crafter, int startIndex) {
+ sendInteger(Float.floatToIntBits(value), container, crafter, startIndex);
}
- public static void sendInteger(int value,Container container, ICrafting crafter,int startIndex){
- crafter.sendProgressBarUpdate(container, startIndex++, (int)(value & 0xFFFFL));
- crafter.sendProgressBarUpdate(container, startIndex, (value & 0xFFFF0000)>>>16);
+ public static void sendInteger(int value, Container container, ICrafting crafter, int startIndex) {
+ crafter.sendProgressBarUpdate(container, startIndex++, (int) (value & 0xFFFFL));
+ crafter.sendProgressBarUpdate(container, startIndex, (value & 0xFFFF0000) >>> 16);
}
- public static String doubleToString(double value){
- if(value==(long)value){
- return Long.toString((long)value);
+ public static String doubleToString(double value) {
+ if (value == (long) value) {
+ return Long.toString((long) value);
}
return Double.toString(value);
}
- public static boolean checkChunkExist(World world, ChunkCoordIntPair chunk){
- int x=chunk.getCenterXPos();
- int z=chunk.getCenterZPosition();
+ public static boolean checkChunkExist(World world, ChunkCoordIntPair chunk) {
+ int x = chunk.getCenterXPos();
+ int z = chunk.getCenterZPosition();
return world.checkChunksExist(x, 0, z, x, 0, z);
}
- public static NBTTagCompound getPlayerData(UUID uuid1,UUID uuid2,String extension) {
+ public static NBTTagCompound getPlayerData(UUID uuid1, UUID uuid2, String extension) {
try {
if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
- if (uuid1 != null && uuid2!=null) {
+ if (uuid1 != null && uuid2 != null) {
IPlayerFileData playerNBTManagerObj = MinecraftServer.getServer().worldServerForDimension(0).getSaveHandler().getSaveHandler();
- SaveHandler sh = (SaveHandler)playerNBTManagerObj;
- File dir = ObfuscationReflectionHelper.getPrivateValue(SaveHandler.class, sh, new String[]{"playersDirectory", "field_75771_c"});
- String id1=uuid1.toString();
- NBTTagCompound tagCompound=read(new File(dir, id1 + "."+extension));
- if(tagCompound!=null){
+ SaveHandler sh = (SaveHandler) playerNBTManagerObj;
+ File dir = ObfuscationReflectionHelper.getPrivateValue(SaveHandler.class, sh, new String[]{"playersDirectory", "field_75771_c"});
+ String id1 = uuid1.toString();
+ NBTTagCompound tagCompound = read(new File(dir, id1 + "." + extension));
+ if (tagCompound != null) {
return tagCompound;
}
- tagCompound=readBackup(new File(dir, id1 + "."+extension+"_bak"));
- if(tagCompound!=null){
+ tagCompound = readBackup(new File(dir, id1 + "." + extension + "_bak"));
+ if (tagCompound != null) {
return tagCompound;
}
- String id2=uuid2.toString();
- tagCompound=read(new File(dir, id2 + "."+extension));
- if(tagCompound!=null){
+ String id2 = uuid2.toString();
+ tagCompound = read(new File(dir, id2 + "." + extension));
+ if (tagCompound != null) {
return tagCompound;
}
- tagCompound=readBackup(new File(dir, id2 + "."+extension+"_bak"));
- if(tagCompound!=null){
+ tagCompound = readBackup(new File(dir, id2 + "." + extension + "_bak"));
+ if (tagCompound != null) {
return tagCompound;
}
}
}
- } catch (Exception ignored) {}
+ } catch (Exception ignored) {
+ }
return new NBTTagCompound();
}
- public static void savePlayerFile(EntityPlayer player,String extension, NBTTagCompound data) {
+ public static void savePlayerFile(EntityPlayer player, String extension, NBTTagCompound data) {
try {
if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
if (player != null) {
IPlayerFileData playerNBTManagerObj = MinecraftServer.getServer().worldServerForDimension(0).getSaveHandler().getSaveHandler();
- SaveHandler sh = (SaveHandler)playerNBTManagerObj;
- File dir = ObfuscationReflectionHelper.getPrivateValue(SaveHandler.class, sh, new String[]{"playersDirectory", "field_75771_c"});
- String id1=player.getUniqueID().toString();
- write(new File(dir, id1 + "."+extension),data);
- write(new File(dir, id1 + "."+extension+"_bak"),data);
- String id2=UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes(StandardCharsets.UTF_8)).toString();
- write(new File(dir, id2 + "."+extension),data);
- write(new File(dir, id2 + "."+extension+"_bak"),data);
+ SaveHandler sh = (SaveHandler) playerNBTManagerObj;
+ File dir = ObfuscationReflectionHelper.getPrivateValue(SaveHandler.class, sh, new String[]{"playersDirectory", "field_75771_c"});
+ String id1 = player.getUniqueID().toString();
+ write(new File(dir, id1 + "." + extension), data);
+ write(new File(dir, id1 + "." + extension + "_bak"), data);
+ String id2 = UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes(StandardCharsets.UTF_8)).toString();
+ write(new File(dir, id2 + "." + extension), data);
+ write(new File(dir, id2 + "." + extension + "_bak"), data);
}
}
- } catch (Exception ignored) {}
+ } catch (Exception ignored) {
+ }
}
- private static NBTTagCompound read(File file){
+ private static NBTTagCompound read(File file) {
if (file != null && file.exists()) {
- try(FileInputStream fileInputStream= new FileInputStream(file)) {
+ try (FileInputStream fileInputStream = new FileInputStream(file)) {
return CompressedStreamTools.readCompressed(fileInputStream);
} catch (Exception var9) {
- TecTech.LOGGER.error("Cannot read NBT File: "+file.getAbsolutePath());
+ TecTech.LOGGER.error("Cannot read NBT File: " + file.getAbsolutePath());
}
}
return null;
}
- private static NBTTagCompound readBackup(File file){
+ private static NBTTagCompound readBackup(File file) {
if (file != null && file.exists()) {
- try(FileInputStream fileInputStream= new FileInputStream(file)) {
+ try (FileInputStream fileInputStream = new FileInputStream(file)) {
return CompressedStreamTools.readCompressed(fileInputStream);
} catch (Exception var9) {
- TecTech.LOGGER.error("Cannot read NBT File: "+file.getAbsolutePath());
+ TecTech.LOGGER.error("Cannot read NBT File: " + file.getAbsolutePath());
return new NBTTagCompound();
}
}
return null;
}
- private static void write(File file,NBTTagCompound tagCompound){
+ private static void write(File file, NBTTagCompound tagCompound) {
if (file != null) {
- if(tagCompound==null){
- if(file.exists()) file.delete();
- }else {
- try(FileOutputStream fileOutputStream= new FileOutputStream(file)) {
- CompressedStreamTools.writeCompressed(tagCompound,fileOutputStream);
+ if (tagCompound == null) {
+ if (file.exists()) file.delete();
+ } else {
+ try (FileOutputStream fileOutputStream = new FileOutputStream(file)) {
+ CompressedStreamTools.writeCompressed(tagCompound, fileOutputStream);
} catch (Exception var9) {
- TecTech.LOGGER.error("Cannot write NBT File: "+file.getAbsolutePath());
+ TecTech.LOGGER.error("Cannot write NBT File: " + file.getAbsolutePath());
}
}
}
}
- public static AxisAlignedBB fromChunkCoordIntPair(ChunkCoordIntPair chunkCoordIntPair){
- int x=chunkCoordIntPair.chunkXPos<<4;
- int z=chunkCoordIntPair.chunkZPos<<4;
- return AxisAlignedBB.getBoundingBox(x,-128,z,x+16,512,z+16);
+ public static AxisAlignedBB fromChunkCoordIntPair(ChunkCoordIntPair chunkCoordIntPair) {
+ int x = chunkCoordIntPair.chunkXPos << 4;
+ int z = chunkCoordIntPair.chunkZPos << 4;
+ return AxisAlignedBB.getBoundingBox(x, -128, z, x + 16, 512, z + 16);
}
- public static AxisAlignedBB fromChunk(Chunk chunk){
- int x=chunk.xPosition<<4;
- int z=chunk.zPosition<<4;
- return AxisAlignedBB.getBoundingBox(x,-128,z,x+16,512,z+16);
+ public static AxisAlignedBB fromChunk(Chunk chunk) {
+ int x = chunk.xPosition << 4;
+ int z = chunk.zPosition << 4;
+ return AxisAlignedBB.getBoundingBox(x, -128, z, x + 16, 512, z + 16);
}
- public static String getConcated(String[] strings,String separator){
+ public static String getConcated(String[] strings, String separator) {
StringBuilder stringBuilder = new StringBuilder();
for (String string : strings) {
stringBuilder.append(string).append(separator);
}
int length = stringBuilder.length();
- if(length >=separator.length()){
- stringBuilder.setLength(length -separator.length());
+ if (length >= separator.length()) {
+ stringBuilder.setLength(length - separator.length());
}
return stringBuilder.toString();
}
- public static double getMagnitude3D(double[] in)
- {
- return Math.sqrt(in[0]*in[0]+in[1]*in[1]+in[2]*in[2]);
+ public static double getMagnitude3D(double[] in) {
+ return Math.sqrt(in[0] * in[0] + in[1] * in[1] + in[2] * in[2]);
}
- public static void normalize3D(double[] in, double[] out)
- {
- double mag=getMagnitude3D(in);
- out[0]=in[0]/mag;
- out[1]=in[1]/mag;
- out[2]=in[2]/mag;
+ public static void normalize3D(double[] in, double[] out) {
+ double mag = getMagnitude3D(in);
+ out[0] = in[0] / mag;
+ out[1] = in[1] / mag;
+ out[2] = in[2] / mag;
}
- public static void crossProduct3D(double[] inA, double[] inB, double[] out)
- {
+ public static void crossProduct3D(double[] inA, double[] inB, double[] out) {
out[0] = inA[1] * inB[2] - inA[2] * inB[1];
out[1] = inA[2] * inB[0] - inA[0] * inB[2];
out[2] = inA[0] * inB[1] - inA[1] * inB[0];
diff --git a/src/main/resources/assets/tectech/lang/en_US.lang b/src/main/resources/assets/tectech/lang/en_US.lang
index f9ab756696..471b0f1062 100644
--- a/src/main/resources/assets/tectech/lang/en_US.lang
+++ b/src/main/resources/assets/tectech/lang/en_US.lang
@@ -799,16 +799,9 @@ gt.blockmachines.debug.tt.writer.desc.2=ABC axises aligned to machine front
tt.keyword.ID=ID
#Example: 32EU at 1A
tt.keyword.at=at
-#EM scan result
-tt.keyword.CLASS=CLASS
-tt.keyword.NAME=NAME
-tt.keyword.CHARGE=CHARGE
-tt.keyword.COLORLESS=COLORLESS
-tt.keyword.MASS=MASS
-tt.keyphrase.LIFE_TIME=LIFE TIME
-tt.keyphrase.CARRIES_COLOR=CARRIES COLOR
+
tt.keyphrase.Hint_Details=Hint Details
-tt.keyphrase.At_current_energy_level=At current energy level
+
#debug boom
tt.keyword.BOOM=BOOM!
tt.keyword.Destination=Destination
@@ -871,11 +864,48 @@ tt.keyphrase.Ass_line_recipe=Assembly Line Recipe
tile.turretHeadEM.name=Elemental Matter Turret
tile.turretBaseEM.name=Elemental Turret Base
-tt.keyword.mol=mol
-tt.keyword.itemMols=items
-tt.keyword.mbMols=mb
+#EM scan result
+tt.keyword.scan.depth=Depth
+tt.keyword.scan.class=Class
+tt.keyword.scan.name=Name
+tt.keyword.scan.symbol=Symbol
+
+tt.keyword.scan.mass=Mass
+tt.keyword.scan.count=Count
+tt.keyword.scan.amount=Amount
+tt.keyword.scan.energy=Energy
+tt.keyword.scan.energyLevel=Energy Level
+tt.keyword.scan.charge=Charge
+tt.keyword.scan.life_mult=Life multiplier
+tt.keyword.scan.half_life=Half life
+tt.keyword.scan.life_time=Life time
+tt.keyword.scan.age=Age
+tt.keyphrase.scan.at_current_energy_level=At current energy level
+tt.keyword.scan.color=Colorless
+tt.keyword.scan.colorless=Colorless
+tt.keyword.scan.colored=Colored
+
+tt.keyword.short.mass=M
+tt.keyword.short.count=Qty
+tt.keyword.short.amount=Qty
+tt.keyword.short.energy=E
+tt.keyword.short.energyLevel=EL
+tt.keyword.short.charge=C
+tt.keyword.short.time=T
+
+tt.keyword.unit.mass=eV/c²
+tt.keyword.unit.massFlux=eV/c²s
+tt.keyword.unit.count=
+tt.keyword.unit.mol=mol
+tt.keyword.unit.itemMols=item(s)
+tt.keyword.unit.mbMols=mb
+tt.keyword.unit.energy=eV
+tt.keyword.unit.charge=e
+tt.keyword.unit.time=s
+tt.keyword.unit.tick=t
#that the thing wont decay
tt.keyword.stable=STABLE
+
#EM types
tt.keyword.Primitive=Primitive
tt.keyword.Element=Element