aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/github/technus/tectech/TecTech.java1
-rw-r--r--src/main/java/com/github/technus/tectech/Vec3pos.java50
-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/turretbases/TurretBaseItemEM.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/dComplexAspectDefinition.java2
-rw-r--r--src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java10
-rw-r--r--src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java10
-rw-r--r--src/main/java/com/github/technus/tectech/loader/MainLoader.java4
-rw-r--r--src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java8
-rw-r--r--src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java34
-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.java4
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentLimits.java183
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentMessage.java (renamed from src/main/java/com/github/technus/tectech/thing/metaTileEntity/RotationMessage.java)69
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignment.java173
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignmentLimits.java19
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/IntegerAxisSwap.java67
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Direction.java34
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/ExtendedFacing.java324
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Flip.java76
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Rotation.java76
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/commands/ConvertFloat.java2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/commands/ConvertInteger.java2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/constructible/IConstructable.java (renamed from src/main/java/com/github/technus/tectech/thing/metaTileEntity/IConstructable.java)2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataMessage.java2
-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/dataTransport/DataPacket.java22
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/dataTransport/QuantumDataPacket.java4
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/cElementalInstanceStack.java2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/dAtomDefinition.java6
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/dHadronDefinition.java2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/iaeaNuclide.java2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/pipe/IActivePipe.java (renamed from src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IActivePipe.java)2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/pipe/IConnectsToDataPipe.java (renamed from src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IConnectsToDataPipe.java)2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/pipe/IConnectsToElementalPipe.java (renamed from src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IConnectsToElementalPipe.java)2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/pipe/IConnectsToEnergyTunnel.java (renamed from src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IConnectsToEnergyTunnel.java)2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/pipe/PipeActivityMessage.java (renamed from src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/PipeActivityMessage.java)4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/block/QuantumGlassItem.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/block/ReactorSimItem.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsBA0.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsTT.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/casing/GT_Item_HintTT.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionContainer_EM.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java4
-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/FrontRotationTriggerItem.java20
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCapacitor.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/TeslaCoilComponent.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCover.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/metaTileEntity/IFrontRotation.java11
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java8
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeData.java8
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java8
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java10
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java21
-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.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputDataItems.java10
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java2
-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.java8
-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.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java8
-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.java2
-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/hatch/gui/GT_GUIContainer_Param.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamText.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java12
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java14
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java16
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java28
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java12
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java14
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java14
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java10
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java8
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java10
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java12
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java16
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java14
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java8
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java18
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java12
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java12
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java36
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java8
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java114
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java429
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedExtendedFacingTexture.java (renamed from src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedTexture.java)428
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java10
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java40
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java40
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java40
-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.java18
-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_DebugStructureWriter.java6
-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.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TT_Transformer.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java16
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_WetTransformer.java4
-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_BuckConverter.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java14
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPowerGenerator.java4
-rw-r--r--src/main/java/com/github/technus/tectech/util/CommonValues.java (renamed from src/main/java/com/github/technus/tectech/CommonValues.java)2
-rw-r--r--src/main/java/com/github/technus/tectech/util/Converter.java (renamed from src/main/java/com/github/technus/tectech/Converter.java)2
-rw-r--r--src/main/java/com/github/technus/tectech/util/Util.java (renamed from src/main/java/com/github/technus/tectech/Util.java)680
-rw-r--r--src/main/java/com/github/technus/tectech/util/Vec3Impl.java146
-rw-r--r--src/main/java/com/github/technus/tectech/util/XSTR.java (renamed from src/main/java/com/github/technus/tectech/XSTR.java)2
135 files changed, 2017 insertions, 1738 deletions
diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java
index 9694dadfd3..47a3b576b1 100644
--- a/src/main/java/com/github/technus/tectech/TecTech.java
+++ b/src/main/java/com/github/technus/tectech/TecTech.java
@@ -12,6 +12,7 @@ import com.github.technus.tectech.mechanics.data.PlayerPersistence;
import com.github.technus.tectech.mechanics.elementalMatter.core.commands.GiveEM;
import com.github.technus.tectech.mechanics.elementalMatter.core.commands.ListEM;
import com.github.technus.tectech.proxy.CommonProxy;
+import com.github.technus.tectech.util.XSTR;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
diff --git a/src/main/java/com/github/technus/tectech/Vec3pos.java b/src/main/java/com/github/technus/tectech/Vec3pos.java
deleted file mode 100644
index eb694813da..0000000000
--- a/src/main/java/com/github/technus/tectech/Vec3pos.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.github.technus.tectech;
-
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
-/**
- * Created by Tec on 05.04.2017.
- */
-public class Vec3pos implements Comparable<Vec3pos> {
- public final int x, z;
- public final short y;
-
- public Vec3pos(int x, short y, int z) {
- this.x = x;
- this.y = y;
- this.z = z;
- }
-
- public Vec3pos(IGregTechTileEntity te) {
- x = te.getXCoord();
- y = te.getYCoord();
- z = te.getZCoord();
- }
-
- @Override
- public int compareTo(Vec3pos o) {
- int tmp=y-o.y;
- if (tmp!=0) {
- return tmp;
- }
- tmp=x-o.x;
- if (tmp!=0) {
- return tmp;
- }
- return z-o.z;
- }
-
- @Override
- public boolean equals(Object obj) {
- if(obj instanceof Vec3pos){
- Vec3pos v=(Vec3pos) obj;
- return x==v.x && z==v.z && y==v.y;
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- return x*524288+z*256+y;
- }
-}
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 adf5d37876..798ffec36c 100644
--- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/NoDreamCraftMachineLoader.java
+++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/NoDreamCraftMachineLoader.java
@@ -2,7 +2,7 @@ package com.github.technus.tectech.compatibility.dreamcraft;
import com.github.technus.tectech.Reference;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
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;
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 fcbb65d609..2842a71df3 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,7 +8,7 @@ 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.Converter;
+import com.github.technus.tectech.util.Converter;
import com.github.technus.tectech.TecTech;
import li.cil.oc.Settings;
import li.cil.oc.api.Driver;
diff --git a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretbases/TurretBaseItemEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretbases/TurretBaseItemEM.java
index 97fc8132a2..ed4b72f094 100644
--- a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretbases/TurretBaseItemEM.java
+++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretbases/TurretBaseItemEM.java
@@ -1,6 +1,6 @@
package com.github.technus.tectech.compatibility.openmodularturrets.blocks.turretbases;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
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 422b931df5..f4ad25f053 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
@@ -10,7 +10,7 @@ import openmodularturrets.handler.ConfigHandler;
import java.text.DecimalFormat;
import java.util.List;
-import static com.github.technus.tectech.CommonValues.TEC_MARK_EM;
+import static com.github.technus.tectech.util.CommonValues.TEC_MARK_EM;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/dComplexAspectDefinition.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/dComplexAspectDefinition.java
index 8961215354..070a05d7e9 100644
--- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/dComplexAspectDefinition.java
+++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/dComplexAspectDefinition.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDefinitionStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack;
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 4074f2d6db..ab6b723e09 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
@@ -1,13 +1,13 @@
package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.casing.TT_Container_Casings;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_quantizer;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder;
@@ -23,8 +23,8 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.ForgeDirection;
-import static com.github.technus.tectech.CommonValues.V;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.CommonValues.V;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat.essentiaContainerCompat;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
@@ -139,7 +139,7 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_
iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2);
}
}
- StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, iGregTechTileEntity, this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, iGregTechTileEntity, getExtendedFacing(), hintsOnly);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java
index 0caf4be6d6..309d029b8e 100644
--- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java
+++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java
@@ -1,13 +1,13 @@
package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.casing.TT_Container_Casings;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_quantizer;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder;
@@ -23,8 +23,8 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.ForgeDirection;
-import static com.github.technus.tectech.CommonValues.V;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.CommonValues.V;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat.essentiaContainerCompat;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
@@ -143,7 +143,7 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu
iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2);
}
}
- StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, iGregTechTileEntity, this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, iGregTechTileEntity, getExtendedFacing(), hintsOnly);
}
@Override
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 a2384eac61..f7bec9adc0 100644
--- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java
+++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java
@@ -38,7 +38,7 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
-import static com.github.technus.tectech.CommonValues.*;
+import static com.github.technus.tectech.util.CommonValues.*;
import static com.github.technus.tectech.TecTech.*;
import static com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.AspectDefinitionCompat.aspectDefinitionCompat;
import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat.essentiaContainerCompat;
@@ -126,7 +126,7 @@ public final class MainLoader {
progressBarPostLoad.step("Dreamcraft Compatibility");
if(Loader.isModLoaded(Reference.DREAMCRAFT)){
try {
- Class clazz = Class.forName("com.dreammaster.gthandler.casings.GT_Container_CasingsNH");
+ Class<?> clazz = Class.forName("com.dreammaster.gthandler.casings.GT_Container_CasingsNH");
TT_Container_Casings.sBlockCasingsNH = (Block)clazz.getField("sBlockCasingsNH").get(null);
if(TT_Container_Casings.sBlockCasingsNH==null){
diff --git a/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java b/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java
index 88b237c003..7d35a216f0 100644
--- a/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java
+++ b/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java
@@ -3,9 +3,9 @@ package com.github.technus.tectech.loader;
import com.github.technus.tectech.mechanics.data.ChunkDataMessage;
import com.github.technus.tectech.mechanics.data.PlayerDataMessage;
import com.github.technus.tectech.mechanics.data.RendererMessage;
-import com.github.technus.tectech.thing.metaTileEntity.RotationMessage;
+import com.github.technus.tectech.mechanics.alignment.AlignmentMessage;
import com.github.technus.tectech.thing.metaTileEntity.hatch.TextParametersMessage;
-import com.github.technus.tectech.thing.metaTileEntity.pipe.PipeActivityMessage;
+import com.github.technus.tectech.mechanics.pipe.PipeActivityMessage;
import static com.github.technus.tectech.Reference.MODID;
@@ -23,8 +23,8 @@ public class NetworkDispatcher extends eu.usrv.yamcore.network.PacketDispatcher
registerMessage(PipeActivityMessage.ServerHandler.class, PipeActivityMessage.PipeActivityQuery.class);
registerMessage(PipeActivityMessage.ClientHandler.class, PipeActivityMessage.PipeActivityData.class);
- registerMessage(RotationMessage.ServerHandler.class, RotationMessage.RotationQuery.class);
- registerMessage(RotationMessage.ClientHandler.class, RotationMessage.RotationData.class);
+ registerMessage(AlignmentMessage.ServerHandler.class, AlignmentMessage.AlignmentQuery.class);
+ registerMessage(AlignmentMessage.ClientHandler.class, AlignmentMessage.AlignmentData.class);
registerMessage(ChunkDataMessage.ServerHandler.class, ChunkDataMessage.ChunkDataQuery.class);
registerMessage(ChunkDataMessage.ClientHandler.class, ChunkDataMessage.ChunkDataData.class);
diff --git a/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java
index a1d400ed54..70f64d3719 100644
--- a/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java
+++ b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java
@@ -165,32 +165,32 @@ public class BloodyRecipeLoader implements Runnable {
GT_ModHandler.addCraftingRecipe(CustomItemList.tM_TeslaPrimary_0.get(1),
GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE,
new Object[]{"WWW", "WwW", "WWW",
- 'W', OrePrefixes.wireGt02.get(Materials.RedstoneAlloy)});
+ 'W', OrePrefixes.wireGt02.get(Materials.Tin)});
//Tesla Primary Coils T1
GT_ModHandler.addCraftingRecipe(CustomItemList.tM_TeslaPrimary_1.get(1),
GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE,
new Object[]{"WWW", "WwW", "WWW",
- 'W', OrePrefixes.wireGt02.get(Materials.SuperconductorMV)});
+ 'W', OrePrefixes.wireGt02.get(Materials.Copper)});
//Tesla Primary Coils T2
GT_ModHandler.addCraftingRecipe(CustomItemList.tM_TeslaPrimary_2.get(1),
GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE,
new Object[]{"WWW", "WwW", "WWW",
- 'W', OrePrefixes.wireGt02.get(Materials.SuperconductorHV)});
+ 'W', OrePrefixes.wireGt02.get(Materials.Silver)});
//Tesla Primary Coils T3
GT_ModHandler.addCraftingRecipe(CustomItemList.tM_TeslaPrimary_3.get(1),
GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE,
new Object[]{"WWW", "WwW", "WWW",
- 'W', OrePrefixes.wireGt02.get(Materials.SuperconductorEV)});
+ 'W', OrePrefixes.wireGt02.get(Materials.Aluminium)});
//Tesla Primary Coils T4
GT_ModHandler.addCraftingRecipe(CustomItemList.tM_TeslaPrimary_4.get(1),
GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE,
new Object[]{"WWW", "WwW", "WWW",
- 'W', OrePrefixes.wireGt02.get(Materials.SuperconductorIV)});
+ 'W', OrePrefixes.wireGt02.get(Materials.Platinum)});
//Tesla Primary Coils T5
GT_ModHandler.addCraftingRecipe(CustomItemList.tM_TeslaPrimary_5.get(1),
GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE,
new Object[]{"WWW", "WwW", "WWW",
- 'W', OrePrefixes.wireGt02.get(Materials.SuperconductorLuV)});
+ 'W', OrePrefixes.wireGt02.get(Materials.Superconductor)});
//endregion
@@ -1114,7 +1114,7 @@ public class BloodyRecipeLoader implements Runnable {
}, Materials.Epoxid.getMolten(288), CustomItemList.teslaComponent.getWithDamage(1, 0), 320, 30);
//Tesla Winding Components Ultimate
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{
- GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorLuV, 16),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 16),
GT_OreDictUnificator.get(OrePrefixes.ring, Materials.NickelZincFerrite, 8),
}, Materials.Epoxid.getMolten(576), CustomItemList.teslaComponent.getWithDamage(1, 1), 320, 7680);
@@ -1125,35 +1125,35 @@ public class BloodyRecipeLoader implements Runnable {
//LV Tesla Capacitor
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{
GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tin, 4),
- GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 4),
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 4),
GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 8),
GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 8),
}, Materials.Epoxid.getMolten(72), CustomItemList.teslaCapacitor.getWithDamage(1, 0), 320, 30);
//MV Tesla Capacitor
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{
GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Copper, 4),
- GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 6),
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 6),
GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 12),
GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 12),
}, Materials.Epoxid.getMolten(144), CustomItemList.teslaCapacitor.getWithDamage(1, 1), 320, 120);
//HV Tesla Capacitor
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{
GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Gold, 4),
- GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 8),
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 8),
GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 16),
GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 16),
}, Materials.Epoxid.getMolten(216), CustomItemList.teslaCapacitor.getWithDamage(1, 2), 320, 480);
//EV Tesla Capacitor
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{
GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Aluminium, 4),
- GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 10),
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 10),
GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 20),
GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 20),
}, Materials.Epoxid.getMolten(288), CustomItemList.teslaCapacitor.getWithDamage(1, 3), 320, 1920);
//IV Tesla Capacitor
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{
GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tungsten, 4),
- GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 12),
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 12),
GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 24),
GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 24),
}, Materials.Epoxid.getMolten(360), CustomItemList.teslaCapacitor.getWithDamage(1, 4), 320, 7680);
@@ -1208,19 +1208,19 @@ public class BloodyRecipeLoader implements Runnable {
//LV Tesla Capacitor
GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 0),
- GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 4), 300, 2);
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 4), 300, 2);
//MV Tesla Capacitor
GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 1),
- GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 6), 300, 2);
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 6), 300, 2);
//HV Tesla Capacitor
GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 2),
- GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 8), 300, 2);
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 8), 300, 2);
//EV Tesla Capacitor
GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 3),
- GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 10), 300, 2);
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 10), 300, 2);
//IV Tesla Capacitor
GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 4),
- GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 12), 300, 2);
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 12), 300, 2);
//endregion
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 9f87428bb5..9dd71df9eb 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
@@ -15,7 +15,7 @@ import cpw.mods.fml.common.Loader;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
-import static com.github.technus.tectech.CommonValues.V;
+import static com.github.technus.tectech.util.CommonValues.V;
import static com.github.technus.tectech.thing.CustomItemList.*;
/**
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 4596e8a2c8..7b432dbcb4 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
@@ -24,11 +24,11 @@ public class ThingsLoader implements Runnable {
if(Textures.BlockIcons.casingTexturePages[tectechTexturePage1]==null) {
Textures.BlockIcons.casingTexturePages[tectechTexturePage1] = new ITexture[128];
}
+ TecTech.LOGGER.info("Added texture page if was null");
if(!Loader.isModLoaded(Reference.DREAMCRAFT)){
- TecTech.LOGGER.info("Adding basic casings");
TT_Container_Casings.sBlockCasingsNH = new GT_Block_CasingsNH();
+ TecTech.LOGGER.info("Adding basic casings");
}
- TecTech.LOGGER.info("Added texture page if was null");
TT_Container_Casings.sBlockCasingsTT = new GT_Block_CasingsTT();
TecTech.LOGGER.info("Elemental Casing registered");
TT_Container_Casings.sBlockCasingsBA0 = new GT_Block_CasingsBA0();
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentLimits.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentLimits.java
new file mode 100644
index 0000000000..26a6d80dd8
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentLimits.java
@@ -0,0 +1,183 @@
+package com.github.technus.tectech.mechanics.alignment;
+
+import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
+import com.github.technus.tectech.mechanics.alignment.enumerable.Flip;
+import com.github.technus.tectech.mechanics.alignment.enumerable.Rotation;
+import net.minecraftforge.common.util.ForgeDirection;
+
+import java.util.Arrays;
+import java.util.Optional;
+import java.util.Random;
+import java.util.function.Function;
+
+import static com.github.technus.tectech.mechanics.alignment.IAlignment.STATES_COUNT;
+
+public class AlignmentLimits implements IAlignmentLimits {
+
+ protected final boolean[] validStates=new boolean[STATES_COUNT];
+
+ public AlignmentLimits() {
+ allowAll();
+ }
+
+ AlignmentLimits allowAll(){
+ Arrays.fill(validStates,true);
+ return this;
+ }
+
+ AlignmentLimits denyAll(){
+ Arrays.fill(validStates,false);
+ return this;
+ }
+
+ AlignmentLimits randomAll(Random random){
+ for (int i = 0; i < validStates.length; i++) {
+ validStates[i]=random.nextBoolean();
+ }
+ return this;
+ }
+
+ AlignmentLimits deny(ExtendedFacing... deny){
+ if(deny!=null){
+ for (ExtendedFacing extendedFacing : deny) {
+ validStates[extendedFacing.getIndex()]=false;
+ }
+ }
+ return this;
+ }
+
+ AlignmentLimits allow(ExtendedFacing... allow){
+ if(allow!=null){
+ for (ExtendedFacing extendedFacing : allow) {
+ validStates[extendedFacing.getIndex()]=false;
+ }
+ }
+ return this;
+ }
+
+ AlignmentLimits deny(ForgeDirection... deny){
+ if(deny!=null){
+ for (ExtendedFacing value : ExtendedFacing.VALUES) {
+ for (ForgeDirection direction : deny) {
+ if (value.getDirection() == direction) {
+ validStates[value.getIndex()] = false;
+ break;
+ }
+ }
+ }
+ }
+ return this;
+ }
+
+ AlignmentLimits allow(ForgeDirection... allow){
+ if(allow!=null){
+ for (ExtendedFacing value : ExtendedFacing.VALUES) {
+ for (ForgeDirection direction : allow) {
+ if (value.getDirection() == direction) {
+ validStates[value.getIndex()] = true;
+ break;
+ }
+ }
+ }
+ }
+ return this;
+ }
+
+ AlignmentLimits deny(Rotation... deny){
+ if(deny!=null){
+ for (ExtendedFacing value : ExtendedFacing.VALUES) {
+ for (Rotation rotation : deny) {
+ if (value.getRotation() == rotation) {
+ validStates[value.getIndex()] = false;
+ break;
+ }
+ }
+ }
+ }
+ return this;
+ }
+
+ AlignmentLimits allow(Rotation... allow){
+ if(allow!=null){
+ for (ExtendedFacing value : ExtendedFacing.VALUES) {
+ for (Rotation rotation : allow) {
+ if (value.getRotation() == rotation) {
+ validStates[value.getIndex()] = true;
+ break;
+ }
+ }
+ }
+ }
+ return this;
+ }
+
+ AlignmentLimits deny(Flip... deny){
+ if(deny!=null){
+ for (ExtendedFacing value : ExtendedFacing.VALUES) {
+ for (Flip flip : deny) {
+ if (value.getFlip() == flip) {
+ validStates[value.getIndex()] = false;
+ break;
+ }
+ }
+ }
+ }
+ return this;
+ }
+
+ AlignmentLimits allow(Flip... allow){
+ if(allow!=null){
+ for (ExtendedFacing value : ExtendedFacing.VALUES) {
+ for (Flip flip : allow) {
+ if (value.getFlip() == flip) {
+ validStates[value.getIndex()] = true;
+ break;
+ }
+ }
+ }
+ }
+ return this;
+ }
+
+ AlignmentLimits predicateApply(Function<ExtendedFacing,Optional<Boolean>> predicate){
+ for (ExtendedFacing value : ExtendedFacing.VALUES) {
+ predicate.apply(value).ifPresent(bool->validStates[value.getIndex()]=bool);
+ }
+ return this;
+ }
+
+ AlignmentLimits ensureDuplicates(){
+ for (ExtendedFacing value : ExtendedFacing.VALUES) {
+ if(validStates[value.getIndex()]){
+ validStates[value.getDuplicate().getIndex()]=true;
+ }
+ }
+ return this;
+ }
+
+ /**
+ * Prefers rotation over flip, so both flip will get translated to opposite rotation and no flip
+ * @param flip the preferred flip to be used Horizontal or vertical
+ * @return this
+ */
+ AlignmentLimits ensureNoDuplicates(Flip flip){
+ if(flip==Flip.BOTH||flip==Flip.NONE){
+ throw new IllegalArgumentException("Preffered Flip must be Horizontal or Vertical");
+ }
+ flip=flip.getOpposite();
+ for (ExtendedFacing value : ExtendedFacing.VALUES) {
+ if(validStates[value.getIndex()]){
+ if(value.getFlip()==Flip.BOTH || value.getFlip()==flip){
+ validStates[value.getIndex()]=false;
+ validStates[value.getDuplicate().getIndex()]=true;
+ }
+ }
+ }
+ return this;
+ }
+
+ @Override
+ public boolean isNewExtendedFacingValid(ForgeDirection direction, Rotation rotation, Flip flip) {
+ return validStates[IAlignment.getAlignmentIndex(direction,rotation,flip)];
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/RotationMessage.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentMessage.java
index 92b38e68ea..07a3e02c1f 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/RotationMessage.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentMessage.java
@@ -1,5 +1,6 @@
-package com.github.technus.tectech.thing.metaTileEntity;
+package com.github.technus.tectech.mechanics.alignment;
+import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import cpw.mods.fml.common.network.ByteBufUtils;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
@@ -15,31 +16,31 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
-public class RotationMessage implements IMessage {
+public class AlignmentMessage implements IMessage {
int mPosX;
int mPosY;
int mPosZ;
int mPosD;
- int mRotF;
+ int mAlign;
- public RotationMessage() {
+ public AlignmentMessage() {
}
- private RotationMessage(GT_MetaTileEntity_MultiblockBase_EM metaTile) {
+ private AlignmentMessage(GT_MetaTileEntity_MultiblockBase_EM metaTile) {
IGregTechTileEntity base=metaTile.getBaseMetaTileEntity();
mPosX=base.getXCoord();
mPosY=base.getYCoord();
mPosZ=base.getZCoord();
mPosD=base.getWorld().provider.dimensionId;
- mRotF=metaTile.getFrontRotation();
+ mAlign =metaTile.getExtendedFacing().getIndex();
}
- private RotationMessage(World world, int x,int y,int z, IFrontRotation front) {
+ private AlignmentMessage(World world, int x, int y, int z, IAlignment front) {
mPosX=x;
mPosY=y;
mPosZ=z;
mPosD=world.provider.dimensionId;
- mRotF=front.getFrontRotation();
+ mAlign =front.getExtendedFacing().getIndex();
}
@Override
@@ -49,7 +50,7 @@ public class RotationMessage implements IMessage {
mPosY = tTag.getInteger("posy");
mPosZ = tTag.getInteger("posz");
mPosD = tTag.getInteger("posd");
- mRotF = tTag.getInteger("rotf");
+ mAlign = tTag.getInteger("rotf");
}
@Override
@@ -59,78 +60,78 @@ public class RotationMessage implements IMessage {
tFXTag.setInteger("posy", mPosY);
tFXTag.setInteger("posz", mPosZ);
tFXTag.setInteger("posd", mPosD);
- tFXTag.setInteger("rotf", mRotF);
+ tFXTag.setInteger("rotf", mAlign);
ByteBufUtils.writeTag(pBuffer, tFXTag);
}
- public static class RotationQuery extends RotationMessage{
- public RotationQuery() {
+ public static class AlignmentQuery extends AlignmentMessage {
+ public AlignmentQuery() {
}
- public RotationQuery(GT_MetaTileEntity_MultiblockBase_EM metaTile) {
+ public AlignmentQuery(GT_MetaTileEntity_MultiblockBase_EM metaTile) {
super(metaTile);
}
- public RotationQuery(World world, int x,int y,int z, IFrontRotation front) {
+ public AlignmentQuery(World world, int x, int y, int z, IAlignment front) {
super(world,x,y,z,front);
}
}
- public static class RotationData extends RotationMessage{
- public RotationData() {
+ public static class AlignmentData extends AlignmentMessage {
+ public AlignmentData() {
}
- private RotationData(RotationQuery query){
+ private AlignmentData(AlignmentQuery query){
mPosX=query.mPosX;
mPosY=query.mPosY;
mPosZ=query.mPosZ;
mPosD=query.mPosD;
- mRotF=query.mRotF;
+ mAlign =query.mAlign;
}
- public RotationData(GT_MetaTileEntity_MultiblockBase_EM metaTile) {
+ public AlignmentData(GT_MetaTileEntity_MultiblockBase_EM metaTile) {
super(metaTile);
}
- public RotationData(World world, int x,int y,int z, IFrontRotation front) {
+ public AlignmentData(World world, int x, int y, int z, IAlignment front) {
super(world,x,y,z,front);
}
}
- public static class ClientHandler extends AbstractClientMessageHandler<RotationData> {
+ public static class ClientHandler extends AbstractClientMessageHandler<AlignmentData> {
@Override
- public IMessage handleClientMessage(EntityPlayer pPlayer, RotationData pMessage, MessageContext pCtx) {
+ public IMessage handleClientMessage(EntityPlayer pPlayer, AlignmentData pMessage, MessageContext pCtx) {
if(pPlayer.worldObj.provider.dimensionId==pMessage.mPosD){
TileEntity te=pPlayer.worldObj.getTileEntity(pMessage.mPosX,pMessage.mPosY,pMessage.mPosZ);
if(te instanceof IGregTechTileEntity){
IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity();
- if(meta instanceof IFrontRotation){
- ((IFrontRotation) meta).forceSetRotationDoRender((byte)pMessage.mRotF);
+ if(meta instanceof IAlignment){
+ ((IAlignment) meta).setExtendedFacing(ExtendedFacing.byIndex(pMessage.mAlign));
}
- }else if (te instanceof IFrontRotation){
- ((IFrontRotation) te).forceSetRotationDoRender((byte)pMessage.mRotF);
+ }else if (te instanceof IAlignment){
+ ((IAlignment) te).setExtendedFacing(ExtendedFacing.byIndex(pMessage.mAlign));
}
}
return null;
}
}
- public static class ServerHandler extends AbstractServerMessageHandler<RotationQuery> {
+ public static class ServerHandler extends AbstractServerMessageHandler<AlignmentQuery> {
@Override
- public IMessage handleServerMessage(EntityPlayer pPlayer, RotationQuery pMessage, MessageContext pCtx) {
+ public IMessage handleServerMessage(EntityPlayer pPlayer, AlignmentQuery pMessage, MessageContext pCtx) {
World world= DimensionManager.getWorld(pMessage.mPosD);
if(world!=null) {
TileEntity te = world.getTileEntity(pMessage.mPosX, pMessage.mPosY, pMessage.mPosZ);
if (te instanceof IGregTechTileEntity) {
IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity();
- if (meta instanceof IFrontRotation) {
- pMessage.mRotF=((IFrontRotation) meta).getFrontRotation();
- return new RotationData(pMessage);
+ if (meta instanceof IAlignment) {
+ pMessage.mAlign =((IAlignment) meta).getExtendedFacing().getIndex();
+ return new AlignmentData(pMessage);
}
- } else if (te instanceof IFrontRotation) {
- pMessage.mRotF=((IFrontRotation) te).getFrontRotation();
- return new RotationData(pMessage);
+ } else if (te instanceof IAlignment) {
+ pMessage.mAlign =((IAlignment) te).getExtendedFacing().getIndex();
+ return new AlignmentData(pMessage);
}
}
return null;
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignment.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignment.java
new file mode 100644
index 0000000000..d7b48f8865
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignment.java
@@ -0,0 +1,173 @@
+package com.github.technus.tectech.mechanics.alignment;
+
+import com.github.technus.tectech.mechanics.alignment.enumerable.Direction;
+import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
+import com.github.technus.tectech.mechanics.alignment.enumerable.Flip;
+import com.github.technus.tectech.mechanics.alignment.enumerable.Rotation;
+import net.minecraftforge.common.util.ForgeDirection;
+
+import java.util.Arrays;
+
+public interface IAlignment extends IAlignmentLimits {
+ int DIRECTIONS_COUNT= Direction.VALUES.length;
+ int ROTATIONS_COUNT= Rotation.VALUES.length;
+ int FLIPS_COUNT= Flip.VALUES.length;
+ int STATES_COUNT = ExtendedFacing.VALUES.length;
+
+ static int getAlignmentIndex(ForgeDirection direction, Rotation rotation, Flip flip){
+ return (direction.ordinal()*ROTATIONS_COUNT+rotation.getIndex())*FLIPS_COUNT+flip.getIndex();
+ }
+
+ default ForgeDirection getDirection(){
+ return getExtendedFacing().getDirection();
+ }
+
+ default void setDirection(ForgeDirection direction){
+ setExtendedFacing(getExtendedFacing().with(direction));
+ }
+
+ default Rotation getRotation(){
+ return getExtendedFacing().getRotation();
+ }
+
+ default void setRotation(Rotation rotation){
+ setExtendedFacing(getExtendedFacing().with(rotation));
+ }
+
+ default Flip getFlip(){
+ return getExtendedFacing().getFlip();
+ }
+
+ default void setFlip(Flip flip){
+ setExtendedFacing(getExtendedFacing().with(flip));
+ }
+
+ ExtendedFacing getExtendedFacing();
+
+ void setExtendedFacing(ExtendedFacing alignment);
+
+ IAlignmentLimits getAlignmentLimits();
+
+ void setAlignmentLimits(IAlignmentLimits limits);
+
+ default boolean toolSetDirection(ForgeDirection direction){
+ if(direction==null || direction==ForgeDirection.UNKNOWN){
+ for (int i = 0,j=getDirection().ordinal()+1, valuesLength = Direction.VALUES.length; i < valuesLength; i++) {
+ if(toolSetDirection(Direction.VALUES[j%valuesLength].getForgeDirection())){
+ return true;
+ }
+ }
+ }else {
+ for (ExtendedFacing extendedFacing : ExtendedFacing.FOR_FACING.get(direction)) {
+ if(checkedSetExtendedFacing(extendedFacing)){
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ default boolean checkedSetDirection(ForgeDirection direction){
+ if (isNewDirectionValid(direction)){
+ setDirection(direction);
+ return true;
+ }
+ return false;
+ }
+
+ default boolean toolSetRotation(Rotation rotation) {
+ if(rotation==null){
+ int flips = Flip.VALUES.length;
+ int rotations = Rotation.VALUES.length;
+ for (int ii = 0,jj=getFlip().ordinal(); ii < flips; ii++) {
+ for (int i = 0,j=getRotation().ordinal()+1; i < rotations; i++) {
+ if(checkedSetExtendedFacing(ExtendedFacing.of(getDirection(),Rotation.VALUES[j%rotations],Flip.VALUES[jj%flips]))){
+ return true;
+ }
+ }
+ }
+ return false;
+ }else {
+ return checkedSetRotation(rotation);
+ }
+ }
+
+ default boolean checkedSetRotation(Rotation rotation){
+ if (isNewRotationValid(rotation)){
+ setRotation(rotation);
+ return true;
+ }
+ return false;
+ }
+
+ default boolean toolSetFlip(Flip flip){
+ if(flip==null){
+ for (int i = 0,j=getFlip().ordinal()+1, valuesLength = Flip.VALUES.length; i < valuesLength; i++) {
+ if(toolSetFlip(Flip.VALUES[j%valuesLength])){
+ return true;
+ }
+ }
+ return false;
+ }else {
+ return checkedSetFlip(flip);
+ }
+ }
+
+ default boolean checkedSetFlip(Flip flip){
+ if (isNewFlipValid(flip)){
+ setFlip(flip);
+ return true;
+ }
+ return false;
+ }
+
+ default boolean toolSetExtendedFacing(ExtendedFacing extendedFacing){
+ if(extendedFacing==null){
+ for (int i = 0,j=getExtendedFacing().ordinal()+1, valuesLength = ExtendedFacing.VALUES.length; i < valuesLength; i++) {
+ if(toolSetExtendedFacing(ExtendedFacing.VALUES[j%valuesLength])){
+ return true;
+ }
+ }
+ return false;
+ }else {
+ return checkedSetExtendedFacing(extendedFacing);
+ }
+ }
+
+ default boolean checkedSetExtendedFacing(ExtendedFacing alignment){
+ if (isNewExtendedFacingValid(alignment)){
+ setExtendedFacing(alignment);
+ return true;
+ }
+ return false;
+ }
+
+ default boolean isNewDirectionValid(ForgeDirection direction) {
+ return isNewExtendedFacingValid(direction,getRotation(),getFlip());
+ }
+
+ default boolean isNewRotationValid(Rotation rotation){
+ return isNewExtendedFacingValid(getDirection(),rotation,getFlip());
+ }
+
+ default boolean isNewFlipValid(Flip flip){
+ return isNewExtendedFacingValid(getDirection(),getRotation(),flip);
+ }
+
+ default boolean isExtendedFacingValid() {
+ return isNewExtendedFacingValid(getDirection(),getRotation(),getFlip());
+ }
+
+ @Override
+ default boolean isNewExtendedFacingValid(ForgeDirection direction, Rotation rotation, Flip flip){
+ return getAlignmentLimits().isNewExtendedFacingValid(direction, rotation, flip);
+ }
+
+ @Override
+ default boolean isNewExtendedFacingValid(ExtendedFacing alignment){
+ return getAlignmentLimits().isNewExtendedFacingValid(
+ alignment.getDirection(),
+ alignment.getRotation(),
+ alignment.getFlip());
+ }
+} \ No newline at end of file
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignmentLimits.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignmentLimits.java
new file mode 100644
index 0000000000..68b4d84dab
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignmentLimits.java
@@ -0,0 +1,19 @@
+package com.github.technus.tectech.mechanics.alignment;
+import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
+import com.github.technus.tectech.mechanics.alignment.enumerable.Flip;
+import com.github.technus.tectech.mechanics.alignment.enumerable.Rotation;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public interface IAlignmentLimits {
+
+ IAlignmentLimits UNLIMITED= (direction, rotation, flip) -> true;
+
+ boolean isNewExtendedFacingValid(ForgeDirection direction, Rotation rotation, Flip flip);
+
+ default boolean isNewExtendedFacingValid(ExtendedFacing alignment){
+ return isNewExtendedFacingValid(
+ alignment.getDirection(),
+ alignment.getRotation(),
+ alignment.getFlip());
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/IntegerAxisSwap.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/IntegerAxisSwap.java
new file mode 100644
index 0000000000..40cb6c3220
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/mechanics/alignment/IntegerAxisSwap.java
@@ -0,0 +1,67 @@
+package com.github.technus.tectech.mechanics.alignment;
+
+import com.github.technus.tectech.util.Vec3Impl;
+import net.minecraftforge.common.util.ForgeDirection;
+
+import static com.github.technus.tectech.mechanics.alignment.enumerable.Direction.getAxisVector;
+import static java.lang.Math.abs;
+
+public class IntegerAxisSwap {
+ private final Vec3Impl forFirstAxis;
+ private final Vec3Impl forSecondAxis;
+ private final Vec3Impl forThirdAxis;
+
+ public IntegerAxisSwap(ForgeDirection forFirstAxis, ForgeDirection forSecondAxis, ForgeDirection forThirdAxis) {
+ this.forFirstAxis = getAxisVector(forFirstAxis);
+ this.forSecondAxis = getAxisVector(forSecondAxis);
+ this.forThirdAxis = getAxisVector(forThirdAxis);
+ if(abs(this.forFirstAxis.get0())+abs(this.forSecondAxis.get0())+abs(this.forThirdAxis.get0())!=1 ||
+ abs(this.forFirstAxis.get1())+abs(this.forSecondAxis.get1())+abs(this.forThirdAxis.get1())!=1 ||
+ abs(this.forFirstAxis.get2())+abs(this.forSecondAxis.get2())+abs(this.forThirdAxis.get2())!=1){
+ throw new IllegalArgumentException("Axis are overlapping/missing! "+
+ forFirstAxis.name()+" "+
+ forSecondAxis.name()+" "+
+ forThirdAxis.name());
+ }
+ }
+
+ public Vec3Impl translate(Vec3Impl point){
+ return new Vec3Impl(
+ forFirstAxis.get0()*point.get0() +forFirstAxis.get1()*point.get1() +forFirstAxis.get2()*point.get2(),
+ forSecondAxis.get0()*point.get0()+forSecondAxis.get1()*point.get1()+forSecondAxis.get2()*point.get2(),
+ forThirdAxis.get0()*point.get0() +forThirdAxis.get1()*point.get1() +forThirdAxis.get2()*point.get2()
+ );
+ }
+
+ public Vec3Impl inverseTranslate(Vec3Impl point){
+ return new Vec3Impl(
+ forFirstAxis.get0()*point.get0()+forSecondAxis.get0()*point.get1()+forThirdAxis.get0()*point.get2(),
+ forFirstAxis.get1()*point.get0()+forSecondAxis.get1()*point.get1()+forThirdAxis.get1()*point.get2(),
+ forFirstAxis.get2()*point.get0()+forSecondAxis.get2()*point.get1()+forThirdAxis.get2()*point.get2()
+ );
+ }
+
+ public void translate(int[] point,int[] out){
+ out[0]=forFirstAxis.get0()*point[0] +forFirstAxis.get1()*point[1] +forFirstAxis.get2()*point[2];
+ out[1]=forSecondAxis.get0()*point[0]+forSecondAxis.get1()*point[1]+forSecondAxis.get2()*point[2];
+ out[2]=forThirdAxis.get0()*point[0] +forThirdAxis.get1()*point[1] +forThirdAxis.get2()*point[2];
+ }
+
+ public void inverseTranslate(int[] point,int[] out){
+ out[0]=forFirstAxis.get0()*point[0]+forSecondAxis.get0()*point[1]+forThirdAxis.get0()*point[2];
+ out[1]=forFirstAxis.get1()*point[0]+forSecondAxis.get1()*point[1]+forThirdAxis.get1()*point[2];
+ out[2]=forFirstAxis.get2()*point[0]+forSecondAxis.get2()*point[1]+forThirdAxis.get2()*point[2];
+ }
+
+ public void translate(double[] point,double[] out){
+ out[0]=forFirstAxis.get0()*point[0] +forFirstAxis.get1()*point[1] +forFirstAxis.get2()*point[2];
+ out[1]=forSecondAxis.get0()*point[0]+forSecondAxis.get1()*point[1]+forSecondAxis.get2()*point[2];
+ out[2]=forThirdAxis.get0()*point[0] +forThirdAxis.get1()*point[1] +forThirdAxis.get2()*point[2];
+ }
+
+ public void inverseTranslate(double[] point,double[] out){
+ out[0]=forFirstAxis.get0()*point[0]+forSecondAxis.get0()*point[1]+forThirdAxis.get0()*point[2];
+ out[1]=forFirstAxis.get1()*point[0]+forSecondAxis.get1()*point[1]+forThirdAxis.get1()*point[2];
+ out[2]=forFirstAxis.get2()*point[0]+forSecondAxis.get2()*point[1]+forThirdAxis.get2()*point[2];
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Direction.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Direction.java
new file mode 100644
index 0000000000..cc3971fedb
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Direction.java
@@ -0,0 +1,34 @@
+package com.github.technus.tectech.mechanics.alignment.enumerable;
+
+import com.github.technus.tectech.util.Vec3Impl;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public enum Direction {
+ DOWN(ForgeDirection.DOWN),
+ UP(ForgeDirection.UP),
+ NORTH(ForgeDirection.NORTH),
+ SOUTH(ForgeDirection.SOUTH),
+ WEST(ForgeDirection.WEST),
+ EAST(ForgeDirection.EAST);
+
+ private final ForgeDirection forgeDirection;
+ private final Vec3Impl axisVector;
+ public static final Direction[] VALUES=values();
+
+ Direction(ForgeDirection forgeDirection) {
+ this.forgeDirection = forgeDirection;
+ axisVector=new Vec3Impl(forgeDirection.offsetX,forgeDirection.offsetY,forgeDirection.offsetZ);
+ }
+
+ public ForgeDirection getForgeDirection() {
+ return forgeDirection;
+ }
+
+ public Vec3Impl getAxisVector() {
+ return axisVector;
+ }
+
+ public static Vec3Impl getAxisVector(ForgeDirection forgeDirection){
+ return VALUES[forgeDirection.ordinal()].axisVector;
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/ExtendedFacing.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/ExtendedFacing.java
new file mode 100644
index 0000000000..68cc50a5ee
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/ExtendedFacing.java
@@ -0,0 +1,324 @@
+package com.github.technus.tectech.mechanics.alignment.enumerable;
+
+import com.github.technus.tectech.mechanics.alignment.IAlignment;
+import com.github.technus.tectech.mechanics.alignment.IntegerAxisSwap;
+import com.github.technus.tectech.util.Vec3Impl;
+import net.minecraftforge.common.util.ForgeDirection;
+
+import java.util.*;
+
+import static com.github.technus.tectech.mechanics.alignment.IAlignment.FLIPS_COUNT;
+import static com.github.technus.tectech.mechanics.alignment.IAlignment.ROTATIONS_COUNT;
+import static java.lang.Math.abs;
+import static java.util.Arrays.stream;
+import static java.util.stream.Collectors.reducing;
+import static java.util.stream.Collectors.toMap;
+
+public enum ExtendedFacing {
+ DOWN_NORMAL_NONE("down normal none"),
+ DOWN_NORMAL_HORIZONTAL("down normal horizontal"),
+ DOWN_NORMAL_VERTICAL("down normal vertical"),
+ DOWN_NORMAL_BOTH("down normal both"),
+ DOWN_CLOCKWISE_NONE("down clockwise none"),
+ DOWN_CLOCKWISE_HORIZONTAL("down clockwise horizontal"),
+ DOWN_CLOCKWISE_VERTICAL("down clockwise vertical"),
+ DOWN_CLOCKWISE_BOTH("down clockwise both"),
+ DOWN_UPSIDE_DOWN_NONE("down upside down none"),
+ DOWN_UPSIDE_DOWN_HORIZONTAL("down upside down horizontal"),
+ DOWN_UPSIDE_DOWN_VERTICAL("down upside down vertical"),
+ DOWN_UPSIDE_DOWN_BOTH("down upside down both"),
+ DOWN_COUNTER_CLOCKWISE_NONE("down counter clockwise none"),
+ DOWN_COUNTER_CLOCKWISE_HORIZONTAL("down counter clockwise horizontal"),
+ DOWN_COUNTER_CLOCKWISE_VERTICAL("down counter clockwise vertical"),
+ DOWN_COUNTER_CLOCKWISE_BOTH("down counter clockwise both"),
+ UP_NORMAL_NONE("up normal none"),
+ UP_NORMAL_HORIZONTAL("up normal horizontal"),
+ UP_NORMAL_VERTICAL("up normal vertical"),
+ UP_NORMAL_BOTH("up normal both"),
+ UP_CLOCKWISE_NONE("up clockwise none"),
+ UP_CLOCKWISE_HORIZONTAL("up clockwise horizontal"),
+ UP_CLOCKWISE_VERTICAL("up clockwise vertical"),
+ UP_CLOCKWISE_BOTH("up clockwise both"),
+ UP_UPSIDE_DOWN_NONE("up upside down none"),
+ UP_UPSIDE_DOWN_HORIZONTAL("up upside down horizontal"),
+ UP_UPSIDE_DOWN_VERTICAL("up upside down vertical"),
+ UP_UPSIDE_DOWN_BOTH("up upside down both"),
+ UP_COUNTER_CLOCKWISE_NONE("up counter clockwise none"),
+ UP_COUNTER_CLOCKWISE_HORIZONTAL("up counter clockwise horizontal"),
+ UP_COUNTER_CLOCKWISE_VERTICAL("up counter clockwise vertical"),
+ UP_COUNTER_CLOCKWISE_BOTH("up counter clockwise both"),
+ NORTH_NORMAL_NONE("north normal none"),
+ NORTH_NORMAL_HORIZONTAL("north normal horizontal"),
+ NORTH_NORMAL_VERTICAL("north normal vertical"),
+ NORTH_NORMAL_BOTH("north normal both"),
+ NORTH_CLOCKWISE_NONE("north clockwise none"),
+ NORTH_CLOCKWISE_HORIZONTAL("north clockwise horizontal"),
+ NORTH_CLOCKWISE_VERTICAL("north clockwise vertical"),
+ NORTH_CLOCKWISE_BOTH("north clockwise both"),
+ NORTH_UPSIDE_DOWN_NONE("north upside down none"),
+ NORTH_UPSIDE_DOWN_HORIZONTAL("north upside down horizontal"),
+ NORTH_UPSIDE_DOWN_VERTICAL("north upside down vertical"),
+ NORTH_UPSIDE_DOWN_BOTH("north upside down both"),
+ NORTH_COUNTER_CLOCKWISE_NONE("north counter clockwise none"),
+ NORTH_COUNTER_CLOCKWISE_HORIZONTAL("north counter clockwise horizontal"),
+ NORTH_COUNTER_CLOCKWISE_VERTICAL("north counter clockwise vertical"),
+ NORTH_COUNTER_CLOCKWISE_BOTH("north counter clockwise both"),
+ SOUTH_NORMAL_NONE("south normal none"),
+ SOUTH_NORMAL_HORIZONTAL("south normal horizontal"),
+ SOUTH_NORMAL_VERTICAL("south normal vertical"),
+ SOUTH_NORMAL_BOTH("south normal both"),
+ SOUTH_CLOCKWISE_NONE("south clockwise none"),
+ SOUTH_CLOCKWISE_HORIZONTAL("south clockwise horizontal"),
+ SOUTH_CLOCKWISE_VERTICAL("south clockwise vertical"),
+ SOUTH_CLOCKWISE_BOTH("south clockwise both"),
+ SOUTH_UPSIDE_DOWN_NONE("south upside down none"),
+ SOUTH_UPSIDE_DOWN_HORIZONTAL("south upside down horizontal"),
+ SOUTH_UPSIDE_DOWN_VERTICAL("south upside down vertical"),
+ SOUTH_UPSIDE_DOWN_BOTH("south upside down both"),
+ SOUTH_COUNTER_CLOCKWISE_NONE("south counter clockwise none"),
+ SOUTH_COUNTER_CLOCKWISE_HORIZONTAL("south counter clockwise horizontal"),
+ SOUTH_COUNTER_CLOCKWISE_VERTICAL("south counter clockwise vertical"),
+ SOUTH_COUNTER_CLOCKWISE_BOTH("south counter clockwise both"),
+ WEST_NORMAL_NONE("west normal none"),
+ WEST_NORMAL_HORIZONTAL("west normal horizontal"),
+ WEST_NORMAL_VERTICAL("west normal vertical"),
+ WEST_NORMAL_BOTH("west normal both"),
+ WEST_CLOCKWISE_NONE("west clockwise none"),
+ WEST_CLOCKWISE_HORIZONTAL("west clockwise horizontal"),
+ WEST_CLOCKWISE_VERTICAL("west clockwise vertical"),
+ WEST_CLOCKWISE_BOTH("west clockwise both"),
+ WEST_UPSIDE_DOWN_NONE("west upside down none"),
+ WEST_UPSIDE_DOWN_HORIZONTAL("west upside down horizontal"),
+ WEST_UPSIDE_DOWN_VERTICAL("west upside down vertical"),
+ WEST_UPSIDE_DOWN_BOTH("west upside down both"),
+ WEST_COUNTER_CLOCKWISE_NONE("west counter clockwise none"),
+ WEST_COUNTER_CLOCKWISE_HORIZONTAL("west counter clockwise horizontal"),
+ WEST_COUNTER_CLOCKWISE_VERTICAL("west counter clockwise vertical"),
+ WEST_COUNTER_CLOCKWISE_BOTH("west counter clockwise both"),
+ EAST_NORMAL_NONE("east normal none"),
+ EAST_NORMAL_HORIZONTAL("east normal horizontal"),
+ EAST_NORMAL_VERTICAL("east normal vertical"),
+ EAST_NORMAL_BOTH("east normal both"),
+ EAST_CLOCKWISE_NONE("east clockwise none"),
+ EAST_CLOCKWISE_HORIZONTAL("east clockwise horizontal"),
+ EAST_CLOCKWISE_VERTICAL("east clockwise vertical"),
+ EAST_CLOCKWISE_BOTH("east clockwise both"),
+ EAST_UPSIDE_DOWN_NONE("east upside down none"),
+ EAST_UPSIDE_DOWN_HORIZONTAL("east upside down horizontal"),
+ EAST_UPSIDE_DOWN_VERTICAL("east upside down vertical"),
+ EAST_UPSIDE_DOWN_BOTH("east upside down both"),
+ EAST_COUNTER_CLOCKWISE_NONE("east counter clockwise none"),
+ EAST_COUNTER_CLOCKWISE_HORIZONTAL("east counter clockwise horizontal"),
+ EAST_COUNTER_CLOCKWISE_VERTICAL("east counter clockwise vertical"),
+ EAST_COUNTER_CLOCKWISE_BOTH("east counter clockwise both");
+
+ public static final ExtendedFacing DEFAULT=NORTH_NORMAL_NONE;
+ public static final ExtendedFacing[] VALUES = values();
+ public static final Map<ForgeDirection, List<ExtendedFacing>> FOR_FACING=new HashMap<>();
+ static {
+ stream(values()).forEach(extendedFacing ->
+ FOR_FACING.compute(extendedFacing.direction,((forgeDirection, extendedFacings) -> {
+ if(extendedFacings==null){
+ extendedFacings = new ArrayList<>();
+ }
+ extendedFacings.add(extendedFacing);
+ return extendedFacings;
+ })));
+ }
+ private static final Map<String, ExtendedFacing> NAME_LOOKUP = stream(VALUES).collect(toMap(ExtendedFacing::getName2, (extendedFacing) -> extendedFacing));
+
+ private final ForgeDirection direction;
+ private final Rotation rotation;
+ private final Flip flip;
+
+ private final String name;
+ private final IntegerAxisSwap integerAxisSwap;
+
+ ExtendedFacing(String name) {
+ this.name = name;
+ direction= Direction.VALUES[ordinal()/(ROTATIONS_COUNT*FLIPS_COUNT)].getForgeDirection();
+ rotation=Rotation.VALUES[ordinal()/FLIPS_COUNT-direction.ordinal()*ROTATIONS_COUNT];
+ flip=Flip.VALUES[ordinal()%FLIPS_COUNT];
+ ForgeDirection a,b,c;
+ switch (direction){
+ case DOWN:
+ a= ForgeDirection.WEST;
+ b= ForgeDirection.NORTH;
+ c= ForgeDirection.UP;
+ break;
+ case UP:
+ a= ForgeDirection.EAST;
+ b= ForgeDirection.NORTH;
+ c= ForgeDirection.DOWN;
+ break;
+ case NORTH:
+ a= ForgeDirection.WEST;
+ b= ForgeDirection.UP;
+ c= ForgeDirection.SOUTH;
+ break;
+ case SOUTH:
+ a= ForgeDirection.EAST;
+ b= ForgeDirection.UP;
+ c= ForgeDirection.NORTH;
+ break;
+ case WEST:
+ a= ForgeDirection.SOUTH;
+ b= ForgeDirection.UP;
+ c= ForgeDirection.EAST;
+ break;
+ case EAST:
+ a= ForgeDirection.NORTH;
+ b= ForgeDirection.UP;
+ c= ForgeDirection.WEST;
+ break;
+ default:throw new RuntimeException("Is impossible...");
+ }
+ switch (flip){//This duplicates some axis swaps since flip boolean would do, but seems more convenient to use
+ case HORIZONTAL:
+ a=a.getOpposite();
+ break;
+ case BOTH:
+ a=a.getOpposite();
+ case VERTICAL:
+ b=b.getOpposite();
+ break;
+ case NONE: break;
+ default:throw new RuntimeException("Even more impossible...");
+ }
+ switch (rotation) {
+ case COUNTER_CLOCKWISE: {
+ ForgeDirection _a=a;
+ a =b;
+ b =_a.getOpposite();
+ break;
+ }
+ case UPSIDE_DOWN:
+ a=a.getOpposite();
+ b=b.getOpposite();
+ break;
+ case CLOCKWISE: {
+ ForgeDirection _a=a;
+ a =b.getOpposite();
+ b =_a;
+ break;
+ }
+ case NORMAL: break;
+ default:
+ throw new RuntimeException("More impossible...");
+ }
+ integerAxisSwap =new IntegerAxisSwap(a,b,c);
+ }
+
+ public static ExtendedFacing of(ForgeDirection direction, Rotation rotation, Flip flip){
+ if(direction==ForgeDirection.UNKNOWN){
+ return VALUES[IAlignment.getAlignmentIndex(ForgeDirection.NORTH, rotation, flip)];
+ }
+ return VALUES[IAlignment.getAlignmentIndex(direction, rotation, flip)];
+ }
+
+ public static ExtendedFacing of(ForgeDirection direction){
+ if(direction==ForgeDirection.UNKNOWN){
+ return DEFAULT;
+ }
+ return VALUES[IAlignment.getAlignmentIndex(direction, Rotation.NORMAL, Flip.NONE)];
+ }
+
+ public ExtendedFacing with(ForgeDirection direction){
+ return of(direction,rotation,flip);
+ }
+
+ public ExtendedFacing with(Rotation rotation){
+ return of(direction,rotation,flip);
+ }
+
+ public ExtendedFacing with(Flip flip){
+ return of(direction,rotation,flip);
+ }
+
+ public ExtendedFacing getOppositeDirection() {
+ return of(direction.getOpposite(),rotation,flip);
+ }
+
+ public ExtendedFacing getOppositeRotation() {
+ return of(direction,rotation.getOpposite(),flip);
+ }
+
+ public ExtendedFacing getOppositeFlip() {
+ return of(direction,rotation,flip.getOpposite());
+ }
+
+ /**
+ * Gets the same effective facing achieved by different rot/flip combo
+ * @return same effective facing, but different enum value
+ */
+ public ExtendedFacing getDuplicate(){
+ return of(direction,rotation.getOpposite(),flip.getOpposite());
+ }
+
+ public int getIndex(){
+ return ordinal();
+ }
+
+ public String getName2() {
+ return this.name;
+ }
+
+ public static ExtendedFacing byName(String name) {
+ return name == null ? null : NAME_LOOKUP.get(name.toLowerCase(Locale.ROOT));
+ }
+
+ public static ExtendedFacing byIndex(int index) {
+ return VALUES[abs(index % VALUES.length)];
+ }
+
+ public static ExtendedFacing random(Random rand) {
+ return VALUES[rand.nextInt(VALUES.length)];
+ }
+
+ public ForgeDirection getDirection() {
+ return direction;
+ }
+
+ public Rotation getRotation() {
+ return rotation;
+ }
+
+ public Flip getFlip() {
+ return flip;
+ }
+
+ /**
+ * Translates relative to front facing offset to world offset
+ * @param abcOffset A,B,C offset (facing relative L-->R,U-->D,F-->B)
+ * @return X,Y,Z offset in world
+ */
+ public Vec3Impl getWorldOffset(Vec3Impl abcOffset) {
+ return integerAxisSwap.inverseTranslate(abcOffset);
+ }
+ public void getWorldOffset(int[] point,int[] out){
+ integerAxisSwap.inverseTranslate(point,out);
+ }
+ public void getWorldOffset(double[] point,double[] out){
+ integerAxisSwap.inverseTranslate(point,out);
+ }
+
+
+ /**
+ * Translates world offset to relative front facing offset
+ * @param xyzOffset X,Y,Z offset in world
+ * @return A,B,C offset (facing relative L-->R,U-->D,F-->B)
+ */
+ public Vec3Impl getOffsetABC(Vec3Impl xyzOffset){
+ return integerAxisSwap.translate(xyzOffset);
+ }
+ public void getOffsetABC(int[] point,int[] out){
+ integerAxisSwap.translate(point,out);
+ }
+ public void getOffsetABC(double[] point,double[] out){
+ integerAxisSwap.translate(point,out);
+ }
+
+ public IntegerAxisSwap getIntegerAxisSwap() {
+ return integerAxisSwap;
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Flip.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Flip.java
new file mode 100644
index 0000000000..4b1dff70ec
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Flip.java
@@ -0,0 +1,76 @@
+package com.github.technus.tectech.mechanics.alignment.enumerable;
+
+import javax.annotation.Nonnull;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Random;
+
+import static java.lang.Math.abs;
+import static java.util.Arrays.stream;
+import static java.util.stream.Collectors.toMap;
+
+public enum Flip {
+ NONE(3, "none"),
+ HORIZONTAL(2, "horizontal"),
+ VERTICAL(1, "vertical"),
+ BOTH(0, "both");
+
+ private final int opposite;
+ private final String name;
+
+ public static final Flip[] VALUES = values();
+ private static final Map<String, Flip> NAME_LOOKUP = stream(VALUES).collect(toMap(Flip::getName2, (flip) -> flip));
+
+ Flip(int oppositeIn, String nameIn) {
+ this.opposite = oppositeIn;
+ this.name = nameIn;
+ }
+
+ public int getIndex(){
+ return ordinal();
+ }
+
+ public Flip getOpposite() {
+ return VALUES[opposite];
+ }
+
+ public String getName2() {
+ return this.name;
+ }
+
+ public static Flip byName(String name) {
+ return name == null ? null : NAME_LOOKUP.get(name.toLowerCase(Locale.ROOT));
+ }
+
+ public static Flip byIndex(int index) {
+ return VALUES[abs(index % VALUES.length)];
+ }
+
+ public static Flip random(@Nonnull Random rand) {
+ return VALUES[rand.nextInt(VALUES.length)];
+ }
+
+ public String toString() {
+ return this.name;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public boolean isNotFlipped(){
+ return this==NONE;
+ }
+
+ public boolean isBothFlipped(){
+ return this==BOTH;
+ }
+
+ public boolean isHorizontallyFlipped() {
+ return this==HORIZONTAL || isBothFlipped();
+ }
+
+ public boolean isVerticallyFliped() {
+ return this==VERTICAL || isBothFlipped();
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Rotation.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Rotation.java
new file mode 100644
index 0000000000..5d41f54a11
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Rotation.java
@@ -0,0 +1,76 @@
+package com.github.technus.tectech.mechanics.alignment.enumerable;
+
+import javax.annotation.Nonnull;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Random;
+
+import static java.lang.Math.abs;
+import static java.util.Arrays.stream;
+import static java.util.stream.Collectors.toMap;
+
+public enum Rotation {
+ NORMAL(2, "normal"),
+ CLOCKWISE(3, "clockwise"),
+ UPSIDE_DOWN(0, "upside down"),
+ COUNTER_CLOCKWISE(1, "counter clockwise");
+
+ private final int opposite;
+ private final String name;
+
+ public static final Rotation[] VALUES = values();
+ private static final Map<String, Rotation> NAME_LOOKUP = stream(VALUES).collect(toMap(Rotation::getName2, (rotation) -> rotation));
+
+ Rotation(int oppositeIn, String nameIn) {
+ this.opposite = oppositeIn;
+ this.name = nameIn;
+ }
+
+ public int getIndex(){
+ return ordinal();
+ }
+
+ public Rotation getOpposite() {
+ return VALUES[opposite];
+ }
+
+ public String getName2() {
+ return this.name;
+ }
+
+ public static Rotation byName(String name) {
+ return name == null ? null : NAME_LOOKUP.get(name.toLowerCase(Locale.ROOT));
+ }
+
+ public static Rotation byIndex(int index) {
+ return VALUES[abs(index % VALUES.length)];
+ }
+
+ public static Rotation random(@Nonnull Random rand) {
+ return VALUES[rand.nextInt(VALUES.length)];
+ }
+
+ public String toString() {
+ return this.name;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public boolean isNotRotated(){
+ return this==NORMAL;
+ }
+
+ public boolean isClockwise(){
+ return this==CLOCKWISE;
+ }
+
+ public boolean isCounterClockwise(){
+ return this==COUNTER_CLOCKWISE;
+ }
+
+ public boolean isUpsideDown(){
+ return this==UPSIDE_DOWN;
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java
index 2a770ea332..a3fa341697 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.mechanics.anomaly;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.loader.MainLoader;
import com.github.technus.tectech.loader.NetworkDispatcher;
import com.github.technus.tectech.mechanics.data.ChunkDataHandler;
diff --git a/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertFloat.java b/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertFloat.java
index 61fa56f93a..5885226f6f 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertFloat.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertFloat.java
@@ -1,6 +1,6 @@
package com.github.technus.tectech.mechanics.commands;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.util.ChatComponentText;
diff --git a/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertInteger.java b/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertInteger.java
index c9767560c3..41edd66684 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertInteger.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertInteger.java
@@ -1,6 +1,6 @@
package com.github.technus.tectech.mechanics.commands;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.util.ChatComponentText;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/IConstructable.java b/src/main/java/com/github/technus/tectech/mechanics/constructible/IConstructable.java
index 096eab8f58..fdfa2904fb 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/IConstructable.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/constructible/IConstructable.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.thing.metaTileEntity;
+package com.github.technus.tectech.mechanics.constructible;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataMessage.java b/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataMessage.java
index 0a086384bc..6094d08ba4 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataMessage.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataMessage.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.mechanics.data;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import cpw.mods.fml.common.network.ByteBufUtils;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
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 0a829de3e9..f69bccc871 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/data/PlayerPersistence.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/data/PlayerPersistence.java
@@ -1,6 +1,6 @@
package com.github.technus.tectech.mechanics.data;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.loader.NetworkDispatcher;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
diff --git a/src/main/java/com/github/technus/tectech/mechanics/dataTransport/DataPacket.java b/src/main/java/com/github/technus/tectech/mechanics/dataTransport/DataPacket.java
index 82234e4c75..990a48ac70 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/dataTransport/DataPacket.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/dataTransport/DataPacket.java
@@ -1,6 +1,6 @@
package com.github.technus.tectech.mechanics.dataTransport;
-import com.github.technus.tectech.Vec3pos;
+import com.github.technus.tectech.util.Vec3Impl;
import net.minecraft.nbt.NBTTagCompound;
import java.util.Collections;
@@ -12,7 +12,7 @@ import java.util.Set;
*/
public abstract class DataPacket<T>{
private static final byte MAX_HISTORY = 64;
- private Set<Vec3pos> trace = new LinkedHashSet<>();
+ private Set<Vec3Impl> trace = new LinkedHashSet<>();
protected T content;
@@ -23,9 +23,9 @@ public abstract class DataPacket<T>{
protected DataPacket(NBTTagCompound nbt) {
content = contentFromNBT(nbt.getCompoundTag("qContent"));
for (int i = 0; i < nbt.getByte("qHistory"); i++) {
- trace.add(new Vec3pos(
+ trace.add(new Vec3Impl(
nbt.getInteger("qX" + i),
- nbt.getShort("qY" + i),
+ nbt.getInteger("qY" + i),
nbt.getInteger("qZ" + i)
));
}
@@ -39,10 +39,10 @@ public abstract class DataPacket<T>{
}
nbt.setByte("qHistory", (byte) trace.size());
int i = 0;
- for (Vec3pos v : trace) {
- nbt.setInteger("qX" + i, v.x);
- nbt.setShort("qY" + i, v.y);
- nbt.setInteger("qZ" + i, v.z);
+ for (Vec3Impl v : trace) {
+ nbt.setInteger("qX" + i, v.get0());
+ nbt.setInteger("qY" + i, v.get1());
+ nbt.setInteger("qZ" + i, v.get2());
i++;
}
return nbt;
@@ -54,7 +54,7 @@ public abstract class DataPacket<T>{
protected abstract T unifyContentWith(T content);
- public final boolean contains(Vec3pos v) {
+ public final boolean contains(Vec3Impl v) {
return trace.contains(v);
}
@@ -64,7 +64,7 @@ public abstract class DataPacket<T>{
public abstract boolean extraCheck();
- protected final DataPacket<T> unifyTrace(Vec3pos... positions) {
+ protected final DataPacket<T> unifyTrace(Vec3Impl... positions) {
Collections.addAll(trace,positions);
return (check() && extraCheck()) ? this : null;
}
@@ -85,7 +85,7 @@ public abstract class DataPacket<T>{
return null;
}
- public final T contentIfNotInTrace(Vec3pos pos) {
+ public final T contentIfNotInTrace(Vec3Impl pos) {
if (trace.contains(pos)) {
return null;
}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/dataTransport/QuantumDataPacket.java b/src/main/java/com/github/technus/tectech/mechanics/dataTransport/QuantumDataPacket.java
index 9661d8d315..268de6f71c 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/dataTransport/QuantumDataPacket.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/dataTransport/QuantumDataPacket.java
@@ -1,6 +1,6 @@
package com.github.technus.tectech.mechanics.dataTransport;
-import com.github.technus.tectech.Vec3pos;
+import com.github.technus.tectech.util.Vec3Impl;
import net.minecraft.nbt.NBTTagCompound;
public class QuantumDataPacket extends DataPacket<Long> {
@@ -34,7 +34,7 @@ public class QuantumDataPacket extends DataPacket<Long> {
return this.content+content;
}
- public QuantumDataPacket unifyTraceWith(Vec3pos... positions) {
+ public QuantumDataPacket unifyTraceWith(Vec3Impl... positions) {
return (QuantumDataPacket) super.unifyTrace(positions);
}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/cElementalInstanceStack.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/cElementalInstanceStack.java
index ba3c8f909c..c108d8c8ae 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/cElementalInstanceStack.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/cElementalInstanceStack.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.mechanics.elementalMatter.core.stacks;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDefinitionStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java
index 24033ba945..701682cdaa 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java
@@ -15,7 +15,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
-import static com.github.technus.tectech.Util.areBitsSet;
+import static com.github.technus.tectech.util.Util.areBitsSet;
import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.cPrimitiveDefinition.null__;
import static com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM.STACKS_REGISTERED;
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/dAtomDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/dAtomDefinition.java
index ea8f6bc201..205851c61b 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/dAtomDefinition.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/dAtomDefinition.java
@@ -2,8 +2,8 @@ package com.github.technus.tectech.mechanics.elementalMatter.definitions.complex
import com.github.technus.tectech.Reference;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
-import com.github.technus.tectech.XSTR;
+import com.github.technus.tectech.util.Util;
+import com.github.technus.tectech.util.XSTR;
import com.github.technus.tectech.compatibility.gtpp.GtppAtomLoader;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDefinitionStackMap;
@@ -25,7 +25,7 @@ import net.minecraft.nbt.NBTTagCompound;
import java.util.*;
-import static com.github.technus.tectech.XSTR.XSTR_INSTANCE;
+import static com.github.technus.tectech.util.XSTR.XSTR_INSTANCE;
import static com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.dComplexAspectDefinition.getNbtTagCompound;
import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eBosonDefinition.boson_Y__;
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/dHadronDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/dHadronDefinition.java
index 04a1eab490..96ee5cc3db 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/dHadronDefinition.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/dHadronDefinition.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.mechanics.elementalMatter.definitions.complex;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDefinitionStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalMutableDefinitionStackMap;
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/iaeaNuclide.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/iaeaNuclide.java
index 8b54bdd306..87a71b684f 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/iaeaNuclide.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/iaeaNuclide.java
@@ -1,6 +1,6 @@
package com.github.technus.tectech.mechanics.elementalMatter.definitions.complex;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import java.io.BufferedReader;
import java.io.InputStreamReader;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IActivePipe.java b/src/main/java/com/github/technus/tectech/mechanics/pipe/IActivePipe.java
index 5552992e56..4f244c804b 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IActivePipe.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/pipe/IActivePipe.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.thing.metaTileEntity.pipe;
+package com.github.technus.tectech.mechanics.pipe;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IConnectsToDataPipe.java b/src/main/java/com/github/technus/tectech/mechanics/pipe/IConnectsToDataPipe.java
index def0795ba3..a775321df2 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IConnectsToDataPipe.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/pipe/IConnectsToDataPipe.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.thing.metaTileEntity.pipe;
+package com.github.technus.tectech.mechanics.pipe;
/**
* Created by Tec on 26.02.2017.
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IConnectsToElementalPipe.java b/src/main/java/com/github/technus/tectech/mechanics/pipe/IConnectsToElementalPipe.java
index 5841d3d010..ea444a0678 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IConnectsToElementalPipe.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/pipe/IConnectsToElementalPipe.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.thing.metaTileEntity.pipe;
+package com.github.technus.tectech.mechanics.pipe;
/**
* Created by Tec on 26.02.2017.
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IConnectsToEnergyTunnel.java b/src/main/java/com/github/technus/tectech/mechanics/pipe/IConnectsToEnergyTunnel.java
index 4a720d067e..3a1d24305e 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IConnectsToEnergyTunnel.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/pipe/IConnectsToEnergyTunnel.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.thing.metaTileEntity.pipe;
+package com.github.technus.tectech.mechanics.pipe;
/**
* Created by Tec on 26.02.2017.
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/PipeActivityMessage.java b/src/main/java/com/github/technus/tectech/mechanics/pipe/PipeActivityMessage.java
index e7183b8838..abde23f33e 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/PipeActivityMessage.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/pipe/PipeActivityMessage.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech.thing.metaTileEntity.pipe;
+package com.github.technus.tectech.mechanics.pipe;
import cpw.mods.fml.common.network.ByteBufUtils;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
@@ -105,7 +105,7 @@ public class PipeActivityMessage implements IMessage {
if(te instanceof IGregTechTileEntity){
IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity();
if(meta instanceof IActivePipe){
- ((IActivePipe) meta).setActive((byte)pMessage.mActive==1);
+ ((IActivePipe) meta).setActive(pMessage.mActive==1);
}
}
}
diff --git a/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassItem.java b/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassItem.java
index 05cbca7990..3f42bdbbc4 100644
--- a/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassItem.java
+++ b/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassItem.java
@@ -8,7 +8,7 @@ import net.minecraft.util.EnumChatFormatting;
import java.util.List;
-import static com.github.technus.tectech.CommonValues.TEC_MARK_EM;
+import static com.github.technus.tectech.util.CommonValues.TEC_MARK_EM;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
diff --git a/src/main/java/com/github/technus/tectech/thing/block/ReactorSimItem.java b/src/main/java/com/github/technus/tectech/thing/block/ReactorSimItem.java
index 14cb682c6f..d659a05005 100644
--- a/src/main/java/com/github/technus/tectech/thing/block/ReactorSimItem.java
+++ b/src/main/java/com/github/technus/tectech/thing/block/ReactorSimItem.java
@@ -8,7 +8,7 @@ import net.minecraft.util.EnumChatFormatting;
import java.util.List;
-import static com.github.technus.tectech.CommonValues.TEC_MARK_GENERAL;
+import static com.github.technus.tectech.util.CommonValues.TEC_MARK_GENERAL;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsBA0.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsBA0.java
index 31ad485306..56fdfd22bb 100644
--- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsBA0.java
+++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsBA0.java
@@ -8,7 +8,7 @@ import net.minecraft.util.EnumChatFormatting;
import java.util.List;
-import static com.github.technus.tectech.CommonValues.*;
+import static com.github.technus.tectech.util.CommonValues.*;
import static net.minecraft.util.StatCollector.translateToLocal;
public class GT_Item_CasingsBA0 extends GT_Item_Casings_Abstract {
diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsTT.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsTT.java
index 23e9c7026f..5c93841d9a 100644
--- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsTT.java
+++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsTT.java
@@ -8,8 +8,8 @@ import net.minecraft.util.EnumChatFormatting;
import java.util.List;
-import static com.github.technus.tectech.CommonValues.COSMIC_MARK;
-import static com.github.technus.tectech.CommonValues.TEC_MARK_EM;
+import static com.github.technus.tectech.util.CommonValues.COSMIC_MARK;
+import static com.github.technus.tectech.util.CommonValues.TEC_MARK_EM;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_HintTT.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_HintTT.java
index 186510ff14..426e7d569b 100644
--- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_HintTT.java
+++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_HintTT.java
@@ -8,7 +8,7 @@ import net.minecraft.util.EnumChatFormatting;
import java.util.List;
-import static com.github.technus.tectech.CommonValues.TEC_MARK_GENERAL;
+import static com.github.technus.tectech.util.CommonValues.TEC_MARK_GENERAL;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
diff --git a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java
index c578f322f6..4af6b53658 100644
--- a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java
+++ b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java
@@ -1,8 +1,8 @@
package com.github.technus.tectech.thing.item;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -23,7 +23,7 @@ import java.util.HashMap;
import java.util.List;
import static com.github.technus.tectech.Reference.MODID;
-import static com.github.technus.tectech.Util.StructureBuilder;
+import static com.github.technus.tectech.util.Util.StructureBuilder;
import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech;
import static gregtech.api.GregTech_API.sBlockCasings1;
import static net.minecraft.util.StatCollector.translateToLocal;
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 6ebfce328e..b23a580bbf 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
@@ -1,7 +1,7 @@
package com.github.technus.tectech.thing.item;
-import com.github.technus.tectech.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.font.TecTechFontRender;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.iElementalInstanceContainer;
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 5cb84505bd..fa1c25cbf5 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
@@ -1,7 +1,7 @@
package com.github.technus.tectech.thing.item;
-import com.github.technus.tectech.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.font.TecTechFontRender;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDefinitionStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException;
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 7e7c2eb625..c951229c92 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
@@ -1,8 +1,8 @@
package com.github.technus.tectech.thing.item;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.font.TecTechFontRender;
import com.github.technus.tectech.loader.gui.ModGuiHandler;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
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 8f113c008b..8e3d770da1 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,6 +1,6 @@
package com.github.technus.tectech.thing.item;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.Reference;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
diff --git a/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java
index e678dbd6cb..efcfcfb7a3 100644
--- a/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java
+++ b/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.thing.item;
-import com.github.technus.tectech.CommonValues;
-import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation;
+import com.github.technus.tectech.mechanics.alignment.IAlignment;
+import com.github.technus.tectech.util.CommonValues;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -42,12 +42,20 @@ public final class FrontRotationTriggerItem extends Item {
if (aPlayer instanceof EntityPlayerMP) {
if (tTileEntity instanceof IGregTechTileEntity) {
IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
- if (metaTE instanceof IFrontRotation) {
- ((IFrontRotation) metaTE).rotateAroundFrontPlane(!aPlayer.isSneaking());
+ if (metaTE instanceof IAlignment) {
+ if(aPlayer.isSneaking()){
+ ((IAlignment) metaTE).toolSetFlip(null);
+ }else {
+ ((IAlignment) metaTE).toolSetRotation(null);
+ }
return true;
}
- } else if (tTileEntity instanceof IFrontRotation) {
- ((IFrontRotation) tTileEntity).rotateAroundFrontPlane(!aPlayer.isSneaking());
+ } else if (tTileEntity instanceof IAlignment) {
+ if(aPlayer.isSneaking()){
+ ((IAlignment) tTileEntity).toolSetFlip(null);
+ }else {
+ ((IAlignment) tTileEntity).toolSetRotation(null);
+ }
return true;
}
}
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 e64ab1eaa6..1d1da74a7a 100644
--- a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java
+++ b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.thing.item;
-import com.github.technus.tectech.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
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;
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 8767982898..6e7e8c426d 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
@@ -1,6 +1,6 @@
package com.github.technus.tectech.thing.item;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -14,7 +14,7 @@ import net.minecraft.util.IIcon;
import java.util.List;
-import static com.github.technus.tectech.CommonValues.V;
+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 net.minecraft.util.StatCollector.translateToLocal;
diff --git a/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilComponent.java b/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilComponent.java
index 2ba984c9cc..cc77b7a26c 100644
--- a/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilComponent.java
+++ b/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilComponent.java
@@ -1,6 +1,6 @@
package com.github.technus.tectech.thing.item;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
diff --git a/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCover.java b/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCover.java
index cf08c03f38..20417ebe71 100644
--- a/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCover.java
+++ b/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCover.java
@@ -1,6 +1,6 @@
package com.github.technus.tectech.thing.item;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
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 03afa1b66b..9d998953e8 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,6 +1,6 @@
package com.github.technus.tectech.thing.item;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.Reference;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.util.GT_Utility;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/IFrontRotation.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/IFrontRotation.java
deleted file mode 100644
index 7ac296e41f..0000000000
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/IFrontRotation.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.github.technus.tectech.thing.metaTileEntity;
-
-public interface IFrontRotation {
- boolean isFrontRotationValid(byte frontRotation, byte frontFacing);
-
- void rotateAroundFrontPlane(boolean direction);
-
- void forceSetRotationDoRender(byte frontRotation);
-
- byte getFrontRotation();
-}
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 4527a9d6ff..b4e8f03a74 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,9 +1,9 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.CommonValues;
+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;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Capacitor;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Capacitor;
import cpw.mods.fml.relauncher.Side;
@@ -23,8 +23,8 @@ import net.minecraft.util.EnumChatFormatting;
import java.util.HashMap;
import java.util.Map;
-import static com.github.technus.tectech.CommonValues.V;
-import static com.github.technus.tectech.Util.getUniqueIdentifier;
+import static com.github.technus.tectech.util.CommonValues.V;
+import static com.github.technus.tectech.util.Util.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 3d18550d09..815f8006c4 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.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
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.thing.metaTileEntity.pipe.IConnectsToDataPipe;
+import com.github.technus.tectech.mechanics.pipe.IConnectsToDataPipe;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -13,7 +13,7 @@ import gregtech.api.util.GT_Utility;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
-import static com.github.technus.tectech.CommonValues.MOVE_AT;
+import static com.github.technus.tectech.util.CommonValues.MOVE_AT;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java
index 6f5a9b377c..4e719f8ec8 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
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_DataConnector.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java
index 6d0706971d..6cbf1e801b 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.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.mechanics.dataTransport.DataPacket;
-import com.github.technus.tectech.thing.metaTileEntity.pipe.IConnectsToDataPipe;
+import com.github.technus.tectech.mechanics.pipe.IConnectsToDataPipe;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Dyes;
@@ -21,7 +21,7 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.reflect.FieldUtils;
-import static com.github.technus.tectech.CommonValues.MOVE_AT;
+import static com.github.technus.tectech.util.CommonValues.MOVE_AT;
import static gregtech.api.enums.Dyes.MACHINE_METAL;
import static net.minecraft.util.StatCollector.translateToLocalFormatted;
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 aeaa54d241..bbc11f10fe 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
@@ -1,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -9,7 +9,7 @@ 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.CommonValues.V;
+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 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 60a663e0c7..fb3487bc09 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.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Energy;
-import com.github.technus.tectech.thing.metaTileEntity.pipe.IConnectsToEnergyTunnel;
+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,8 +13,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import static com.github.technus.tectech.CommonValues.TRANSFER_AT;
-import static com.github.technus.tectech.CommonValues.V;
+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 682c7536bf..d0b9411773 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,11 +1,11 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.iElementalInstanceContainer;
import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException;
-import com.github.technus.tectech.thing.metaTileEntity.pipe.IConnectsToElementalPipe;
+import com.github.technus.tectech.mechanics.pipe.IConnectsToElementalPipe;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Dyes;
@@ -23,7 +23,7 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.reflect.FieldUtils;
-import static com.github.technus.tectech.CommonValues.*;
+import static com.github.technus.tectech.util.CommonValues.*;
import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
import static gregtech.api.enums.Dyes.MACHINE_METAL;
import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java
index 9a16aa1339..4410372d47 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -10,7 +10,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import static com.github.technus.tectech.CommonValues.V;
+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 net.minecraft.util.StatCollector.translateToLocal;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java
index 6034e51a98..2407f2ab0a 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java
@@ -1,18 +1,17 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.CommonValues;
-import com.github.technus.tectech.Util;
-import com.github.technus.tectech.thing.metaTileEntity.pipe.IConnectsToEnergyTunnel;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
+import com.github.technus.tectech.mechanics.pipe.IConnectsToEnergyTunnel;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
-import static com.github.technus.tectech.CommonValues.TRANSFER_AT;
-import static com.github.technus.tectech.CommonValues.V;
+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_IN_LASER_TT;
import static net.minecraft.util.StatCollector.translateToLocal;
@@ -40,16 +39,6 @@ public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatc
}
@Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- }
-
- @Override
public boolean isSimpleMachine() {
return true;
}
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 c7b0eb983e..3bbd6b9d54 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,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
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 cpw.mods.fml.relauncher.Side;
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 c628a92cb4..386a08b790 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.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket;
-import com.github.technus.tectech.thing.metaTileEntity.pipe.IConnectsToDataPipe;
+import com.github.technus.tectech.mechanics.pipe.IConnectsToDataPipe;
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 97565e155e..f270971f4d 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.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.mechanics.dataTransport.InventoryDataPacket;
-import com.github.technus.tectech.thing.metaTileEntity.pipe.IConnectsToDataPipe;
+import com.github.technus.tectech.mechanics.pipe.IConnectsToDataPipe;
import gregtech.api.enums.Dyes;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -20,7 +20,7 @@ import org.apache.commons.lang3.reflect.FieldUtils;
import java.util.ArrayList;
-import static com.github.technus.tectech.CommonValues.MOVE_AT;
+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 gregtech.api.enums.Dyes.MACHINE_METAL;
@@ -166,7 +166,7 @@ public class GT_MetaTileEntity_Hatch_InputDataItems extends GT_MetaTileEntity_Ha
@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
- NBTTagCompound stacksTag=new NBTTagCompound();
+ NBTTagCompound stacksTag= aNBT.getCompoundTag("data_stacks");
int count=stacksTag.getInteger("count");
if(count>0){
ArrayList<ItemStack> stacks=new ArrayList<>();
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java
index cfa15b4cf3..b0f71aab24 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java
@@ -1,6 +1,6 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
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_OutputData.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java
index 083a8ee1f1..87a9c93785 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.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
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.thing.metaTileEntity.pipe.IConnectsToDataPipe;
+import com.github.technus.tectech.mechanics.pipe.IConnectsToDataPipe;
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 d98675d0f2..385de4343c 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.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
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.thing.metaTileEntity.pipe.IConnectsToDataPipe;
+import com.github.technus.tectech.mechanics.pipe.IConnectsToDataPipe;
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 d826daf355..a1e4f5a8a5 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,6 +1,6 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_EM;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
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 362ba9f3c5..ad7f1fe159 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
@@ -1,8 +1,8 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Dyes;
@@ -28,8 +28,8 @@ import org.apache.commons.lang3.reflect.FieldUtils;
import java.util.Locale;
-import static com.github.technus.tectech.CommonValues.DISPERSE_AT;
-import static com.github.technus.tectech.CommonValues.V;
+import static com.github.technus.tectech.util.CommonValues.DISPERSE_AT;
+import static com.github.technus.tectech.util.CommonValues.V;
import static com.github.technus.tectech.loader.MainLoader.elementalPollution;
import static gregtech.api.enums.Dyes.MACHINE_METAL;
import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity;
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 7bcc796e9d..7b8a488e57 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,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
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;
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 09f11710da..bc4562307b 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,6 +1,6 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.CommonValues;
+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;
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 47d7037946..d9d5f90593 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,9 +1,9 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.CommonValues;
+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;
+import com.github.technus.tectech.util.Util;
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 cpw.mods.fml.common.Loader;
@@ -28,8 +28,8 @@ import org.apache.commons.lang3.reflect.FieldUtils;
import java.util.HashMap;
import java.util.Map;
-import static com.github.technus.tectech.CommonValues.MULTI_CHECK_AT;
-import static com.github.technus.tectech.Util.getUniqueIdentifier;
+import static com.github.technus.tectech.util.CommonValues.MULTI_CHECK_AT;
+import static com.github.technus.tectech.util.Util.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 80b7185ba4..d723dd908c 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,8 +1,8 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
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;
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 d206143700..b0b53f6c79 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,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_ParamText;
import cpw.mods.fml.common.network.ByteBufUtils;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
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 cb189538d8..da067078c9 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,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch.gui;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Param;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
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 b3b720732d..c8fa85996a 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,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch.gui;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Param;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
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 7b6f97981f..9c0e08948f 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,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch.gui;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
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;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java
index b094cd2d93..7eb71651bb 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java
@@ -1,6 +1,6 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch.gui;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.font.TecTechFontRender;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java
index 45e4f1fb65..4346118619 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java
@@ -1,6 +1,6 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch.gui;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.font.TecTechFontRender;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamText.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamText.java
index 2b17563db0..50e608294e 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamText.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamText.java
@@ -1,6 +1,6 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch.gui;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.font.TecTechFontRender;
import com.github.technus.tectech.loader.NetworkDispatcher;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_ParamText;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java
index 21e020be01..d52a3c23f7 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java
@@ -1,11 +1,11 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder;
-import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture;
+import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -17,7 +17,7 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
@@ -97,14 +97,14 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)};
+ return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12], new TT_RenderedExtendedFacingTexture(aActive ? ScreenON : ScreenOFF)};
}
return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12]};
}
@Override
public void construct(int stackSize, boolean hintsOnly) {
- StructureBuilderExtreme(shape, blockType, blockMeta, 5, 5, 0, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 5, 5, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java
index 79ae424bcb..74ebae9f57 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java
@@ -1,11 +1,11 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder;
-import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture;
+import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -17,7 +17,7 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
@@ -291,7 +291,7 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)};
+ return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12], new TT_RenderedExtendedFacingTexture(aActive ? ScreenON : ScreenOFF)};
}
return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12]};
}
@@ -299,9 +299,9 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E
@Override
public void construct(int stackSize, boolean hintsOnly) {
if ((stackSize & 1) == 1) {
- StructureBuilderExtreme(shape, blockType, blockMeta, 16, 16, 0, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 16, 16, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
} else {
- StructureBuilderExtreme(shape2, blockType2, blockMeta2, 16, 16, 0, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape2, blockType2, blockMeta2, 16, 16, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
}
}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java
index 2b0b0f8465..d37fcfdc4b 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java
@@ -1,6 +1,6 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.dComplexAspectDefinition;
import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition;
@@ -13,10 +13,10 @@ import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.
import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eQuarkDefinition;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.casing.TT_Container_Casings;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.*;
-import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture;
+import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -33,7 +33,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import java.util.HashMap;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
@@ -592,9 +592,9 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
if (aFacing % 2 == 0) {
- return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)};
+ return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new TT_RenderedExtendedFacingTexture(aActive ? ScreenON : ScreenOFF)};
} else {
- return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new TT_RenderedTexture(aActive ? ScreenON_Slave : ScreenOFF_Slave)};
+ return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new TT_RenderedExtendedFacingTexture(aActive ? ScreenON_Slave : ScreenOFF_Slave)};
}
}
return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4]};
@@ -682,9 +682,9 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB
}
}
if ((stackSize & 1) == 1) {
- StructureBuilderExtreme(shape, blockType, blockMeta1, 11, 1, 18, iGregTechTileEntity, this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta1, 11, 1, 18, iGregTechTileEntity, getExtendedFacing(), hintsOnly);
} else {
- StructureBuilderExtreme(shape, blockType, blockMeta2, 11, 1, 18, iGregTechTileEntity, this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta2, 11, 1, 18, iGregTechTileEntity, getExtendedFacing(), hintsOnly);
}
}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java
index edb581179e..1afbdf66e0 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java
@@ -1,16 +1,16 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
-import com.github.technus.tectech.Vec3pos;
+import com.github.technus.tectech.util.Util;
+import com.github.technus.tectech.util.Vec3Impl;
import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputData;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputData;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Rack;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.*;
-import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture;
+import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -28,8 +28,8 @@ import net.minecraft.util.ResourceLocation;
import java.util.ArrayList;
-import static com.github.technus.tectech.CommonValues.V;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.CommonValues.V;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
@@ -224,7 +224,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB
@Override
public void outputAfterRecipe_EM() {
if (!eOutputData.isEmpty()) {
- Vec3pos pos = new Vec3pos(getBaseMetaTileEntity());
+ Vec3Impl pos = new Vec3Impl(getBaseMetaTileEntity());
QuantumDataPacket pack = new QuantumDataPacket(eAvailableData / eOutputData.size()).unifyTraceWith(pos);
if (pack == null) {
return;
@@ -265,7 +265,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][3], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)};
+ return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][3], new TT_RenderedExtendedFacingTexture(aActive ? ScreenON : ScreenOFF)};
}
return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][3]};
}
@@ -337,16 +337,16 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB
@Override
public void construct(int stackSize, boolean hintsOnly) {
IGregTechTileEntity igt = getBaseMetaTileEntity();
- StructureBuilderExtreme(front, blockType, blockMeta, 1, 2, 0, igt, this, hintsOnly);
- StructureBuilderExtreme(cap, blockType, blockMeta, 1, 2, -1, igt, this, hintsOnly);
+ StructureBuilderExtreme(front, blockType, blockMeta, 1, 2, 0, igt, getExtendedFacing(), hintsOnly);
+ StructureBuilderExtreme(cap, blockType, blockMeta, 1, 2, -1, igt, getExtendedFacing(), hintsOnly);
byte offset = -2;
for (int rackSlices = Math.min(stackSize, 12); rackSlices > 0; rackSlices--) {
- StructureBuilderExtreme(slice, blockType, blockMeta, 1, 2, offset--, igt, this, hintsOnly);
+ StructureBuilderExtreme(slice, blockType, blockMeta, 1, 2, offset--, igt, getExtendedFacing(), hintsOnly);
}
- StructureBuilderExtreme(cap, blockType, blockMeta, 1, 2, offset--, igt, this, hintsOnly);
- StructureBuilderExtreme(terminator, blockType, blockMeta, 1, 2, offset, igt, this, hintsOnly);
+ StructureBuilderExtreme(cap, blockType, blockMeta, 1, 2, offset--, igt, getExtendedFacing(), hintsOnly);
+ StructureBuilderExtreme(terminator, blockType, blockMeta, 1, 2, offset, igt, getExtendedFacing(), hintsOnly);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java
index 263a46a9d3..3083f36721 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java
@@ -1,11 +1,11 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder;
-import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture;
+import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -17,7 +17,7 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
@@ -99,14 +99,14 @@ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockB
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)};
+ return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12], new TT_RenderedExtendedFacingTexture(aActive ? ScreenON : ScreenOFF)};
}
return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12]};
}
@Override
public void construct(int stackSize, boolean hintsOnly) {
- StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java
index f18fe57b6f..57ab6d770d 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java
@@ -1,16 +1,16 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.Reference;
import com.github.technus.tectech.mechanics.dataTransport.InventoryDataPacket;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputDataItems;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputDataItems;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder;
-import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture;
+import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -27,8 +27,8 @@ import net.minecraft.util.ResourceLocation;
import java.util.ArrayList;
-import static com.github.technus.tectech.CommonValues.V;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.CommonValues.V;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
import static com.github.technus.tectech.recipe.TT_recipeAdder.nullItem;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
@@ -138,7 +138,7 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][1], new TT_RenderedTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)};
+ return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][1], new TT_RenderedExtendedFacingTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)};
}
return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][1]};
}
@@ -171,7 +171,7 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB
@Override
public void construct(int stackSize, boolean hintsOnly) {
- StructureBuilderExtreme(shape, blockType, blockMeta, 2, 1, 0, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 2, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java
index 90879f1b60..ffea7781ee 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java
@@ -1,13 +1,13 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.*;
-import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture;
+import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -26,8 +26,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import org.apache.commons.lang3.reflect.FieldUtils;
-import static com.github.technus.tectech.CommonValues.VN;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.CommonValues.VN;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
@@ -214,7 +214,7 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)};
+ return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12], new TT_RenderedExtendedFacingTexture(aActive ? ScreenON : ScreenOFF)};
}
return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12]};
}
@@ -244,7 +244,7 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase
@Override
public void construct(int stackSize, boolean hintsOnly) {
- StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java
index 27b770c88b..cb13abf358 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java
@@ -1,13 +1,13 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElementalDefinition;
import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aOredictDequantizationInfo;
import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.iExchangeInfo;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder;
@@ -24,8 +24,8 @@ import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList;
-import static com.github.technus.tectech.CommonValues.V;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.CommonValues.V;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
import static com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition.STABLE_RAW_LIFE_TIME;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition.refMass;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition.refUnstableMass;
@@ -149,7 +149,7 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo
@Override
public void construct(int stackSize, boolean hintsOnly) {
- StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java
index 4e8e8d27ec..23a36f0edb 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java
@@ -1,10 +1,10 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
import cofh.api.energy.IEnergyContainerItem;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.Reference;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
@@ -22,7 +22,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
@@ -183,7 +183,7 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa
@Override
public void construct(int stackSize, boolean hintsOnly) {
- StructureBuilderExtreme(shape, blockType, blockMeta, 1, 2, 0, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 1, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java
index aba87eaf6b..448f0a5563 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputElemental;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.*;
@@ -12,8 +12,8 @@ import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import static com.github.technus.tectech.CommonValues.V;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.CommonValues.V;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
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.base.LedStatus.*;
@@ -170,7 +170,7 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB
@Override
public void construct(int stackSize, boolean hintsOnly) {
- StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java
index 4d65b67ed0..4696164979 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java
@@ -1,6 +1,6 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.Reference;
import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
@@ -11,7 +11,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.transformations
import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aOredictQuantizationInfo;
import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder;
import cpw.mods.fml.relauncher.Side;
@@ -28,9 +28,9 @@ import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList;
-import static com.github.technus.tectech.CommonValues.V;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
-import static com.github.technus.tectech.Util.isInputEqual;
+import static com.github.technus.tectech.util.CommonValues.V;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.Util.isInputEqual;
import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
import static com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition.DEFAULT_ENERGY_LEVEL;
import static com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition.STABLE_RAW_LIFE_TIME;
@@ -198,7 +198,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock
@Override
public void construct(int stackSize, boolean hintsOnly) {
- StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java
index 93111e1f60..e9bb65c19f 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java
@@ -1,13 +1,13 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.recipe.TT_recipe;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Holder;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder;
-import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture;
+import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Textures;
@@ -35,9 +35,9 @@ import org.apache.commons.lang3.reflect.FieldUtils;
import java.util.ArrayList;
import java.util.LinkedHashMap;
-import static com.github.technus.tectech.CommonValues.V;
-import static com.github.technus.tectech.CommonValues.VN;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+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.Util.StructureBuilderExtreme;
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.GT_Block_CasingsTT.texturePage;
@@ -394,7 +394,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][3], new TT_RenderedTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)};
+ return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][3], new TT_RenderedExtendedFacingTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)};
}
return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][3]};
}
@@ -553,7 +553,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB
@Override
public void construct(int stackSize, boolean hintsOnly) {
- StructureBuilderExtreme(shape, blockType, blockMeta, 1, 3, 4, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 1, 3, 4, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
}
@Override
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 e03ea94928..be869b2ba9 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
@@ -1,6 +1,6 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack;
@@ -11,7 +11,7 @@ import com.github.technus.tectech.thing.CustomItemList;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.block.QuantumStuffBlock;
import com.github.technus.tectech.thing.item.ElementalDefinitionScanStorage_EM;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.*;
import gregtech.api.enums.ItemList;
@@ -32,10 +32,10 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.util.ForgeDirection;
import org.apache.commons.lang3.reflect.FieldUtils;
-import static com.github.technus.tectech.CommonValues.V;
-import static com.github.technus.tectech.CommonValues.VN;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
-import static com.github.technus.tectech.Util.areBitsSet;
+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.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.Util.areBitsSet;
import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.cPrimitiveDefinition.nbtE__;
import static com.github.technus.tectech.recipe.TT_recipe.E_RECIPE_ID;
@@ -514,7 +514,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
@Override
public void construct(int stackSize, boolean hintsOnly) {
- StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java
index b159827012..9c88c4ecf3 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java
@@ -1,8 +1,8 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -11,7 +11,7 @@ import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
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 net.minecraft.util.StatCollector.translateToLocal;
@@ -70,7 +70,7 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc
@Override
public void construct(int stackSize, boolean hintsOnly) {
- StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java
index 795349c50c..47949ea36e 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java
@@ -1,14 +1,14 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.Reference;
-import com.github.technus.tectech.Vec3pos;
import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputData;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputData;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.*;
-import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture;
+import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
+import com.github.technus.tectech.util.Vec3Impl;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -20,8 +20,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
-import static com.github.technus.tectech.CommonValues.V;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.CommonValues.V;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
@@ -128,7 +128,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas
}
}
- Vec3pos pos = new Vec3pos(getBaseMetaTileEntity());
+ Vec3Impl pos = new Vec3Impl(getBaseMetaTileEntity());
QuantumDataPacket pack = new QuantumDataPacket(0L).unifyTraceWith(pos);
if (pack == null) {
return;
@@ -191,7 +191,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][1], new TT_RenderedTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)};
+ return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][1], new TT_RenderedExtendedFacingTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)};
}
return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][1]};
}
@@ -217,7 +217,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas
@Override
public void construct(int stackSize, boolean hintsOnly) {
- StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java
index 1a3bebf59b..81fd5eb6ad 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java
@@ -1,13 +1,13 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.Reference;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder;
-import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture;
+import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -20,7 +20,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
@@ -118,7 +118,7 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][0], new TT_RenderedTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)};
+ return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][0], new TT_RenderedExtendedFacingTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)};
}
return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][0]};
}
@@ -150,7 +150,7 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo
@Override
public void construct(int stackSize, boolean hintsOnly) {
- StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java
index 034fdca334..1f9d88e4fd 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java
@@ -1,11 +1,11 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder;
-import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture;
+import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -17,7 +17,7 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
@@ -98,14 +98,14 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)};
+ return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new TT_RenderedExtendedFacingTexture(aActive ? ScreenON : ScreenOFF)};
}
return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4]};
}
@Override
public void construct(int stackSize, boolean hintsOnly) {
- StructureBuilderExtreme(shape, blockType, blockMeta, 4, 4, 0, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 4, 4, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java
index 881f802d19..497efd6f71 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java
@@ -1,10 +1,11 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.Reference;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.*;
-import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture;
+import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
+import com.github.technus.tectech.util.Vec3Impl;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -23,11 +24,12 @@ import net.minecraft.util.EnumChatFormatting;
import java.util.ArrayList;
import java.util.HashSet;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
import static com.github.technus.tectech.loader.MainLoader.microwaving;
import static com.github.technus.tectech.recipe.TT_recipeAdder.nullItem;
import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*;
import static gregtech.api.GregTech_API.sBlockCasings4;
+import static net.minecraft.util.AxisAlignedBB.getBoundingBox;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -124,16 +126,14 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock
timerValue.set(timerValue.get() + 1);
remainingTime.set(timerSetting.get() - timerValue.get());
IGregTechTileEntity mte = getBaseMetaTileEntity();
- int[] xyzOffsets = getTranslatedOffsets(0, -1, 2);
- double xPos = mte.getXCoord() + 0.5f + xyzOffsets[0];
- double yPos = mte.getYCoord() + 0.5f + xyzOffsets[1];
- double zPos = mte.getZCoord() + 0.5f + xyzOffsets[2];
- AxisAlignedBB aabb = getBoundingBox(-2, -2, -2, 2, 2, 2).offset(xPos, yPos, zPos);
- xyzOffsets = getTranslatedOffsets(0, -4, 0);
- double[] xyzExpansion = getTranslatedOffsets(1.5, 0, 1.5);
- for (int i = 0; i < 3; i++) {//gets ABS from translated to get expansion values
- if (xyzExpansion[i] < 0) xyzExpansion[i] = -xyzExpansion[i];
- }
+ Vec3Impl xyzOffsets = getExtendedFacing().getWorldOffset(new Vec3Impl(0, -1, 2));
+ double xPos = mte.getXCoord() + 0.5f + xyzOffsets.get0();
+ double yPos = mte.getYCoord() + 0.5f + xyzOffsets.get1();
+ double zPos = mte.getZCoord() + 0.5f + xyzOffsets.get2();
+ AxisAlignedBB aabb = getBoundingBox(-2, -2, -2, 2, 2, 2)
+ .offset(xPos, yPos, zPos);
+ xyzOffsets = getExtendedFacing().getWorldOffset(new Vec3Impl(0, -4, 0));
+ Vec3Impl xyzExpansion = getExtendedFacing().getWorldOffset(new Vec3Impl(1, 0, 1)).abs();
int power = (int) powerSetting.get();
int damagingFactor =
Math.min(power >> 6, 8) +
@@ -169,8 +169,8 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock
}
}
}
- aabb.offset(xyzOffsets[0], xyzOffsets[1], xyzOffsets[2]);
- aabb = aabb.expand(xyzExpansion[0], xyzExpansion[1], xyzExpansion[2]);
+ aabb.offset(xyzOffsets.get0(), xyzOffsets.get1(), xyzOffsets.get2());
+ aabb = aabb.expand(xyzExpansion.get0()*1.5, xyzExpansion.get1()*1.5, xyzExpansion.get2()*1.5);
inside = false;
damagingFactor >>= 1;
} while (damagingFactor > 0);
@@ -206,7 +206,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][49], new TT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)};
+ return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][49], new TT_RenderedExtendedFacingTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)};
} else if (aSide == GT_Utility.getOppositeSide(aFacing)) {
return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][49], aActive ? Textures.BlockIcons.casingTexturePages[0][52] : Textures.BlockIcons.casingTexturePages[0][53]};
}
@@ -246,7 +246,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock
@Override
public void construct(int stackSize, boolean hintsOnly) {
- StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java
index d35304dfca..bf18a545ef 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java
@@ -1,12 +1,12 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder;
-import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture;
+import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -108,7 +108,7 @@ public class GT_MetaTileEntity_TM_proccessingStack extends GT_MetaTileEntity_Mul
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][49], new TT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)};
+ return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][49], new TT_RenderedExtendedFacingTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)};
} else if (aSide == GT_Utility.getOppositeSide(aFacing)) {
return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][49], aActive ? Textures.BlockIcons.casingTexturePages[0][52] : Textures.BlockIcons.casingTexturePages[0][53]};
}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java
index d083c58ff3..85ccc5d881 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java
@@ -1,20 +1,21 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.CommonValues;
+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.data.RendererMessage;
import com.github.technus.tectech.mechanics.data.ThaumSpark;
import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil;
import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil_Ultimate;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Capacitor;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Param;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.*;
-import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture;
+import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_TeslaCoil;
+import com.github.technus.tectech.util.Vec3Impl;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -28,17 +29,16 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
+import java.util.*;
-import static com.github.technus.tectech.CommonValues.V;
-import static com.github.technus.tectech.Util.*;
+import static com.github.technus.tectech.util.CommonValues.V;
+import static com.github.technus.tectech.util.Util.*;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsBA0;
import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*;
import static gregtech.api.enums.GT_Values.E;
+import static java.lang.Math.max;
+import static java.lang.Math.min;
import static net.minecraft.util.StatCollector.translateToLocal;
public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {
@@ -72,9 +72,9 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
private byte oldOrientation = -1;
//Coordinate Arrays
- private int[][] scanPosOffsets = new int[10][3];
- private int[] posZap = new int[3];//Power Transfer Origin
- public int[] posTop = new int[3];//Lightning Origin
+ private final Vec3Impl[] scanPosOffsets = new Vec3Impl[10];
+ private Vec3Impl posZap = Vec3Impl.NULL_VECTOR;//Power Transfer Origin
+ public Vec3Impl posTop = Vec3Impl.NULL_VECTOR;//Lightning Origin
//endregion
//region structure
@@ -249,15 +249,15 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
return 1F;
}
- private void scanForTransmissionTargets(int[] coordsMin, int[] coordsMax) {
+ private void scanForTransmissionTargets(Vec3Impl coordsMin, Vec3Impl coordsMax) {
//This makes sure the minimums are actually smaller than the maximums
- int xMin = coordsMin[0] < coordsMax[0] ? coordsMin[0] : coordsMax[0];
- int yMin = coordsMin[1] < coordsMax[1] ? coordsMin[1] : coordsMax[1];
- int zMin = coordsMin[2] < coordsMax[2] ? coordsMin[2] : coordsMax[2];
+ int xMin = min(coordsMin.get0(), coordsMax.get0());
+ int yMin = min(coordsMin.get1(), coordsMax.get1());
+ int zMin = min(coordsMin.get2(), coordsMax.get2());
//And vice versa
- int xMax = coordsMin[0] > coordsMax[0] ? coordsMin[0] : coordsMax[0];
- int yMax = coordsMin[1] > coordsMax[1] ? coordsMin[1] : coordsMax[1];
- int zMax = coordsMin[2] > coordsMax[2] ? coordsMin[2] : coordsMax[2];
+ int xMax = max(coordsMin.get0(), coordsMax.get0());
+ int yMax = max(coordsMin.get1(), coordsMax.get1());
+ int zMax = max(coordsMin.get2(), coordsMax.get2());
for (int xPos = xMin; xPos <= xMax; xPos++) {
for (int yPos = yMin; yPos <= yMax; yPos++) {
@@ -266,12 +266,13 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
continue;
}
IGregTechTileEntity node = getBaseMetaTileEntity().getIGregTechTileEntityOffset(xPos, yPos, zPos);
- if (node == null) {
- continue;
- }
- IMetaTileEntity nodeInside = node.getMetaTileEntity();
- if (nodeInside instanceof GT_MetaTileEntity_TeslaCoil || nodeInside instanceof GT_MetaTileEntity_TM_teslaCoil && node.isActive() || (node.getCoverBehaviorAtSide((byte) 1) instanceof GT_Cover_TM_TeslaCoil)) {
- eTeslaMap.put(node, (int) Math.ceil(Math.sqrt(Math.pow(xPos, 2) + Math.pow(yPos, 2) + Math.pow(zPos, 2))));
+ if (node != null) {
+ IMetaTileEntity nodeInside = node.getMetaTileEntity();
+ if (nodeInside instanceof GT_MetaTileEntity_TeslaCoil ||
+ nodeInside instanceof GT_MetaTileEntity_TM_teslaCoil && node.isActive() ||
+ (node.getCoverBehaviorAtSide((byte) 1) instanceof GT_Cover_TM_TeslaCoil)) {
+ eTeslaMap.put(node, (int) Math.ceil(Math.sqrt(Math.pow(xPos, 2) + Math.pow(yPos, 2) + Math.pow(zPos, 2))));
+ }
}
}
}
@@ -280,13 +281,13 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
}
private void thaumLightning(IGregTechTileEntity mte, IGregTechTileEntity node) {
- byte xR = (byte) (node.getXCoord() - posTop[0]);
- byte yR = (byte) (node.getYCoord() - posTop[1]);
- byte zR = (byte) (node.getZCoord() - posTop[2]);
+ byte xR = (byte) (node.getXCoord() - posTop.get0());
+ byte yR = (byte) (node.getYCoord() - posTop.get1());
+ byte zR = (byte) (node.getZCoord() - posTop.get2());
int wID = mte.getWorld().provider.dimensionId;
- sparkList.add(new ThaumSpark(posTop[0], posTop[1], posTop[2], xR, yR, zR, wID));
+ sparkList.add(new ThaumSpark(posTop.get0(), posTop.get1(), posTop.get2(), xR, yR, zR, wID));
}
@Override
@@ -303,9 +304,10 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
}
eCapacitorHatches.clear();
- int[] xyzOffsets;
- xyzOffsets = getTranslatedOffsets(0, -1, 1);
- mTier = iGregTechTileEntity.getMetaIDOffset(xyzOffsets[0], xyzOffsets[1], xyzOffsets[2]);
+ Vec3Impl xyzOffsets;
+
+ xyzOffsets = getExtendedFacing().getWorldOffset(new Vec3Impl(0, -1, 1));
+ mTier = iGregTechTileEntity.getMetaIDOffset(xyzOffsets.get0(), xyzOffsets.get1(), xyzOffsets.get2());
if (structureCheck_EM(shape, blockType, blockMetas[mTier], addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 3, 16, 0) && eCapacitorHatches.size() > 0) {
for (GT_MetaTileEntity_Hatch_Capacitor cap : eCapacitorHatches) {
@@ -315,37 +317,31 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
}
//Only recalculate offsets on orientation or rotation change
- if (oldRotation != getFrontRotation() || oldOrientation != iGregTechTileEntity.getFrontFacing()) {
- oldRotation = getFrontRotation();
+ if (oldRotation != getExtendedFacing().ordinal() || oldOrientation != iGregTechTileEntity.getFrontFacing()) {
+ oldRotation = (byte) getExtendedFacing().ordinal();
oldOrientation = iGregTechTileEntity.getFrontFacing();
//Calculate coordinates of the middle bottom
- xyzOffsets = getTranslatedOffsets(0, 0, 2);
- posZap[0] = iGregTechTileEntity.getXCoord() + xyzOffsets[0];
- posZap[1] = iGregTechTileEntity.getYCoord() + xyzOffsets[1];
- posZap[2] = iGregTechTileEntity.getZCoord() + xyzOffsets[2];
+ posZap = getExtendedFacing().getWorldOffset(new Vec3Impl(0, 0, 2)).add(getBaseMetaTileEntity());
//Calculate coordinates of the top sphere
- xyzOffsets = getTranslatedOffsets(0, -14, 2);
- posTop[0] = iGregTechTileEntity.getXCoord() + xyzOffsets[0];
- posTop[1] = iGregTechTileEntity.getYCoord() + xyzOffsets[1];
- posTop[2] = iGregTechTileEntity.getZCoord() + xyzOffsets[2];
+ posTop = getExtendedFacing().getWorldOffset(new Vec3Impl(0, -14, 2)).add(getBaseMetaTileEntity());
//Calculate offsets for scanning
- scanPosOffsets[0] = getTranslatedOffsets(40, 0, 43);
- scanPosOffsets[1] = getTranslatedOffsets(-40, -4, -37);
+ scanPosOffsets[0] = getExtendedFacing().getWorldOffset(new Vec3Impl(40, 0, 43));
+ scanPosOffsets[1] = getExtendedFacing().getWorldOffset(new Vec3Impl(-40, -4, -37));
- scanPosOffsets[2] = getTranslatedOffsets(40, -5, 43);
- scanPosOffsets[3] = getTranslatedOffsets(-40, -8, -37);
+ scanPosOffsets[2] = getExtendedFacing().getWorldOffset(new Vec3Impl(40, -5, 43));
+ scanPosOffsets[3] = getExtendedFacing().getWorldOffset(new Vec3Impl(-40, -8, -37));
- scanPosOffsets[4] = getTranslatedOffsets(40, -9, 43);
- scanPosOffsets[5] = getTranslatedOffsets(-40, -12, -37);
+ scanPosOffsets[4] = getExtendedFacing().getWorldOffset(new Vec3Impl(40, -9, 43));
+ scanPosOffsets[5] = getExtendedFacing().getWorldOffset(new Vec3Impl(-40, -12, -37));
- scanPosOffsets[6] = getTranslatedOffsets(40, -13, 43);
- scanPosOffsets[7] = getTranslatedOffsets(-40, -16, -37);
+ scanPosOffsets[6] = getExtendedFacing().getWorldOffset(new Vec3Impl(40, -13, 43));
+ scanPosOffsets[7] = getExtendedFacing().getWorldOffset(new Vec3Impl(-40, -16, -37));
- scanPosOffsets[8] = getTranslatedOffsets(40, -17, 43);
- scanPosOffsets[9] = getTranslatedOffsets(-40, -20, -37);
+ scanPosOffsets[8] = getExtendedFacing().getWorldOffset(new Vec3Impl(40, -17, 43));
+ scanPosOffsets[9] = getExtendedFacing().getWorldOffset(new Vec3Impl(-40, -20, -37));
}
return true;
}
@@ -434,7 +430,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][16 + 6], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)};
+ return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][16 + 6], new TT_RenderedExtendedFacingTexture(aActive ? ScreenON : ScreenOFF)};
}
return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][16 + 6]};
}
@@ -612,9 +608,9 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
int tY = node.getYCoord();
int tZ = node.getZCoord();
- int tXN = posZap[0];
- int tYN = posZap[1];
- int tZN = posZap[2];
+ int tXN = posZap.get0();
+ int tYN = posZap.get1();
+ int tZN = posZap.get2();
int tOffset = (int) Math.ceil(Math.sqrt(Math.pow(tX - tXN, 2) + Math.pow(tY - tYN, 2) + Math.pow(tZ - tZN, 2)));
teslaCoil.eTeslaMap.put(mte, tOffset);
@@ -649,7 +645,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
//Power Limit Settings
long outputVoltage;
if (outputVoltageSetting.get() > 0) {
- outputVoltage = Math.min(outputVoltageMax, (long) outputVoltageSetting.get());
+ outputVoltage = min(outputVoltageMax, (long) outputVoltageSetting.get());
} else {
outputVoltage = outputVoltageMax;
}
@@ -657,7 +653,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
long outputCurrent;
if (outputCurrentSetting.get() > 0) {
- outputCurrent = Math.min(outputCurrentMax, (long) outputCurrentSetting.get());
+ outputCurrent = min(outputCurrentMax, (long) outputCurrentSetting.get());
} else {
outputCurrent = outputCurrentMax;
}
@@ -826,7 +822,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
@Override
public void construct(int stackSize, boolean hintsOnly) {
- StructureBuilderExtreme(shape, blockType, blockMetas[(stackSize - 1) % 6], 3, 16, 0, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMetas[(stackSize - 1) % 6], 3, 16, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java
index c42c15bd8d..8086b70691 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.multi.base;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.gui.GT_Slot_Holo;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
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 0e00a3180f..52bdd3574f 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
@@ -2,17 +2,19 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.base;
import com.github.technus.tectech.Reference;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
-import com.github.technus.tectech.Vec3pos;
+import com.github.technus.tectech.mechanics.alignment.*;
+import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
+import com.github.technus.tectech.mechanics.alignment.enumerable.Flip;
+import com.github.technus.tectech.mechanics.alignment.enumerable.Rotation;
+import com.github.technus.tectech.util.Util;
+import com.github.technus.tectech.util.Vec3Impl;
import com.github.technus.tectech.loader.NetworkDispatcher;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack;
import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException;
-import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation;
-import com.github.technus.tectech.thing.metaTileEntity.RotationMessage;
import com.github.technus.tectech.thing.metaTileEntity.hatch.*;
-import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture;
+import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -31,23 +33,23 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
+import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import java.util.ArrayList;
-import static com.github.technus.tectech.CommonValues.*;
-import static com.github.technus.tectech.Util.StructureCheckerExtreme;
-import static com.github.technus.tectech.Util.getTier;
+import static com.github.technus.tectech.util.CommonValues.*;
+import static com.github.technus.tectech.util.Util.StructureCheckerExtreme;
+import static com.github.technus.tectech.util.Util.getTier;
import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
/**
* Created by danie_000 on 27.10.2016.
*/
-public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEntity_MultiBlockBase implements IFrontRotation {
+public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEntity_MultiBlockBase implements IAlignment {
//region Client side variables (static - one per class)
//Front icon holders - static so it is default one for my blocks
@@ -130,8 +132,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
private boolean explodedThisTick = false;
//front rotation val
- private byte frontRotation = 0;
-
+ private IAlignmentLimits alignmentLimits = AlignmentLimits.UNLIMITED;
+ private ExtendedFacing extendedFacing = ExtendedFacing.DEFAULT;
//endregion
protected GT_MetaTileEntity_MultiblockBase_EM(int aID, String aName, String aNameRegional) {
@@ -149,345 +151,46 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
}
//region SUPER STRUCT
-
@Override
- public boolean isFrontRotationValid(byte frontRotation, byte frontFacing) {
- return true;
- }
-
- public boolean isFacingValid_EM(byte aFacing) {
- return true;
+ public ExtendedFacing getExtendedFacing() {
+ return extendedFacing;
}
@Override
- public void rotateAroundFrontPlane(boolean direction) {
- if (direction) {
- frontRotation++;
- if (frontRotation > 3) frontRotation = 0;
- } else {
- frontRotation--;
- if (frontRotation < 0) frontRotation = 3;
- }
- if (isFrontRotationValid(frontRotation, getBaseMetaTileEntity().getFrontFacing())) {
- updateRotationOnClients();
- } else {
- rotateAroundFrontPlane(direction);
+ public void setExtendedFacing(ExtendedFacing alignment) {
+ if(extendedFacing!=alignment){
+ extendedFacing=alignment;
+ IGregTechTileEntity base = getBaseMetaTileEntity();
+ if (getBaseMetaTileEntity().isServerSide()) {
+ NetworkDispatcher.INSTANCE.sendToAllAround(new AlignmentMessage.AlignmentData(this),
+ base.getWorld().provider.dimensionId,
+ base.getXCoord(), base.getYCoord(), base.getZCoord(), 512);
+ }else{
+ base.issueTextureUpdate();
+ }
}
}
- /**
- * Gets AABB based on abc and not xyz, without offsetting to controller position!!!
- *
- * @param minA
- * @param minB
- * @param minC
- * @param maxA
- * @param maxB
- * @param maxC
- * @return
- */
- public final AxisAlignedBB getBoundingBox(double minA, double minB, double minC, double maxA, double maxB, double maxC) {
- double[] offSetsMin = getTranslatedOffsets(minA, minB, minC);
- double[] offSetsMax = getTranslatedOffsets(maxA, maxB, maxC);
- for (int i = 0; i < 3; i++) {
- if (offSetsMax[i] < offSetsMin[i]) {
- double temp = offSetsMax[i];
- offSetsMax[i] = offSetsMin[i];
- offSetsMin[i] = temp;
- }
- }
- return AxisAlignedBB.getBoundingBox(
- offSetsMin[0], offSetsMin[1], offSetsMin[2],
- offSetsMax[0], offSetsMax[1], offSetsMax[2]
- );
+ @Override
+ public IAlignmentLimits getAlignmentLimits() {
+ return alignmentLimits;
}
- /**
- * Translates relative axis coordinates abc to absolute axis coordinates xyz
- * abc from the CONTROLLER!
- *
- * @param a
- * @param b
- * @param c
- * @return
- */
- public final double[] getTranslatedOffsets(double a, double b, double c) {
- double[] result = new double[3];
- switch (getBaseMetaTileEntity().getFrontFacing() + (frontRotation << 3)) {
- case 4:
- result[0] = c;
- result[2] = a;
- result[1] = -b;
- break;
- case 12:
- result[0] = c;
- result[1] = -a;
- result[2] = -b;
- break;
- case 20:
- result[0] = c;
- result[2] = -a;
- result[1] = b;
- break;
- case 28:
- result[0] = c;
- result[1] = a;
- result[2] = b;
- break;
-
- case 3:
- result[0] = a;
- result[2] = -c;
- result[1] = -b;
- break;
- case 11:
- result[1] = -a;
- result[2] = -c;
- result[0] = -b;
- break;
- case 19:
- result[0] = -a;
- result[2] = -c;
- result[1] = b;
- break;
- case 27:
- result[1] = a;
- result[2] = -c;
- result[0] = b;
- break;
-
- case 5:
- result[0] = -c;
- result[2] = -a;
- result[1] = -b;
- break;
- case 13:
- result[0] = -c;
- result[1] = -a;
- result[2] = b;
- break;
- case 21:
- result[0] = -c;
- result[2] = a;
- result[1] = b;
- break;
- case 29:
- result[0] = -c;
- result[1] = a;
- result[2] = -b;
- break;
-
- case 2:
- result[0] = -a;
- result[2] = c;
- result[1] = -b;
- break;
- case 10:
- result[1] = -a;
- result[2] = c;
- result[0] = b;
- break;
- case 18:
- result[0] = a;
- result[2] = c;
- result[1] = b;
- break;
- case 26:
- result[1] = a;
- result[2] = c;
- result[0] = -b;
- break;
- //Things get odd if the block faces up or down...
- case 1:
- result[0] = a;
- result[2] = b;
- result[1] = -c;
- break;//similar to 3
- case 9:
- result[2] = a;
- result[0] = -b;
- result[1] = -c;
- break;//similar to 3
- case 17:
- result[0] = -a;
- result[2] = -b;
- result[1] = -c;
- break;//similar to 3
- case 25:
- result[2] = -a;
- result[0] = b;
- result[1] = -c;
- break;//similar to 3
-
- case 0:
- result[0] = -a;
- result[2] = b;
- result[1] = c;
- break;//similar to 2
- case 8:
- result[2] = a;
- result[0] = b;
- result[1] = c;
- break;
- case 16:
- result[0] = a;
- result[2] = -b;
- result[1] = c;
- break;
- case 24:
- result[2] = -a;
- result[0] = -b;
- result[0] = -b;
- result[1] = +c;
- break;
- }
- return result;
+ @Override
+ public void setAlignmentLimits(IAlignmentLimits limits) {
+ alignmentLimits=limits;
}
- public final int[] getTranslatedOffsets(int a, int b, int c) {
- int[] result = new int[3];
- switch (getBaseMetaTileEntity().getFrontFacing() + (frontRotation << 3)) {
- case 4:
- result[0] = c;
- result[2] = a;
- result[1] = -b;
- break;
- case 12:
- result[0] = c;
- result[1] = -a;
- result[2] = -b;
- break;
- case 20:
- result[0] = c;
- result[2] = -a;
- result[1] = b;
- break;
- case 28:
- result[0] = c;
- result[1] = a;
- result[2] = b;
- break;
-
- case 3:
- result[0] = a;
- result[2] = -c;
- result[1] = -b;
- break;
- case 11:
- result[1] = -a;
- result[2] = -c;
- result[0] = -b;
- break;
- case 19:
- result[0] = -a;
- result[2] = -c;
- result[1] = b;
- break;
- case 27:
- result[1] = a;
- result[2] = -c;
- result[0] = b;
- break;
-
- case 5:
- result[0] = -c;
- result[2] = -a;
- result[1] = -b;
- break;
- case 13:
- result[0] = -c;
- result[1] = -a;
- result[2] = b;
- break;
- case 21:
- result[0] = -c;
- result[2] = a;
- result[1] = b;
- break;
- case 29:
- result[0] = -c;
- result[1] = a;
- result[2] = -b;
- break;
-
- case 2:
- result[0] = -a;
- result[2] = c;
- result[1] = -b;
- break;
- case 10:
- result[1] = -a;
- result[2] = c;
- result[0] = b;
- break;
- case 18:
- result[0] = a;
- result[2] = c;
- result[1] = b;
- break;
- case 26:
- result[1] = a;
- result[2] = c;
- result[0] = -b;
- break;
- //Things get odd if the block faces up or down...
- case 1:
- result[0] = a;
- result[2] = b;
- result[1] = -c;
- break;//similar to 3
- case 9:
- result[2] = a;
- result[0] = -b;
- result[1] = -c;
- break;//similar to 3
- case 17:
- result[0] = -a;
- result[2] = -b;
- result[1] = -c;
- break;//similar to 3
- case 25:
- result[2] = -a;
- result[0] = b;
- result[1] = -c;
- break;//similar to 3
-
- case 0:
- result[0] = -a;
- result[2] = b;
- result[1] = c;
- break;//similar to 2
- case 8:
- result[2] = a;
- result[0] = b;
- result[1] = c;
- break;
- case 16:
- result[0] = a;
- result[2] = -b;
- result[1] = c;
- break;
- case 24:
- result[2] = -a;
- result[0] = -b;
- result[0] = -b;
- result[1] = +c;
- break;
- }
- return result;
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return getAlignmentLimits()
+ .isNewExtendedFacingValid(getExtendedFacing().with(ForgeDirection.getOrientation(aFacing)));
}
- //can be used to check structures of multi-blocks larger than one chunk, but...
- //ALL THE HATCHES AND THE CONTROLLER SHOULD BE IN ONE CHUNK OR IN LOADED CHUNKS
- //@Deprecated
- //public final boolean structureCheck_EM(
- // String[][] structure,//0-9 casing, +- air no air, a-z ignore
- // Block[] blockType,//use numbers 0-9 for casing types
- // byte[] blockMeta,//use numbers 0-9 for casing types
- // int horizontalOffset, int verticalOffset, int depthOffset) {
- // return StructureChecker(structure, blockType, blockMeta,
- // horizontalOffset, verticalOffset, depthOffset, getBaseMetaTileEntity(), !mMachine);
- //}
+ @Override
+ public void onFacingChange() {
+ toolSetDirection(ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()));
+ }
public final boolean structureCheck_EM(
String[][] structure,//0-9 casing, +- air no air, a-z ignore
@@ -499,7 +202,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
byte[] blockMetaFallback,//use numbers 0-9 for casing types
int horizontalOffset, int verticalOffset, int depthOffset) {
return StructureCheckerExtreme(structure, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback,
- horizontalOffset, verticalOffset, depthOffset, getBaseMetaTileEntity(), this, !mMachine);
+ horizontalOffset, verticalOffset, depthOffset, getBaseMetaTileEntity(), getExtendedFacing(), !mMachine);
}
//endregion
@@ -729,7 +432,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)};
+ return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new TT_RenderedExtendedFacingTexture(aActive ? ScreenON : ScreenOFF)};
}
return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4]};
}
@@ -904,7 +607,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
*/
protected long getAvailableData_EM() {
long result = 0;
- Vec3pos pos = new Vec3pos(getBaseMetaTileEntity());
+ Vec3Impl pos = new Vec3Impl(getBaseMetaTileEntity());
for (GT_MetaTileEntity_Hatch_InputData in : eInputData) {
if (in.q != null) {
Long value = in.q.contentIfNotInTrace(pos);
@@ -976,7 +679,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", frontRotation);
+ aNBT.setByte("eRotation", (byte)extendedFacing.getRotation().getIndex());
+ aNBT.setByte("eFlip", (byte)extendedFacing.getFlip().getIndex());
aNBT.setBoolean("eParam", eParameters);
aNBT.setBoolean("ePass", ePowerPass);
aNBT.setBoolean("eVoid", eSafeVoid);
@@ -1066,7 +770,10 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
eCertainMode = aNBT.getByte("eCertainM");
eCertainStatus = aNBT.getByte("eCertainS");
minRepairStatus = aNBT.getByte("eMinRepair");
- frontRotation = aNBT.getByte("eRotation");
+ extendedFacing=ExtendedFacing.of(
+ ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()),
+ Rotation.byIndex(aNBT.getByte("eRotation")),
+ Flip.byIndex(aNBT.getByte("eFlip")));
eParameters = aNBT.getBoolean("eParam");
ePowerPass = aNBT.getBoolean("ePass");
eSafeVoid = aNBT.getBoolean("eVoid");
@@ -1265,40 +972,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
//region internal
- @Override
- public final byte getFrontRotation() {
- return frontRotation;
- }
-
- @Override
- public final void forceSetRotationDoRender(byte rotation) {
- frontRotation = rotation;
- IGregTechTileEntity base = getBaseMetaTileEntity();
- if (base.isClientSide()) {
- base.issueTextureUpdate();
- }
- }
-
- protected final void updateRotationOnClients() {
- if (getBaseMetaTileEntity().isServerSide()) {
- IGregTechTileEntity base = getBaseMetaTileEntity();
- NetworkDispatcher.INSTANCE.sendToAllAround(new RotationMessage.RotationData(this),
- base.getWorld().provider.dimensionId,
- base.getXCoord(),
- base.getYCoord(),
- base.getZCoord(),
- 256);
- }
- }
-
- @Override
- public final boolean isFacingValid(byte aFacing) {
- if (!isFrontRotationValid(frontRotation, aFacing)) {
- rotateAroundFrontPlane(false);
- }
- return isFacingValid_EM(aFacing);
- }
-
/**
* internal check machine
*
@@ -1380,7 +1053,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
public final void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
isFacingValid(aBaseMetaTileEntity.getFrontFacing());
if (getBaseMetaTileEntity().isClientSide()) {
- NetworkDispatcher.INSTANCE.sendToServer(new RotationMessage.RotationQuery(this));
+ NetworkDispatcher.INSTANCE.sendToServer(new AlignmentMessage.AlignmentQuery(this));
}
onFirstTick_EM(aBaseMetaTileEntity);
}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedTexture.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedExtendedFacingTexture.java
index 39a12f1f86..4ecea706cc 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedTexture.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedExtendedFacingTexture.java
@@ -1,6 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.multi.base.render;
-import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation;
+import com.github.technus.tectech.mechanics.alignment.IAlignment;
+import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
import gregtech.api.enums.Dyes;
import gregtech.api.interfaces.IColorModulationContainer;
import gregtech.api.interfaces.IIconContainer;
@@ -14,8 +15,9 @@ 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;
-public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
+public class TT_RenderedExtendedFacingTexture implements ITexture,IColorModulationContainer {
private final IIconContainer mIconContainer;
private final boolean mAllowAlpha;
/**
@@ -26,25 +28,25 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
*/
public short[] mRGBa;
- public TT_RenderedTexture(IIconContainer aIcon, short[] aRGBa, boolean aAllowAlpha) {
+ 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;
}
- public TT_RenderedTexture(IIconContainer aIcon, short[] aRGBa) {
+ public TT_RenderedExtendedFacingTexture(IIconContainer aIcon, short[] aRGBa) {
this(aIcon, aRGBa, true);
}
- public TT_RenderedTexture(IIconContainer aIcon) {
+ public TT_RenderedExtendedFacingTexture(IIconContainer aIcon) {
this(aIcon, Dyes._NULL.mRGBa);
}
@Override
public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.6F), (int) (mRGBa[1] * 0.6F), (int) (mRGBa[2] * 0.6F), mAllowAlpha ? 255 - mRGBa[3] : 255);
- byte rotation = getRotation(aX, aY, aZ);
+ ExtendedFacing rotation = getExtendedFacing(aX, aY, aZ);
renderFaceXPos(aRenderer, aX, aY, aZ, mIconContainer.getIcon(), rotation);
if (mIconContainer.getOverlayIcon() != null) {
Tessellator.instance.setColorRGBA(153, 153, 153, 255);
@@ -55,7 +57,7 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
@Override
public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.6F), (int) (mRGBa[1] * 0.6F), (int) (mRGBa[2] * 0.6F), mAllowAlpha ? 255 - mRGBa[3] : 255);
- byte rotation = getRotation(aX, aY, aZ);
+ ExtendedFacing rotation = getExtendedFacing(aX, aY, aZ);
renderFaceXNeg(aRenderer, aX, aY, aZ, mIconContainer.getIcon(), rotation);
if (mIconContainer.getOverlayIcon() != null) {
Tessellator.instance.setColorRGBA(153, 153, 153, 255);
@@ -66,7 +68,7 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
@Override
public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 1.0F), (int) (mRGBa[1] * 1.0F), (int) (mRGBa[2] * 1.0F), mAllowAlpha ? 255 - mRGBa[3] : 255);
- byte rotation = getRotation(aX, aY, aZ);
+ ExtendedFacing rotation = getExtendedFacing(aX, aY, aZ);
renderFaceYPos(aRenderer, aX, aY, aZ, mIconContainer.getIcon(), rotation);
if (mIconContainer.getOverlayIcon() != null) {
Tessellator.instance.setColorRGBA(255, 255, 255, 255);
@@ -77,7 +79,7 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
@Override
public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.5F), (int) (mRGBa[1] * 0.5F), (int) (mRGBa[2] * 0.5F), mAllowAlpha ? 255 - mRGBa[3] : 255);
- byte rotation = getRotation(aX, aY, aZ);
+ 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);
@@ -88,7 +90,7 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
@Override
public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.8F), (int) (mRGBa[1] * 0.8F), (int) (mRGBa[2] * 0.8F), mAllowAlpha ? 255 - mRGBa[3] : 255);
- byte rotation = getRotation(aX, aY, aZ);
+ ExtendedFacing rotation = getExtendedFacing(aX, aY, aZ);
renderFaceZPos(aRenderer, aX, aY, aZ, mIconContainer.getIcon(), rotation);
if (mIconContainer.getOverlayIcon() != null) {
Tessellator.instance.setColorRGBA(204, 204, 204, 255);
@@ -99,7 +101,7 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
@Override
public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.8F), (int) (mRGBa[1] * 0.8F), (int) (mRGBa[2] * 0.8F), mAllowAlpha ? 255 - mRGBa[3] : 255);
- byte rotation = getRotation(aX, aY, aZ);
+ ExtendedFacing rotation = getExtendedFacing(aX, aY, aZ);
renderFaceZNeg(aRenderer, aX, aY, aZ, mIconContainer.getIcon(), rotation);
if (mIconContainer.getOverlayIcon() != null) {
Tessellator.instance.setColorRGBA(204, 204, 204, 255);
@@ -111,26 +113,46 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
/**
* 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, byte rotation) {
+ 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 = (double) icon.getInterpolatedU(aRenderer.renderMaxX * 16.0D);
- double d4 = (double) icon.getInterpolatedU(aRenderer.renderMinX * 16.0D);
- double d5 = (double) icon.getInterpolatedV(aRenderer.renderMinZ * 16.0D);
- double d6 = (double) icon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D);
+ 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 = (double) icon.getMaxU();
- d4 = (double) icon.getMinU();
+ d3 = icon.getMaxU();
+ d4 = icon.getMinU();
}
if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) {
- d5 = (double) icon.getMinV();
- d6 = (double) icon.getMaxV();
+ 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;
@@ -138,12 +160,12 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
double d9 = d5;
double d10 = d6;
- switch (rotation) {
+ switch (rotation.getRotation().ordinal()) {
case 3:
- d3 = (double) icon.getInterpolatedU(aRenderer.renderMaxZ * 16.0D);
- d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxX * 16.0D);
- d4 = (double) icon.getInterpolatedU(aRenderer.renderMinZ * 16.0D);
- d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinX * 16.0D);
+ 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;
@@ -152,10 +174,10 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
d6 = d9;
break;
case 1:
- d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinZ * 16.0D);
- d5 = (double) icon.getInterpolatedV(aRenderer.renderMinX * 16.0D);
- d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxZ * 16.0D);
- d6 = (double) icon.getInterpolatedV(aRenderer.renderMaxX * 16.0D);
+ 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;
@@ -164,10 +186,10 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
d10 = d5;
break;
case 2:
- d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxX * 16.0D);
- d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinX * 16.0D);
- d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinZ * 16.0D);
- d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxZ * 16.0D);
+ 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;
@@ -210,27 +232,46 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
/**
* 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, byte rotation) {
+ 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 = (double) icon.getInterpolatedU(aRenderer.renderMinX * 16.0D);
- double d4 = (double) icon.getInterpolatedU(aRenderer.renderMaxX * 16.0D);
- double d5 = (double) icon.getInterpolatedV(aRenderer.renderMinZ * 16.0D);
- double d6 = (double) icon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D);
+ 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 = (double) icon.getMinU();
- d4 = (double) icon.getMaxU();
+ d3 = icon.getMinU();
+ d4 = icon.getMaxU();
}
if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) {
- d5 = (double) icon.getMinV();
-
- d6 = (double) icon.getMaxV();
+ 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;
@@ -238,12 +279,12 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
double d9 = d5;
double d10 = d6;
- switch (rotation) {
+ switch (rotation.getRotation().ordinal()) {
case 1:
- d3 = (double) icon.getInterpolatedU(aRenderer.renderMinZ * 16.0D);
- d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxX * 16.0D);
- d4 = (double) icon.getInterpolatedU(aRenderer.renderMaxZ * 16.0D);
- d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinX * 16.0D);
+ 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;
@@ -252,10 +293,10 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
d6 = d9;
break;
case 3:
- d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxZ * 16.0D);
- d5 = (double) icon.getInterpolatedV(aRenderer.renderMinX * 16.0D);
- d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinZ * 16.0D);
- d6 = (double) icon.getInterpolatedV(aRenderer.renderMaxX * 16.0D);
+ 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;
@@ -264,10 +305,10 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
d10 = d5;
break;
case 2:
- d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinX * 16.0D);
- d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxX * 16.0D);
- d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinZ * 16.0D);
- d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxZ * 16.0D);
+ 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;
@@ -310,23 +351,24 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
/**
* 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, byte rotation) {
+ 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 = (double) icon.getInterpolatedU(aRenderer.renderMinX * 16.0D);
- double d4 = (double) icon.getInterpolatedU(aRenderer.renderMaxX * 16.0D);
+ double d3 = icon.getInterpolatedU(aRenderer.renderMinX * 16.0D);
+ double d4 = icon.getInterpolatedU(aRenderer.renderMaxX * 16.0D);
if (aRenderer.field_152631_f) {
- d4 = (double) icon.getInterpolatedU((1.0D - aRenderer.renderMinX) * 16.0D);
- d3 = (double) icon.getInterpolatedU((1.0D - aRenderer.renderMaxX) * 16.0D);
+ d4 = icon.getInterpolatedU((1.0D - aRenderer.renderMinX) * 16.0D);
+ d3 = icon.getInterpolatedU((1.0D - aRenderer.renderMaxX) * 16.0D);
}
- double d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxY * 16.0D);
- double d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinY * 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) {
@@ -336,13 +378,33 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
}
if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) {
- d3 = (double) icon.getMinU();
- d4 = (double) icon.getMaxU();
+ d3 = icon.getMinU();
+ d4 = icon.getMaxU();
}
if (aRenderer.renderMinY < 0.0D || aRenderer.renderMaxY > 1.0D) {
- d5 = (double) icon.getMinV();
- d6 = (double) icon.getMaxV();
+ 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;
@@ -350,12 +412,12 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
double d9 = d5;
double d10 = d6;
- switch (rotation) {
+ switch (rotation.getRotation().ordinal()) {
case 3:
- d3 = (double) icon.getInterpolatedU(aRenderer.renderMaxY * 16.0D);
- d4 = (double) icon.getInterpolatedU(aRenderer.renderMinY * 16.0D);
- d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinX * 16.0D);
- d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxX * 16.0D);
+ 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;
@@ -364,10 +426,10 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
d6 = d9;
break;
case 1:
- d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinY * 16.0D);
- d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxY * 16.0D);
- d5 = (double) icon.getInterpolatedV(aRenderer.renderMaxX * 16.0D);
- d6 = (double) icon.getInterpolatedV(aRenderer.renderMinX * 16.0D);
+ 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;
@@ -376,10 +438,10 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
d10 = d5;
break;
case 2:
- d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinX * 16.0D);
- d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxX * 16.0D);
- d5 = (double) icon.getInterpolatedV(aRenderer.renderMaxY * 16.0D);
- d6 = (double) icon.getInterpolatedV(aRenderer.renderMinY * 16.0D);
+ 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;
@@ -422,17 +484,17 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
/**
* 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, byte rotation) {
+ 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 = (double) icon.getInterpolatedU(aRenderer.renderMinX * 16.0D);
- double d4 = (double) icon.getInterpolatedU(aRenderer.renderMaxX * 16.0D);
- double d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxY * 16.0D);
- double d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinY * 16.0D);
+ 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) {
@@ -442,13 +504,33 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
}
if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) {
- d3 = (double) icon.getMinU();
- d4 = (double) icon.getMaxU();
+ d3 = icon.getMinU();
+ d4 = icon.getMaxU();
}
if (aRenderer.renderMinY < 0.0D || aRenderer.renderMaxY > 1.0D) {
- d5 = (double) icon.getMinV();
- d6 = (double) icon.getMaxV();
+ 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;
@@ -456,12 +538,12 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
double d9 = d5;
double d10 = d6;
- switch (rotation) {
+ switch (rotation.getRotation().ordinal()) {
case 1:
- d3 = (double) icon.getInterpolatedU(aRenderer.renderMinY * 16.0D);
- d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinX * 16.0D);
- d4 = (double) icon.getInterpolatedU(aRenderer.renderMaxY * 16.0D);
- d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxX * 16.0D);
+ 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;
@@ -470,10 +552,10 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
d6 = d9;
break;
case 3:
- d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxY * 16.0D);
- d5 = (double) icon.getInterpolatedV(aRenderer.renderMinX * 16.0D);
- d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinY * 16.0D);
- d6 = (double) icon.getInterpolatedV(aRenderer.renderMaxX * 16.0D);
+ 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;
@@ -482,10 +564,10 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
d10 = d5;
break;
case 2:
- d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinX * 16.0D);
- d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxX * 16.0D);
- d5 = (double) icon.getInterpolatedV(aRenderer.renderMaxY * 16.0D);
- d6 = (double) icon.getInterpolatedV(aRenderer.renderMinY * 16.0D);
+ 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;
@@ -528,17 +610,17 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
/**
* 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, byte rotation) {
+ 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 = (double) icon.getInterpolatedU(aRenderer.renderMinZ * 16.0D);
- double d4 = (double) icon.getInterpolatedU(aRenderer.renderMaxZ * 16.0D);
- double d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxY * 16.0D);
- double d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinY * 16.0D);
+ 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) {
@@ -548,13 +630,33 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
}
if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) {
- d3 = (double) icon.getMinU();
- d4 = (double) icon.getMaxU();
+ d3 = icon.getMinU();
+ d4 = icon.getMaxU();
}
if (aRenderer.renderMinY < 0.0D || aRenderer.renderMaxY > 1.0D) {
- d5 = (double) icon.getMinV();
- d6 = (double) icon.getMaxV();
+ 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;
@@ -562,12 +664,12 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
double d9 = d5;
double d10 = d6;
- switch (rotation) {
+ switch (rotation.getRotation().ordinal()) {
case 1:
- d3 = (double) icon.getInterpolatedU(aRenderer.renderMinY * 16.0D);
- d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxZ * 16.0D);
- d4 = (double) icon.getInterpolatedU(aRenderer.renderMaxY * 16.0D);
- d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinZ * 16.0D);
+ 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;
@@ -576,10 +678,10 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
d6 = d9;
break;
case 3:
- d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxY * 16.0D);
- d5 = (double) icon.getInterpolatedV(aRenderer.renderMinZ * 16.0D);
- d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinY * 16.0D);
- d6 = (double) icon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D);
+ 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;
@@ -588,10 +690,10 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
d10 = d5;
break;
case 2:
- d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinZ * 16.0D);
- d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxZ * 16.0D);
- d5 = (double) icon.getInterpolatedV(aRenderer.renderMaxY * 16.0D);
- d6 = (double) icon.getInterpolatedV(aRenderer.renderMinY * 16.0D);
+ 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;
@@ -634,23 +736,23 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
/**
* 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, byte rotation) {
+ 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 = (double) icon.getInterpolatedU(aRenderer.renderMinZ * 16.0D);
- double d4 = (double) icon.getInterpolatedU(aRenderer.renderMaxZ * 16.0D);
+ double d3 = icon.getInterpolatedU(aRenderer.renderMinZ * 16.0D);
+ double d4 = icon.getInterpolatedU(aRenderer.renderMaxZ * 16.0D);
if (aRenderer.field_152631_f) {
- d4 = (double) icon.getInterpolatedU((1.0D - aRenderer.renderMinZ) * 16.0D);
- d3 = (double) icon.getInterpolatedU((1.0D - aRenderer.renderMaxZ) * 16.0D);
+ d4 = icon.getInterpolatedU((1.0D - aRenderer.renderMinZ) * 16.0D);
+ d3 = icon.getInterpolatedU((1.0D - aRenderer.renderMaxZ) * 16.0D);
}
- double d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxY * 16.0D);
- double d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinY * 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) {
@@ -660,13 +762,33 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
}
if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) {
- d3 = (double) icon.getMinU();
- d4 = (double) icon.getMaxU();
+ d3 = icon.getMinU();
+ d4 = icon.getMaxU();
}
if (aRenderer.renderMinY < 0.0D || aRenderer.renderMaxY > 1.0D) {
- d5 = (double) icon.getMinV();
- d6 = (double) icon.getMaxV();
+ 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;
@@ -674,12 +796,12 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
double d9 = d5;
double d10 = d6;
- switch (rotation) {
+ switch (rotation.getRotation().ordinal()) {
case 3:
- d3 = (double) icon.getInterpolatedU(aRenderer.renderMaxY * 16.0D);
- d5 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMinZ * 16.0D);
- d4 = (double) icon.getInterpolatedU(aRenderer.renderMinY * 16.0D);
- d6 = (double) icon.getInterpolatedV(16.0D - aRenderer.renderMaxZ * 16.0D);
+ 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;
@@ -688,10 +810,10 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
d6 = d9;
break;
case 1:
- d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinY * 16.0D);
- d5 = (double) icon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D);
- d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxY * 16.0D);
- d6 = (double) icon.getInterpolatedV(aRenderer.renderMinZ * 16.0D);
+ 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;
@@ -700,10 +822,10 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
d10 = d5;
break;
case 2:
- d3 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMinZ * 16.0D);
- d4 = (double) icon.getInterpolatedU(16.0D - aRenderer.renderMaxZ * 16.0D);
- d5 = (double) icon.getInterpolatedV(aRenderer.renderMaxY * 16.0D);
- d6 = (double) icon.getInterpolatedV(aRenderer.renderMinY * 16.0D);
+ 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;
@@ -753,17 +875,19 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer {
return mIconContainer != null;
}
- private static byte getRotation(int x, int y, int z) {
+ 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 IFrontRotation) {
- return ((IFrontRotation) meta).getFrontRotation();
+ if (meta instanceof IAlignment) {
+ return ((IAlignment) meta).getExtendedFacing();
+ }else{
+ return ExtendedFacing.of(ForgeDirection.getOrientation(meta.getBaseMetaTileEntity().getFrontFacing()));
}
}
}
- return 0;
+ return ExtendedFacing.DEFAULT;
}
}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java
index 63177d40ae..9612426598 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java
@@ -11,7 +11,7 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters;
import java.util.Arrays;
-import static com.github.technus.tectech.CommonValues.V;
+import static com.github.technus.tectech.util.CommonValues.V;
import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java
index 08a79e5c90..c79087d051 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java
@@ -9,7 +9,7 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunctio
import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters;
-import static com.github.technus.tectech.CommonValues.V;
+import static com.github.technus.tectech.util.CommonValues.V;
import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*;
/**
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java
index 8187759445..b81dd885a5 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java
@@ -4,7 +4,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInsta
import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters;
-import static com.github.technus.tectech.CommonValues.V;
+import static com.github.technus.tectech.util.CommonValues.V;
/**
* Created by danie_000 on 24.12.2017.
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java
index d45fbc31d7..dce8f56ce9 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java
@@ -1,12 +1,12 @@
package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.block.QuantumStuffBlock;
-import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
+import com.github.technus.tectech.mechanics.constructible.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.*;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -21,7 +21,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import java.util.HashMap;
import java.util.function.Supplier;
-import static com.github.technus.tectech.Util.StructureBuilderExtreme;
+import static com.github.technus.tectech.util.Util.StructureBuilderExtreme;
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.base.LedStatus.*;
@@ -350,7 +350,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa
@Override
public void construct(int stackSize, boolean hintsOnly) {
- StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 1, getBaseMetaTileEntity(), this, hintsOnly);
+ StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 1, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
}
@Override
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 59ad1b927e..7aabff1af4 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,6 +1,9 @@
package com.github.technus.tectech.thing.metaTileEntity.pipe;
-import com.github.technus.tectech.CommonValues;
+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;
@@ -31,7 +34,7 @@ import static net.minecraft.util.StatCollector.translateToLocal;
/**
* Created by Tec on 26.02.2017.
*/
-public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConnectsToDataPipe,IActivePipe {
+public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConnectsToDataPipe, IActivePipe {
private static Textures.BlockIcons.CustomIcon EMpipe;
private static Textures.BlockIcons.CustomIcon EMbar,EMbarActive;
public byte connectionCount = 0;
@@ -118,25 +121,16 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide()) {
if ((aTick & 31) == 31) {
+ if(TecTech.RANDOM.nextInt(15)==0) {
+ NetworkDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this),
+ aBaseMetaTileEntity.getWorld().provider.dimensionId,
+ aBaseMetaTileEntity.getXCoord(),
+ aBaseMetaTileEntity.getYCoord(),
+ aBaseMetaTileEntity.getZCoord(),
+ 256);
+ }
if(active){
- if(TecTech.RANDOM.nextInt(15)==0) {
- NetworkDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this),
- aBaseMetaTileEntity.getWorld().provider.dimensionId,
- aBaseMetaTileEntity.getXCoord(),
- aBaseMetaTileEntity.getYCoord(),
- aBaseMetaTileEntity.getZCoord(),
- 256);
- }
active=false;
- }else if(getActive()){
- if(TecTech.RANDOM.nextInt(15)==0) {
- NetworkDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this),
- aBaseMetaTileEntity.getWorld().provider.dimensionId,
- aBaseMetaTileEntity.getXCoord(),
- aBaseMetaTileEntity.getYCoord(),
- aBaseMetaTileEntity.getZCoord(),
- 256);
- }
}
mConnections = 0;
connectionCount = 0;
@@ -275,9 +269,11 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn
}
@Override
- public void setActive(boolean active) {
- this.active=active;
- getBaseMetaTileEntity().issueTextureUpdate();
+ public void setActive(boolean state) {
+ if(state!=active) {
+ active = state;
+ getBaseMetaTileEntity().issueTextureUpdate();
+ }
}
@Override
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 98e0feccd1..55a7f23b6a 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,6 +1,9 @@
package com.github.technus.tectech.thing.metaTileEntity.pipe;
-import com.github.technus.tectech.CommonValues;
+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;
@@ -32,7 +35,7 @@ import static net.minecraft.util.StatCollector.translateToLocal;
/**
* Created by Tec on 26.02.2017.
*/
-public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnectsToElementalPipe,IActivePipe {
+public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnectsToElementalPipe, IActivePipe {
private static Textures.BlockIcons.CustomIcon EMpipe;
static Textures.BlockIcons.CustomIcon EMcandy,EMCandyActive;
public byte connectionCount = 0;
@@ -119,25 +122,16 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide()) {
if ((aTick & 31) == 31) {
+ if(TecTech.RANDOM.nextInt(15)==0) {
+ NetworkDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this),
+ aBaseMetaTileEntity.getWorld().provider.dimensionId,
+ aBaseMetaTileEntity.getXCoord(),
+ aBaseMetaTileEntity.getYCoord(),
+ aBaseMetaTileEntity.getZCoord(),
+ 256);
+ }
if(active){
- if(TecTech.RANDOM.nextInt(7)==0) {
- NetworkDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this),
- aBaseMetaTileEntity.getWorld().provider.dimensionId,
- aBaseMetaTileEntity.getXCoord(),
- aBaseMetaTileEntity.getYCoord(),
- aBaseMetaTileEntity.getZCoord(),
- 256);
- }
active=false;
- }else if(getActive()){
- if(TecTech.RANDOM.nextInt(7)==0) {
- NetworkDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this),
- aBaseMetaTileEntity.getWorld().provider.dimensionId,
- aBaseMetaTileEntity.getXCoord(),
- aBaseMetaTileEntity.getYCoord(),
- aBaseMetaTileEntity.getZCoord(),
- 256);
- }
}
mConnections = 0;
connectionCount = 0;
@@ -240,9 +234,11 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec
}
@Override
- public void setActive(boolean active) {
- this.active=active;
- getBaseMetaTileEntity().issueTextureUpdate();
+ public void setActive(boolean state) {
+ if(state!=active) {
+ active = state;
+ getBaseMetaTileEntity().issueTextureUpdate();
+ }
}
@Override
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 ce315fcd86..ef767dacdd 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,6 +1,9 @@
package com.github.technus.tectech.thing.metaTileEntity.pipe;
-import com.github.technus.tectech.CommonValues;
+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;
@@ -31,11 +34,11 @@ import static com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEn
import static gregtech.api.enums.Dyes.MACHINE_METAL;
import static net.minecraft.util.StatCollector.translateToLocal;
-public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements IConnectsToEnergyTunnel,IActivePipe {
+public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements IConnectsToEnergyTunnel, IActivePipe {
private static Textures.BlockIcons.CustomIcon EMpipe;
public byte connectionCount = 0;
- private boolean active;
+ private boolean active,lastActive;
public GT_MetaTileEntity_Pipe_Energy(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, 0);
@@ -115,25 +118,16 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide()) {
if ((aTick & 31) == 31) {
+ if(TecTech.RANDOM.nextInt(15)==0) {
+ NetworkDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this),
+ aBaseMetaTileEntity.getWorld().provider.dimensionId,
+ aBaseMetaTileEntity.getXCoord(),
+ aBaseMetaTileEntity.getYCoord(),
+ aBaseMetaTileEntity.getZCoord(),
+ 256);
+ }
if(active){
- if(TecTech.RANDOM.nextInt(31)==0) {
- NetworkDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this),
- aBaseMetaTileEntity.getWorld().provider.dimensionId,
- aBaseMetaTileEntity.getXCoord(),
- aBaseMetaTileEntity.getYCoord(),
- aBaseMetaTileEntity.getZCoord(),
- 256);
- }
active=false;
- }else if(getActive()){
- if(TecTech.RANDOM.nextInt(31)==0) {
- NetworkDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this),
- aBaseMetaTileEntity.getWorld().provider.dimensionId,
- aBaseMetaTileEntity.getXCoord(),
- aBaseMetaTileEntity.getYCoord(),
- aBaseMetaTileEntity.getZCoord(),
- 256);
- }
}
mConnections = 0;
connectionCount = 0;
@@ -180,8 +174,10 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo
@Override
public void setActive(boolean state){
- this.active=state;
- getBaseMetaTileEntity().issueTextureUpdate();
+ if(state!=active) {
+ active = state;
+ getBaseMetaTileEntity().issueTextureUpdate();
+ }
}
@Override
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 d4335e3c5a..737046729f 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,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.single;
-import com.github.technus.tectech.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
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 cpw.mods.fml.relauncher.Side;
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 c98db2b985..d942786916 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,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.single;
-import com.github.technus.tectech.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
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 cpw.mods.fml.common.FMLCommonHandler;
@@ -26,14 +26,12 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
-import static com.github.technus.tectech.CommonValues.V;
import static com.github.technus.tectech.Reference.MODID;
import static com.github.technus.tectech.recipe.TT_recipeAdder.nullItem;
import static com.github.technus.tectech.thing.metaTileEntity.Textures.MACHINE_CASINGS_TT;
+import static com.github.technus.tectech.util.CommonValues.V;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -93,8 +91,7 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine
return DID_NOT_FIND_RECIPE;
}
ItemStack input=getInputAt(0);
- ArrayList<IDataRender> renders=getRenders(new Util.ItemStack_NoNBT(input));
- for(IDataRender render:renders){
+ for(IDataRender render:getRenders(new Util.ItemStack_NoNBT(input))){
if(render.canRender(input,mTier)){
mOutputItems[0]=input.copy();
input.stackSize-=1;
@@ -186,8 +183,9 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine
renders.add(render);
}
- public static ArrayList<IDataRender> getRenders(Util.ItemStack_NoNBT stack){
- return RENDER_REGISTRY.get(stack);
+ public static List<IDataRender> getRenders(Util.ItemStack_NoNBT stack){
+ ArrayList<IDataRender> iDataRenders = RENDER_REGISTRY.get(stack);
+ return iDataRenders==null?Collections.emptyList():iDataRenders;
}
public interface IDataRender {
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 e092eb7c38..6fef2efbe9 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,8 +1,8 @@
package com.github.technus.tectech.thing.metaTileEntity.single;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
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;
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 0da48dfbac..931da27e6c 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,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.single;
-import com.github.technus.tectech.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
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 cpw.mods.fml.relauncher.Side;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java
index 171e051c5c..f40752bcf5 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java
@@ -1,8 +1,8 @@
package com.github.technus.tectech.thing.metaTileEntity.single;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_DebugStructureWriter;
import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_DebugStructureWriter;
import cpw.mods.fml.relauncher.Side;
@@ -20,7 +20,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
-import static com.github.technus.tectech.Util.StructureWriter;
+import static com.github.technus.tectech.util.Util.StructureWriter;
import static com.github.technus.tectech.thing.metaTileEntity.Textures.MACHINE_CASINGS_TT;
import static net.minecraft.util.StatCollector.translateToLocal;
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 79f753aa02..9bac9df2f3 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,7 +10,7 @@ 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;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.mechanics.avr.SidedRedstone;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
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 c22219e6d9..03ec9efd89 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,8 +1,8 @@
package com.github.technus.tectech.thing.metaTileEntity.single;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -21,7 +21,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import org.apache.commons.lang3.reflect.FieldUtils;
-import static com.github.technus.tectech.CommonValues.RECIPE_AT;
+import static com.github.technus.tectech.util.CommonValues.RECIPE_AT;
import static com.github.technus.tectech.thing.metaTileEntity.Textures.MACHINE_CASINGS_TT;
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_TT_Transformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TT_Transformer.java
index 2302d1a42b..61f2259c5c 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TT_Transformer.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TT_Transformer.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.single;
-import com.github.technus.tectech.CommonValues;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.CommonValues;
+import com.github.technus.tectech.util.Util;
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/single/GT_MetaTileEntity_TeslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java
index 48db8725df..0c282ac94f 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,8 +1,8 @@
package com.github.technus.tectech.thing.metaTileEntity.single;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.loader.NetworkDispatcher;
import com.github.technus.tectech.mechanics.data.RendererMessage;
import com.github.technus.tectech.mechanics.data.ThaumSpark;
@@ -26,9 +26,9 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
-import static com.github.technus.tectech.CommonValues.V;
-import static com.github.technus.tectech.Util.entriesSortedByValues;
-import static com.github.technus.tectech.Util.map;
+import static com.github.technus.tectech.util.CommonValues.V;
+import static com.github.technus.tectech.util.Util.entriesSortedByValues;
+import static com.github.technus.tectech.util.Util.map;
import static com.github.technus.tectech.thing.metaTileEntity.Textures.*;
import static java.lang.Math.round;
import static net.minecraft.util.StatCollector.translateToLocal;
@@ -206,9 +206,9 @@ public class GT_MetaTileEntity_TeslaCoil extends GT_MetaTileEntity_BasicBatteryB
IMetaTileEntity nodeInside = node.getMetaTileEntity();
if (nodeInside instanceof GT_MetaTileEntity_TM_teslaCoil) {
GT_MetaTileEntity_TM_teslaCoil nodeTesla = (GT_MetaTileEntity_TM_teslaCoil) nodeInside;
- xR = (byte) (nodeTesla.posTop[0] - x);
- yR = (byte) (nodeTesla.posTop[1] - y);
- zR = (byte) (nodeTesla.posTop[2] - z);
+ xR = (byte) (nodeTesla.posTop.get0() - x);
+ yR = (byte) (nodeTesla.posTop.get1() - y);
+ zR = (byte) (nodeTesla.posTop.get2() - z);
} else {
xR = (byte) (node.getXCoord() - x);
yR = (byte) (node.getYCoord() - y);
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_WetTransformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_WetTransformer.java
index 02f84bd7c3..ca937f813c 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_WetTransformer.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_WetTransformer.java
@@ -1,11 +1,11 @@
package com.github.technus.tectech.thing.metaTileEntity.single;
-import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.util.CommonValues;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import static com.github.technus.tectech.CommonValues.V;
+import static com.github.technus.tectech.util.CommonValues.V;
import static net.minecraft.util.StatCollector.translateToLocal;
public class GT_MetaTileEntity_WetTransformer extends GT_MetaTileEntity_TT_Transformer {
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 ebeb266c64..b40a9126b7 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,6 +1,6 @@
package com.github.technus.tectech.thing.metaTileEntity.single.gui;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_DebugPollutor;
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/gui/GT_GUIContainer_BuckConverter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_BuckConverter.java
index 946006c8fa..6b6b778d40 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_BuckConverter.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_BuckConverter.java
@@ -1,11 +1,11 @@
package com.github.technus.tectech.thing.metaTileEntity.single.gui;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.InventoryPlayer;
-import static com.github.technus.tectech.CommonValues.VN;
+import static com.github.technus.tectech.util.CommonValues.VN;
import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
public class GT_GUIContainer_BuckConverter extends GT_GUIContainerMetaTile_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 eb2c2e4112..bde5b90048 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,6 +1,6 @@
package com.github.technus.tectech.thing.metaTileEntity.single.gui;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_DataReader;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.gui.GT_Slot_Holo;
@@ -115,8 +115,8 @@ public class GT_GUIContainer_DataReader extends GT_GUIContainerMetaTile_Machine
private void renderDataBG(ItemStack thing, int mouseX, int mouseY, int x, int y, byte mTier) {
if (thing != null) {
- ArrayList<GT_MetaTileEntity_DataReader.IDataRender> renders = GT_MetaTileEntity_DataReader.getRenders(new Util.ItemStack_NoNBT(thing));
- for (GT_MetaTileEntity_DataReader.IDataRender render : renders) {
+ for (GT_MetaTileEntity_DataReader.IDataRender render :
+ GT_MetaTileEntity_DataReader.getRenders(new Util.ItemStack_NoNBT(thing))) {
if (render.canRender(thing, mTier)) {
if (!GT_Utility.areStacksEqual(stack, thing, false)) {
render.initRender(thing);
@@ -133,8 +133,8 @@ public class GT_GUIContainer_DataReader extends GT_GUIContainerMetaTile_Machine
if(stack==null){
return false;
}
- ArrayList<GT_MetaTileEntity_DataReader.IDataRender> renders = GT_MetaTileEntity_DataReader.getRenders(new Util.ItemStack_NoNBT(stack));
- for (GT_MetaTileEntity_DataReader.IDataRender render : renders) {
+ for (GT_MetaTileEntity_DataReader.IDataRender render :
+ GT_MetaTileEntity_DataReader.getRenders(new Util.ItemStack_NoNBT(stack))) {
if (render.canRender(stack, mTier)) {
render.renderForeground(stack, mouseX, mouseY, this, fontRendererObj);
return true;
@@ -147,8 +147,8 @@ public class GT_GUIContainer_DataReader extends GT_GUIContainerMetaTile_Machine
if(stack==null){
return false;
}
- ArrayList<GT_MetaTileEntity_DataReader.IDataRender> renders = GT_MetaTileEntity_DataReader.getRenders(new Util.ItemStack_NoNBT(stack));
- for (GT_MetaTileEntity_DataReader.IDataRender render : renders) {
+ for (GT_MetaTileEntity_DataReader.IDataRender render :
+ GT_MetaTileEntity_DataReader.getRenders(new Util.ItemStack_NoNBT(stack))) {
if (render.canRender(stack, mTier)) {
render.renderTooltips(stack, mouseX, mouseY, this);
return true;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPowerGenerator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPowerGenerator.java
index ad3839e80a..ee6e952040 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPowerGenerator.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPowerGenerator.java
@@ -1,11 +1,11 @@
package com.github.technus.tectech.thing.metaTileEntity.single.gui;
-import com.github.technus.tectech.Util;
+import com.github.technus.tectech.util.Util;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.InventoryPlayer;
-import static com.github.technus.tectech.CommonValues.VN;
+import static com.github.technus.tectech.util.CommonValues.VN;
import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
public class GT_GUIContainer_DebugPowerGenerator extends GT_GUIContainerMetaTile_Machine {
diff --git a/src/main/java/com/github/technus/tectech/CommonValues.java b/src/main/java/com/github/technus/tectech/util/CommonValues.java
index 9564643fbe..f5d5ce6900 100644
--- a/src/main/java/com/github/technus/tectech/CommonValues.java
+++ b/src/main/java/com/github/technus/tectech/util/CommonValues.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech;
+package com.github.technus.tectech.util;
import net.minecraft.util.EnumChatFormatting;
diff --git a/src/main/java/com/github/technus/tectech/Converter.java b/src/main/java/com/github/technus/tectech/util/Converter.java
index 5d1f5c802e..799d98a4d6 100644
--- a/src/main/java/com/github/technus/tectech/Converter.java
+++ b/src/main/java/com/github/technus/tectech/util/Converter.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech;
+package com.github.technus.tectech.util;
import java.io.*;
diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/util/Util.java
index 5bd3ff59a9..cd055528b1 100644
--- a/src/main/java/com/github/technus/tectech/Util.java
+++ b/src/main/java/com/github/technus/tectech/util/Util.java
@@ -1,7 +1,8 @@
-package com.github.technus.tectech;
+package com.github.technus.tectech.util;
+import com.github.technus.tectech.TecTech;
+import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
import com.github.technus.tectech.thing.casing.TT_Container_Casings;
-import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
@@ -31,6 +32,7 @@ import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.storage.IPlayerFileData;
import net.minecraft.world.storage.SaveHandler;
+import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.StringUtils;
@@ -164,295 +166,6 @@ public final class Util {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
- //region junk
- /*
- //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller
- //This only checks for REGULAR BLOCKS!
- public static boolean StructureChecker(String[][] structure,//0-9 casing, +- air no air, A... ignore 'A'-CHAR-1 blocks
- Block[] blockType,//use numbers 0-9 for casing types
- byte[] blockMeta,//use numbers 0-9 for casing types
- int horizontalOffset, int verticalOffset, int depthOffset,
- IGregTechTileEntity aBaseMetaTileEntity,
- boolean forceCheck) {
- World world = aBaseMetaTileEntity.getWorld();
- if (world.isRemote) {
- return false;
- }
- //TE Rotation
- byte facing = aBaseMetaTileEntity.getFrontFacing();
-
- int x, y, z, a, b, c, pointer;
- int
- baseX=aBaseMetaTileEntity.getXCoord(),
- baseZ=aBaseMetaTileEntity.getZCoord(),
- baseY=aBaseMetaTileEntity.getYCoord();
- //a,b,c - relative to block face!
- //x,y,z - relative to block position on map!
- //yPos - absolute height of checked block
-
- //perform your duties
- c = -depthOffset;
- for (String[] _structure : structure) {//front to back
- b = verticalOffset;
- for (String __structure : _structure) {//top to bottom
- a = -horizontalOffset;
- for (char block : __structure.toCharArray()) {//left to right
- if (block < ' ') {//Control chars allow skipping
- b -= block;
- break;
- } if (block > '@')//characters allow to skip check a-1 skip, b-2 skips etc.
- {
- a += block - '@';
- } else if (block < '+')//used to mark THINGS
- {
- a++;
- } else if (block=='.') {
- a++;
- } else {
- //get x y z from rotation
- switch (facing) {//translation
- case 4:
- x = baseX + c;
- z = baseZ + a;
- y = baseY + b;
- break;
- case 3:
- x = baseX + a;
- z = baseZ - c;
- y = baseY + b;
- break;
- case 5:
- x = baseX - c;
- z = baseZ - a;
- y = baseY + b;
- break;
- case 2:
- x = baseX - a;
- z = baseZ + c;
- y = baseY + b;
- break;
- //Things get odd if the block faces up or down...
- case 1:
- x = baseX + a;
- z = baseZ + b;
- y = baseY - c;
- break;//similar to 3
- case 0:
- x = baseX - a;
- z = baseZ - b;
- y = baseY + c;
- break;//similar to 2
- default:
- return false;
- }
-
- //that must be here since in some cases other axis (b,c) controls y
- if (y < 0 || y >= 256) {
- return false;
- }
-
- //Check block
- if (world.blockExists(x, y, z)) {//this actually checks if the chunk is loaded at this pos
- switch (block) {
- case '-'://must be air
- if (world.getBlock(x, y, z).getMaterial() != Material.air) {
- return false;
- }
- break;
- case '+'://must not be air
- if (world.getBlock(x, y, z).getMaterial() == Material.air) {
- return false;
- }
- break;
- default: //check for block (countable)
- pointer = block - '0';
- //countable air -> net.minecraft.block.BlockAir
- if (world.getBlock(x, y, z) != blockType[pointer]) {
- if (DEBUG_MODE) {
- TecTech.LOGGER.info("Struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName());
- }
- return false;
- }
- if (world.getBlockMetadata(x, y, z) != blockMeta[pointer]) {
- if (DEBUG_MODE) {
- TecTech.LOGGER.info("Struct-meta-id-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlockMetadata(x, y, z) + ' ' + blockMeta[pointer]);
- }
- return false;
- }
- }
- } else if (forceCheck) {
- return false;
- }
- a++;//block in horizontal layer
- }
- }
- b--;//horizontal layer
- }
- c++;//depth
- }
- return true;
- }
-
- //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller
- //This only checks for REGULAR BLOCKS!
- public static boolean StructureCheckerAdvanced(
- String[][] structure,//0-9 casing, +- air no air, A... ignore 'A'-CHAR-1 blocks
- Block[] blockType,//use numbers 0-9 for casing types
- byte[] blockMeta,//use numbers 0-9 for casing types
- Method adder,
- String[] addingMethods,
- short[] casingTextures,
- Block[] blockTypeFallback,//use numbers 0-9 for casing types
- byte[] blockMetaFallback,//use numbers 0-9 for casing types
- int horizontalOffset, int verticalOffset, int depthOffset,
- IGregTechTileEntity aBaseMetaTileEntity,
- boolean forceCheck) {
- World world = aBaseMetaTileEntity.getWorld();
- if (world.isRemote) {
- return false;
- }
- //TE Rotation
- byte facing = aBaseMetaTileEntity.getFrontFacing();
-
- IGregTechTileEntity igt;
- IMetaTileEntity imt = aBaseMetaTileEntity.getMetaTileEntity();
-
- int x, y, z, a, b, c, pointer;
- int baseX=aBaseMetaTileEntity.getXCoord(),
- baseZ=aBaseMetaTileEntity.getZCoord(),
- baseY=aBaseMetaTileEntity.getYCoord();
- //a,b,c - relative to block face!
- //x,y,z - relative to block position on map!
- //yPos - absolute height of checked block
-
- //perform your duties
- c = -depthOffset;
- for (String[] _structure : structure) {//front to back
- b = verticalOffset;
- for (String __structure : _structure) {//top to bottom
- a = -horizontalOffset;
- for (char block : __structure.toCharArray()) {//left to right
- if (block < ' ') {//Control chars allow skipping
- b -= block;
- break;
- } else if (block > '@') //characters allow to skip check A-1 skip, B-2 skips etc.
- {
- a += block - '@';
- }//else if (block < '+')//used to mark THINGS
- // a++;
- else if (block=='.') {
- a++;
- } else {
- //get x y z from rotation
- switch (facing) {//translation
- case 4:
- x = baseX + c;
- z = baseZ + a;
- y = baseY + b;
- break;
- case 3:
- x = baseX + a;
- z = baseZ - c;
- y = baseY + b;
- break;
- case 5:
- x = baseX - c;
- z = baseZ - a;
- y = baseY + b;
- break;
- case 2:
- x = baseX - a;
- z = baseZ + c;
- y = baseY + b;
- break;
- //Things get odd if the block faces up or down...
- case 1:
- x = baseX + a;
- z = baseZ + b;
- y = baseY - c;
- break;//similar to 3
- case 0:
- x = baseX - a;
- z = baseZ - b;
- y = baseY + c;
- break;//similar to 2
- default:
- return false;
- }
-
- //that must be here since in some cases other axis (b,c) controls y
- if (y < 0 || y >= 256) {
- return false;
- }
-
- //Check block
- if (world.blockExists(x, y, z)) {//this actually checks if the chunk is loaded at this pos
- switch (block) {
- case '-'://must be air
- if (world.getBlock(x, y, z).getMaterial() != Material.air) {
- return false;
- }
- break;
- case '+'://must not be air
- if (world.getBlock(x, y, z).getMaterial() == Material.air) {
- return false;
- }
- break;
- default://check for block (countable)
- if ((pointer = block - '0') >= 0) {
- //countable air -> net.minecraft.block.BlockAir
- if (world.getBlock(x, y, z) != blockType[pointer]) {
- if (DEBUG_MODE) {
- TecTech.LOGGER.info("Struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName());
- }
- return false;
- }
- if (world.getBlockMetadata(x, y, z) != blockMeta[pointer]) {
- if (DEBUG_MODE) {
- TecTech.LOGGER.info("Struct-meta-id-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlockMetadata(x, y, z) + ' ' + blockMeta[pointer]);
- }
- return false;
- }
- } else if ((pointer = block - ' ') >= 0) {
- igt = aBaseMetaTileEntity.getIGregTechTileEntity(x, y, z);
- try {
- if (igt == null || !(boolean) adder.invoke(imt, addingMethods[pointer], igt, casingTextures[pointer])) {
- if (world.getBlock(x, y, z) != blockTypeFallback[pointer]) {
- if (DEBUG_MODE) {
- TecTech.LOGGER.info("Fallback-struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName()));
- }
- return false;
- }
- if (world.getBlockMetadata(x, y, z) != blockMetaFallback[pointer]) {
- if (DEBUG_MODE) {
- TecTech.LOGGER.info("Fallback-Struct-meta-id-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlockMetadata(x, y, z) + ' ' + blockMetaFallback[pointer]);
- }
- return false;
- }
- }
- } catch (InvocationTargetException | IllegalAccessException e) {
- if (DEBUG_MODE) {
- e.printStackTrace();
- }
- return false;
- }
- }
- }
- } else if (forceCheck) {
- return false;
- }
- a++;//block in horizontal layer
- }
- }
- b--;//horizontal layer
- }
- c++;//depth
- }
- return true;
- }
- */
- //endregion
-
//Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller
//This only checks for REGULAR BLOCKS!
public static boolean StructureCheckerExtreme(
@@ -465,19 +178,23 @@ public final class Util {
byte[] blockMetaFallback,//use numbers 0-9 for casing types
int horizontalOffset, int verticalOffset, int depthOffset,
IGregTechTileEntity aBaseMetaTileEntity,
- IFrontRotation frontRotation,
+ ExtendedFacing extendedFacing,
boolean forceCheck) {
World world = aBaseMetaTileEntity.getWorld();
if (world.isRemote) {
return false;
}
//TE Rotation
- int facingAndRotation = aBaseMetaTileEntity.getFrontFacing() + (frontRotation == null ? 0 : (frontRotation.getFrontRotation() << 3));
+ if(extendedFacing==null){
+ extendedFacing=ExtendedFacing.of(ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()));
+ }
IGregTechTileEntity igt;
IMetaTileEntity imt = aBaseMetaTileEntity.getMetaTileEntity();
- int x, y, z, a, b, c, pointer;
+ int xyz[]=new int[3];
+ int abc[]=new int[3];
+ int pointer;
int baseX = aBaseMetaTileEntity.getXCoord(),
baseZ = aBaseMetaTileEntity.getZCoord(),
baseY = aBaseMetaTileEntity.getYCoord();
@@ -486,202 +203,74 @@ public final class Util {
//yPos - absolute height of checked block
//perform your duties
- c = -depthOffset;
+ abc[2] = -depthOffset;
for (String[] _structure : structure) {//front to back
- b = verticalOffset;
+ abc[1] = verticalOffset;
for (String __structure : _structure) {//top to bottom
- a = -horizontalOffset;
+ abc[0] = -horizontalOffset;
for (char block : __structure.toCharArray()) {//left to right
if (block < ' ') {//Control chars allow skipping
- b -= block;
+ abc[1] -= block;
break;
} else if (block > '@') {//characters allow to skip check A-1 skip, B-2 skips etc.
- a += block - '@';
+ abc[0] += block - '@';
}//else if (block < '+')//used to mark THINGS
// a++;
else if (block == '.') {
- a++;
+ abc[0]++;
} else {
//get x y z from rotation
- switch (facingAndRotation) {//translation
- case 4:
- x = baseX + c;
- z = baseZ + a;
- y = baseY + b;
- break;
- case 12:
- x = baseX + c;
- y = baseY - a;
- z = baseZ + b;
- break;
- case 20:
- x = baseX + c;
- z = baseZ - a;
- y = baseY - b;
- break;
- case 28:
- x = baseX + c;
- y = baseY + a;
- z = baseZ - b;
- break;
-
- case 3:
- x = baseX + a;
- z = baseZ - c;
- y = baseY + b;
- break;
- case 11:
- y = baseY - a;
- z = baseZ - c;
- x = baseX + b;
- break;
- case 19:
- x = baseX - a;
- z = baseZ - c;
- y = baseY - b;
- break;
- case 27:
- y = baseY + a;
- z = baseZ - c;
- x = baseX - b;
- break;
-
- case 5:
- x = baseX - c;
- z = baseZ - a;
- y = baseY + b;
- break;
- case 13:
- x = baseX - c;
- y = baseY - a;
- z = baseZ - b;
- break;
- case 21:
- x = baseX - c;
- z = baseZ + a;
- y = baseY - b;
- break;
- case 29:
- x = baseX - c;
- y = baseY + a;
- z = baseZ + b;
- break;
-
- case 2:
- x = baseX - a;
- z = baseZ + c;
- y = baseY + b;
- break;
- case 10:
- y = baseY - a;
- z = baseZ + c;
- x = baseX - b;
- break;
- case 18:
- x = baseX + a;
- z = baseZ + c;
- y = baseY - b;
- break;
- case 26:
- y = baseY + a;
- z = baseZ + c;
- x = baseX + b;
- break;
- //Things get odd if the block faces up or down...
- case 1:
- x = baseX + a;
- z = baseZ - b;
- y = baseY - c;
- break;//similar to 3
- case 9:
- z = baseZ + a;
- x = baseX + b;
- y = baseY - c;
- break;//similar to 3
- case 17:
- x = baseX - a;
- z = baseZ + b;
- y = baseY - c;
- break;//similar to 3
- case 25:
- z = baseZ - a;
- x = baseX - b;
- y = baseY - c;
- break;//similar to 3
-
- case 0:
- x = baseX - a;
- z = baseZ - b;
- y = baseY + c;
- break;//similar to 2
- case 8:
- z = baseZ + a;
- x = baseX - b;
- y = baseY + c;
- break;
- case 16:
- x = baseX + a;
- z = baseZ + b;
- y = baseY + c;
- break;
- case 24:
- z = baseZ - a;
- x = baseX + b;
- y = baseY + c;
- break;
- default:
- if (DEBUG_MODE) {
- TecTech.LOGGER.info("facing = " + facingAndRotation);
- }
- return false;
- }
+ extendedFacing.getWorldOffset(abc,xyz);
+ xyz[0]+=baseX;
+ xyz[1]+=baseY;
+ xyz[2]+=baseZ;
//that must be here since in some cases other axis (b,c) controls y
- if (y < 0 || y >= 256) {
+ if (xyz[1] < 0 || xyz[1] >= 256) {
return false;
}
//Check block
- if (world.blockExists(x, y, z)) {//this actually checks if the chunk is loaded at this pos
+ if (world.blockExists(xyz[0], xyz[1], xyz[2])) {//this actually checks if the chunk is loaded at this pos
switch (block) {
case '-'://must be air
- if (world.getBlock(x, y, z).getMaterial() != Material.air) {
+ if (world.getBlock(xyz[0], xyz[1], xyz[2]).getMaterial() != Material.air) {
return false;
}
break;
case '+'://must not be air
- if (world.getBlock(x, y, z).getMaterial() == Material.air) {
+ if (world.getBlock(xyz[0], xyz[1], xyz[2]).getMaterial() == Material.air) {
return false;
}
break;
default://check for block (countable)
if ((pointer = block - '0') >= 0) {
//countable air -> net.minecraft.block.BlockAir
- if (world.getBlock(x, y, z) != blockType[pointer]) {
+ if (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockType[pointer]) {
if (DEBUG_MODE) {
- TecTech.LOGGER.info("Struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName());
+ TecTech.LOGGER.info("Struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlock(xyz[0], xyz[1], xyz[2]).getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName());
}
return false;
}
- if (world.getBlockMetadata(x, y, z) != blockMeta[pointer]) {
+ if (world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != blockMeta[pointer]) {
if (DEBUG_MODE) {
- TecTech.LOGGER.info("Struct-meta-id-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlockMetadata(x, y, z) + ' ' + blockMeta[pointer]);
+ TecTech.LOGGER.info("Struct-meta-id-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) + ' ' + blockMeta[pointer]);
}
return false;
}
} else //noinspection ConstantConditions
if ((pointer = block - ' ') >= 0) {
- igt = aBaseMetaTileEntity.getIGregTechTileEntity(x, y, z);
+ igt = aBaseMetaTileEntity.getIGregTechTileEntity(xyz[0], xyz[1], xyz[2]);
if (igt == null || !addingMethods[pointer].apply(igt, casingTextures[pointer])) {
- if (world.getBlock(x, y, z) != blockTypeFallback[pointer]) {
+ if (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockTypeFallback[pointer]) {
if (DEBUG_MODE) {
- TecTech.LOGGER.info("Fallback-struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName()));
+ TecTech.LOGGER.info("Fallback-struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlock(xyz[0], xyz[1], xyz[2]).getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName()));
}
return false;
}
- if (world.getBlockMetadata(x, y, z) != blockMetaFallback[pointer]) {
+ if (world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != blockMetaFallback[pointer]) {
if (DEBUG_MODE) {
- TecTech.LOGGER.info("Fallback-Struct-meta-id-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlockMetadata(x, y, z) + ' ' + blockMetaFallback[pointer]);
+ TecTech.LOGGER.info("Fallback-Struct-meta-id-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) + ' ' + blockMetaFallback[pointer]);
}
return false;
}
@@ -691,12 +280,12 @@ public final class Util {
} else if (forceCheck) {
return false;
}
- a++;//block in horizontal layer
+ abc[0]++;//block in horizontal layer
}
}
- b--;//horizontal layer
+ abc[1]--;//horizontal layer
}
- c++;//depth
+ abc[2]++;//depth
}
return true;
}
@@ -717,11 +306,11 @@ public final class Util {
Block[] blockType,//use numbers 0-9 for casing types
byte[] blockMeta,//use numbers 0-9 for casing types
int horizontalOffset, int verticalOffset, int depthOffset,
- IGregTechTileEntity aBaseMetaTileEntity, IFrontRotation frontRotation, boolean hintsOnly) {
+ IGregTechTileEntity aBaseMetaTileEntity, ExtendedFacing extendedFacing, boolean hintsOnly) {
byte facing = aBaseMetaTileEntity.getFrontFacing();
return StructureBuilderExtreme(structure, blockType, blockMeta,
horizontalOffset, verticalOffset, depthOffset,
- aBaseMetaTileEntity.getWorld().getTileEntity(aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()), frontRotation,
+ aBaseMetaTileEntity.getWorld().getTileEntity(aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()), extendedFacing,
facing, hintsOnly);
}
@@ -737,7 +326,7 @@ public final class Util {
Block[] blockType,//use numbers 0-9 for casing types
byte[] blockMeta,//use numbers 0-9 for casing types
int horizontalOffset, int verticalOffset, int depthOffset,
- TileEntity tileEntity, IFrontRotation frontRotation, int facing, boolean hintsOnly) {
+ TileEntity tileEntity, ExtendedFacing extendedFacing, int simpleFacing, boolean hintsOnly) {
if (!tileEntity.hasWorldObj()) {
return false;
}
@@ -748,214 +337,89 @@ public final class Util {
//TE Rotation
- int x, y, z, a, b, c, pointer;
+
+ int xyz[]=new int[3];
+ int abc[]=new int[3];
+ int pointer;
int
baseX = tileEntity.xCoord,
baseZ = tileEntity.zCoord,
baseY = tileEntity.yCoord;
//a,b,c - relative to block face!
//x,y,z - relative to block position on map!
- if (frontRotation != null) {
- facing += frontRotation.getFrontRotation() << 3;
+ if (extendedFacing == null) {
+ extendedFacing=ExtendedFacing.of(ForgeDirection.getOrientation(simpleFacing));
}
//perform your duties
- c = -depthOffset;
+ abc[2] = -depthOffset;
for (String[] _structure : structure) {//front to back
- b = verticalOffset;
+ abc[1] = verticalOffset;
for (String __structure : _structure) {//top to bottom
- a = -horizontalOffset;
+ abc[0] = -horizontalOffset;
for (char block : __structure.toCharArray()) {//left to right
if (block < ' ') {//Control chars allow skipping
- b -= block;
+ abc[1] -= block;
break;
}
if (block > '@')//characters allow to skip check a-1 skip, b-2 skips etc.
{
- a += block - '@';
+ abc[0] += block - '@';
}//else if (block < '+')//used to mark THINGS
// a++;
else if (block == '.')// this TE
{
- a++;
+ abc[0]++;
} else {
//get x y z from rotation
- switch (facing) {
- case 4:
- x = baseX + c;
- z = baseZ + a;
- y = baseY + b;
- break;
- case 12:
- x = baseX + c;
- y = baseY - a;
- z = baseZ + b;
- break;
- case 20:
- x = baseX + c;
- z = baseZ - a;
- y = baseY - b;
- break;
- case 28:
- x = baseX + c;
- y = baseY + a;
- z = baseZ - b;
- break;
-
- case 3:
- x = baseX + a;
- z = baseZ - c;
- y = baseY + b;
- break;
- case 11:
- y = baseY - a;
- z = baseZ - c;
- x = baseX + b;
- break;
- case 19:
- x = baseX - a;
- z = baseZ - c;
- y = baseY - b;
- break;
- case 27:
- y = baseY + a;
- z = baseZ - c;
- x = baseX - b;
- break;
-
- case 5:
- x = baseX - c;
- z = baseZ - a;
- y = baseY + b;
- break;
- case 13:
- x = baseX - c;
- y = baseY - a;
- z = baseZ - b;
- break;
- case 21:
- x = baseX - c;
- z = baseZ + a;
- y = baseY - b;
- break;
- case 29:
- x = baseX - c;
- y = baseY + a;
- z = baseZ + b;
- break;
-
- case 2:
- x = baseX - a;
- z = baseZ + c;
- y = baseY + b;
- break;
- case 10:
- y = baseY - a;
- z = baseZ + c;
- x = baseX - b;
- break;
- case 18:
- x = baseX + a;
- z = baseZ + c;
- y = baseY - b;
- break;
- case 26:
- y = baseY + a;
- z = baseZ + c;
- x = baseX + b;
- break;
- //Things get odd if the block faces up or down...
- case 1:
- x = baseX + a;
- z = baseZ - b;
- y = baseY - c;
- break;//similar to 3
- case 9:
- z = baseZ + a;
- x = baseX + b;
- y = baseY - c;
- break;//similar to 3
- case 17:
- x = baseX - a;
- z = baseZ + b;
- y = baseY - c;
- break;//similar to 3
- case 25:
- z = baseZ - a;
- x = baseX - b;
- y = baseY - c;
- break;//similar to 3
-
- case 0:
- x = baseX - a;
- z = baseZ - b;
- y = baseY + c;
- break;//similar to 2
- case 8:
- z = baseZ + a;
- x = baseX - b;
- y = baseY + c;
- break;
- case 16:
- x = baseX + a;
- z = baseZ + b;
- y = baseY + c;
- break;
- case 24:
- z = baseZ - a;
- x = baseX + b;
- y = baseY + c;
- break;
- default:
- if (DEBUG_MODE) {
- TecTech.LOGGER.info("facing = " + facing);
- }
- return false;
- }
+ extendedFacing.getWorldOffset(abc,xyz);
+ xyz[0]+=baseX;
+ xyz[1]+=baseY;
+ xyz[2]+=baseZ;
//that must be here since in some cases other axis (b,c) controls y
- if (y < 0 || y >= 256) {
+ if (xyz[1] < 0 || xyz[1] >= 256) {
return false;
}
//Check block
- if (world.blockExists(x, y, z)) {//this actually checks if the chunk is loaded
+ if (world.blockExists(xyz[0], xyz[1], xyz[2])) {//this actually checks if the chunk is loaded
if (hintsOnly) {
switch (block) {
case '-'://must be air
- TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, 13);
+ TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], TT_Container_Casings.sHintCasingsTT, 13);
break;
case '+'://must not be air
- TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, 14);
+ TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], TT_Container_Casings.sHintCasingsTT, 14);
break;
default: //check for block
if ((pointer = block - '0') >= 0) {
- if (world.getBlock(x, y, z) != blockType[pointer] || world.getBlockMetadata(x, y, z) != blockMeta[pointer]) {
- TecTech.proxy.hint_particle(world, x, y, z, blockType[pointer], blockMeta[pointer]);
+ if (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockType[pointer] || world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != blockMeta[pointer]) {
+ TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], blockType[pointer], blockMeta[pointer]);
}
} else if ((pointer = block - ' ') >= 0) {
if (pointer >= 0 && pointer < 12) {
- TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, pointer);
+ TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], TT_Container_Casings.sHintCasingsTT, pointer);
} else {
- TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, 12);
+ TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], TT_Container_Casings.sHintCasingsTT, 12);
}
} else {
- TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, 15);
+ TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], TT_Container_Casings.sHintCasingsTT, 15);
}
}
} else {
switch (block) {
case '-'://must be air
- world.setBlock(x, y, z, Blocks.air, 0, 2);
+ world.setBlock(xyz[0], xyz[1], xyz[2], Blocks.air, 0, 2);
break;
case '+'://must not be air
- world.setBlock(x, y, z, TT_Container_Casings.sBlockCasingsTT, 14, 2);
+ world.setBlock(xyz[0], xyz[1], xyz[2], TT_Container_Casings.sBlockCasingsTT, 14, 2);
break;
default: //check for block
if ((pointer = block - '0') >= 0) {
- world.setBlock(x, y, z, blockType[pointer], blockMeta[pointer], 2);
+ world.setBlock(xyz[0], xyz[1], xyz[2], blockType[pointer], blockMeta[pointer], 2);
} else if (block - ' ' < 0) {
- world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 15, 2);
+ world.setBlock(xyz[0], xyz[1], xyz[2], TT_Container_Casings.sHintCasingsTT, 15, 2);
} //else {
//switch(pointer){
// case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11:
@@ -966,12 +430,12 @@ public final class Util {
}
}
}
- a++;//block in horizontal layer
+ abc[0]++;//block in horizontal layer
}
}
- b--;//horizontal layer
+ abc[1]--;//horizontal layer
}
- c++;//depth
+ abc[2]++;//depth
}
return true;
}
diff --git a/src/main/java/com/github/technus/tectech/util/Vec3Impl.java b/src/main/java/com/github/technus/tectech/util/Vec3Impl.java
new file mode 100644
index 0000000000..84e6497560
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/util/Vec3Impl.java
@@ -0,0 +1,146 @@
+package com.github.technus.tectech.util;
+
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.dispenser.IPosition;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class Vec3Impl implements Comparable<Vec3Impl> {
+ public static final Vec3Impl NULL_VECTOR = new Vec3Impl(0, 0, 0);
+ private final int val0;
+ private final int val1;
+ private final int val2;
+
+ public Vec3Impl(int in0, int in1, int in2) {
+ this.val0 = in0;
+ this.val1 = in1;
+ this.val2 = in2;
+ }
+
+ public Vec3Impl(IGregTechTileEntity baseMetaTileEntity) {
+ this(baseMetaTileEntity.getXCoord(),baseMetaTileEntity.getYCoord(),baseMetaTileEntity.getZCoord());
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ } else if (o instanceof Vec3Impl) {
+ Vec3Impl vec3i = (Vec3Impl)o;
+ return val0 == vec3i.val0 && val1 == vec3i.val1 && val2 == vec3i.val2;
+ }
+ return false;
+ }
+
+ public int hashCode() {
+ return (val1 + val2 * 31) * 31 + val0;
+ }
+
+ public int compareTo(Vec3Impl o) {
+ return val1 == o.val1 ? val2 == o.val2 ? val0 - o.val0 : val2 - o.val2 : val1 - o.val1;
+ }
+
+ /**
+ * Gets the coordinate.
+ */
+ public int get(int index) {
+ switch (index){
+ case 0: return val0;
+ case 1: return val1;
+ case 2: return val2;
+ default: return 0;
+ }
+ }
+
+ /**
+ * Gets the X coordinate.
+ */
+ public int get0() {
+ return this.val0;
+ }
+
+ /**
+ * Gets the Y coordinate.
+ */
+ public int get1() {
+ return this.val1;
+ }
+
+ /**
+ * Gets the Z coordinate.
+ */
+ public int get2() {
+ return this.val2;
+ }
+
+ public Vec3Impl offset(ForgeDirection facing, int n) {
+ return n == 0 ? this : new Vec3Impl(val0 + facing.offsetX * n, val1 + facing.offsetY * n, val2 + facing.offsetZ * n);
+ }
+
+ public Vec3Impl add(IGregTechTileEntity tileEntity) {
+ return new Vec3Impl(val0 + tileEntity.getXCoord(), val1 + tileEntity.getYCoord(), val2 + tileEntity.getZCoord());
+ }
+
+ public Vec3Impl sub(IGregTechTileEntity tileEntity) {
+ return new Vec3Impl(val0 - tileEntity.getXCoord(), val1 - tileEntity.getYCoord(), val2 - tileEntity.getZCoord());
+ }
+
+ public Vec3Impl add(Vec3Impl pos) {
+ return new Vec3Impl(val0 + pos.val0, val1 + pos.val1, val2 + pos.val2);
+ }
+
+ public Vec3Impl sub(Vec3Impl pos) {
+ return new Vec3Impl(val0 - pos.val0, val1 - pos.val1, val2 - pos.val2);
+ }
+
+ public Vec3Impl add(int pos0,int pos1,int pos2) {
+ return new Vec3Impl(val0 + pos0, val1 + pos1, val2 + pos2);
+ }
+
+ public Vec3Impl sub(int pos0,int pos1,int pos2) {
+ return new Vec3Impl(val0 - pos0, val1 - pos1, val2 - pos2);
+ }
+
+ public Vec3Impl crossProduct(Vec3Impl vec) {
+ return new Vec3Impl(val1 * vec.val2 - val2 * vec.val1, val2 * vec.val0 - val0 * vec.val2,
+ val0 * vec.val1 - val1 * vec.val0);
+ }
+
+ public boolean withinDistance(Vec3Impl to, double distance) {
+ return this.distanceSq(to.val0, to.val1, to.val2, false) < distance * distance;
+ }
+
+ public boolean withinDistance(IPosition to, double distance) {
+ return this.distanceSq(to.getX(), to.getY(), to.getZ(), true) < distance * distance;
+ }
+
+ public double distanceSq(Vec3Impl to) {
+ return this.distanceSq(to.val0, to.val1, to.val2, true);
+ }
+
+ public double distanceSq(IPosition to, boolean useCenter) {
+ return this.distanceSq(to.getX(), to.getY(), to.getZ(), useCenter);
+ }
+
+ public double distanceSq(double x, double y, double z, boolean useCenter) {
+ double d0 = useCenter ? 0.5D : 0.0D;
+ double d1 = (double)val0 + d0 - x;
+ double d2 = (double)val1 + d0 - y;
+ double d3 = (double)val2 + d0 - z;
+ return d1 * d1 + d2 * d2 + d3 * d3;
+ }
+
+ public int manhattanDistance(Vec3Impl to) {
+ float f = (float)Math.abs(to.val0 - val0);
+ float f1 = (float)Math.abs(to.val1 - val1);
+ float f2 = (float)Math.abs(to.val2 - val2);
+ return (int)(f + f1 + f2);
+ }
+
+ @Override
+ public String toString() {
+ return "Vec3[" + val0 + ", " + val1 + ", " + val2 + "]";
+ }
+
+ public Vec3Impl abs() {
+ return new Vec3Impl(Math.abs(val0),Math.abs(val1),Math.abs(val2));
+ }
+} \ No newline at end of file
diff --git a/src/main/java/com/github/technus/tectech/XSTR.java b/src/main/java/com/github/technus/tectech/util/XSTR.java
index f5ff457fe1..31c9b6a65c 100644
--- a/src/main/java/com/github/technus/tectech/XSTR.java
+++ b/src/main/java/com/github/technus/tectech/util/XSTR.java
@@ -1,4 +1,4 @@
-package com.github.technus.tectech;
+package com.github.technus.tectech.util;
/*
A subclass of java.util.random that implements the Xorshift random number
generator