aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.gradle.kts6
-rw-r--r--gradle.properties4
-rw-r--r--real.gradle.properties8
-rw-r--r--src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java208
-rw-r--r--src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java81
-rw-r--r--src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java65
-rw-r--r--src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java133
-rw-r--r--src/main/java/com/github/technus/tectech/entity/fx/WeightlessParticleFX.java44
-rw-r--r--src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java57
-rw-r--r--src/main/java/com/github/technus/tectech/loader/MainLoader.java36
-rw-r--r--src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java6
-rw-r--r--src/main/java/com/github/technus/tectech/loader/recipe/BaseRecipeLoader.java40
-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.java140
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentUtility.java45
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignment.java187
-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/IAlignmentProvider.java5
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/alignment/IntegerAxisSwap.java84
-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.java358
-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/constructable/ConstructableUtility.java114
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/constructable/IConstructable.java16
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/constructable/IMultiblockInfoContainer.java39
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/dataTransport/DataPacket.java2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/dataTransport/QuantumDataPacket.java2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/spark/ThaumSpark.java3
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/IBlockPosConsumer.java7
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/ICustomBlockSetting.java17
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java167
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java43
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementChain.java41
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementCheckOnly.java16
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementDeferred.java7
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementNoPlacement.java11
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java28
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java262
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java288
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java1395
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/adders/IBlockAdder.java14
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/adders/IHatchAdder.java14
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/adders/ITileAdder.java12
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/tesla/ITeslaConnectableSimple.java2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/tesla/TeslaCoverConnection.java7
-rw-r--r--src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java12
-rw-r--r--src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java12
-rw-r--r--src/main/java/com/github/technus/tectech/proxy/ClientProxy.java42
-rw-r--r--src/main/java/com/github/technus/tectech/proxy/CommonProxy.java6
-rw-r--r--src/main/java/com/github/technus/tectech/thing/CustomItemList.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java106
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java49
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java48
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/PowerPassUpgradeCover.java10
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java5
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java3
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java12
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java71
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java183
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java88
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java60
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java46
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java94
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java55
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java46
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java68
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java53
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java102
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java114
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java53
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java50
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java9
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java64
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java49
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java38
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java93
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java87
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedExtendedFacingTexture.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_collider/GT_MetaTileEntity_EM_collider.java82
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java56
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java8
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java34
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java6
-rw-r--r--src/main/java/com/github/technus/tectech/util/Vec3Impl.java146
-rw-r--r--src/main/resources/assets/tectech/lang/en_US.lang8
-rw-r--r--src/main/resources/assets/tectech/lang/zh_CN.lang10
90 files changed, 1247 insertions, 5251 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index bf388c9e64..29a4f8b6de 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -6,8 +6,9 @@ import java.io.*
buildscript {
repositories {
mavenCentral()
- maven("http://files.minecraftforge.net/maven")
+ maven("https://gregtech.overminddl1.com/")
maven("https://jitpack.io")
+
}
dependencies {
classpath("com.github.GTNH2:ForgeGradle:FG_1.2-SNAPSHOT"){
@@ -170,6 +171,7 @@ dependencies {
//Hard Dependencies
compile("net.industrial-craft:industrialcraft-2:$ic2Version:dev")
+ compile("com.github.GTNewHorizons:StructureLib:1.0.9:deobf")
compile("com.github.GTNewHorizons:GT5-Unofficial:$gt5uVersion:dev"){
exclude("net.industrial-craft", "industrialcraft-2")
isChanging = true
@@ -287,4 +289,4 @@ tasks.register("signJar") {
// extra["signing.password"] = propSign.getProperty("keyStorePass")
// }
// dependsOn(":reobf")
-//} \ No newline at end of file
+//}
diff --git a/gradle.properties b/gradle.properties
index 83dd93b556..7fc32d532c 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,4 +1,6 @@
#Dummy File, replaced in Jenkins
+systemProp.org.gradle.internal.http.connectionTimeout=120000
+systemProp.org.gradle.internal.http.socketTimeout=120000
keyStoreAlias=w
keyStore=w
-keyStorePass=w \ No newline at end of file
+keyStorePass=w
diff --git a/real.gradle.properties b/real.gradle.properties
index ed62eeefe5..5cf1722acc 100644
--- a/real.gradle.properties
+++ b/real.gradle.properties
@@ -1,4 +1,6 @@
-projectVersion=4.10.4
+systemProp.org.gradle.internal.http.connectionTimeout=120000
+systemProp.org.gradle.internal.http.socketTimeout=120000
+projectVersion=4.10.8
ic2Version=2.2.828-experimental
gt5uVersion=experimental-SNAPSHOT
yamcoreVersion=1.7.10-0.5.79
@@ -13,6 +15,6 @@ wailaVersion=1.5.10_1.7.10
galacticraftVersion=1.7-3.0.12.504
galacticGregVersion=master-SNAPSHOT
buildcraftVersion=7.1.23
-forestryVersion=4.2.16.64
+forestryVersion=4.4.0.0
enderioVersion=1.7.10-2.3.0.429_beta
-enderCoreVersion=1.7.10-0.2.0.39_beta \ No newline at end of file
+enderCoreVersion=1.7.10-0.2.0.39_beta
diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java
index 4ebe84147f..dbb67a28c2 100644
--- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java
+++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java
@@ -260,9 +260,9 @@ public class DreamCraftRecipeLoader {
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UIV_UEV").get(1), CustomItemList.eM_dynamoMulti4_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 4)}, Materials.Electrum.getMolten(4608), CustomItemList.eM_dynamoMulti16_UEV.get(1), 200, 2000000);
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UIV_UEV").get(1), CustomItemList.eM_dynamoMulti16_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 6)}, Materials.Tungsten.getMolten(4608), CustomItemList.eM_dynamoMulti64_UEV.get(1), 400, 2000000);
- GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hatch_Dynamo_UIV").get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 2)}, Materials.Silver.getMolten(8000), CustomItemList.eM_dynamoMulti4_UIV.get(1), 100, 8000000);
- GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UMV_UIV").get(1), CustomItemList.eM_dynamoMulti4_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 4)}, Materials.Electrum.getMolten(8000), CustomItemList.eM_dynamoMulti16_UIV.get(1), 200, 8000000);
- GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UMV_UIV").get(1), CustomItemList.eM_dynamoMulti16_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 6)}, Materials.Tungsten.getMolten(8000), CustomItemList.eM_dynamoMulti64_UIV.get(1), 400, 8000000);
+ GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hatch_Dynamo_UIV").get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 2)}, Materials.Silver.getMolten(9216), CustomItemList.eM_dynamoMulti4_UIV.get(1), 100, 8000000);
+ GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UMV_UIV").get(1), CustomItemList.eM_dynamoMulti4_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 4)}, Materials.Electrum.getMolten(9216), CustomItemList.eM_dynamoMulti16_UIV.get(1), 200, 8000000);
+ GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UMV_UIV").get(1), CustomItemList.eM_dynamoMulti16_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 6)}, Materials.Tungsten.getMolten(9216), CustomItemList.eM_dynamoMulti64_UIV.get(1), 400, 8000000);
//Energy Hatches IV-UIV
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Tungsten, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 2)}, Materials.Silver.getMolten(144), CustomItemList.eM_energyMulti4_IV.get(1), 100, 1920);
@@ -289,9 +289,9 @@ public class DreamCraftRecipeLoader {
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UIV_UEV").get(1), CustomItemList.eM_energyMulti4_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 4)}, Materials.Electrum.getMolten(4608), CustomItemList.eM_energyMulti16_UEV.get(1), 200, 2000000);
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UIV_UEV").get(1), CustomItemList.eM_energyMulti16_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 6)}, Materials.Tungsten.getMolten(4608), CustomItemList.eM_energyMulti64_UEV.get(1), 400, 2000000);
- GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hatch_Energy_UIV").get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 2)}, Materials.Silver.getMolten(8000), CustomItemList.eM_energyMulti4_UIV.get(1), 100, 8000000);
- GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UMV_UIV").get(1), CustomItemList.eM_energyMulti4_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 4)}, Materials.Electrum.getMolten(8000), CustomItemList.eM_energyMulti16_UIV.get(1), 200, 8000000);
- GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UMV_UIV").get(1), CustomItemList.eM_energyMulti16_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 6)}, Materials.Tungsten.getMolten(8000), CustomItemList.eM_energyMulti64_UIV.get(1), 400, 8000000);
+ GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hatch_Energy_UIV").get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 2)}, Materials.Silver.getMolten(9216), CustomItemList.eM_energyMulti4_UIV.get(1), 100, 8000000);
+ GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UMV_UIV").get(1), CustomItemList.eM_energyMulti4_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 4)}, Materials.Electrum.getMolten(9216), CustomItemList.eM_energyMulti16_UIV.get(1), 200, 8000000);
+ GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UMV_UIV").get(1), CustomItemList.eM_energyMulti16_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 6)}, Materials.Tungsten.getMolten(9216), CustomItemList.eM_energyMulti64_UIV.get(1), 400, 8000000);
//Buck Converter IV-UIV
if (Loader.isModLoaded("bartworks")) {
@@ -445,7 +445,7 @@ public class DreamCraftRecipeLoader {
ItemList.Emitter_ZPM.get(8),
ItemList.Robot_Arm_ZPM.get(1),
ItemList.Electric_Motor_ZPM.get(2),
- new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 1)},
+ new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), 1},
new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Naquadah, 2)},
new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Naquadah, 16)},
CustomItemList.DATApipe.get(2),
@@ -576,7 +576,7 @@ public class DreamCraftRecipeLoader {
//Quantum Computer
GT_Values.RA.addAssemblylineRecipe(ItemList.Tool_DataOrb.get(1), 20000, new Object[]{
CustomItemList.Machine_Multi_Switch.get(1),
- new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 2)},
+ new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), 2},
ItemList.Tool_DataOrb.get(1),
ItemList.Cover_Screen.get(1),
new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorUV, 8)},
@@ -592,7 +592,7 @@ public class DreamCraftRecipeLoader {
GT_Values.RA.addAssemblylineRecipe(getItemContainer("ScannerZPM").get(1), 80000, new Object[]{
CustomItemList.Machine_Multi_Switch.get(1),
ItemList.Sensor_ZPM.get(8),
- new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 4)},
+ new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), 4},
ItemList.Field_Generator_ZPM.get(1),
ItemList.Electric_Motor_ZPM.get(2),
new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Naquadah, 4)},
@@ -711,7 +711,7 @@ public class DreamCraftRecipeLoader {
new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000),
}, CustomItemList.Machine_Multi_Infuser.get(1), 8000, 2000000);
- //Motor UV-UHV
+ //Motor UHV-UEV
TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Motor_UV.get(1L),
24000, 32, 100000, 4, new ItemStack[]{
GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.SamariumMagnetic, 4L),
@@ -750,14 +750,14 @@ public class DreamCraftRecipeLoader {
Materials.SolderingAlloy.getMolten(5184),
Materials.Lubricant.getFluid(8000)}, ItemList.Electric_Motor_UEV.get(1L), 2000, 800000);
- //Pumps UV-UHV
+ //Pumps UHV-UEV
TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Pump_UV.get(1L),
- 24000, 32, 100000, 4, new ItemStack[]{
+ 24000, 32, 100000, 4, new Object[]{
ItemList.Electric_Motor_UHV.get(1L),
GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Neutronium, 2L),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.CosmicNeutronium, 4L),
GT_OreDictUnificator.get(OrePrefixes.screw, Materials.CosmicNeutronium, 16L),
- GT_OreDictUnificator.get(OrePrefixes.ring, Materials.AnySyntheticRubber, 32L),
+ new Object[]{OrePrefixes.ring.get(Materials.AnySyntheticRubber), 32L},
GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.CosmicNeutronium, 4L),
GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 2L)}, new FluidStack[]{
Materials.Naquadria.getMolten(2592),
@@ -765,44 +765,45 @@ public class DreamCraftRecipeLoader {
Materials.Lubricant.getFluid(4000)}, ItemList.Electric_Pump_UHV.get(1), 1000, 200000);
TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Pump_UHV.get(1L),
- 48000, 64, 200000, 8, new ItemStack[]{
+ 48000, 64, 200000, 8, new Object[]{
ItemList.Electric_Motor_UEV.get(1L),
GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.NetherStar, 2L),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Infinity, 4L),
GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Infinity, 16L),
- GT_OreDictUnificator.get(OrePrefixes.ring, (Materials.AnySyntheticRubber), 64L),
+ new Object[]{OrePrefixes.ring.get(Materials.AnySyntheticRubber), 64L},
GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.Infinity, 4L),
GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 2L)}, new FluidStack[]{
Materials.Quantium.getMolten(2592),
Materials.SolderingAlloy.getMolten(5184),
Materials.Lubricant.getFluid(8000)}, ItemList.Electric_Pump_UEV.get(1), 2000, 800000);
- //Conveyor Belt UV-UHV
+ //Conveyor Belt UHV-UEV
TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Conveyor_Module_UV.get(1L),
- 24000, 32, 100000, 4, new ItemStack[]{
+ 24000, 32, 100000, 4, new Object[]{
ItemList.Electric_Motor_UHV.get(2L),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.CosmicNeutronium, 2L),
GT_OreDictUnificator.get(OrePrefixes.ring, Materials.CosmicNeutronium, 8L),
GT_OreDictUnificator.get(OrePrefixes.round, Materials.CosmicNeutronium, 64L),
- GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 2L)}, new FluidStack[]{
+ GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 2L),
+ new Object[]{OrePrefixes.plate.get(Materials.AnySyntheticRubber), 40L}}, new FluidStack[]{
Materials.Naquadria.getMolten(2592),
Materials.SolderingAlloy.getMolten(2592),
- Materials.Lubricant.getFluid(4000),
- Materials.Silicone.getMolten(5760)}, ItemList.Conveyor_Module_UHV.get(1), 1000, 200000);
+ Materials.Lubricant.getFluid(4000)}, ItemList.Conveyor_Module_UHV.get(1), 1000, 200000);
TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Conveyor_Module_UHV.get(1L),
- 48000, 64, 200000, 8, new ItemStack[]{
+ 48000, 64, 200000, 8, new Object[]{
ItemList.Electric_Motor_UEV.get(2L),
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Infinity, 2L),
GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Infinity, 8L),
GT_OreDictUnificator.get(OrePrefixes.round, Materials.Infinity, 64L),
- GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 2L)}, new FluidStack[]{
+ GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 2L),
+ new Object[]{OrePrefixes.plate.get(Materials.AnySyntheticRubber), 64L},
+ new Object[]{OrePrefixes.plate.get(Materials.AnySyntheticRubber), 16L}}, new FluidStack[]{
Materials.Quantium.getMolten(2592),
Materials.SolderingAlloy.getMolten(5184),
- Materials.Lubricant.getFluid(8000),
- Materials.Silicone.getMolten(11520)}, ItemList.Conveyor_Module_UEV.get(1), 2000, 800000);
+ Materials.Lubricant.getFluid(8000)}, ItemList.Conveyor_Module_UEV.get(1), 2000, 800000);
- //Piston UV-UHV
+ //Piston UHV-UEV
TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Piston_UV.get(1L),
24000, 32, 100000, 4, new ItemStack[]{
ItemList.Electric_Motor_UHV.get(1L),
@@ -831,7 +832,7 @@ public class DreamCraftRecipeLoader {
Materials.SolderingAlloy.getMolten(5184),
Materials.Lubricant.getFluid(8000)}, ItemList.Electric_Piston_UEV.get(1), 2000, 800000);
- //Robot Arm UV-UHV
+ //Robot Arm UHV-UEV
TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Robot_Arm_UV.get(1L),
24000, 32, 100000, 4, new Object[]{
GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.CosmicNeutronium, 8L),
@@ -862,7 +863,7 @@ public class DreamCraftRecipeLoader {
Materials.SolderingAlloy.getMolten(9216),
Materials.Lubricant.getFluid(8000)}, ItemList.Robot_Arm_UEV.get(1L), 2000, 800000);
- //Emitter UV-UHV
+ //Emitter UHV-UEV
TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Emitter_UV.get(1L),
24000, 32, 100000, 4, new Object[]{
GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.CosmicNeutronium, 1L),
@@ -895,7 +896,7 @@ public class DreamCraftRecipeLoader {
Materials.SolderingAlloy.getMolten(9216)},
ItemList.Emitter_UEV.get(1L), 2000, 800000);
- //Sensor UV-UHV
+ //Sensor UHV-UEV
TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Sensor_UV.get(1L),
24000, 32, 100000, 4, new Object[]{
GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.CosmicNeutronium, 1L),
@@ -928,7 +929,7 @@ public class DreamCraftRecipeLoader {
Materials.SolderingAlloy.getMolten(9216)},
ItemList.Sensor_UEV.get(1L), 2000, 800000);
- //Fieldgen UV and UHV
+ //Fieldgen UHV and UEV
TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Field_Generator_UV.get(1),
48000, 64, 200000, 8, new Object[]{
GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.CosmicNeutronium, 1L),
@@ -971,7 +972,7 @@ public class DreamCraftRecipeLoader {
Materials.SolderingAlloy.getMolten(9216)},
ItemList.Field_Generator_UEV.get(1L), 4000, 800000);
- //UHV Energy Hatch
+ //UHV-UMV Energy Hatch & Dynamo
TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Energy_UV.get(1L),
24000, 16, 50000, 2, new Object[]{
ItemList.Hull_MAX.get(1L),
@@ -992,7 +993,7 @@ public class DreamCraftRecipeLoader {
new FluidStack(FluidRegistry.getFluid("ic2coolant"), 16000),
Materials.SolderingAlloy.getMolten(5760),
}, ItemList.Hatch_Energy_MAX.get(1L), 1000, 2000000);
-
+
TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Dynamo_UV.get(1L),
48000, 32, 100000, 4, new Object[]{
ItemList.Hull_MAX.get(1L),
@@ -1014,9 +1015,129 @@ public class DreamCraftRecipeLoader {
Materials.SolderingAlloy.getMolten(5760)},
ItemList.Hatch_Dynamo_MAX.get(1L), 1000, 2000000);
+ TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Energy_MAX.get(1L),
+ 48000, 32, 100000, 4, new Object[]{
+ getItemContainer("Hull_UEV").get(1L),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.SuperconductorUHV, 4L),
+ ItemList.Circuit_Chip_QPIC.get(4L),
+ new Object[]{OrePrefixes.circuit.get(Materials.Bio), 2L},
+ ItemList.UHV_Coil.get(4L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Electric_Pump_UEV.get(1L)},
+ new FluidStack[]{
+ new FluidStack(FluidRegistry.getFluid("ic2coolant"), 32000),
+ Materials.SolderingAlloy.getMolten(11520),
+ Materials.UUMatter.getFluid(8000L)},
+ getItemContainer("Hatch_Energy_UEV").get(1L), 1000, 8000000);
+
+ TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Dynamo_MAX.get(1L),
+ 96000, 64, 200000, 8, new Object[]{
+ getItemContainer("Hull_UEV").get(1L),
+ GT_OreDictUnificator.get(OrePrefixes.spring, Materials.Longasssuperconductornameforuhvwire, 16L),
+ ItemList.Circuit_Chip_QPIC.get(4L),
+ new Object[]{OrePrefixes.circuit.get(Materials.Bio), 2L},
+ ItemList.UHV_Coil.get(4L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Electric_Pump_UEV.get(1L)},
+ new FluidStack[]{
+ new FluidStack(FluidRegistry.getFluid("ic2coolant"), 32000),
+ Materials.SolderingAlloy.getMolten(11520),
+ Materials.UUMatter.getFluid(8000L)},
+ getItemContainer("Hatch_Dynamo_UEV").get(1L), 1000, 8000000);
+
+ TT_recipeAdder.addResearchableAssemblylineRecipe(getItemContainer("Hatch_Energy_UEV").get(1L),
+ 96000, 64, 200000, 8, new Object[]{
+ getItemContainer("Hull_UIV").get(1L),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.SuperconductorUHV, 8L),
+ ItemList.Circuit_Chip_QPIC.get(4L),
+ getItemContainer("NanoCircuit").get(2),
+ ItemList.UHV_Coil.get(8L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Electric_Pump_UEV.get(2L)},
+ new FluidStack[]{
+ new FluidStack(FluidRegistry.getFluid("ic2coolant"), 64000),
+ Materials.SolderingAlloy.getMolten(23040),
+ Materials.UUMatter.getFluid(16000L)},
+ getItemContainer("Hatch_Energy_UIV").get(1L), 1000, 16000000);
+
+ TT_recipeAdder.addResearchableAssemblylineRecipe(getItemContainer("Hatch_Dynamo_UEV").get(1L),
+ 192000, 128, 400000, 16, new Object[]{
+ getItemContainer("Hull_UIV").get(1L),
+ GT_OreDictUnificator.get(OrePrefixes.spring, Materials.Longasssuperconductornameforuhvwire, 32L),
+ ItemList.Circuit_Chip_QPIC.get(4L),
+ getItemContainer("NanoCircuit").get(2),
+ ItemList.UHV_Coil.get(8L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Electric_Pump_UEV.get(2L)},
+ new FluidStack[]{
+ new FluidStack(FluidRegistry.getFluid("ic2coolant"), 64000),
+ Materials.SolderingAlloy.getMolten(23040),
+ Materials.UUMatter.getFluid(16000L)},
+ getItemContainer("Hatch_Dynamo_UIV").get(1L), 1000, 16000000);
+
+ TT_recipeAdder.addResearchableAssemblylineRecipe(getItemContainer("Hatch_Energy_UIV").get(1L),
+ 192000, 128, 400000, 16, new Object[]{
+ getItemContainer("Hull_UMV").get(1L),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUHV, 16L),
+ ItemList.Circuit_Chip_QPIC.get(4L),
+ getItemContainer("PikoCircuit").get(2),
+ ItemList.UHV_Coil.get(16L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Electric_Pump_UEV.get(4L)},
+ new FluidStack[]{
+ new FluidStack(FluidRegistry.getFluid("ic2coolant"), 128000),
+ Materials.SolderingAlloy.getMolten(46080),
+ Materials.UUMatter.getFluid(32000L)},
+ getItemContainer("Hatch_Energy_UMV").get(1L), 1000, 32000000);
+
+ TT_recipeAdder.addResearchableAssemblylineRecipe(getItemContainer("Hatch_Dynamo_UIV").get(1L),
+ 384000, 256, 800000, 32, new Object[]{
+ getItemContainer("Hull_UMV").get(1L),
+ GT_OreDictUnificator.get(OrePrefixes.spring, Materials.Longasssuperconductornameforuhvwire, 64L),
+ ItemList.Circuit_Chip_QPIC.get(4L),
+ getItemContainer("PikoCircuit").get(2),
+ ItemList.UHV_Coil.get(16L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Reactor_Coolant_Sp_6.get(1L),
+ ItemList.Electric_Pump_UEV.get(4L)},
+ new FluidStack[]{
+ new FluidStack(FluidRegistry.getFluid("ic2coolant"), 128000),
+ Materials.SolderingAlloy.getMolten(46080),
+ Materials.UUMatter.getFluid(32000L)},
+ getItemContainer("Hatch_Dynamo_UMV").get(1L), 1000, 32000000);
+
//UHV Circuit
TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Circuit_Wetwaresupercomputer.get(1L),
- 24000, 64, 50000, 4, new ItemStack[]{
+ 24000, 64, 50000, 4, new Object[]{
GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tritanium, 2),
ItemList.Circuit_Wetwaresupercomputer.get(2L),
ItemList.ZPM_Coil.get(16L),
@@ -1026,7 +1147,7 @@ public class DreamCraftRecipeLoader {
ItemList.Circuit_Parts_DiodeASMD.get(16L),
ItemList.Circuit_Chip_Ram.get(48L),
GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorZPM, 64L),
- GT_OreDictUnificator.get(OrePrefixes.foil, (Materials.AnySyntheticRubber), 64L),
+ new Object[]{OrePrefixes.foil.get(Materials.AnySyntheticRubber), 64L},
}, new FluidStack[]{
Materials.SolderingAlloy.getMolten(2880L),
new FluidStack(FluidRegistry.getFluid("ic2coolant"), 10000),
@@ -1035,7 +1156,7 @@ public class DreamCraftRecipeLoader {
//Bio Chips
TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Circuit_Biowarecomputer.get(1L),
- 48000, 128, 500000, 8, new ItemStack[]{
+ 48000, 128, 500000, 8, new Object[]{
ItemList.Circuit_Board_Bio_Ultra.get(2L),
ItemList.Circuit_Biowarecomputer.get(2L),
ItemList.Circuit_Parts_TransistorASMD.get(16L),
@@ -1045,7 +1166,7 @@ public class DreamCraftRecipeLoader {
ItemList.Circuit_Chip_NOR.get(32L),
ItemList.Circuit_Chip_Ram.get(64L),
GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.NiobiumTitanium, 32L),
- GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 16L),
+ new Object[]{OrePrefixes.foil.get(Materials.AnySyntheticRubber), 64L},
}, new FluidStack[]{
Materials.SolderingAlloy.getMolten(1440L),
Materials.BioMediumSterilized.getFluid(1440L),
@@ -1054,7 +1175,7 @@ public class DreamCraftRecipeLoader {
ItemList.Circuit_Biowaresupercomputer.get(1L), 4000, 500000);
TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Circuit_Biowaresupercomputer.get(1L),
- 96000, 256, 1000000, 16, new ItemStack[]{
+ 96000, 256, 1000000, 16, new Object[]{
GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tritanium, 4L),
ItemList.Circuit_Biowaresupercomputer.get(2L),
ItemList.UV_Coil.get(16L),
@@ -1064,7 +1185,7 @@ public class DreamCraftRecipeLoader {
ItemList.Circuit_Parts_DiodeASMD.get(24L),
ItemList.Circuit_Chip_Ram.get(64L),
GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorUHV, 64),
- GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 64),
+ new Object[]{OrePrefixes.foil.get(Materials.AnySyntheticRubber), 64L},
GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Polybenzimidazole, 64)
}, new FluidStack[]{
Materials.SolderingAlloy.getMolten(2880L),
@@ -1072,9 +1193,9 @@ public class DreamCraftRecipeLoader {
new FluidStack(FluidRegistry.getFluid("ic2coolant"), 20000)
}, ItemList.Circuit_Biomainframe.get(1L), 6000, 2000000);
- //GTNH Circuits
+ //GTNH UIV, UMV, UXV Circuits
TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Circuit_Biomainframe.get(1L),
- 192000, 512, 2000000, 32, new ItemStack[]{
+ 192000, 512, 2000000, 32, new Object[]{
GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tritanium, 8),
ItemList.Circuit_Biomainframe.get(2L),
ItemList.Circuit_Parts_CapacitorASMD.get(32L),
@@ -1085,7 +1206,7 @@ public class DreamCraftRecipeLoader {
ItemList.Circuit_Chip_NPIC.get(64L),
GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Draconium, 64),
GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorUHV, 64),
- GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 64),
+ new Object[]{OrePrefixes.foil.get(Materials.AnySyntheticRubber), 64L},
GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Polybenzimidazole, 64)
}, new FluidStack[]{
Materials.SolderingAlloy.getMolten(3744L),
@@ -1133,7 +1254,7 @@ public class DreamCraftRecipeLoader {
Materials.Osmium.getMolten(2304L)
}, getItemContainer("QuantumCircuit").get(1L), 20000, 32000000);
- //Stargate Stuff
+ //Stargate Recipes
if (Loader.isModLoaded("eternalsingularity") && Loader.isModLoaded("SGCraft")) {
TT_recipeAdder.addResearchableAssemblylineRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Infinity, 1L),
192000, 512, 2000000, 32, new ItemStack[]{
@@ -1712,6 +1833,11 @@ public class DreamCraftRecipeLoader {
ItemList.Emitter_LuV.get(1),
ItemList.Electric_Pump_LuV.get(1),
}, Materials.Chrome.getMolten(288), CustomItemList.enderLinkFluidCover.getWithDamage(1, 0), 320, 30720);
+ //Power Pass Upgrade Cover
+ GT_Values.RA.addAssemblerRecipe(new ItemStack[]{
+ CustomItemList.Machine_Multi_Transformer.get(1),
+ GT_Utility.getIntegratedCircuit(1)
+ }, null, CustomItemList.powerPassUpgradeCover.getWithDamage(1, 0), 320, 30720);
//endregion
//region recycling
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 267af79784..5b7fd9e218 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,21 +1,19 @@
package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi;
-import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMInstanceStack;
-import com.github.technus.tectech.mechanics.structure.Structure;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
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.multi.GT_MetaTileEntity_EM_quantizer;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.util.CommonValues;
+import com.gtnewhorizon.structurelib.StructureLibAPI;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -26,13 +24,14 @@ import net.minecraftforge.common.util.ForgeDirection;
import thaumcraft.api.aspects.Aspect;
import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat.essentiaContainerCompat;
-import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.EM_COUNT_PER_MATERIAL_AMOUNT;
import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.EM_COUNT_PER_ITEM_DIMINISHED;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
+import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.EM_COUNT_PER_MATERIAL_AMOUNT;
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.util.CommonValues.V;
-import static gregtech.api.enums.GT_Values.E;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -41,31 +40,34 @@ import static net.minecraft.util.StatCollector.translateToLocal;
public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {
//region structure
//use multi A energy inputs, use less power the longer it runs
- private static final String[][] shape = new String[][]{
- {" ", " . ", " ",},
- {"0A0", E, "0A0",},
- {"121", "232", "121",},
- {"\"\"\"", "\"2\"", "\"\"\"",},
- {"202", "0!0", "202",},
- };
- private static final Block[] blockType = new Block[]{QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{0, 0, 4, 8};
- private static final IHatchAdder<GT_MetaTileEntity_EM_essentiaDequantizer>[] addingMethods = adders(
- GT_MetaTileEntity_EM_essentiaDequantizer::addClassicToMachineList,
- GT_MetaTileEntity_EM_essentiaDequantizer::addElementalInputToMachineList,
- GT_MetaTileEntity_EM_essentiaDequantizer::addElementalMufflerToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4, 4};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.emtoessentia.hint.0"),//1 - Classic Hatches or High Power Casing
translateToLocal("gt.blockmachines.multimachine.em.emtoessentia.hint.1"),//2 - Elemental Input Hatch
- translateToLocal("gt.blockmachines.multimachine.em.emtoessentia.hint.2"),//3 - Elemental Overflow Hatches or Elemental Casing
+ translateToLocal("gt.blockmachines.multimachine.em.emtoessentia.hint.2"),//3 - Elemental Overflow Hatches or Molecular Casing
translateToLocal("gt.blockmachines.multimachine.em.emtoessentia.hint.3"),//General - Some sort of Essentia Storage
};
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_essentiaDequantizer> STRUCTURE_DEFINITION =
+ IStructureDefinition.<GT_MetaTileEntity_EM_essentiaDequantizer>builder()
+ .addShape("main", new String[][]{
+ {"DDD", "D~D", "DDD"},
+ {"E E", " ", "E E"},
+ {"ABA", "BCB", "ABA"},
+ {"FFF", "FBF", "FFF"},
+ {"BEB", "EGE", "BEB"}
+ })
+ .addElement('A', ofBlock(sBlockCasingsTT, 0))
+ .addElement('B', ofBlock(sBlockCasingsTT, 4))
+ .addElement('C', ofBlock(sBlockCasingsTT, 8))
+ .addElement('D', ofHatchAdderOptional(GT_MetaTileEntity_EM_essentiaDequantizer::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0))
+ .addElement('E', ofBlock(QuantumGlassBlock.INSTANCE, 0))
+ .addElement('F', ofHatchAdderOptional(GT_MetaTileEntity_EM_essentiaDequantizer::addElementalMufflerToMachineList, textureOffset + 4, 3, sBlockCasingsTT, 4))
+ .addElement('G', ofHatchAdder(GT_MetaTileEntity_EM_essentiaDequantizer::addElementalInputToMachineList, textureOffset + 4, 2))
+ .build();
+
private String outputEssentiaName;
+
//endregion
public GT_MetaTileEntity_EM_essentiaDequantizer(int aID, String aName, String aNameRegional) {
@@ -83,7 +85,7 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return essentiaContainerCompat.check(this) && structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0);
+ return essentiaContainerCompat.check(this) && structureCheck_EM("main", 1, 1, 0);
}
@Override
@@ -130,12 +132,12 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_
TileEntity container = essentiaContainerCompat.getContainer(this);
if (container == null) {
stopMachine();
- }else{
- if(!essentiaContainerCompat.putInContainer(container,outputEssentiaName)){
+ } else {
+ if (!essentiaContainerCompat.putInContainer(container, outputEssentiaName)) {
stopMachine();
}
}
- outputEssentiaName=null;
+ outputEssentiaName = null;
}
@Override
@@ -156,11 +158,11 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
IGregTechTileEntity iGregTechTileEntity = getBaseMetaTileEntity();
- int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX;
- int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY;
- int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ;
+ int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX;
+ int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY;
+ int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ;
if (hintsOnly) {
- TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(),
+ StructureLibAPI.hintParticle(iGregTechTileEntity.getWorld(),
iGregTechTileEntity.getXCoord() + xDir,
iGregTechTileEntity.getYCoord() + yDir,
iGregTechTileEntity.getZCoord() + zDir,
@@ -170,7 +172,12 @@ 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);
}
}
- Structure.builder(shape, blockType, blockMeta, 1, 1, 0, iGregTechTileEntity, getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 1, 1, 0, hintsOnly, stackSize);
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_EM_essentiaDequantizer> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@Override
@@ -181,12 +188,12 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_
@Override
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
- aNBT.setString("eOutputEssentia",outputEssentiaName);
+ aNBT.setString("eOutputEssentia", outputEssentiaName);
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
- outputEssentiaName=aNBT.getString("eOutputEssentia");
+ outputEssentiaName = aNBT.getString("eOutputEssentia");
}
-} \ No newline at end of file
+}
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 a381a37f89..80a8e92d3d 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,23 +1,22 @@
package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi;
-import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.EMPrimalAspectDefinition;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
+import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition;
import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMInstanceStack;
-import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition;
-import com.github.technus.tectech.mechanics.structure.Structure;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
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.multi.GT_MetaTileEntity_EM_quantizer;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.util.CommonValues;
+import com.gtnewhorizon.structurelib.StructureLibAPI;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
@@ -26,11 +25,12 @@ import net.minecraftforge.common.util.ForgeDirection;
import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat.essentiaContainerCompat;
import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.EM_COUNT_PER_MATERIAL_AMOUNT;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
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.util.CommonValues.V;
-import static gregtech.api.enums.GT_Values.E;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -39,29 +39,31 @@ import static net.minecraft.util.StatCollector.translateToLocal;
public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {
//region structure
//use multi A energy inputs, use less power the longer it runs
- private static final String[][] shape = new String[][]{
- {" ", " . ", " ",},
- {"0A0", E, "0A0",},
- {"121", "232", "121",},
- {"\"\"\"", "\"1\"", "\"\"\"",},
- {"010", "1!1", "010",},
- };
- private static final Block[] blockType = new Block[]{QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{0, 4, 0, 8};
- private static final IHatchAdder<GT_MetaTileEntity_EM_essentiaQuantizer>[] addingMethods = adders(
- GT_MetaTileEntity_EM_essentiaQuantizer::addClassicToMachineList,
- GT_MetaTileEntity_EM_essentiaQuantizer::addElementalOutputToMachineList,
- GT_MetaTileEntity_EM_essentiaQuantizer::addElementalMufflerToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4, 4};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.essentiatoem.hint.0"),//1 - Classic Hatches or High Power Casing
translateToLocal("gt.blockmachines.multimachine.em.essentiatoem.hint.1"),//2 - Elemental Output Hatch
- translateToLocal("gt.blockmachines.multimachine.em.essentiatoem.hint.2"),//3 - Elemental Overflow Hatches or Elemental Casing
+ translateToLocal("gt.blockmachines.multimachine.em.essentiatoem.hint.2"),//3 - Elemental Overflow Hatches or Molecular Casing
translateToLocal("gt.blockmachines.multimachine.em.essentiatoem.hint.3"),//General - Some sort of Essentia Storage
};
+
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_essentiaQuantizer> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_EM_essentiaQuantizer>builder()
+ .addShape("main", new String[][]{
+ {"FFF", "F~F", "FFF"},
+ {"E E", " ", "E E"},
+ {"BAB", "ACA", "BAB"},
+ {"DDD", "DBD", "DDD"},
+ {"EBE", "BGB", "EBE"}
+ })
+ .addElement('A', ofBlock(sBlockCasingsTT, 0))
+ .addElement('B', ofBlock(sBlockCasingsTT, 4))
+ .addElement('C', ofBlock(sBlockCasingsTT, 8))
+ .addElement('D', ofHatchAdderOptional(GT_MetaTileEntity_EM_essentiaQuantizer::addElementalMufflerToMachineList, textureOffset + 4, 3, sBlockCasingsTT, 4))
+ .addElement('E', ofBlock(QuantumGlassBlock.INSTANCE, 0))
+ .addElement('F', ofHatchAdderOptional(GT_MetaTileEntity_EM_essentiaQuantizer::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0))
+ .addElement('G', ofHatchAdder(GT_MetaTileEntity_EM_essentiaQuantizer::addElementalOutputToMachineList, textureOffset + 4, 2))
+ .build();
//endregion
public GT_MetaTileEntity_EM_essentiaQuantizer(int aID, String aName, String aNameRegional) {
@@ -79,7 +81,7 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return essentiaContainerCompat.check(this) && structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0);
+ return essentiaContainerCompat.check(this) && structureCheck_EM("main", 1, 1, 0);
}
@Override
@@ -134,7 +136,7 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu
int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY;
int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ;
if (hintsOnly) {
- TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(),
+ StructureLibAPI.hintParticle(iGregTechTileEntity.getWorld(),
iGregTechTileEntity.getXCoord() + xDir,
iGregTechTileEntity.getYCoord() + yDir,
iGregTechTileEntity.getZCoord() + zDir,
@@ -144,11 +146,16 @@ 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);
}
}
- Structure.builder(shape, blockType, blockMeta, 1, 1, 0, iGregTechTileEntity, getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 1, 1, 0, hintsOnly, stackSize);
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_EM_essentiaQuantizer> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@Override
public String[] getStructureDescription(ItemStack stackSize) {
return description;
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java b/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java
deleted file mode 100644
index dd5cd59ac7..0000000000
--- a/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java
+++ /dev/null
@@ -1,133 +0,0 @@
-package com.github.technus.tectech.entity.fx;
-
-import com.github.technus.tectech.TecTech;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.enums.Dyes;
-import net.minecraft.block.Block;
-import net.minecraft.client.particle.EntityFX;
-import net.minecraft.client.renderer.Tessellator;
-import net.minecraft.init.Blocks;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.World;
-import org.lwjgl.opengl.GL11;
-
-@SideOnly(Side.CLIENT)
-public class BlockHint extends EntityFX {
- private IIcon[] icons = new IIcon[6];
- private short[] mRGBa = Dyes._NULL.mRGBa;
-
- public BlockHint(World world){
- this(world,0,0,0, Blocks.stone,0);
- }
-
- /**
- *
- * @param world
- * @param x
- * @param y
- * @param z
- * @param icons DOWN, UP, NORTH, SOUTH, WEST, EAST
- */
- public BlockHint(World world, int x, int y, int z, IIcon[] icons) {
- super(world, x + .25, y + .5, z + .25);
- particleGravity = 0;
- prevPosX = posX;
- prevPosY = posY;
- prevPosZ = posZ;
- noClip = true;
- particleMaxAge = 2000 + TecTech.RANDOM.nextInt(200);
- this.icons=icons;
- }
-
- public BlockHint(World world, int x, int y, int z, Block block, int meta) {
- super(world, x+.25, y+.5, z+.25);
- particleGravity = 0;
- prevPosX = posX;
- prevPosY = posY;
- prevPosZ = posZ;
- noClip = true;
- particleMaxAge = 2000 + TecTech.RANDOM.nextInt(200);
- for (int i = 0; i < 6; i++) {
- icons[i] = block.getIcon(i, meta);
- }
- }
-
- public BlockHint withColorTint(short[] coloure){
- this.mRGBa =coloure;
- return this;
- }
-
- @Override
- public void renderParticle(Tessellator tes, float subTickTime, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) {
- float size = .5f;
- float X = (float) (prevPosX + (posX - prevPosX) * (double) subTickTime - EntityFX.interpPosX);
- float Y = (float) (prevPosY + (posY - prevPosY) * (double) subTickTime - EntityFX.interpPosY) - size / 2;
- float Z = (float) (prevPosZ + (posZ - prevPosZ) * (double) subTickTime - EntityFX.interpPosZ);
- GL11.glDisable(GL11.GL_CULL_FACE);
- GL11.glDepthMask(false);
- tes.setColorRGBA((int) (mRGBa[0] * .9F), (int) (mRGBa[1] * .95F), (int) (mRGBa[2] * 1F), 192);
-
- //var8, var9 - X U
- //var 10, var 11 - Y V
- for(int i=0;i<6;i++){
- if(icons[i]==null) {
- continue;
- }
- double u=icons[i].getMinU();
- double U=icons[i].getMaxU();
- double v=icons[i].getMinV();
- double V=icons[i].getMaxV();
- switch (i){//{DOWN, UP, NORTH, SOUTH, WEST, EAST}
- case 0:
- tes.addVertexWithUV(X, Y, Z + size, u, V);
- tes.addVertexWithUV(X, Y, Z, u, v);
- tes.addVertexWithUV(X + size, Y, Z, U, v);
- tes.addVertexWithUV(X + size, Y, Z + size, U, V);
- break;
- case 1:
- tes.addVertexWithUV(X, Y + size, Z, u, v);
- tes.addVertexWithUV(X, Y + size, Z + size, u, V);
- tes.addVertexWithUV(X + size, Y + size, Z + size, U, V);
- tes.addVertexWithUV(X + size, Y + size, Z, U, v);
- break;
- case 2:
- tes.addVertexWithUV(X, Y, Z, U, V);
- tes.addVertexWithUV(X, Y + size, Z, U, v);
- tes.addVertexWithUV(X + size, Y + size, Z, u, v);
- tes.addVertexWithUV(X + size, Y, Z, u, V);
- break;
- case 3:
- tes.addVertexWithUV(X + size, Y, Z + size, U, V);
- tes.addVertexWithUV(X + size, Y + size, Z + size, U, v);
- tes.addVertexWithUV(X, Y + size, Z + size, u, v);
- tes.addVertexWithUV(X, Y, Z + size, u, V);
- break;
- case 4:
- tes.addVertexWithUV(X, Y, Z + size, U, V);
- tes.addVertexWithUV(X, Y + size, Z + size, U, v);
- tes.addVertexWithUV(X, Y + size, Z, u, v);
- tes.addVertexWithUV(X, Y, Z, u, V);
- break;
- case 5:
- tes.addVertexWithUV(X + size, Y, Z, U, V);
- tes.addVertexWithUV(X + size, Y + size, Z, U, v);
- tes.addVertexWithUV(X + size, Y + size, Z + size, u, v);
- tes.addVertexWithUV(X + size, Y, Z + size, u, V);
- break;
- }
- }
- GL11.glEnable(GL11.GL_CULL_FACE);
- GL11.glDepthMask(true);
- }
-
- @Override
- public int getFXLayer() {
- return 1;
- }
-
- @Override
- public boolean shouldRenderInPass(int pass) {
- return pass==2;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/entity/fx/WeightlessParticleFX.java b/src/main/java/com/github/technus/tectech/entity/fx/WeightlessParticleFX.java
deleted file mode 100644
index d1d2ed611c..0000000000
--- a/src/main/java/com/github/technus/tectech/entity/fx/WeightlessParticleFX.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.github.technus.tectech.entity.fx;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import net.minecraft.client.particle.EntityFX;
-import net.minecraft.world.World;
-
-@SideOnly(Side.CLIENT)
-public class WeightlessParticleFX extends EntityFX
-{
- public WeightlessParticleFX(World p_i1205_1_, double p_i1205_2_, double p_i1205_4_, double p_i1205_6_, double p_i1205_8_, double p_i1205_10_, double p_i1205_12_)
- {
- super(p_i1205_1_, p_i1205_2_, p_i1205_4_, p_i1205_6_, p_i1205_8_, p_i1205_10_, p_i1205_12_);
- this.motionX = p_i1205_8_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F);
- this.motionY = p_i1205_10_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F);
- this.motionZ = p_i1205_12_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F);
- this.particleRed = this.particleGreen = this.particleBlue = this.rand.nextFloat() * 0.3F + 0.7F;
- this.particleScale = this.rand.nextFloat() * this.rand.nextFloat() * 6.0F + 1.0F;
- this.particleMaxAge = (int)(16.0D / ((double)this.rand.nextFloat() * 0.8D + 0.2D)) + 2;
- this.noClip=true;
- }
-
- /**
- * Called to update the entity's position/logic.
- */
- public void onUpdate()
- {
- this.prevPosX = this.posX;
- this.prevPosY = this.posY;
- this.prevPosZ = this.posZ;
-
- if (this.particleAge++ >= this.particleMaxAge)
- {
- this.setDead();
- }
-
- this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge);
- //this.motionY += 0.004D;
- this.moveEntity(this.motionX, this.motionY, this.motionZ);
- this.motionX *= 0.8999999761581421D;
- this.motionY *= 0.8999999761581421D;
- this.motionZ *= 0.8999999761581421D;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java b/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java
deleted file mode 100644
index dc282ec0b6..0000000000
--- a/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package com.github.technus.tectech.loader;
-
-import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
-import com.github.technus.tectech.mechanics.constructable.IMultiblockInfoContainer;
-import com.github.technus.tectech.mechanics.structure.IStructureDefinition;
-import com.github.technus.tectech.mechanics.structure.StructureDefinition;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-
-import static com.github.technus.tectech.mechanics.constructable.IMultiblockInfoContainer.registerMetaClass;
-import static com.github.technus.tectech.mechanics.structure.StructureUtility.ofBlock;
-import static com.github.technus.tectech.mechanics.structure.StructureUtility.ofHint;
-import static gregtech.api.GregTech_API.sBlockCasings1;
-
-public class ConstructableLoader implements Runnable {
-
- @Override
- public void run() {
- registerMetaClass(GT_MetaTileEntity_ElectricBlastFurnace.class, new IMultiblockInfoContainer<GT_MetaTileEntity_ElectricBlastFurnace>() {
- //region Structure
- private final IStructureDefinition<GT_MetaTileEntity_ElectricBlastFurnace> definition=
- StructureDefinition.<GT_MetaTileEntity_ElectricBlastFurnace>builder()
- .addShapeOldApi("main",new String[][]{
- {"000","\"\"\"","\"\"\""," . ",},
- {"0!0","\"A\"","\"A\""," ",},
- {"000","\"\"\"","\"\"\""," ",},
- })
- .addElement('0', ofBlock(sBlockCasings1,11))
- .addElement('\"', ofHint(3))
- .addElement('!', ofHint(2))
- .addElement(' ', ofHint(1))
- .build();
- private final String[] desc=new String[]{
- EnumChatFormatting.AQUA+"Hint Details:",
- "1 - Classic Hatches or Heat Proof Casing",
- "2 - Muffler Hatch",
- "3 - Coil blocks"
- };
- //endregion
-
- @Override
- public void construct(ItemStack stackSize, boolean hintsOnly, GT_MetaTileEntity_ElectricBlastFurnace tileEntity, ExtendedFacing aSide) {
- IGregTechTileEntity base = tileEntity.getBaseMetaTileEntity();
- definition.buildOrHints(tileEntity, stackSize, "main", base.getWorld(),
- aSide, base.getXCoord(), base.getYCoord(),
- base.getZCoord(), 1, 3, 0, hintsOnly);
- }
-
- @Override
- public String[] getDescription(ItemStack stackSize) {
- return desc;
- }
- });
- }
-}
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 b9d737f98a..3eea6f7bc4 100644
--- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java
+++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java
@@ -7,7 +7,6 @@ import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.trans
import com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat;
import com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompatEnabled;
import com.github.technus.tectech.loader.gui.CreativeTabTecTech;
-import com.github.technus.tectech.loader.gui.CreativeTabEM;
import com.github.technus.tectech.loader.gui.ModGuiHandler;
import com.github.technus.tectech.loader.recipe.BaseRecipeLoader;
import com.github.technus.tectech.loader.thing.ComponentLoader;
@@ -41,12 +40,11 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
-import static com.github.technus.tectech.util.CommonValues.*;
import static com.github.technus.tectech.TecTech.*;
import static com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.transformations.AspectDefinitionCompat.aspectDefinitionCompat;
import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat.essentiaContainerCompat;
import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
-import static com.github.technus.tectech.TecTech.creativeTabTecTech;
+import static com.github.technus.tectech.util.CommonValues.*;
import static gregtech.api.enums.GT_Values.W;
public final class MainLoader {
@@ -65,21 +63,20 @@ public final class MainLoader {
public static void preLoad(){
creativeTabTecTech =new CreativeTabTecTech("TecTech");
- creativeTabEM =new CreativeTabEM("EM");
//set expanded texture arrays for tiers
try {
- Textures.run();
+ new Textures();
}catch (Throwable t){
LOGGER.error("Loading textures...",t);
}
}
- public static void load(EMDefinitionsRegistry registry) {
+ public static void load(EMDefinitionsRegistry definitionsRegistry) {
ProgressManager.ProgressBar progressBarLoad = ProgressManager.push("TecTech Loader", 9);
progressBarLoad.step("Elemental Things");
- new ElementalLoader().run(registry);
+ new ElementalLoader().run(definitionsRegistry);
LOGGER.info("Elemental Init Done");
progressBarLoad.step("Thaumcraft Compatibility");
@@ -124,8 +121,8 @@ public final class MainLoader {
ProgressManager.pop(progressBarLoad);
}
- public static void postLoad(EMDefinitionsRegistry registry, EMTransformationRegistry transformationInfo) {
- ProgressManager.ProgressBar progressBarPostLoad = ProgressManager.push("TecTech Post Loader", 6);
+ public static void postLoad(EMDefinitionsRegistry definitionsRegistry, EMTransformationRegistry transformationInfo) {
+ ProgressManager.ProgressBar progressBarPostLoad = ProgressManager.push("TecTech Post Loader", 4);
progressBarPostLoad.step("Dreamcraft Compatibility");
if(Loader.isModLoaded(Reference.DREAMCRAFT)){
@@ -142,16 +139,21 @@ public final class MainLoader {
}
progressBarPostLoad.step("Thaumcraft Compatibility");
- aspectDefinitionCompat = Loader.isModLoaded(Reference.THAUMCRAFT) ? new AspectDefinitionCompatEnabled() : new AspectDefinitionCompat();
- aspectDefinitionCompat.run(registry);
+ if (Loader.isModLoaded(Reference.THAUMCRAFT)) {
+ aspectDefinitionCompat = new AspectDefinitionCompatEnabled();
+ aspectDefinitionCompat.run(definitionsRegistry);
+ } else {
+ aspectDefinitionCompat = new AspectDefinitionCompat();
+ }
progressBarPostLoad.step("Recipes");
new BaseRecipeLoader().run(transformationInfo);
TecTech.LOGGER.info("Recipe Init Done");
- progressBarPostLoad.step("Register Extra Hazmat Suits");
- registerExtraHazmats();
- TecTech.LOGGER.info("Hazmat additions done");
+ //Hazmat moved to GT5U
+ //progressBarPostLoad.step("Register Extra Hazmat Suits");
+ //registerExtraHazmats();
+ //TecTech.LOGGER.info("Hazmat additions done");
if (!configTecTech.DISABLE_BLOCK_HARDNESS_NERF) {
progressBarPostLoad.step("Nerf blocks blast resistance");
@@ -162,14 +164,10 @@ public final class MainLoader {
TecTech.LOGGER.info("Blocks were not nerfed");
}
- progressBarPostLoad.step("Constructable stuff");
- new ConstructableLoader().run();
- TecTech.LOGGER.info("Constructable initialized");
-
ProgressManager.pop(progressBarPostLoad);
}
- private static void registerExtraHazmats() {
+ private static void registerExtraHazmats() { //Hazmat moved to GT5U
ItemStack EMT_iqC=GT_ModHandler.getModItem("EMT","itemArmorQuantumChestplate",1,W);
ItemStack GRAVI_gC=GT_ModHandler.getModItem("GraviSuite","graviChestPlate",1,W);
ItemStack GRAVI_anC=GT_ModHandler.getModItem("GraviSuite", "advNanoChestPlate", 1, W);
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 1edd924587..8401af51ca 100644
--- a/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java
+++ b/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java
@@ -3,10 +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.enderStorage.EnderLinkCoverMessage;
+import com.github.technus.tectech.mechanics.pipe.PipeActivityMessage;
import com.github.technus.tectech.mechanics.spark.RendererMessage;
-import com.github.technus.tectech.mechanics.alignment.AlignmentMessage;
import com.github.technus.tectech.thing.metaTileEntity.hatch.TextParametersMessage;
-import com.github.technus.tectech.mechanics.pipe.PipeActivityMessage;
import static com.github.technus.tectech.Reference.MODID;
@@ -24,9 +23,6 @@ public class NetworkDispatcher extends eu.usrv.yamcore.network.PacketDispatcher
registerMessage(PipeActivityMessage.ServerHandler.class, PipeActivityMessage.PipeActivityQuery.class);
registerMessage(PipeActivityMessage.ClientHandler.class, PipeActivityMessage.PipeActivityData.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/BaseRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/recipe/BaseRecipeLoader.java
index d91d0e5900..2d28c9aa50 100644
--- a/src/main/java/com/github/technus/tectech/loader/recipe/BaseRecipeLoader.java
+++ b/src/main/java/com/github/technus/tectech/loader/recipe/BaseRecipeLoader.java
@@ -9,9 +9,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.
import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.EMHadronDefinition;
import com.github.technus.tectech.thing.CustomItemList;
import com.github.technus.tectech.thing.casing.TT_Container_Casings;
-import com.github.technus.tectech.thing.item.ConstructableTriggerItem;
import com.github.technus.tectech.thing.item.EuMeterGT;
-import com.github.technus.tectech.thing.item.FrontRotationTriggerItem;
import cpw.mods.fml.common.Loader;
import gregtech.api.enums.Dyes;
import gregtech.api.enums.ItemList;
@@ -30,8 +28,8 @@ import static gregtech.api.enums.GT_Values.RA;
* Created by danie_000 on 16.11.2016.
*/
public class BaseRecipeLoader {
- public static Materials getOrDefault(String name,Materials def){
- Materials mat=Materials.get(name);
+ public static Materials getOrDefault(String name, Materials def) {
+ Materials mat = Materials.get(name);
return mat == Materials._NULL || mat == null ? def : mat;
}
@@ -46,25 +44,26 @@ public class BaseRecipeLoader {
// Recipes init - common goes here rest goes into methods below
// ===================================================================================================
- for(int i=0;i<=15;i++) {
+ for (int i = 0; i <= 15; i++) {
RA.addAssemblerRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(i), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cobalt, 1)}, Materials.Aluminium.getMolten(864), new ItemStack(TT_Container_Casings.sHintCasingsTT, 1, i), 32, 120);
}
//Scrench
- GT_ModHandler.addCraftingRecipe(new ItemStack(FrontRotationTriggerItem.INSTANCE,1),
- GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE,
- new Object[]{"fPR", " RP", "S h",
- 'P', OrePrefixes.plate.get(Materials.Cobalt),
- 'R', OrePrefixes.stick.get(Materials.Cobalt),
- 'S', OrePrefixes.stick.get(Materials.Wood),});
+// GT_ModHandler.addCraftingRecipe(new ItemStack(FrontRotationTriggerItem.INSTANCE,1),
+// GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE,
+// new Object[]{"fPR", " RP", "S h",
+// 'P', OrePrefixes.plate.get(Materials.Cobalt),
+// 'R', OrePrefixes.stick.get(Materials.Cobalt),
+// 'S', OrePrefixes.stick.get(Materials.Wood),});
//BLUEprint
- GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ConstructableTriggerItem.INSTANCE, 1),
- GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE,
- new Object[]{Dyes.dyeBlue, OrePrefixes.plate.get(Materials.Paper), Dyes.dyeBlue, Dyes.dyeWhite});
+// GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ConstructableTriggerItem.INSTANCE, 1),
+// GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE,
+// new Object[]{Dyes.dyeBlue, OrePrefixes.plate.get(Materials.Paper), Dyes.dyeBlue, Dyes.dyeWhite});
+
//GT EU reader
- GT_ModHandler.addCraftingRecipe(new ItemStack(EuMeterGT.INSTANCE,1),
+ GT_ModHandler.addCraftingRecipe(new ItemStack(EuMeterGT.INSTANCE, 1),
GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE,
new Object[]{"PGW", "SCW", "BRN",
'P', OrePrefixes.plateDouble.get(Materials.Steel),
@@ -79,7 +78,7 @@ public class BaseRecipeLoader {
//Owner detector
GT_ModHandler.addCraftingRecipe(CustomItemList.Machine_OwnerDetector.get(1),
GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE,
- new Object[]{"PPP","GEG","PPP",
+ new Object[]{"PPP", "GEG", "PPP",
'P', OrePrefixes.plate.get(Materials.IronMagnetic),
'G', OrePrefixes.plate.get(Materials.Glass),
'E', OrePrefixes.gem.get(Materials.EnderPearl)});
@@ -87,7 +86,7 @@ public class BaseRecipeLoader {
//Data reader
GT_ModHandler.addCraftingRecipe(CustomItemList.Machine_DataReader.get(1),
GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE,
- new Object[]{"BdB","GES","PwP",
+ new Object[]{"BdB", "GES", "PwP",
'B', OrePrefixes.screw.get(Materials.Iridium),
'P', OrePrefixes.plate.get(Materials.Iridium),
'G', ItemList.Cover_Screen,
@@ -95,16 +94,15 @@ public class BaseRecipeLoader {
'E', ItemList.Hull_IV});
//Data Bank
- RA.addAssemblylineRecipe(ItemList.Hatch_DataAccess_EV.get(1), 20000, new ItemStack[]{
+ RA.addAssemblylineRecipe(ItemList.Hatch_DataAccess_EV.get(1), 20000, new Object[]{
CustomItemList.Machine_Multi_Switch.get(1),
- GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2),
+ new Object[]{OrePrefixes.circuit.get(Materials.Master), 2},
ItemList.Tool_DataOrb.get(1),
ItemList.Cover_Screen.get(1),
}, new FluidStack[]{
new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000),
Materials.Hydrogen.getGas(1000),
}, CustomItemList.Machine_Multi_DataBank.get(1), 12000, 14000);
- //CustomItemList.Machine_Multi_DataBank
//Bucks
//RA.addAssemblerRecipe(CustomItemList.)
@@ -116,7 +114,7 @@ public class BaseRecipeLoader {
if (Loader.isModLoaded(Reference.DREAMCRAFT)) {
new DreamCraftRecipeLoader().run(transformationInfo);//init recipes for GTNH version
} else if (Loader.isModLoaded(Reference.SPARTAKCORE)) {
- new SpartakCoreRecipeLoader().run(transformationInfo);//init recipes for SpartakCore version
+ new SpartakCoreRecipeLoader().run(transformationInfo);//init recipes for SpartakCore version
} else {
new BloodyRecipeLoader().run(transformationInfo);//init recipes for NON-GTNH version
}
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 4adeeec315..d144d74618 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
@@ -33,8 +33,6 @@ public class ThingsLoader implements Runnable {
TecTech.LOGGER.info("Elemental Casing registered");
TT_Container_Casings.sBlockCasingsBA0 = new GT_Block_CasingsBA0();
TecTech.LOGGER.info("Nikolai's Casing registered");
- TT_Container_Casings.sHintCasingsTT = new GT_Block_HintTT();
- TecTech.LOGGER.info("Hint Blocks registered");
QuantumGlassBlock.run();
TecTech.LOGGER.info("Quantum Glass registered");
@@ -52,8 +50,6 @@ public class ThingsLoader implements Runnable {
ReactorSimBlock.run();
TecTech.LOGGER.info("Reactor Simulator registered");
- ConstructableTriggerItem.run();
- FrontRotationTriggerItem.run();
ParametrizerMemoryCard.run();
ElementalDefinitionScanStorage_EM.run();
EuMeterGT.run();
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
deleted file mode 100644
index 26a6d80dd8..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentLimits.java
+++ /dev/null
@@ -1,183 +0,0 @@
-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/mechanics/alignment/AlignmentMessage.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentMessage.java
deleted file mode 100644
index 07a3e02c1f..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentMessage.java
+++ /dev/null
@@ -1,140 +0,0 @@
-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;
-import cpw.mods.fml.common.network.simpleimpl.MessageContext;
-import eu.usrv.yamcore.network.client.AbstractClientMessageHandler;
-import eu.usrv.yamcore.network.server.AbstractServerMessageHandler;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import io.netty.buffer.ByteBuf;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-import net.minecraftforge.common.DimensionManager;
-
-public class AlignmentMessage implements IMessage {
- int mPosX;
- int mPosY;
- int mPosZ;
- int mPosD;
- int mAlign;
-
- public AlignmentMessage() {
- }
-
- 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;
- mAlign =metaTile.getExtendedFacing().getIndex();
- }
-
- private AlignmentMessage(World world, int x, int y, int z, IAlignment front) {
- mPosX=x;
- mPosY=y;
- mPosZ=z;
- mPosD=world.provider.dimensionId;
- mAlign =front.getExtendedFacing().getIndex();
- }
-
- @Override
- public void fromBytes(ByteBuf pBuffer) {
- NBTTagCompound tTag = ByteBufUtils.readTag(pBuffer);
- mPosX = tTag.getInteger("posx");
- mPosY = tTag.getInteger("posy");
- mPosZ = tTag.getInteger("posz");
- mPosD = tTag.getInteger("posd");
- mAlign = tTag.getInteger("rotf");
- }
-
- @Override
- public void toBytes(ByteBuf pBuffer) {
- NBTTagCompound tFXTag = new NBTTagCompound();
- tFXTag.setInteger("posx", mPosX);
- tFXTag.setInteger("posy", mPosY);
- tFXTag.setInteger("posz", mPosZ);
- tFXTag.setInteger("posd", mPosD);
- tFXTag.setInteger("rotf", mAlign);
-
- ByteBufUtils.writeTag(pBuffer, tFXTag);
- }
-
- public static class AlignmentQuery extends AlignmentMessage {
- public AlignmentQuery() {
- }
-
- public AlignmentQuery(GT_MetaTileEntity_MultiblockBase_EM metaTile) {
- super(metaTile);
- }
-
- public AlignmentQuery(World world, int x, int y, int z, IAlignment front) {
- super(world,x,y,z,front);
- }
- }
-
- public static class AlignmentData extends AlignmentMessage {
- public AlignmentData() {
- }
-
- private AlignmentData(AlignmentQuery query){
- mPosX=query.mPosX;
- mPosY=query.mPosY;
- mPosZ=query.mPosZ;
- mPosD=query.mPosD;
- mAlign =query.mAlign;
- }
-
- public AlignmentData(GT_MetaTileEntity_MultiblockBase_EM metaTile) {
- super(metaTile);
- }
-
- public AlignmentData(World world, int x, int y, int z, IAlignment front) {
- super(world,x,y,z,front);
- }
- }
-
- public static class ClientHandler extends AbstractClientMessageHandler<AlignmentData> {
- @Override
- 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 IAlignment){
- ((IAlignment) meta).setExtendedFacing(ExtendedFacing.byIndex(pMessage.mAlign));
- }
- }else if (te instanceof IAlignment){
- ((IAlignment) te).setExtendedFacing(ExtendedFacing.byIndex(pMessage.mAlign));
- }
- }
- return null;
- }
- }
-
- public static class ServerHandler extends AbstractServerMessageHandler<AlignmentQuery> {
- @Override
- 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 IAlignment) {
- pMessage.mAlign =((IAlignment) meta).getExtendedFacing().getIndex();
- return new AlignmentData(pMessage);
- }
- } else if (te instanceof IAlignment) {
- pMessage.mAlign =((IAlignment) te).getExtendedFacing().getIndex();
- return new AlignmentData(pMessage);
- }
- }
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentUtility.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentUtility.java
deleted file mode 100644
index 68e11b77af..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentUtility.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package com.github.technus.tectech.mechanics.alignment;
-
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.FakePlayer;
-
-public class AlignmentUtility {
- private AlignmentUtility(){
-
- }
-
- public static boolean handle(EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ){
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if(tTileEntity==null || aPlayer instanceof FakePlayer) {
- return aPlayer instanceof EntityPlayerMP;
- }
- if (aPlayer instanceof EntityPlayerMP) {
- if (tTileEntity instanceof IGregTechTileEntity) {
- IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
- if (metaTE instanceof IAlignmentProvider) {
- IAlignment alignment = ((IAlignmentProvider) metaTE).getAlignment();
- if(aPlayer.isSneaking()){
- alignment.toolSetFlip(null);
- }else {
- alignment.toolSetRotation(null);
- }
- return true;
- }
- } else if (tTileEntity instanceof IAlignmentProvider) {
- IAlignment alignment = ((IAlignmentProvider) tTileEntity).getAlignment();
- if(aPlayer.isSneaking()){
- alignment.toolSetFlip(null);
- }else {
- alignment.toolSetRotation(null);
- }
- return true;
- }
- }
- return false;
- }
-}
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
deleted file mode 100644
index a2a6301070..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignment.java
+++ /dev/null
@@ -1,187 +0,0 @@
-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,IAlignmentProvider {
- int DIRECTIONS_COUNT= Direction.VALUES.length;
- int ROTATIONS_COUNT= Rotation.VALUES.length;
- int FLIPS_COUNT= Flip.VALUES.length;
- int STATES_COUNT = ExtendedFacing.VALUES.length;
-
- ExtendedFacing getExtendedFacing();
-
- void setExtendedFacing(ExtendedFacing alignment);
-
- IAlignmentLimits getAlignmentLimits();
-
- void setAlignmentLimits(IAlignmentLimits limits);
-
- @Override
- default IAlignment getAlignment(){
- return this;
- }
-
- 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));
- }
-
- 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 canSetToDirectionAny(ForgeDirection direction){
- for (ExtendedFacing extendedFacing : ExtendedFacing.FOR_FACING.get(direction)) {
- if(isNewExtendedFacingValid(extendedFacing)){
- 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
deleted file mode 100644
index 68b4d84dab..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignmentLimits.java
+++ /dev/null
@@ -1,19 +0,0 @@
-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/IAlignmentProvider.java b/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignmentProvider.java
deleted file mode 100644
index 07dc972aac..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignmentProvider.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.github.technus.tectech.mechanics.alignment;
-
-public interface IAlignmentProvider {
- IAlignment getAlignment();
-} \ No newline at end of file
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
deleted file mode 100644
index 1c44164731..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/IntegerAxisSwap.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package com.github.technus.tectech.mechanics.alignment;
-
-import com.github.technus.tectech.util.Vec3Impl;
-import net.minecraft.util.Vec3;
-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 Vec3 translate(Vec3 point){
- return Vec3.createVectorHelper(
- forFirstAxis.get0()*point.xCoord +forFirstAxis.get1()*point.yCoord +forFirstAxis.get2()*point.zCoord,
- forSecondAxis.get0()*point.xCoord+forSecondAxis.get1()*point.yCoord+forSecondAxis.get2()*point.zCoord,
- forThirdAxis.get0()*point.xCoord +forThirdAxis.get1()*point.yCoord +forThirdAxis.get2()*point.zCoord
- );
- }
-
- public Vec3 inverseTranslate(Vec3 point){
- return Vec3.createVectorHelper(
- forFirstAxis.get0()*point.xCoord+forSecondAxis.get0()*point.yCoord+forThirdAxis.get0()*point.zCoord,
- forFirstAxis.get1()*point.xCoord+forSecondAxis.get1()*point.yCoord+forThirdAxis.get1()*point.zCoord,
- forFirstAxis.get2()*point.xCoord+forSecondAxis.get2()*point.yCoord+forThirdAxis.get2()*point.zCoord
- );
- }
-
- 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
deleted file mode 100644
index cc3971fedb..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Direction.java
+++ /dev/null
@@ -1,34 +0,0 @@
-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
deleted file mode 100644
index 5949b432df..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/ExtendedFacing.java
+++ /dev/null
@@ -1,358 +0,0 @@
-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.minecraft.util.Vec3;
-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.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 ForgeDirection a,b,c;
- 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.SOUTH;
- c= ForgeDirection.UP;
- break;
- case UP:
- a= ForgeDirection.EAST;
- b= ForgeDirection.SOUTH;
- c= ForgeDirection.DOWN;
- break;
- case NORTH:
- a= ForgeDirection.WEST;
- b= ForgeDirection.DOWN;
- c= ForgeDirection.SOUTH;
- break;
- case SOUTH:
- a= ForgeDirection.EAST;
- b= ForgeDirection.DOWN;
- c= ForgeDirection.NORTH;
- break;
- case WEST:
- a= ForgeDirection.SOUTH;
- b= ForgeDirection.DOWN;
- c= ForgeDirection.EAST;
- break;
- case EAST:
- a= ForgeDirection.NORTH;
- b= ForgeDirection.DOWN;
- 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 CLOCKWISE: {
- ForgeDirection _a=a;
- a =b;
- b =_a.getOpposite();
- break;
- }
- case UPSIDE_DOWN:
- a=a.getOpposite();
- b=b.getOpposite();
- break;
- case COUNTER_CLOCKWISE: {
- ForgeDirection _a=a;
- a =b.getOpposite();
- b =_a;
- break;
- }
- case NORMAL: break;
- default:
- throw new RuntimeException("More impossible...");
- }
- this.a=a;
- this.b=b;
- this.c=c;
- 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 Vec3 getWorldOffset(Vec3 abcOffset) {
- return integerAxisSwap.inverseTranslate(abcOffset);
- }
- 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 Vec3 getOffsetABC(Vec3 xyzOffset){
- return integerAxisSwap.translate(xyzOffset);
- }
- 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;
- }
-
- public ForgeDirection getRelativeLeftInWorld() {
- return a;
- }
-
- public ForgeDirection getRelativeRightInWorld() {
- return a.getOpposite();
- }
-
- public ForgeDirection getRelativeDownInWorld() {
- return b;
- }
-
- public ForgeDirection getRelativeUpInWorld() {
- return b.getOpposite();
- }
-
- public ForgeDirection getRelativeBackInWorld() {
- return c;
- }
-
- public ForgeDirection getRelativeForwardInWorld() {
- return c.getOpposite();
- }
-}
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
deleted file mode 100644
index 4b1dff70ec..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Flip.java
+++ /dev/null
@@ -1,76 +0,0 @@
-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
deleted file mode 100644
index 5d41f54a11..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/alignment/enumerable/Rotation.java
+++ /dev/null
@@ -1,76 +0,0 @@
-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/constructable/ConstructableUtility.java b/src/main/java/com/github/technus/tectech/mechanics/constructable/ConstructableUtility.java
deleted file mode 100644
index 2dc74330f9..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/constructable/ConstructableUtility.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package com.github.technus.tectech.mechanics.constructable;
-
-import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.alignment.IAlignment;
-import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.FakePlayer;
-import net.minecraftforge.common.util.ForgeDirection;
-
-public class ConstructableUtility {
- private ConstructableUtility(){
-
- }
-
- public static boolean handle(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if(tTileEntity==null || aPlayer instanceof FakePlayer) {
- return aPlayer instanceof EntityPlayerMP;
- }
- if (aPlayer instanceof EntityPlayerMP) {
- //struct gen
- if (aPlayer.isSneaking() && aPlayer.capabilities.isCreativeMode) {
- if (tTileEntity instanceof IGregTechTileEntity) {
- IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
- if (metaTE instanceof IConstructable) {
- ((IConstructable) metaTE).construct(aStack, false);
- } else if (IMultiblockInfoContainer.contains(metaTE.getClass())) {
- IMultiblockInfoContainer<IMetaTileEntity> iMultiblockInfoContainer =IMultiblockInfoContainer.get(metaTE.getClass());
- if(metaTE instanceof IAlignment){
- iMultiblockInfoContainer.construct(aStack, false, metaTE, (
- (IAlignment) metaTE).getExtendedFacing());
- }else {
- iMultiblockInfoContainer.construct(aStack, false, metaTE,
- ExtendedFacing.of(ForgeDirection.getOrientation(((IGregTechTileEntity) tTileEntity).getFrontFacing())));
- }
- }
- } else if (tTileEntity instanceof IConstructable) {
- ((IConstructable) tTileEntity).construct(aStack, false);
- } else if (IMultiblockInfoContainer.contains(tTileEntity.getClass())) {
- IMultiblockInfoContainer<TileEntity> iMultiblockInfoContainer =IMultiblockInfoContainer.get(tTileEntity.getClass());
- if(tTileEntity instanceof IAlignment){
- iMultiblockInfoContainer.construct(aStack, false, tTileEntity,
- ((IAlignment) tTileEntity).getExtendedFacing());
- }else {
- iMultiblockInfoContainer.construct(aStack, false, tTileEntity,
- ExtendedFacing.of(ForgeDirection.getOrientation(aSide)));
- }
- }
- }
- return true;
- }else if (TecTech.proxy.isThePlayer(aPlayer)){//particles and text client side
- //if ((!aPlayer.isSneaking() || !aPlayer.capabilities.isCreativeMode)) {
- if(tTileEntity instanceof IGregTechTileEntity) {
- IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
- if (metaTE instanceof IConstructable) {
- ((IConstructable) metaTE).construct(aStack, true);
- TecTech.proxy.printInchat(((IConstructable) metaTE).getStructureDescription(aStack));
- return false;
- } else if(IMultiblockInfoContainer.contains(metaTE.getClass())){
- IMultiblockInfoContainer<IMetaTileEntity> iMultiblockInfoContainer =IMultiblockInfoContainer.get(metaTE.getClass());
- if(metaTE instanceof IAlignment){
- iMultiblockInfoContainer.construct(aStack, true, metaTE,
- ((IAlignment) metaTE).getExtendedFacing());
- }else {
- iMultiblockInfoContainer.construct(aStack, true, metaTE,
- ExtendedFacing.of(ForgeDirection.getOrientation(((IGregTechTileEntity) tTileEntity).getFrontFacing())));
- }
- TecTech.proxy.printInchat(IMultiblockInfoContainer.get(metaTE.getClass()).getDescription(aStack));
- return false;
- }
- } else if(tTileEntity instanceof IConstructable){
- ((IConstructable) tTileEntity).construct(aStack,true);
- TecTech.proxy.printInchat(((IConstructable) tTileEntity).getStructureDescription(aStack));
- return false;
- } else if(IMultiblockInfoContainer.contains(tTileEntity.getClass())){
- IMultiblockInfoContainer<TileEntity> iMultiblockInfoContainer = IMultiblockInfoContainer.get(tTileEntity.getClass());
- if(tTileEntity instanceof IAlignment){
- iMultiblockInfoContainer.construct(aStack, true, tTileEntity,
- ((IAlignment) tTileEntity).getExtendedFacing());
- }else {
- iMultiblockInfoContainer.construct(aStack, true, tTileEntity,
- ExtendedFacing.of(ForgeDirection.getOrientation(aSide)));
- }
- TecTech.proxy.printInchat(IMultiblockInfoContainer.get(tTileEntity.getClass()).getDescription(aStack));
- return false;
- }
- //} else {
- // if(tTileEntity instanceof IGregTechTileEntity) {
- // IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
- // if (metaTE instanceof IConstructable) {
- // TecTech.proxy.printInchat(((IConstructable) metaTE).getStructureDescription(aStack.stackSize));
- // return false;
- // } else if(multiblockMap.containsKey(metaTE.getClass().getCanonicalName())){
- // TecTech.proxy.printInchat(multiblockMap.get(metaTE.getClass().getCanonicalName()).getDescription(aStack.stackSize));
- // return false;
- // }
- // } else if(tTileEntity instanceof IConstructable){
- // TecTech.proxy.printInchat(((IConstructable) tTileEntity).getStructureDescription(aStack.stackSize));
- // return false;
- // } else if(multiblockMap.containsKey(tTileEntity.getClass().getCanonicalName())){
- // TecTech.proxy.printInchat(multiblockMap.get(tTileEntity.getClass().getCanonicalName()).getDescription(aStack.stackSize));
- // return false;
- // }
- //}
- }
- return false;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/constructable/IConstructable.java b/src/main/java/com/github/technus/tectech/mechanics/constructable/IConstructable.java
deleted file mode 100644
index 1de0381f1f..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/constructable/IConstructable.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.github.technus.tectech.mechanics.constructable;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import net.minecraft.item.ItemStack;
-
-/**
- * Created by Tec on 24.03.2017.
- */
-public interface IConstructable {
- void construct(ItemStack stackSize, boolean hintsOnly);
-
- @SideOnly(Side.CLIENT)
- String[] getStructureDescription(ItemStack stackSize);
-}
-
diff --git a/src/main/java/com/github/technus/tectech/mechanics/constructable/IMultiblockInfoContainer.java b/src/main/java/com/github/technus/tectech/mechanics/constructable/IMultiblockInfoContainer.java
deleted file mode 100644
index 173e0d16ec..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/constructable/IMultiblockInfoContainer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.github.technus.tectech.mechanics.constructable;
-
-import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-
-import java.util.HashMap;
-
-/**
- * To implement IConstructable on not own TileEntities
- */
-public interface IMultiblockInfoContainer<T> {
- HashMap<String, IMultiblockInfoContainer<?>> MULTIBLOCK_MAP = new HashMap<>();
-
- static <T extends TileEntity> void registerTileClass(Class<T> clazz, IMultiblockInfoContainer<?> info){
- MULTIBLOCK_MAP.put(clazz.getCanonicalName(),info);
- }
-
- static <T extends IMetaTileEntity> void registerMetaClass(Class<T> clazz, IMultiblockInfoContainer<?> info){
- MULTIBLOCK_MAP.put(clazz.getCanonicalName(),info);
- }
-
- @SuppressWarnings("unchecked")
- static <T> IMultiblockInfoContainer<T> get(Class<?> tClass){
- return (IMultiblockInfoContainer<T>)MULTIBLOCK_MAP.get(tClass.getCanonicalName());
- }
-
- static boolean contains(Class<?> tClass){
- return MULTIBLOCK_MAP.containsKey(tClass.getCanonicalName());
- }
-
- void construct(ItemStack stackSize, boolean hintsOnly, T tileEntity, ExtendedFacing aSide);
-
- @SideOnly(Side.CLIENT)
- String[] getDescription(ItemStack stackSize);
-}
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 990a48ac70..f30105f1ee 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.util.Vec3Impl;
+import com.gtnewhorizon.structurelib.util.Vec3Impl;
import net.minecraft.nbt.NBTTagCompound;
import java.util.Collections;
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 268de6f71c..0fddb53fe9 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.util.Vec3Impl;
+import com.gtnewhorizon.structurelib.util.Vec3Impl;
import net.minecraft.nbt.NBTTagCompound;
public class QuantumDataPacket extends DataPacket<Long> {
diff --git a/src/main/java/com/github/technus/tectech/mechanics/spark/ThaumSpark.java b/src/main/java/com/github/technus/tectech/mechanics/spark/ThaumSpark.java
index e31e63f250..0480cfffd2 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/spark/ThaumSpark.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/spark/ThaumSpark.java
@@ -1,6 +1,7 @@
package com.github.technus.tectech.mechanics.spark;
-import com.github.technus.tectech.util.Vec3Impl;
+
+import com.gtnewhorizon.structurelib.util.Vec3Impl;
import java.io.Serializable;
import java.util.Objects;
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockPosConsumer.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockPosConsumer.java
deleted file mode 100644
index c3ea2d3e3f..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockPosConsumer.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import net.minecraft.world.World;
-
-public interface IBlockPosConsumer {
- void consume(World world, int x, int y, int z);
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/ICustomBlockSetting.java b/src/main/java/com/github/technus/tectech/mechanics/structure/ICustomBlockSetting.java
deleted file mode 100644
index b70e76fbac..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/ICustomBlockSetting.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import net.minecraft.block.Block;
-import net.minecraft.world.World;
-
-public interface ICustomBlockSetting {
- /**
- * Default block setting calls {@link World#setBlock(int x, int y, int z, Block block, int meta, int updateType)} like:
- * {@code world.setBlock(x,y,z,this/block,meta,2)} where updateType 2 means to update lighting and stuff
- * @param world world that should be affected
- * @param x x position to set
- * @param y y position to set
- * @param z z position to set
- * @param meta required meta
- */
- void setBlock(World world, int x, int y, int z, int meta);
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java
deleted file mode 100644
index c8488d5cea..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java
+++ /dev/null
@@ -1,167 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-import java.util.Arrays;
-
-import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
-
-public interface IStructureDefinition<T> {
- /**
- * Used internally
- * @param name same name as for other methods here
- * @return the array of elements to process
- */
- IStructureElement<T>[] getStructureFor(String name);
-
- default boolean check(T object,String piece, World world, ExtendedFacing extendedFacing,
- int basePositionX, int basePositionY, int basePositionZ,
- int basePositionA, int basePositionB, int basePositionC,
- boolean forceCheckAllBlocks){
- return iterate(object, null, getStructureFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ,
- basePositionA, basePositionB, basePositionC,false,forceCheckAllBlocks);
- }
-
- default boolean hints(T object, ItemStack trigger,String piece, World world, ExtendedFacing extendedFacing,
- int basePositionX, int basePositionY, int basePositionZ,
- int basePositionA, int basePositionB, int basePositionC) {
- return iterate(object, trigger, getStructureFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ,
- basePositionA, basePositionB, basePositionC,true,null);
- }
-
- default boolean build(T object, ItemStack trigger,String piece, World world, ExtendedFacing extendedFacing,
- int basePositionX, int basePositionY, int basePositionZ,
- int basePositionA, int basePositionB, int basePositionC) {
- return iterate(object, trigger, getStructureFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ,
- basePositionA, basePositionB, basePositionC,false,null);
- }
-
- default boolean buildOrHints(T object, ItemStack trigger,String piece, World world, ExtendedFacing extendedFacing,
- int basePositionX, int basePositionY, int basePositionZ,
- int basePositionA, int basePositionB, int basePositionC,
- boolean hintsOnly){
- return iterate(object, trigger, getStructureFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ,
- basePositionA, basePositionB, basePositionC,hintsOnly,null);
- }
-
- static <T> boolean iterate(T object, ItemStack trigger, IStructureElement<T>[] elements, World world, ExtendedFacing extendedFacing,
- int basePositionX, int basePositionY, int basePositionZ,
- int basePositionA, int basePositionB, int basePositionC,
- boolean hintsOnly, Boolean checkBlocksIfNotNullForceCheckAllIfTrue){
- if(world.isRemote ^ hintsOnly){
- return false;
- }
-
- //change base position to base offset
- basePositionA=-basePositionA;
- basePositionB=-basePositionB;
- basePositionC=-basePositionC;
-
- int[] abc = new int[]{basePositionA,basePositionB,basePositionC};
- int[] xyz = new int[3];
-
- if(checkBlocksIfNotNullForceCheckAllIfTrue!=null){
- if(checkBlocksIfNotNullForceCheckAllIfTrue){
- for (IStructureElement<T> element : elements) {
- if(element.isNavigating()) {
- abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA();
- abc[1] = (element.resetB() ? basePositionB : abc[1]) + element.getStepB();
- abc[2] = (element.resetC() ? basePositionC : abc[2]) + element.getStepC();
- }else {
- extendedFacing.getWorldOffset(abc, xyz);
- xyz[0] += basePositionX;
- xyz[1] += basePositionY;
- xyz[2] += basePositionZ;
-
- if (world.blockExists(xyz[0], xyz[1], xyz[2])) {
- if(!element.check(object, world, xyz[0], xyz[1], xyz[2])){
- if(DEBUG_MODE){
- TecTech.LOGGER.info("Multi ["+basePositionX+", "+basePositionY+", "+basePositionZ+"] failed @ "+
- Arrays.toString(xyz)+" "+Arrays.toString(abc));
- }
- return false;
- }
- } else {
- if(DEBUG_MODE){
- TecTech.LOGGER.info("Multi ["+basePositionX+", "+basePositionY+", "+basePositionZ+"] !blockExists @ "+
- Arrays.toString(xyz)+" "+Arrays.toString(abc));
- }
- return false;
- }
- abc[0]+=1;
- }
- }
- } else {
- for (IStructureElement<T> element : elements) {
- if(element.isNavigating()) {
- abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA();
- abc[1] = (element.resetB() ? basePositionB : abc[1]) + element.getStepB();
- abc[2] = (element.resetC() ? basePositionC : abc[2]) + element.getStepC();
- }else {
- extendedFacing.getWorldOffset(abc, xyz);
- xyz[0] += basePositionX;
- xyz[1] += basePositionY;
- xyz[2] += basePositionZ;
-
- if (world.blockExists(xyz[0], xyz[1], xyz[2])) {
- if(!element.check(object, world, xyz[0], xyz[1], xyz[2])){
- if(DEBUG_MODE){
- TecTech.LOGGER.info("Multi ["+basePositionX+", "+basePositionY+", "+basePositionZ+"] failed @ "+
- Arrays.toString(xyz)+" "+Arrays.toString(abc));
- }
- return false;
- }
- } else {
- if(DEBUG_MODE){
- TecTech.LOGGER.info("Multi ["+basePositionX+", "+basePositionY+", "+basePositionZ+"] !blockExists @ "+
- Arrays.toString(xyz)+" "+Arrays.toString(abc));
- }
- }
- abc[0]+=1;
- }
- }
- }
- }else {
- if(hintsOnly) {
- for (IStructureElement<T> element : elements) {
- if(element.isNavigating()) {
- abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA();
- abc[1] = (element.resetB() ? basePositionB : abc[1]) + element.getStepB();
- abc[2] = (element.resetC() ? basePositionC : abc[2]) + element.getStepC();
- }else {
- extendedFacing.getWorldOffset(abc, xyz);
- xyz[0] += basePositionX;
- xyz[1] += basePositionY;
- xyz[2] += basePositionZ;
-
- element.spawnHint(object, world, xyz[0], xyz[1], xyz[2], trigger);
-
- abc[0]+=1;
- }
- }
- } else {
- for (IStructureElement<T> element : elements) {
- if(element.isNavigating()) {
- abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA();
- abc[1] = (element.resetB() ? basePositionB : abc[1]) + element.getStepB();
- abc[2] = (element.resetC() ? basePositionC : abc[2]) + element.getStepC();
- }else {
- extendedFacing.getWorldOffset(abc, xyz);
- xyz[0] += basePositionX;
- xyz[1] += basePositionY;
- xyz[2] += basePositionZ;
-
- if (world.blockExists(xyz[0], xyz[1], xyz[2])) {
- element.placeBlock(object, world, xyz[0], xyz[1], xyz[2], trigger);
- }
- abc[0]+=1;
- }
- }
- }
- }
- return true;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java
deleted file mode 100644
index f946e71f91..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-/**
- * Use StructureUtility to instantiate
- */
-public interface IStructureElement<T> {
- boolean check(T t,World world,int x,int y,int z);
-
- boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger);
-
- boolean placeBlock(T t,World world,int x,int y,int z, ItemStack trigger);
-
- default int getStepA(){
- return 1;
- }
-
- default int getStepB(){
- return 0;
- }
-
- default int getStepC(){
- return 0;
- }
-
- default boolean resetA(){
- return false;
- }
-
- default boolean resetB(){
- return false;
- }
-
- default boolean resetC(){
- return false;
- }
-
- default boolean isNavigating(){
- return false;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementChain.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementChain.java
deleted file mode 100644
index f9593ee1c5..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementChain.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-/**
- * Use StructureUtility to instantiate
- */
-public interface IStructureElementChain<T> extends IStructureElement<T> {
- IStructureElement<T>[] fallbacks();
-
- @Override
- default boolean check(T t, World world, int x, int y, int z){
- for (IStructureElement<T> fallback : fallbacks()) {
- if (fallback.check(t, world, x, y, z)) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- default boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- for (IStructureElement<T> fallback : fallbacks()) {
- if (fallback.spawnHint(t, world, x, y, z, trigger)) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- default boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- for (IStructureElement<T> fallback : fallbacks()) {
- if (fallback.placeBlock(t, world, x, y, z, trigger)) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementCheckOnly.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementCheckOnly.java
deleted file mode 100644
index ec15aea53b..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementCheckOnly.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-public interface IStructureElementCheckOnly<T> extends IStructureElement<T> {
- @Override
- default boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger){
- return false;
- }
-
- @Override
- default boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger){
- return false;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementDeferred.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementDeferred.java
deleted file mode 100644
index dbb74312a8..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementDeferred.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-/**
- * Use StructureUtility to instantiate
- */
-public interface IStructureElementDeferred<T> extends IStructureElement<T> {
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementNoPlacement.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementNoPlacement.java
deleted file mode 100644
index 47e6060878..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementNoPlacement.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-public interface IStructureElementNoPlacement<T> extends IStructureElement<T> {
- @Override
- default boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger){
- return false;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java
deleted file mode 100644
index d3f4134cea..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-/**
- * Use StructureUtility to instantiate
- */
-interface IStructureNavigate<T> extends IStructureElement<T> {
- @Override
- default boolean check(T t, World world, int x, int y, int z){
- return true;
- }
-
- @Override
- default boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return true;
- }
-
- @Override
- default boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return true;
- }
-
- default boolean isNavigating(){
- return true;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java b/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java
deleted file mode 100644
index 83951372a2..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java
+++ /dev/null
@@ -1,262 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.thing.casing.TT_Container_Casings;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.init.Blocks;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-
-import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
-
-@Deprecated
-public class Structure {
- private Structure() {
- }
-
- @Deprecated
- @SafeVarargs
- public static <T> IHatchAdder<T>[] adders(IHatchAdder<T>... iHatchAdder) {
- return iHatchAdder;
- }
-
- //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller
- //This only checks for REGULAR BLOCKS!
- @Deprecated
- public static <T extends IMetaTileEntity> boolean checker(
- 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
- IHatchAdder<T>[] 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,
- T metaTile,
- ExtendedFacing extendedFacing,
- boolean forceCheck) {
- IGregTechTileEntity aBaseMetaTileEntity = metaTile.getBaseMetaTileEntity();
- World world = aBaseMetaTileEntity.getWorld();
- if (world.isRemote) {
- return false;
- }
- //TE Rotation
- if (extendedFacing == null) {
- extendedFacing = ExtendedFacing.of(ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()));
- }
-
- IGregTechTileEntity igt;
-
- int[] xyz = new int[3];
- int[] abc = new int[3];
- int 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
- abc[2] = -depthOffset;
- for (String[] _structure : structure) {//front to back
- abc[1] = -verticalOffset;
- for (String __structure : _structure) {//top to bottom
- abc[0] = -horizontalOffset;
- for (char block : __structure.toCharArray()) {//left to right
- if (block < ' ') {
- //Control chars allow skipping
- abc[1] += block;
- break;
- } else if (block > '@') {
- //characters allow to skip check A-1 skip, B-2 skips etc.
- abc[0] += block - '@';
- }//else if (block < '+')//used to mark THINGS
- // a++;
- else if (block == '.') {
- abc[0]++;
- } else {
- //get x y z from rotation
- 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 (xyz[1] < 0 || xyz[1] >= 256) {
- return false;
- }
-
- //Check block
- 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(xyz[0], xyz[1], xyz[2]).getMaterial() != Material.air) {
- return false;
- }
- break;
- case '+'://must not be air
- if (world.getBlock(xyz[0], xyz[1], xyz[2]).getMaterial() == Material.air) {
- return false;
- }
- break;
- default://check for block (countable)
- Block worldblock = world.getBlock(xyz[0], xyz[1], xyz[2]);
- int dmg = worldblock.getDamageValue(world, xyz[0], xyz[1], xyz[2]);
- if ((pointer = block - '0') >= 0) {
- //countable air -> net.minecraft.block.BlockAir
- if (worldblock != blockType[pointer]) {
- if (DEBUG_MODE) {
- TecTech.LOGGER.info("Struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + worldblock.getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName());
- }
- return false;
- }
- if (dmg != blockMeta[pointer]) {
- if (DEBUG_MODE) {
- TecTech.LOGGER.info("Struct-meta-id-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + dmg + ' ' + blockMeta[pointer]);
- }
- return false;
- }
- } else if ((pointer = block - ' ') >= 0) {
- igt = aBaseMetaTileEntity.getIGregTechTileEntity(xyz[0], xyz[1], xyz[2]);
- if (igt == null || !addingMethods[pointer].apply(metaTile, igt, casingTextures[pointer])) {
- if (worldblock != blockTypeFallback[pointer]) {
- if (DEBUG_MODE) {
- TecTech.LOGGER.info("Fallback-struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + worldblock.getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName()));
- }
- return false;
- }
- if (dmg != blockMetaFallback[pointer]) {
- if (DEBUG_MODE) {
- TecTech.LOGGER.info("Fallback-Struct-meta-id-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + dmg + ' ' + blockMetaFallback[pointer]);
- }
- return false;
- }
- }
- }
- }
- } else if (forceCheck) {
- return false;
- }
- abc[0]++;//block in horizontal layer
- }
- }
- abc[1]++;//horizontal layer
- }
- abc[2]++;//depth
- }
- return true;
- }
-
- @Deprecated
- public static boolean builder(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 tileEntity, ExtendedFacing extendedFacing, boolean hintsOnly) {
- World world = tileEntity.getWorld();
- int baseX = tileEntity.getXCoord();
- int baseY = tileEntity.getYCoord();
- int baseZ = tileEntity.getZCoord();
- if (world == null || (!world.isRemote && hintsOnly)) {
- return false;
- }
-
- //TE Rotation
- int[] xyz = new int[3];
- int[] abc = new int[3];
- int pointer;
-
- //a,b,c - relative to block face!
- //x,y,z - relative to block position on map!
-
- //perform your duties
- abc[2] = -depthOffset;
- for (String[] _structure : structure) {//front to back
- abc[1] = -verticalOffset;
- for (String __structure : _structure) {//top to bottom
- abc[0] = -horizontalOffset;
- for (char block : __structure.toCharArray()) {//left to right
- if (block < ' ') {//Control chars allow skipping
- abc[1] += block;
- break;
- }
- if (block > '@')//characters allow to skip check a-1 skip, b-2 skips etc.
- {
- abc[0] += block - '@';
- }//else if (block < '+')//used to mark THINGS
- // a++;
- else if (block == '.')// this TE
- {
- abc[0]++;
- } else {
- //get x y z from rotation
- 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 (xyz[1] < 0 || xyz[1] >= 256) {
- return false;
- }
-
- //Check block
- 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, xyz[0], xyz[1], xyz[2], TT_Container_Casings.sHintCasingsTT, 13);
- break;
- case '+'://must not be air
- 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(xyz[0], xyz[1], xyz[2]) != blockType[pointer] || blockType[pointer].getDamageValue(world, 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 < 12) {
- TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], TT_Container_Casings.sHintCasingsTT, pointer);
- } else {
- TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], TT_Container_Casings.sHintCasingsTT, 12);
- }
- } else {
- 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(xyz[0], xyz[1], xyz[2], Blocks.air, 0, 2);
- break;
- case '+'://must not be air
- world.setBlock(xyz[0], xyz[1], xyz[2], TT_Container_Casings.sBlockCasingsTT, 14, 2);
- break;
- default: //check for block
- if ((pointer = block - '0') >= 0) {
- if (blockType[pointer] instanceof ICustomBlockSetting) {
- ((ICustomBlockSetting) blockType[pointer]).setBlock(world, xyz[0], xyz[1], xyz[2], blockMeta[pointer]);
- } else {
- world.setBlock(xyz[0], xyz[1], xyz[2], blockType[pointer], blockMeta[pointer], 2);
- }
- }
- }
- }
- }
- abc[0]++;//block in horizontal layer
- }
- }
- abc[1]++;//horizontal layer
- }
- abc[2]++;//depth
- }
- return true;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java
deleted file mode 100644
index 9a1e94d98a..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java
+++ /dev/null
@@ -1,288 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import com.github.technus.tectech.util.Vec3Impl;
-
-import java.util.*;
-
-import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
-import static com.github.technus.tectech.mechanics.structure.StructureUtility.*;
-
-public class StructureDefinition<T> implements IStructureDefinition<T> {
- private final Map<Character, IStructureElement<T>> elements;
- private final Map<String, String> shapes;
- private final Map<String, IStructureElement<T>[]> structures;
-
- public static <B> Builder<B> builder() {
- return new Builder<>();
- }
-
- private StructureDefinition(
- Map<Character, IStructureElement<T>> elements,
- Map<String, String> shapes,
- Map<String, IStructureElement<T>[]> structures) {
- this.elements =elements;
- this.shapes=shapes;
- this.structures = structures;
- }
-
- public static class Builder<T> {
- private static final char A='\uA000';
- private static final char B='\uB000';
- private static final char C='\uC000';
- private char d ='\uD000';
- private final Map<Vec3Impl,Character> navigates;
- private final Map<Character, IStructureElement<T>> elements;
- private final Map<String, String> shapes;
-
- private Builder() {
- navigates=new HashMap<>();
- elements = new HashMap<>();
- shapes = new HashMap<>();
- }
-
- public Map<Character, IStructureElement<T>> getElements() {
- return elements;
- }
-
- public Map<String, String> getShapes() {
- return shapes;
- }
-
- /**
- * Casings go: 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
- * <br/>
- * HatchAdders go: space ! " # $ % & ' ( ) *
- * @param name
- * @param structurePiece
- * @return
- */
- @Deprecated
- public Builder<T> addShapeOldApi(String name, String[][] structurePiece) {
- StringBuilder builder = new StringBuilder();
- if (structurePiece.length > 0) {
- for (String[] strings : structurePiece) {
- if (strings.length > 0) {
- for (String string : strings) {
- for (int i = 0; i < string.length(); i++) {
- char ch = string.charAt(i);
- if(ch<' '){
- for (int b = 0; b < ch; b++) {
- builder.append(B);
- }
- }else if(ch>'@'){
- for (int a = '@'; a < ch; a++) {
- builder.append(A);
- }
- }else if(ch=='.'){
- builder.append(A);
- }else{
- builder.append(ch);
- }
- }
- builder.append(B);
- }
- builder.setLength(builder.length() - 1);
- }
- builder.append(C);
- }
- builder.setLength(builder.length() - 1);
- }
- int a=0,b=0,c=0;
- for (int i = 0; i < builder.length(); i++) {
- char ch = builder.charAt(i);
- if(ch==A){
- a++;
- }else if(ch==B){
- a=0;
- b++;
- }else if(ch==C){
- a=0;
- b=0;
- c++;
- }else if(a!=0 || b!=0 || c!=0){
- Vec3Impl vec3 = new Vec3Impl(a, b, c);
- Character navigate = navigates.get(vec3);
- if(navigate==null){
- navigate= d++;
- navigates.put(vec3,navigate);
- addElement(navigate,step(vec3));
- }
- builder.setCharAt(i-1,navigate);
- a=0;
- b=0;
- c=0;
- }
- }
-
- String built = builder.toString().replaceAll("[\\uA000\\uB000\\uC000]","");
-
- if(built.contains("+")){
- addElement('+',notAir());
- }
- if (built.contains("-")) {
- addElement('-', isAir());
- }
- shapes.put(name, built);
- return this;
- }
-
- /**
- * Adds shape
- * +- is air/no air checks
- * space bar is skip
- * ~ is also skip (but marks controller position, optional and logically it is a space...)
- * rest needs to be defined
- *
- * next char is next block(a)
- * next string is next line(b)
- * next string[] is next slice(c)
- *
- * char A000-FFFF range is reserved for generated skips
- * @param name unlocalized/code name
- * @param structurePiece generated or written struct - DO NOT STORE IT ANYWHERE, or at least set them to null afterwards
- * @return this builder
- */
- public Builder<T> addShape(String name, String[][] structurePiece) {
- StringBuilder builder = new StringBuilder();
- if (structurePiece.length > 0) {
- for (String[] strings : structurePiece) {
- if (strings.length > 0) {
- for (String string : strings) {
- builder.append(string).append(B);
- }
- builder.setLength(builder.length() - 1);
- }
- builder.append(C);
- }
- builder.setLength(builder.length() - 1);
- }
- int a=0,b=0,c=0;
- for (int i = 0; i < builder.length(); i++) {
- char ch = builder.charAt(i);
- if(ch ==' ' || ch =='~'){
- builder.setCharAt(i,A);
- ch=A;
- }
- if(ch==A){
- a++;
- }else if(ch==B){
- a=0;
- b++;
- }else if(ch==C){
- a=0;
- b=0;
- c++;
- }else if(a!=0 || b!=0 || c!=0){
- Vec3Impl vec3 = new Vec3Impl(a, b, c);
- Character navigate = navigates.get(vec3);
- if(navigate==null){
- navigate=d++;
- navigates.put(vec3,navigate);
- addElement(navigate,step(vec3));
- }
- builder.setCharAt(i-1,navigate);
- a=0;
- b=0;
- c=0;
- }
- }
-
- String built = builder.toString().replaceAll("[\\uA000\\uB000\\uC000]","");
-
- if(built.contains("+")){
- addElement('+',notAir());
- }
- if (built.contains("-")) {
- addElement('-', isAir());
- }
- shapes.put(name, built);
- return this;
- }
-
- public Builder<T> addElement(Character name, IStructureElement<T> structurePiece) {
- elements.putIfAbsent(name, structurePiece);
- return this;
- }
-
- public IStructureDefinition<T> build() {
- Map<String, IStructureElement<T>[]> structures = compileStructureMap();
- if(DEBUG_MODE){
- return new StructureDefinition<>(new HashMap<>(elements), new HashMap<>(shapes), structures);
- }else {
- return structures::get;
- }
- }
-
- @SuppressWarnings("unchecked")
- private Map<String, IStructureElement<T>[]> compileElementSetMap() {
- Set<Integer> missing = new HashSet<>();
- shapes.values().stream().map(CharSequence::chars).forEach(intStream -> intStream.forEach(c -> {
- IStructureElement<T> iStructureElement = elements.get((char) c);
- if (iStructureElement == null) {
- missing.add(c);
- }
- }));
- if (missing.isEmpty()) {
- Map<String, IStructureElement<T>[]> map = new HashMap<>();
- shapes.forEach((key, value) -> {
- Set<Character> chars=new HashSet<>();
- for (char c : value.toCharArray()) {
- chars.add(c);
- }
- IStructureElement<T>[] compiled = new IStructureElement[chars.size()];
- int i=0;
- for (Character aChar : chars) {
- compiled[i++]=elements.get(aChar);
- }
- map.put(key, compiled);
- });
- return map;
- } else {
- throw new RuntimeException("Missing Structure Element bindings for (chars as integers): " +
- Arrays.toString(missing.toArray()));
- }
- }
-
- @SuppressWarnings("unchecked")
- private Map<String, IStructureElement<T>[]> compileStructureMap() {
- Set<Integer> mising = new HashSet<>();
- shapes.values().stream().map(CharSequence::chars).forEach(intStream -> intStream.forEach(c -> {
- IStructureElement<T> iStructureElement = elements.get((char) c);
- if (iStructureElement == null) {
- mising.add(c);
- }
- }));
- if (mising.isEmpty()) {
- Map<String, IStructureElement<T>[]> map = new HashMap<>();
- shapes.forEach((key, value) -> {
- IStructureElement<T>[] compiled = new IStructureElement[value.length()];
- for (int i = 0; i < value.length(); i++) {
- compiled[i] = elements.get(value.charAt(i));
- }
- map.put(key, compiled);
- });
- return map;
- } else {
- throw new RuntimeException("Missing Structure Element bindings for (chars as integers): " +
- Arrays.toString(mising.toArray()));
- }
- }
- }
-
- public Map<Character, IStructureElement<T>> getElements(){
- return elements;
- }
-
- public Map<String, String> getShapes() {
- return shapes;
- }
-
- public Map<String, IStructureElement<T>[]> getStructures() {
- return structures;
- }
-
- @Override
- public IStructureElement<T>[] getStructureFor(String name) {
- return structures.get(name);
- }
-} \ No newline at end of file
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java
deleted file mode 100644
index 521b0e7645..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java
+++ /dev/null
@@ -1,1395 +0,0 @@
-package com.github.technus.tectech.mechanics.structure;
-
-import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
-import com.github.technus.tectech.mechanics.structure.adders.IBlockAdder;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.adders.ITileAdder;
-import com.github.technus.tectech.util.Vec3Impl;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.World;
-
-import java.util.*;
-import java.util.function.BiFunction;
-import java.util.function.Consumer;
-import java.util.function.Function;
-import java.util.function.Supplier;
-
-import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sHintCasingsTT;
-import static java.lang.Integer.MIN_VALUE;
-
-/**
- * Fluent API for structure checking!
- *
- * (Just import static this class to have a nice fluent syntax while defining structure definitions)
- */
-public class StructureUtility {
- private static final String NICE_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz=|!@#$%&()[]{};:<>/?_,.*^'`";
- @SuppressWarnings("rawtypes")
- private static final Map<Vec3Impl, IStructureNavigate> STEP = new HashMap<>();
- @SuppressWarnings("rawtypes")
- private static final IStructureElement AIR = new IStructureElement() {
- @Override
- public boolean check(Object t, World world, int x, int y, int z) {
- return world.getBlock(x, y, z).getMaterial() == Material.air;
- }
-
- @Override
- public boolean spawnHint(Object o, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, sHintCasingsTT, 13);
- return true;
- }
-
- @Override
- public boolean placeBlock(Object o, World world, int x, int y, int z, ItemStack trigger) {
- world.setBlock(x, y, z, Blocks.air, 0, 2);
- return false;
- }
- };
- @SuppressWarnings("rawtypes")
- private static final IStructureElement NOT_AIR = new IStructureElement() {
- @Override
- public boolean check(Object t, World world, int x, int y, int z) {
- return world.getBlock(x, y, z).getMaterial() != Material.air;
- }
-
- @Override
- public boolean spawnHint(Object o, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, sHintCasingsTT, 14);
- return true;
- }
-
- @Override
- public boolean placeBlock(Object o, World world, int x, int y, int z, ItemStack trigger) {
- world.setBlock(x, y, z, sHintCasingsTT, 14, 2);
- return true;
- }
- };
- @SuppressWarnings("rawtypes")
- private static final IStructureElement ERROR = new IStructureElement() {
- @Override
- public boolean check(Object t, World world, int x, int y, int z) {
- return false;
- }
-
- @Override
- public boolean spawnHint(Object o, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, sHintCasingsTT, 15);
- return true;
- }
-
- @Override
- public boolean placeBlock(Object o, World world, int x, int y, int z, ItemStack trigger) {
- return true;
- }
- };
-
- private StructureUtility() {
-
- }
-
- @SuppressWarnings("unchecked")
- public static <T> IStructureElement<T> isAir() {
- return AIR;
- }
-
- @SuppressWarnings("unchecked")
- public static <T> IStructureElement<T> notAir() {
- return NOT_AIR;
- }
-
- /**
- * Check returns false.
- * Placement is always handled by this and does nothing.
- * Makes little to no use it in fallback chain.
- *
- * @param <T>
- * @return
- */
- @SuppressWarnings("unchecked")
- public static <T> IStructureElement<T> error() {
- return ERROR;
- }
-
- //region hint only
-
- /**
- * Check always returns: true.
- *
- * @param dots
- * @param <T>
- * @return
- */
- public static <T> IStructureElementNoPlacement<T> ofHint(int dots) {
- int meta = dots - 1;
- return new IStructureElementNoPlacement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, sHintCasingsTT, meta);
- return false;
- }
- };
- }
-
- /**
- * Check always returns: true.
- *
- * @param icons
- * @param <T>
- * @return
- */
- public static <T> IStructureElementNoPlacement<T> ofHintDeferred(Supplier<IIcon[]> icons) {
- return new IStructureElementNoPlacement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, icons.get());
- return false;
- }
- };
- }
-
- /**
- * Check always returns: true.
- *
- * @param icons
- * @param RGBa
- * @param <T>
- * @return
- */
- public static <T> IStructureElementNoPlacement<T> ofHintDeferred(Supplier<IIcon[]> icons, short[] RGBa) {
- return new IStructureElementNoPlacement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle_tinted(world, x, y, z, icons.get(), RGBa);
- return false;
- }
- };
- }
-
- //endregion
-
- //region block
-
- /**
- * Does not allow Block duplicates (with different meta)
- */
- public static <T> IStructureElementNoPlacement<T> ofBlocksFlatHint(Map<Block, Integer> blocsMap, Block hintBlock, int hintMeta) {
- if (blocsMap == null || blocsMap.isEmpty() || hintBlock == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementNoPlacement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return blocsMap.getOrDefault(worldBlock, MIN_VALUE) == worldBlock.getDamageValue(world, x, y, z);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta);
- return true;
- }
- };
- }
-
- /**
- * Allows block duplicates (with different meta)
- */
- public static <T> IStructureElementNoPlacement<T> ofBlocksMapHint(Map<Block, Collection<Integer>> blocsMap, Block hintBlock, int hintMeta) {
- if (blocsMap == null || blocsMap.isEmpty() || hintBlock == null) {
- throw new IllegalArgumentException();
- }
- for (Collection<Integer> value : blocsMap.values()) {
- if (value.isEmpty()) {
- throw new IllegalArgumentException();
- }
- }
- return new IStructureElementNoPlacement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return blocsMap.getOrDefault(worldBlock, Collections.emptySet()).contains(worldBlock.getDamageValue(world, x, y, z));
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta);
- return true;
- }
- };
- }
-
- public static <T> IStructureElementNoPlacement<T> ofBlockHint(Block block, int meta, Block hintBlock, int hintMeta) {
- if (block == null || hintBlock == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementNoPlacement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return block == worldBlock && meta == worldBlock.getDamageValue(world, x, y, z);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta);
- return true;
- }
- };
- }
-
- public static <T> IStructureElementNoPlacement<T> ofBlockHint(Block block, int meta) {
- return ofBlockHint(block, meta, block, meta);
- }
-
- public static <T> IStructureElementNoPlacement<T> ofBlockAdderHint(IBlockAdder<T> iBlockAdder, Block hintBlock, int hintMeta) {
- if (iBlockAdder == null || hintBlock == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementNoPlacement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return iBlockAdder.apply(t, worldBlock, worldBlock.getDamageValue(world, x, y, z));
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta);
- return true;
- }
- };
- }
-
- /**
- * Does not allow Block duplicates (with different meta)
- */
- public static <T> IStructureElement<T> ofBlocksFlat(Map<Block, Integer> blocsMap, Block defaultBlock, int defaultMeta) {
- if (blocsMap == null || blocsMap.isEmpty() || defaultBlock == null) {
- throw new IllegalArgumentException();
- }
- if(defaultBlock instanceof ICustomBlockSetting){
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return blocsMap.getOrDefault(worldBlock, MIN_VALUE) == worldBlock.getDamageValue(world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- ((ICustomBlockSetting) defaultBlock).setBlock(world, x, y, z, defaultMeta);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- }else {
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return blocsMap.getOrDefault(worldBlock, MIN_VALUE) == worldBlock.getDamageValue(world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- world.setBlock(x, y, z, defaultBlock, defaultMeta, 2);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- }
- }
-
- /**
- * Allows block duplicates (with different meta)
- */
- public static <T> IStructureElement<T> ofBlocksMap(Map<Block, Collection<Integer>> blocsMap, Block defaultBlock, int defaultMeta) {
- if (blocsMap == null || blocsMap.isEmpty() || defaultBlock == null) {
- throw new IllegalArgumentException();
- }
- for (Collection<Integer> value : blocsMap.values()) {
- if (value.isEmpty()) {
- throw new IllegalArgumentException();
- }
- }
- if(defaultBlock instanceof ICustomBlockSetting){
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return blocsMap.getOrDefault(worldBlock, Collections.emptySet()).contains(worldBlock.getDamageValue(world, x, y, z));
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- ((ICustomBlockSetting) defaultBlock).setBlock(world, x, y, z, defaultMeta);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- }else {
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return blocsMap.getOrDefault(worldBlock, Collections.emptySet()).contains(worldBlock.getDamageValue(world, x, y, z));
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- world.setBlock(x, y, z, defaultBlock, defaultMeta, 2);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- }
- }
-
- public static <T> IStructureElement<T> ofBlock(Block block, int meta, Block defaultBlock, int defaultMeta) {
- if (block == null || defaultBlock == null) {
- throw new IllegalArgumentException();
- }
- if(block instanceof ICustomBlockSetting){
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return block == worldBlock && meta == worldBlock.getDamageValue(world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- ((ICustomBlockSetting) defaultBlock).setBlock(world, x, y, z, defaultMeta);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- } else {
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return block == worldBlock && meta == worldBlock.getDamageValue(world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- world.setBlock(x, y, z, defaultBlock, defaultMeta, 2);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- }
- }
-
- /**
- * Same as above but ignores target meta id
- */
- public static <T> IStructureElement<T> ofBlockAnyMeta(Block block, Block defaultBlock, int defaultMeta) {
- if (block == null || defaultBlock == null) {
- throw new IllegalArgumentException();
- }
- if(block instanceof ICustomBlockSetting){
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return block == world.getBlock(x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- ((ICustomBlockSetting) defaultBlock).setBlock(world, x, y, z, defaultMeta);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- } else {
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return block == world.getBlock(x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- world.setBlock(x, y, z, defaultBlock, defaultMeta, 2);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- }
- }
-
- public static <T> IStructureElement<T> ofBlock(Block block, int meta) {
- return ofBlock(block, meta, block, meta);
- }
-
- /**
- * Same as above but ignores target meta id
- */
- public static <T> IStructureElement<T> ofBlockAnyMeta(Block block) {
- return ofBlockAnyMeta(block, block, 0);
- }
-
- /**
- * Same as above but allows to set hint particle render
- */
- public static <T> IStructureElement<T> ofBlockAnyMeta(Block block,int defaultMeta) {
- return ofBlockAnyMeta(block, block, defaultMeta);
- }
-
- //endregion
-
- //region adders
-
- public static <T> IStructureElement<T> ofBlockAdder(IBlockAdder<T> iBlockAdder, Block defaultBlock, int defaultMeta) {
- if (iBlockAdder == null || defaultBlock == null) {
- throw new IllegalArgumentException();
- }
- if(defaultBlock instanceof ICustomBlockSetting){
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return iBlockAdder.apply(t, worldBlock, worldBlock.getDamageValue(world, x, y, z));
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- ((ICustomBlockSetting) defaultBlock).setBlock(world, x, y, z, defaultMeta);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- }else {
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- Block worldBlock = world.getBlock(x, y, z);
- return iBlockAdder.apply(t, worldBlock, worldBlock.getDamageValue(world, x, y, z));
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- world.setBlock(x, y, z, defaultBlock, defaultMeta, 2);
- return true;
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta);
- return true;
- }
- };
- }
- }
-
- public static <T> IStructureElement<T> ofBlockAdder(IBlockAdder<T> iBlockAdder, int dots) {
- return ofBlockAdder(iBlockAdder, sHintCasingsTT, dots - 1);
- }
-
- public static <T> IStructureElementNoPlacement<T> ofTileAdder(ITileAdder<T> iTileAdder, Block hintBlock, int hintMeta) {
- if (iTileAdder == null || hintBlock == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementNoPlacement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- TileEntity tileEntity = world.getTileEntity(x, y, z);
- return tileEntity instanceof IGregTechTileEntity && iTileAdder.apply(t, tileEntity);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta);
- return true;
- }
- };
- }
-
- public static <T> IStructureElementNoPlacement<T> ofHatchAdder(IHatchAdder<T> iHatchAdder, int textureIndex, int dots) {
- return ofHatchAdder(iHatchAdder, textureIndex, sHintCasingsTT, dots - 1);
- }
-
- public static <T> IStructureElementNoPlacement<T> ofHatchAdder(IHatchAdder<T> iHatchAdder, int textureIndex, Block hintBlock, int hintMeta) {
- if (iHatchAdder == null || hintBlock == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementNoPlacement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- TileEntity tileEntity = world.getTileEntity(x, y, z);
- return tileEntity instanceof IGregTechTileEntity && iHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) textureIndex);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta);
- return true;
- }
- };
- }
-
- public static <T> IStructureElement<T> ofHatchAdderOptional(IHatchAdder<T> iHatchAdder, int textureIndex, int dots, Block placeCasing, int placeCasingMeta) {
- return ofHatchAdderOptional(iHatchAdder, textureIndex, sHintCasingsTT, dots - 1, placeCasing, placeCasingMeta);
- }
-
- public static <T> IStructureElement<T> ofHatchAdderOptional(IHatchAdder<T> iHatchAdder, int textureIndex, Block hintBlock, int hintMeta, Block placeCasing, int placeCasingMeta) {
- if (iHatchAdder == null || hintBlock == null) {
- throw new IllegalArgumentException();
- }
- if(placeCasing instanceof ICustomBlockSetting){
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- TileEntity tileEntity = world.getTileEntity(x, y, z);
- Block worldBlock = world.getBlock(x, y, z);
- return (tileEntity instanceof IGregTechTileEntity &&
- iHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) textureIndex)) ||
- (worldBlock == placeCasing && worldBlock.getDamageValue(world, x, y, z) == placeCasingMeta);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta);
- return true;
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- ((ICustomBlockSetting) placeCasing).setBlock(world, x, y, z, placeCasingMeta);
- return true;
- }
- };
- }else {
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- TileEntity tileEntity = world.getTileEntity(x, y, z);
- Block worldBlock = world.getBlock(x, y, z);
- return (tileEntity instanceof IGregTechTileEntity &&
- iHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) textureIndex)) ||
- (worldBlock == placeCasing && worldBlock.getDamageValue(world, x, y, z) == placeCasingMeta);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta);
- return true;
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- world.setBlock(x, y, z, placeCasing, placeCasingMeta, 2);
- return true;
- }
- };
- }
- }
-
- //endregion
-
- //region side effects
-
- public static <B extends IStructureElement<T>, T> IStructureElement<T> onElementPass(Consumer<T> onCheckPass, B element) {
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- boolean check = element.check(t, world, x, y, z);
- if (check) {
- onCheckPass.accept(t);
- }
- return check;
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return element.placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return element.spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- public static <B extends IStructureElement<T>, T> IStructureElement<T> onElementFail(Consumer<T> onFail, B element) {
- return new IStructureElement<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- boolean check = element.check(t, world, x, y, z);
- if (!check) {
- onFail.accept(t);
- }
- return check;
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return element.placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return element.spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- //endregion
-
- /**
- * Take care while chaining, as it will try to call every structure element until it returns true.
- * If none does it will finally return false.
- *
- * @param elementChain
- * @param <T>
- * @return
- */
- @SafeVarargs
- public static <T> IStructureElementChain<T> ofChain(IStructureElement<T>... elementChain) {
- if (elementChain == null || elementChain.length == 0) {
- throw new IllegalArgumentException();
- }
- for (IStructureElement<T> iStructureElement : elementChain) {
- if (iStructureElement == null) {
- throw new IllegalArgumentException();
- }
- }
- return () -> elementChain;
- }
-
- /**
- * Take care while chaining, as it will try to call every structure element until it returns true.
- * If none does it will finally return false.
- *
- * @param elementChain
- * @param <T>
- * @return
- */
- @SuppressWarnings("unchecked")
- public static <T> IStructureElementChain<T> ofChain(List<IStructureElement<T>> elementChain) {
- return ofChain(elementChain.toArray(new IStructureElement[0]));
- }
-
- //region defer
-
- public static <T> IStructureElementDeferred<T> defer(Supplier<IStructureElement<T>> to) {
- if (to == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return to.get().check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return to.get().placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return to.get().spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- public static <T> IStructureElementDeferred<T> defer(Function<T, IStructureElement<T>> to) {
- if (to == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return to.apply(t).check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return to.apply(t).placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return to.apply(t).spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- public static <T, K> IStructureElementDeferred<T> defer(Function<T, K> keyExtractor, Map<K, IStructureElement<T>> map) {
- if (keyExtractor == null || map == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return map.get(keyExtractor.apply(t)).check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.get(keyExtractor.apply(t)).placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.get(keyExtractor.apply(t)).spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- public static <T, K> IStructureElementDeferred<T> defer(Function<T, K> keyExtractor, Map<K, IStructureElement<T>> map, IStructureElement<T> defaultElem) {
- if (keyExtractor == null || map == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return map.getOrDefault(keyExtractor.apply(t), defaultElem).check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.getOrDefault(keyExtractor.apply(t), defaultElem).placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.getOrDefault(keyExtractor.apply(t), defaultElem).spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- @SafeVarargs
- public static <T> IStructureElementDeferred<T> defer(Function<T, Integer> keyExtractor, IStructureElement<T>... array) {
- if (keyExtractor == null || array == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return array[keyExtractor.apply(t)].check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return array[keyExtractor.apply(t)].placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return array[keyExtractor.apply(t)].spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- public static <T> IStructureElementDeferred<T> defer(Function<T, Integer> keyExtractor, List<IStructureElement<T>> array) {
- return defer(keyExtractor, array.toArray(new IStructureElement[0]));
- }
-
- public static <T> IStructureElementDeferred<T> defer(BiFunction<T, ItemStack, IStructureElement<T>> to) {
- if (to == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return to.apply(t, null).check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return to.apply(t, trigger).placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return to.apply(t, trigger).spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- public static <T, K> IStructureElementDeferred<T> defer(BiFunction<T, ItemStack, K> keyExtractor, Map<K, IStructureElement<T>> map) {
- if (keyExtractor == null || map == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return map.get(keyExtractor.apply(t, null)).check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.get(keyExtractor.apply(t, trigger)).placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.get(keyExtractor.apply(t, trigger)).spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- public static <T, K> IStructureElementDeferred<T> defer(BiFunction<T, ItemStack, K> keyExtractor, Map<K, IStructureElement<T>> map, IStructureElement<T> defaultElem) {
- if (keyExtractor == null || map == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return map.getOrDefault(keyExtractor.apply(t, null), defaultElem).check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.getOrDefault(keyExtractor.apply(t, trigger), defaultElem).placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.getOrDefault(keyExtractor.apply(t, trigger), defaultElem).spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- @SafeVarargs
- public static <T> IStructureElementDeferred<T> defer(BiFunction<T, ItemStack, Integer> keyExtractor, IStructureElement<T>... array) {
- if (keyExtractor == null || array == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return array[keyExtractor.apply(t, null)].check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return array[keyExtractor.apply(t, trigger)].placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return array[keyExtractor.apply(t, trigger)].spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- public static <T> IStructureElementDeferred<T> defer(BiFunction<T, ItemStack, Integer> keyExtractor, List<IStructureElement<T>> array) {
- return defer(keyExtractor, array.toArray(new IStructureElement[0]));
- }
-
- public static <T> IStructureElementDeferred<T> defer(Function<T, IStructureElement<T>> toCheck, BiFunction<T, ItemStack, IStructureElement<T>> to) {
- if (to == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return toCheck.apply(t).check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return to.apply(t, trigger).placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return to.apply(t, trigger).spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- public static <T, K> IStructureElementDeferred<T> defer(Function<T, K> keyExtractorCheck, BiFunction<T, ItemStack, K> keyExtractor, Map<K, IStructureElement<T>> map) {
- if (keyExtractor == null || map == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return map.get(keyExtractorCheck.apply(t)).check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.get(keyExtractor.apply(t, trigger)).placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.get(keyExtractor.apply(t, trigger)).spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- public static <T, K> IStructureElementDeferred<T> defer(Function<T, K> keyExtractorCheck, BiFunction<T, ItemStack, K> keyExtractor, Map<K, IStructureElement<T>> map, IStructureElement<T> defaultElem) {
- if (keyExtractor == null || map == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return map.getOrDefault(keyExtractorCheck.apply(t), defaultElem).check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.getOrDefault(keyExtractor.apply(t, trigger), defaultElem).placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return map.getOrDefault(keyExtractor.apply(t, trigger), defaultElem).spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- @SafeVarargs
- public static <T> IStructureElementDeferred<T> defer(Function<T, Integer> keyExtractorCheck, BiFunction<T, ItemStack, Integer> keyExtractor, IStructureElement<T>... array) {
- if (keyExtractor == null || array == null) {
- throw new IllegalArgumentException();
- }
- return new IStructureElementDeferred<T>() {
- @Override
- public boolean check(T t, World world, int x, int y, int z) {
- return array[keyExtractorCheck.apply(t)].check(t, world, x, y, z);
- }
-
- @Override
- public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
- return array[keyExtractor.apply(t, trigger)].placeBlock(t, world, x, y, z, trigger);
- }
-
- @Override
- public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
- return array[keyExtractor.apply(t, trigger)].spawnHint(t, world, x, y, z, trigger);
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- public static <T> IStructureElementDeferred<T> defer(Function<T, Integer> keyExtractorCheck, BiFunction<T, ItemStack, Integer> keyExtractor, List<IStructureElement<T>> array) {
- return defer(keyExtractorCheck, keyExtractor, array.toArray(new IStructureElement[0]));
- }
-
- //endregion
-
- /**
- * Used internally, to generate skips for structure definitions
- *
- * @param a
- * @param b
- * @param c
- * @param <T>
- * @return
- */
- public static <T> IStructureNavigate<T> step(int a, int b, int c) {
- return step(new Vec3Impl(a, b, c));
- }
-
- /**
- * Used internally, to generate skips for structure definitions
- *
- * @param step
- * @param <T>
- * @return
- */
- @SuppressWarnings("unchecked")
- public static <T> IStructureNavigate<T> step(Vec3Impl step) {
- if (step == null || step.get0() < 0 || step.get1() < 0 || step.get2() < 0) {
- throw new IllegalArgumentException();
- }
- return STEP.computeIfAbsent(step, vec3 -> {
- if (vec3.get2() > 0) {
- return stepC(vec3.get0(), vec3.get1(), vec3.get2());
- } else if (vec3.get1() > 0) {
- return stepB(vec3.get0(), vec3.get1(), vec3.get2());
- } else {
- return stepA(vec3.get0(), vec3.get1(), vec3.get2());
- }
- });
- }
-
- private static <T> IStructureNavigate<T> stepA(int a, int b, int c) {
- return new IStructureNavigate<T>() {
- @Override
- public int getStepA() {
- return a;
- }
-
- @Override
- public int getStepB() {
- return b;
- }
-
- @Override
- public int getStepC() {
- return c;
- }
- };
- }
-
- private static <T> IStructureNavigate<T> stepB(int a, int b, int c) {
- return new IStructureNavigate<T>() {
- @Override
- public int getStepA() {
- return a;
- }
-
- @Override
- public int getStepB() {
- return b;
- }
-
- @Override
- public int getStepC() {
- return c;
- }
-
- @Override
- public boolean resetA() {
- return true;
- }
- };
- }
-
- private static <T> IStructureNavigate<T> stepC(int a, int b, int c) {
- return new IStructureNavigate<T>() {
- @Override
- public int getStepA() {
- return a;
- }
-
- @Override
- public int getStepB() {
- return b;
- }
-
- @Override
- public int getStepC() {
- return c;
- }
-
- @Override
- public boolean resetA() {
- return true;
- }
-
- @Override
- public boolean resetB() {
- return true;
- }
- };
- }
-
- /**
- * Used only to get pseudo code in structure writer...
- *
- * @param world
- * @return
- */
- public static String getPseudoJavaCode(World world, ExtendedFacing extendedFacing,
- int basePositionX, int basePositionY, int basePositionZ,
- int basePositionA, int basePositionB, int basePositionC,
- int sizeA, int sizeB, int sizeC, boolean transpose) {
- Map<Block, Set<Integer>> blocks = new TreeMap<>(Comparator.comparing(Block::getUnlocalizedName));
- Set<Class<? extends TileEntity>> tiles = new TreeSet<>(Comparator.comparing(Class::getCanonicalName));
- Set<Class<? extends IMetaTileEntity>> gtTiles = new TreeSet<>(Comparator.comparing(Class::getCanonicalName));
- iterate(world, extendedFacing, basePositionX, basePositionY, basePositionZ,
- basePositionA, basePositionB, basePositionC,
- sizeA, sizeB, sizeC, ((w, x, y, z) -> {
- TileEntity tileEntity = w.getTileEntity(x, y, z);
- if (tileEntity == null) {
- Block block = w.getBlock(x, y, z);
- if (block != null && block != Blocks.air) {
- blocks.compute(block, (b, set) -> {
- if (set == null) {
- set = new TreeSet<>();
- }
- set.add(block.getDamageValue(world, x, y, z));
- return set;
- });
- }
- } else {
- if (tileEntity instanceof IGregTechTileEntity) {
- IMetaTileEntity meta = ((IGregTechTileEntity) tileEntity).getMetaTileEntity();
- if (meta != null) {
- gtTiles.add(meta.getClass());
- } else {
- tiles.add(tileEntity.getClass());
- }
- } else {
- tiles.add(tileEntity.getClass());
- }
- }
- }));
- Map<String, Character> map = new HashMap<>();
- StringBuilder builder = new StringBuilder();
- {
- int i = 0;
- char c;
- builder.append("\n\nStructure:\n")
- .append("\nBlocks:\n");
- for (Map.Entry<Block, Set<Integer>> entry : blocks.entrySet()) {
- Block block = entry.getKey();
- Set<Integer> set = entry.getValue();
- for (Integer meta : set) {
- c = NICE_CHARS.charAt(i++);
- if (i > NICE_CHARS.length()) {
- return "Too complicated for nice chars";
- }
- map.put(block.getUnlocalizedName() + '\0' + meta, c);
- builder.append(c).append(" -> ofBlock...(")
- .append(block.getUnlocalizedName()).append(", ").append(meta).append(", ...);\n");
- }
- }
- builder.append("\nTiles:\n");
- for (Class<? extends TileEntity> tile : tiles) {
- c = NICE_CHARS.charAt(i++);
- if (i > NICE_CHARS.length()) {
- return "Too complicated for nice chars";
- }
- map.put(tile.getCanonicalName(), c);
- builder.append(c).append(" -> ofTileAdder(")
- .append(tile.getCanonicalName()).append(", ...);\n");
- }
- builder.append("\nMeta:\n");
- for (Class<? extends IMetaTileEntity> gtTile : gtTiles) {
- c = NICE_CHARS.charAt(i++);
- if (i > NICE_CHARS.length()) {
- return "Too complicated for nice chars";
- }
- map.put(gtTile.getCanonicalName(), c);
- builder.append(c).append(" -> ofHatchAdder(")
- .append(gtTile.getCanonicalName()).append(", textureId, ...);\n");
- }
- }
- builder.append("\nOffsets:\n")
- .append(basePositionA).append(' ').append(basePositionB).append(' ').append(basePositionC).append('\n');
- if (transpose) {
- builder.append("\nTransposed Scan:\n")
- .append("new String[][]{\n")
- .append(" {\"");
- iterate(world, extendedFacing, basePositionX, basePositionY, basePositionZ,
- basePositionA, basePositionB, basePositionC, true,
- sizeA, sizeB, sizeC, ((w, x, y, z) -> {
- TileEntity tileEntity = w.getTileEntity(x, y, z);
- if (tileEntity == null) {
- Block block = w.getBlock(x, y, z);
- if (block != null && block != Blocks.air) {
- builder.append(map.get(block.getUnlocalizedName() + '\0' + block.getDamageValue(world, x, y, z)));
- } else {
- builder.append(' ');
- }
- } else {
- if (tileEntity instanceof IGregTechTileEntity) {
- IMetaTileEntity meta = ((IGregTechTileEntity) tileEntity).getMetaTileEntity();
- if (meta != null) {
- builder.append(map.get(meta.getClass().getCanonicalName()));
- } else {
- builder.append(map.get(tileEntity.getClass().getCanonicalName()));
- }
- } else {
- builder.append(map.get(tileEntity.getClass().getCanonicalName()));
- }
- }
- }),
- () -> builder.append("\",\""),
- () -> {
- builder.setLength(builder.length() - 2);
- builder.append("},\n {\"");
- });
- builder.setLength(builder.length() - 8);
- builder.append("\n}\n\n");
- } else {
- builder.append("\nNormal Scan:\n")
- .append("new String[][]{{\n")
- .append(" \"");
- iterate(world, extendedFacing, basePositionX, basePositionY, basePositionZ,
- basePositionA, basePositionB, basePositionC, false,
- sizeA, sizeB, sizeC, ((w, x, y, z) -> {
- TileEntity tileEntity = w.getTileEntity(x, y, z);
- if (tileEntity == null) {
- Block block = w.getBlock(x, y, z);
- if (block != null && block != Blocks.air) {
- builder.append(map.get(block.getUnlocalizedName() + '\0' + block.getDamageValue(world, x, y, z)));
- } else {
- builder.append(' ');
- }
- } else {
- if (tileEntity instanceof IGregTechTileEntity) {
- IMetaTileEntity meta = ((IGregTechTileEntity) tileEntity).getMetaTileEntity();
- if (meta != null) {
- builder.append(map.get(meta.getClass().getCanonicalName()));
- } else {
- builder.append(map.get(tileEntity.getClass().getCanonicalName()));
- }
- } else {
- builder.append(map.get(tileEntity.getClass().getCanonicalName()));
- }
- }
- }),
- () -> builder.append("\",\n").append(" \""),
- () -> {
- builder.setLength(builder.length() - 7);
- builder.append("\n").append("},{\n").append(" \"");
- });
- builder.setLength(builder.length() - 8);
- builder.append("}\n\n");
- }
- return (builder.toString().replaceAll("\"\"", "E"));
- }
-
- public static void iterate(World world, ExtendedFacing extendedFacing,
- int basePositionX, int basePositionY, int basePositionZ,
- int basePositionA, int basePositionB, int basePositionC,
- int sizeA, int sizeB, int sizeC,
- IBlockPosConsumer iBlockPosConsumer) {
- sizeA -= basePositionA;
- sizeB -= basePositionB;
- sizeC -= basePositionC;
-
- int[] abc = new int[3];
- int[] xyz = new int[3];
-
- for (abc[2] = -basePositionC; abc[2] < sizeC; abc[2]++) {
- for (abc[1] = -basePositionB; abc[1] < sizeB; abc[1]++) {
- for (abc[0] = -basePositionA; abc[0] < sizeA; abc[0]++) {
- extendedFacing.getWorldOffset(abc, xyz);
- iBlockPosConsumer.consume(world, xyz[0] + basePositionX, xyz[1] + basePositionY, xyz[2] + basePositionZ);
- }
-
- }
- }
- }
-
- public static void iterate(World world, ExtendedFacing extendedFacing,
- int basePositionX, int basePositionY, int basePositionZ,
- int basePositionA, int basePositionB, int basePositionC,
- boolean transpose, int sizeA, int sizeB, int sizeC,
- IBlockPosConsumer iBlockPosConsumer,
- Runnable nextB,
- Runnable nextC) {
- sizeA -= basePositionA;
- sizeB -= basePositionB;
- sizeC -= basePositionC;
-
- int[] abc = new int[3];
- int[] xyz = new int[3];
- if (transpose) {
- for (abc[1] = -basePositionB; abc[1] < sizeB; abc[1]++) {
- for (abc[2] = -basePositionC; abc[2] < sizeC; abc[2]++) {
- for (abc[0] = -basePositionA; abc[0] < sizeA; abc[0]++) {
- extendedFacing.getWorldOffset(abc, xyz);
- iBlockPosConsumer.consume(world, xyz[0] + basePositionX, xyz[1] + basePositionY, xyz[2] + basePositionZ);
- }
- nextB.run();
- }
- nextC.run();
- }
- } else {
- for (abc[2] = -basePositionC; abc[2] < sizeC; abc[2]++) {
- for (abc[1] = -basePositionB; abc[1] < sizeB; abc[1]++) {
- for (abc[0] = -basePositionA; abc[0] < sizeA; abc[0]++) {
- extendedFacing.getWorldOffset(abc, xyz);
- iBlockPosConsumer.consume(world, xyz[0] + basePositionX, xyz[1] + basePositionY, xyz[2] + basePositionZ);
- }
- nextB.run();
- }
- nextC.run();
- }
- }
- }
-
- /**
- * Transposes shape (swaps B and C axis, can be used to un-transpose transposed shape)
- * WARNING! Do not use on old api...
- *
- * @param structurePiece shape (transposed shape)
- * @return transposed shape (untransposed shape)
- */
- public static String[][] transpose(String[][] structurePiece) {
- String[][] shape = new String[structurePiece[0].length][structurePiece.length];
- for (int i = 0; i < structurePiece.length; i++) {
- for (int j = 0; j < structurePiece[i].length; j++) {
- shape[j][i] = structurePiece[i][j];
- }
- }
- return shape;
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/adders/IBlockAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/adders/IBlockAdder.java
deleted file mode 100644
index 908c4c4aca..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/adders/IBlockAdder.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.github.technus.tectech.mechanics.structure.adders;
-
-
-import net.minecraft.block.Block;
-
-public interface IBlockAdder<T> {
- /**
- * Callback on block added, needs to check if block is valid (and add it)
- * @param block block attempted to add
- * @param meta meta of block attempted to add
- * @return is structure still valid
- */
- boolean apply(T t,Block block, Integer meta);
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/adders/IHatchAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/adders/IHatchAdder.java
deleted file mode 100644
index a47befc2e8..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/adders/IHatchAdder.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.github.technus.tectech.mechanics.structure.adders;
-
-
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
-public interface IHatchAdder<T> {
- /**
- * Callback to add hatch, needs to check if hatch is valid (and add it)
- * @param iGregTechTileEntity hatch
- * @param aShort requested texture index, or null if not...
- * @return managed to add hatch (structure still valid)
- */
- boolean apply(T t,IGregTechTileEntity iGregTechTileEntity, Short aShort);
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/adders/ITileAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/adders/ITileAdder.java
deleted file mode 100644
index cc3c7dbb7a..0000000000
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/adders/ITileAdder.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.github.technus.tectech.mechanics.structure.adders;
-
-import net.minecraft.tileentity.TileEntity;
-
-public interface ITileAdder<T> {
- /**
- * Callback to add hatch, needs to check if tile is valid (and add it)
- * @param tileEntity tile
- * @return managed to add hatch (structure still valid)
- */
- boolean apply(T t,TileEntity tileEntity);
-}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/tesla/ITeslaConnectableSimple.java b/src/main/java/com/github/technus/tectech/mechanics/tesla/ITeslaConnectableSimple.java
index 3b56b6968c..2adc25bbed 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/tesla/ITeslaConnectableSimple.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/tesla/ITeslaConnectableSimple.java
@@ -1,6 +1,6 @@
package com.github.technus.tectech.mechanics.tesla;
-import com.github.technus.tectech.util.Vec3Impl;
+import com.gtnewhorizon.structurelib.util.Vec3Impl;
public interface ITeslaConnectableSimple {
//-128 to -1 disables capability
diff --git a/src/main/java/com/github/technus/tectech/mechanics/tesla/TeslaCoverConnection.java b/src/main/java/com/github/technus/tectech/mechanics/tesla/TeslaCoverConnection.java
index 5c6fef6af8..0b84236709 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/tesla/TeslaCoverConnection.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/tesla/TeslaCoverConnection.java
@@ -1,7 +1,7 @@
package com.github.technus.tectech.mechanics.tesla;
-import com.github.technus.tectech.util.Vec3Impl;
import com.google.common.base.Objects;
+import com.gtnewhorizon.structurelib.util.Vec3Impl;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import static com.github.technus.tectech.mechanics.tesla.ITeslaConnectable.TeslaUtil.teslaSimpleNodeSetAdd;
@@ -14,7 +14,10 @@ public class TeslaCoverConnection implements ITeslaConnectableSimple {
public TeslaCoverConnection(IGregTechTileEntity IGT, byte teslaReceptionCapability) {
this.IGT = IGT;
- this.pos = new Vec3Impl(IGT);
+ this.pos = new Vec3Impl(IGT.getXCoord(),
+ IGT.getYCoord(),
+ IGT.getZCoord());
+
this.teslaReceptionCapability = teslaReceptionCapability;
}
diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java
index 358d55be0e..114dc7399f 100644
--- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java
+++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java
@@ -215,18 +215,18 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler {
int tSpecial = ((CachedDefaultRecipe) arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue;
short ampere=(short) (tSpecial & 0xFFFF),minComputationPerSec=(short)(tSpecial>>>16);
if (tEUt != 0) {
- drawText(10, 73, trans("152","Max Total: ") + (1+ (computation-minComputationPerSec) /minComputationPerSec) * (long)tEUt * ampere * 20 + " EU", -16777216);
- drawText(10, 83, trans("153","Usage: ") + (long)tEUt*ampere + " EU/t", -16777216);
+ drawText(10, 73, trans("152","Max Total: ") + GT_Utility.formatNumbers((1+ (computation-minComputationPerSec) /minComputationPerSec) * (long)tEUt * ampere * 20) + " EU", -16777216);
+ drawText(10, 83, trans("153","Usage: ") + GT_Utility.formatNumbers((long)tEUt*ampere) + " EU/t", -16777216);
if (mRecipeMap.mShowVoltageAmperageInNEI) {
- drawText(10, 93, trans("154","Voltage: ") + tEUt + " EU", -16777216);
- drawText(10, 103, trans("155","Amperage: ") + ampere, -16777216);
+ drawText(10, 93, trans("154","Voltage: ") + GT_Utility.formatNumbers(tEUt) + " EU", -16777216);
+ drawText(10, 103, trans("155","Amperage: ") + GT_Utility.formatNumbers(ampere), -16777216);
} else {
drawText(10, 93, trans("156","Voltage: unspecified"), -16777216);
drawText(10, 103, trans("157","Amperage: unspecified"), -16777216);
}
}
- drawText(10, 113, "Computation: "+computation, -16777216);
- drawText(10, 123, "Min Computation: "+minComputationPerSec + " /s", -16777216);
+ drawText(10, 113, "Computation: " + GT_Utility.formatNumbers(computation), -16777216);
+ drawText(10, 123, "Min Computation: " + GT_Utility.formatNumbers(minComputationPerSec) + " /s", -16777216);
} else {
int i = 0;
for (String descLine : recipeDesc) {
diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java
index 0c7651977e..2dc4604fd5 100644
--- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java
+++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java
@@ -215,18 +215,18 @@ public class TT_NEI_ScannerHandler extends TemplateRecipeHandler {
int tSpecial = ((CachedDefaultRecipe) arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue;
short ampere=(short) (tSpecial & 0xFFFF),minComputationPerSec=(short)(tSpecial>>>16);
if (tEUt != 0) {
- drawText(10, 73, trans("152","Max Total: ") + (1+ (computation-minComputationPerSec) /minComputationPerSec) * (long)tEUt * ampere * 20 + " EU", -16777216);
- drawText(10, 83, trans("153","Usage: ") + (long)tEUt*ampere + " EU/t", -16777216);
+ drawText(10, 73, trans("152","Max Total: ") + GT_Utility.formatNumbers((1+ (computation-minComputationPerSec) /minComputationPerSec) * (long)tEUt * ampere * 20) + " EU", -16777216);
+ drawText(10, 83, trans("153","Usage: ") + GT_Utility.formatNumbers((long)tEUt*ampere) + " EU/t", -16777216);
if (mRecipeMap.mShowVoltageAmperageInNEI) {
- drawText(10, 93, trans("154","Voltage: ") + tEUt + " EU", -16777216);
- drawText(10, 103, trans("155","Amperage: ") + ampere, -16777216);
+ drawText(10, 93, trans("154","Voltage: ") + GT_Utility.formatNumbers(tEUt) + " EU", -16777216);
+ drawText(10, 103, trans("155","Amperage: ") + GT_Utility.formatNumbers(ampere), -16777216);
} else {
drawText(10, 93, trans("156","Voltage: unspecified"), -16777216);
drawText(10, 103, trans("157","Amperage: unspecified"), -16777216);
}
}
- drawText(10, 113, "Computation: "+computation, -16777216);
- drawText(10, 123, "Min Computation: "+minComputationPerSec + " /s", -16777216);
+ drawText(10, 113, "Computation: " + GT_Utility.formatNumbers(computation), -16777216);
+ drawText(10, 123, "Min Computation: " + GT_Utility.formatNumbers(minComputationPerSec) + " /s", -16777216);
} else {
int i = 0;
for (String descLine : recipeDesc) {
diff --git a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java
index 6a2a81057e..d7baec4ef5 100644
--- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java
+++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java
@@ -1,10 +1,7 @@
package com.github.technus.tectech.proxy;
import com.github.technus.tectech.Reference;
-import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.compatibility.openmodularturrets.TT_turret_loader;
-import com.github.technus.tectech.entity.fx.BlockHint;
-import com.github.technus.tectech.entity.fx.WeightlessParticleFX;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.block.QuantumGlassRender;
import com.github.technus.tectech.thing.block.QuantumStuffBlock;
@@ -12,11 +9,11 @@ import com.github.technus.tectech.thing.block.QuantumStuffRender;
import com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM;
import com.github.technus.tectech.thing.item.ElementalDefinitionContainer_EM;
import com.github.technus.tectech.thing.item.renderElemental.RenderElementalName;
+import com.gtnewhorizon.structurelib.entity.fx.WeightlessParticleFX;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Loader;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.gui.GuiNewChat;
@@ -24,7 +21,6 @@ import net.minecraft.client.particle.EntityFX;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatComponentText;
-import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.util.ForgeDirection;
@@ -49,42 +45,6 @@ public class ClientProxy extends CommonProxy {
}
@Override
- public void hint_particle_tinted(World w,int x, int y, int z, IIcon[] icons,short[] RGBa) {
- Minecraft.getMinecraft().effectRenderer.addEffect(new BlockHint(w,x,y,z,icons).withColorTint(RGBa));
-
- EntityFX particle = new WeightlessParticleFX(w, x + RANDOM.nextFloat() * 0.5F, y + RANDOM.nextFloat() * 0.5F, z + RANDOM.nextFloat() * 0.5F, 0, 0, 0);
- particle.setRBGColorF(0, 0.6F * RANDOM.nextFloat(), 0.8f);
- Minecraft.getMinecraft().effectRenderer.addEffect(particle);
- }
-
- @Override
- public void hint_particle_tinted(World w,int x, int y, int z, Block block, int meta,short[] RGBa) {
- Minecraft.getMinecraft().effectRenderer.addEffect(new BlockHint(w,x,y,z,block,meta).withColorTint(RGBa));
-
- EntityFX particle = new WeightlessParticleFX(w, x + RANDOM.nextFloat() * 0.5F, y + RANDOM.nextFloat() * 0.5F, z + RANDOM.nextFloat() * 0.5F, 0, 0, 0);
- particle.setRBGColorF(0, 0.6F * RANDOM.nextFloat(), 0.8f);
- Minecraft.getMinecraft().effectRenderer.addEffect(particle);
- }
-
- @Override
- public void hint_particle(World w,int x, int y, int z, IIcon[] icons) {
- Minecraft.getMinecraft().effectRenderer.addEffect(new BlockHint(w,x,y,z,icons));
-
- EntityFX particle = new WeightlessParticleFX(w, x + RANDOM.nextFloat() * 0.5F, y + RANDOM.nextFloat() * 0.5F, z + RANDOM.nextFloat() * 0.5F, 0, 0, 0);
- particle.setRBGColorF(0, 0.6F * RANDOM.nextFloat(), 0.8f);
- Minecraft.getMinecraft().effectRenderer.addEffect(particle);
- }
-
- @Override
- public void hint_particle(World w,int x, int y, int z, Block block, int meta) {
- Minecraft.getMinecraft().effectRenderer.addEffect(new BlockHint(w,x,y,z,block,meta));
-
- EntityFX particle = new WeightlessParticleFX(w, x + RANDOM.nextFloat() * 0.5F, y + RANDOM.nextFloat() * 0.5F, z + RANDOM.nextFloat() * 0.5F, 0, 0, 0);
- particle.setRBGColorF(0, 0.6F * RANDOM.nextFloat(), 0.8f);
- Minecraft.getMinecraft().effectRenderer.addEffect(particle);
- }
-
- @Override
public void em_particle(IGregTechTileEntity aMuffler, byte facing) {//CUTE!
ForgeDirection aDir = ForgeDirection.getOrientation(facing);
float xPos = aDir.offsetX * 0.76F + aMuffler.getXCoord() + 0.25F;
diff --git a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java
index 490cdf1092..0fbe8d890e 100644
--- a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java
+++ b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java
@@ -2,22 +2,16 @@ package com.github.technus.tectech.proxy;
import cpw.mods.fml.common.network.IGuiHandler;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatComponentText;
-import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
public class CommonProxy implements IGuiHandler {
public void registerRenderInfo() {}
- public void hint_particle_tinted(World w,int x, int y, int z, IIcon[] icons,short[] RGBa){}
- public void hint_particle_tinted(World w,int x, int y, int z, Block block, int meta,short[] RGBa){}
- public void hint_particle(World w,int x, int y, int z, IIcon[] icons){}
- public void hint_particle(World w,int x, int y, int z, Block block, int meta){}
public void em_particle(IGregTechTileEntity aMuffler, byte facing) {}//CUTE!
public void pollutor_particle(IGregTechTileEntity aPollutor, byte facing) {}//CUTE!
public void em_particle(World w,double x, double y, double z){}
diff --git a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java
index 9bd69c67ed..9e555e3961 100644
--- a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java
+++ b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java
@@ -94,7 +94,7 @@ public enum CustomItemList implements IItemContainer {
eM_avr_HV, eM_avr_EV, eM_avr_IV, eM_avr_LuV, eM_avr_ZPM, eM_avr_UV, eM_avr_UHV, eM_avr_UEV, eM_avr_UIV, eM_avr_UMV,
- scanContainer, parametrizerMemory, teslaCapacitor, teslaCover, teslaComponent, teslaStaff, enderLinkFluidCover,
+ scanContainer, parametrizerMemory, teslaCapacitor, teslaCover, teslaComponent, teslaStaff, enderLinkFluidCover, powerPassUpgradeCover,
Machine_TeslaCoil_1by1_LV, Machine_TeslaCoil_1by1_MV, Machine_TeslaCoil_1by1_HV, Machine_TeslaCoil_1by1_EV, Machine_TeslaCoil_1by1_IV,
Machine_TeslaCoil_2by2_LV, Machine_TeslaCoil_2by2_MV, Machine_TeslaCoil_2by2_HV, Machine_TeslaCoil_2by2_EV, Machine_TeslaCoil_2by2_IV,
diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java
deleted file mode 100644
index 9648e41d8d..0000000000
--- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package com.github.technus.tectech.thing.casing;
-
-import com.github.technus.tectech.Reference;
-import com.github.technus.tectech.thing.CustomItemList;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.common.blocks.GT_Block_Casings_Abstract;
-import gregtech.common.blocks.GT_Material_Casings;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.IBlockAccess;
-
-import java.util.List;
-
-import static com.github.technus.tectech.TecTech.creativeTabTecTech;
-
-/**
- * Created by danie_000 on 03.10.2016.
- */
-public class GT_Block_HintTT extends GT_Block_Casings_Abstract {
- private static IIcon[] hint = new IIcon[16];
-
- public GT_Block_HintTT() {
- super(GT_Item_HintTT.class, "gt.blockhintTT", GT_Material_Casings.INSTANCE);
- setCreativeTab(creativeTabTecTech);
-
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Hint 1 dot");//id is -1
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Hint 2 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Hint 3 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Hint 4 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Hint 5 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Hint 6 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Hint 7 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Hint 8 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Hint 9 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Hint 10 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Hint 11 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Hint 12 dots");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Hint general");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Hint air");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Hint no air");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Hint error");
-
-
- CustomItemList.hint_0.set(new ItemStack(this, 1, 0));
- CustomItemList.hint_1.set(new ItemStack(this, 1, 1));
- CustomItemList.hint_2.set(new ItemStack(this, 1, 2));
- CustomItemList.hint_3.set(new ItemStack(this, 1, 3));
- CustomItemList.hint_4.set(new ItemStack(this, 1, 4));
- CustomItemList.hint_5.set(new ItemStack(this, 1, 5));
- CustomItemList.hint_6.set(new ItemStack(this, 1, 6));
- CustomItemList.hint_7.set(new ItemStack(this, 1, 7));
- CustomItemList.hint_8.set(new ItemStack(this, 1, 8));
- CustomItemList.hint_9.set(new ItemStack(this, 1, 9));
- CustomItemList.hint_10.set(new ItemStack(this, 1, 10));
- CustomItemList.hint_11.set(new ItemStack(this, 1, 11));
- CustomItemList.hint_general.set(new ItemStack(this, 1, 12));
- CustomItemList.hint_air.set(new ItemStack(this, 1, 13));
- CustomItemList.hint_noAir.set(new ItemStack(this, 1, 14));
- CustomItemList.hint_error.set(new ItemStack(this, 1, 15));
- }
-
- @Override
- public void registerBlockIcons(IIconRegister aIconRegister) {
- //super.registerBlockIcons(aIconRegister);
- hint[0] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_0");
- hint[1] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_1");
- hint[2] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_2");
- hint[3] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_3");
- hint[4] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_4");
- hint[5] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_5");
- hint[6] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_6");
- hint[7] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_7");
- hint[8] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_8");
- hint[9] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_9");
- hint[10] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_10");
- hint[11] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_11");
- hint[12] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_DEFAULT");
- hint[13] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_AIR");
- hint[14] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_NOAIR");
- hint[15] = aIconRegister.registerIcon(Reference.MODID+":iconsets/HINT_ERROR");
- }
-
- @Override
- public IIcon getIcon(int aSide, int aMeta) {
- return hint[aMeta];
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide) {
- int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
- return getIcon(aSide, tMeta);
- }
-
- @Override
- public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) {
- for (int i = 0; i <= 15; i++) {
- aList.add(new ItemStack(aItem, 1, i));
- }
- }
-}
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
deleted file mode 100644
index 3d00fcdf35..0000000000
--- a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package com.github.technus.tectech.thing.item;
-
-import com.github.technus.tectech.mechanics.constructable.ConstructableUtility;
-import com.github.technus.tectech.util.CommonValues;
-import cpw.mods.fml.common.registry.GameRegistry;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-
-import java.util.List;
-
-import static com.github.technus.tectech.Reference.MODID;
-import static com.github.technus.tectech.TecTech.creativeTabTecTech;
-import static net.minecraft.util.StatCollector.translateToLocal;
-
-/**
- * Created by Tec on 15.03.2017.
- */
-public final class ConstructableTriggerItem extends Item {
- public static ConstructableTriggerItem INSTANCE;
-
- private ConstructableTriggerItem() {
- setUnlocalizedName("em.constructable");
- setTextureName(MODID + ":itemConstructable");
- setCreativeTab(creativeTabTecTech);
- }
-
- @Override
- public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
- return ConstructableUtility.handle(aStack, aPlayer, aWorld, aX, aY, aZ, aSide);
- }
-
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) {
- aList.add(CommonValues.TEC_MARK_GENERAL);
- aList.add(translateToLocal("item.em.constructable.desc.0"));//Triggers Constructable Interface
- aList.add(EnumChatFormatting.BLUE + translateToLocal("item.em.constructable.desc.1"));//Shows multiblock construction details,
- aList.add(EnumChatFormatting.BLUE + translateToLocal("item.em.constructable.desc.2"));//just Use on a multiblock controller.
- aList.add(EnumChatFormatting.BLUE + translateToLocal("item.em.constructable.desc.3"));//(Sneak Use in creative to build)
- aList.add(EnumChatFormatting.BLUE + translateToLocal("item.em.constructable.desc.4"));//Quantity affects tier/mode/type
- }
-
- public static void run() {
- INSTANCE = new ConstructableTriggerItem();
- GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName());
- }
-}
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
deleted file mode 100644
index b74f40f336..0000000000
--- a/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.github.technus.tectech.thing.item;
-
-import com.github.technus.tectech.mechanics.alignment.AlignmentUtility;
-import com.github.technus.tectech.util.CommonValues;
-import cpw.mods.fml.common.registry.GameRegistry;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-
-import java.util.List;
-
-import static com.github.technus.tectech.Reference.MODID;
-import static com.github.technus.tectech.TecTech.creativeTabTecTech;
-import static net.minecraft.util.StatCollector.translateToLocal;
-
-/**
- * Created by Tec on 15.03.2017.
- */
-public final class FrontRotationTriggerItem extends Item {
- public static FrontRotationTriggerItem INSTANCE;
-
- private FrontRotationTriggerItem() {
- setMaxStackSize(1);
- setUnlocalizedName("em.frontRotate");
- setTextureName(MODID + ":itemFrontRotate");
- setCreativeTab(creativeTabTecTech);
- }
-
- @Override
- public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
- return AlignmentUtility.handle(aPlayer,aWorld,aX,aY,aZ);
- }
-
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) {
- aList.add(CommonValues.TEC_MARK_GENERAL);
- aList.add(translateToLocal("item.em.frontRotate.desc.0"));//Triggers Front Rotation Interface
- aList.add(EnumChatFormatting.BLUE + translateToLocal("item.em.frontRotate.desc.1"));//Rotates only the front panel,
- aList.add(EnumChatFormatting.BLUE + translateToLocal("item.em.frontRotate.desc.2"));//which allows structure rotation.
- }
-
- public static void run() {
- INSTANCE = new FrontRotationTriggerItem();
- GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName());
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/thing/item/PowerPassUpgradeCover.java b/src/main/java/com/github/technus/tectech/thing/item/PowerPassUpgradeCover.java
index 7dcf8bb48a..06c05e5b9d 100644
--- a/src/main/java/com/github/technus/tectech/thing/item/PowerPassUpgradeCover.java
+++ b/src/main/java/com/github/technus/tectech/thing/item/PowerPassUpgradeCover.java
@@ -13,7 +13,7 @@ import net.minecraft.util.EnumChatFormatting;
import java.util.List;
import static com.github.technus.tectech.Reference.MODID;
-import static com.github.technus.tectech.thing.CustomItemList.enderLinkFluidCover;
+import static com.github.technus.tectech.thing.CustomItemList.powerPassUpgradeCover;
import static net.minecraft.util.StatCollector.translateToLocal;
public final class PowerPassUpgradeCover extends Item {
@@ -28,15 +28,15 @@ public final class PowerPassUpgradeCover extends Item {
@Override
public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) {
aList.add(CommonValues.BASS_MARK);
- aList.add(translateToLocal("item.tm.powerpassupgradecover.desc.0"));//Ender-Fluid-Enables Machines!
- aList.add(EnumChatFormatting.BLUE + translateToLocal("item.tm.powerpassupgradecover.desc.1"));//Use on any side of a fluid tank to link it to the Ender
- aList.add(EnumChatFormatting.BLUE + translateToLocal("item.tm.powerpassupgradecover.desc.2"));//Ender Tanks so are laggy -Bot from the Chads of NH
+ aList.add(translateToLocal("item.tm.powerpassupgradecover.desc.0"));//Add power pass functionality to TecTech Multiblocks
+ aList.add(EnumChatFormatting.BLUE + translateToLocal("item.tm.powerpassupgradecover.desc.1"));//Active transformer in a can??
+ aList.add(EnumChatFormatting.BLUE + translateToLocal("item.tm.powerpassupgradecover.desc.2"));//Chain them up like Christmas lights!
}
public static void run() {
INSTANCE = new PowerPassUpgradeCover();
GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName());
- enderLinkFluidCover.set(INSTANCE);
+ powerPassUpgradeCover.set(INSTANCE);
}
@Override
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 6cbf1e801b..4aa90339cc 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
@@ -160,7 +160,10 @@ public abstract class GT_MetaTileEntity_Hatch_DataConnector<T extends DataPacket
@Override
public String[] getInfoData() {
if (id > 0) {
- return new String[]{translateToLocalFormatted("tt.keyword.ID", clientLocale) + ": " + EnumChatFormatting.AQUA + id, translateToLocalFormatted("tt.keyword.Content", clientLocale) + ": " + EnumChatFormatting.AQUA + (q != null ? q.getContentString() : 0), translateToLocalFormatted("tt.keyword.PacketHistory", clientLocale) + ": " + EnumChatFormatting.RED + (q != null ? q.getTraceSize() : 0),};
+ return new String[]{
+ translateToLocalFormatted("tt.keyword.ID", clientLocale) + ": " + EnumChatFormatting.AQUA + id,
+ translateToLocalFormatted("tt.keyword.Content", clientLocale) + ": " + EnumChatFormatting.AQUA + (q != null ? q.getContentString() : 0),
+ translateToLocalFormatted("tt.keyword.PacketHistory", clientLocale) + ": " + EnumChatFormatting.RED + (q != null ? q.getTraceSize() : 0),};
}
return new String[]{
translateToLocalFormatted("tt.keyword.Content", clientLocale) + ": " + EnumChatFormatting.AQUA + (q != null ? q.getContentString() : 0),
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 202dc344c2..b015d71b60 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
@@ -111,7 +111,8 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc
return new String[]{
CommonValues.TEC_MARK_GENERAL,
mDescription,//TODO NOT PASS DESCRIPTION
- translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": " + EnumChatFormatting.YELLOW + (Amperes * maxEUOutput()) + EnumChatFormatting.RESET + " EU/t"//Throughput
+ translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": "
+ + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(Amperes * maxEUOutput()) + EnumChatFormatting.RESET + " EU/t"//Throughput
};
}
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 4410372d47..0acb9849a7 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
@@ -6,6 +6,7 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
+import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
@@ -116,7 +117,8 @@ public class GT_MetaTileEntity_Hatch_EnergyMulti extends GT_MetaTileEntity_Hatch
return new String[]{
CommonValues.TEC_MARK_GENERAL,
mDescription,
- translateToLocal("gt.blockmachines.hatch.energymulti.desc.1") + ": " + EnumChatFormatting.AQUA + maxAmperesIn() + " A"//Amperes In
+ translateToLocal("gt.blockmachines.hatch.energymulti.desc.1") + ": "
+ + EnumChatFormatting.AQUA + GT_Utility.formatNumbers(maxAmperesIn()) + " A"//Amperes In
};
}
} \ No newline at end of file
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 854678b79b..d44119e1ab 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
@@ -6,6 +6,7 @@ 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 gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
@@ -108,7 +109,8 @@ public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatc
return new String[]{
CommonValues.TEC_MARK_GENERAL,
mDescription,
- translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": " + EnumChatFormatting.YELLOW + (Amperes * maxEUInput()) + EnumChatFormatting.RESET + " EU/t"//Throughput
+ translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": "
+ + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(Amperes * maxEUInput()) + EnumChatFormatting.RESET + " EU/t"//Throughput
};
}
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 6a9b24ef55..2a04af23d1 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
@@ -12,6 +12,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Utility;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -90,8 +91,8 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity
return new String[]{
CommonValues.TEC_MARK_EM,
mDescription,
- translateToLocal("gt.blockmachines.hatch.emmuffler.desc.1") + ": " + EnumChatFormatting.AQUA + String.format(Locale.ENGLISH, "%+.2E", overflowMax) + " eV/c\u00b2",
- translateToLocal("gt.blockmachines.hatch.emmuffler.desc.2") + ": " + EnumChatFormatting.AQUA + String.format(Locale.ENGLISH, "%+.2E", overflowDisperse) + " (eV/c\u00b2)/s",
+ translateToLocal("gt.blockmachines.hatch.emmuffler.desc.1") + ": " + EnumChatFormatting.AQUA + GT_Utility.formatNumbers(overflowMax) + " eV/c\u00b2",
+ translateToLocal("gt.blockmachines.hatch.emmuffler.desc.2") + ": " + EnumChatFormatting.AQUA + GT_Utility.formatNumbers(overflowDisperse) + " (eV/c\u00b2)/s",
translateToLocal("gt.blockmachines.hatch.emmuffler.desc.3")
};
}
@@ -216,9 +217,10 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity
public String[] getInfoData() {
return new String[]{
translateToLocalFormatted("tt.keyphrase.Contained_mass", clientLocale) + ":",
- EnumChatFormatting.RED + Double.toString(overflowMatter) + EnumChatFormatting.RESET + " eV/c\u00b2 /",
- EnumChatFormatting.GREEN + Double.toString(overflowMax) + EnumChatFormatting.RESET + " eV/c\u00b2",
- translateToLocalFormatted("tt.keyphrase.Mass_Disposal_speed", clientLocale) + ": " + EnumChatFormatting.BLUE + overflowDisperse + EnumChatFormatting.RESET + " (eV/c\u00b2)/s"
+ EnumChatFormatting.RED + GT_Utility.formatNumbers(overflowMatter) + EnumChatFormatting.RESET + " eV/c\u00b2 /",
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(overflowMax) + EnumChatFormatting.RESET + " eV/c\u00b2",
+ translateToLocalFormatted("tt.keyphrase.Mass_Disposal_speed", clientLocale) + ": " +
+ EnumChatFormatting.BLUE + GT_Utility.formatNumbers(overflowDisperse) + EnumChatFormatting.RESET + " (eV/c\u00b2)/s"
};
}
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 584e28a607..05829c89e4 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,27 +1,28 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.Structure;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import com.github.technus.tectech.util.CommonValues;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
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;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -31,30 +32,6 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl
//region variables
private static Textures.BlockIcons.CustomIcon ScreenOFF;
private static Textures.BlockIcons.CustomIcon ScreenON;
- //endregion
-
- //region structure
- private static final String[][] shape = new String[][]{
- {"\u0002", "D000", "C0 0", "C0 . 0", "C0 0", "D000"},
- {"C01A10", "C01A10", "D1A1", "00B101B00", "11111111111", "C01110", "11111111111", "00B101B00", "D1A1", "C01A10", "C01A10",},
- {"C01A10", "A223222322", "A244242442", "03442424430", "12225252221", "A244222442", "12225252221", "03442424430", "A244242442", "A223222322", "C01A10",},
- {"D111", "A244222442", "A4G4", "A4G4", "12G21", "12G21", "12G21", "A4G4", "A4G4", "A244222442", "D111",},
- {"A0C0C0", "03444244430", "A4G4", "A4G4", "A4G4", "02G20", "A4G4", "A4G4", "A4G4", "03444244430", "A0C0C0",},
- {"00C!C00", "02444544420", "A4G4", "A4G4", "A4G4", "!5G5!", "A4G4", "A4G4", "A4G4", "02444544420", "00C!C00",},
- {"A0C0C0", "03444244430", "A4G4", "A4G4", "A4G4", "02G20", "A4G4", "A4G4", "A4G4", "03444244430", "A0C0C0",},
- {"D111", "A244222442", "A4G4", "A4G4", "12G21", "12G21", "12G21", "A4G4", "A4G4", "A244222442", "D111",},
- {"C01A10", "A223222322", "A244242442", "03442424430", "12225252221", "A244222442", "12225252221", "03442424430", "A244242442", "A223222322", "C01A10",},
- {"C01A10", "C01A10", "D1A1", "00B101B00", "11111111111", "C01110", "11111111111", "00B101B00", "D1A1", "C01A10", "C01A10",},
- {"\u0002", "D000", "C0 0", "C0 0", "C0 0", "D000"},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{4, 5, 12, 6, 0, 10};
- private static final IHatchAdder<GT_MetaTileEntity_EM_annihilation>[] addingMethods = adders(
- GT_MetaTileEntity_EM_annihilation::addClassicToMachineList,
- GT_MetaTileEntity_EM_annihilation::addElementalToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.annihilation.hint.0"),//1 - Classic Hatches or High Power Casing
@@ -62,6 +39,33 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl
};
//endregion
+ //region structure
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_annihilation> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_EM_annihilation>builder()
+ .addShape("main", transpose(new String[][]{
+ {" "," AB BA "," AB BA "," BBB "," A A A ","AA F AA"," A A A "," BBB "," AB BA "," AB BA "," "},
+ {" "," AB BA "," EECEEECEE "," EGGEEEGGE ","ACGGGEGGGCA","AEGGGDGGGEA","ACGGGEGGGCA"," EGGEEEGGE "," EECEEECEE "," AB BA "," "},
+ {" "," B B "," EGGEGEGGE "," G G "," G G "," G G "," G G "," G G "," EGGEGEGGE "," B B "," "},
+ {" AAA ","AA BAB AA","ACGGEGEGGCA"," G G "," G G "," G G "," G G "," G G ","ACGGEGEGGCA","AA BAB AA"," AAA "},
+ {" AHHHA ","BBBBBBBBBBB","BEEEDEDEEEB","BE EB"," G G "," G G "," G G ","BE EB","BEEEDEDEEEB","BBBBBBBBBBB"," AHHHA "},
+ {" AH~HA "," ABBBA "," EGGEEEGGE ","BE EB","AE EA","FD DF","AE EA","BE EB"," EGGEEEGGE "," ABBBA "," AHHHA "},
+ {" AHHHA ","BBBBBBBBBBB","BEEEDEDEEEB","BE EB"," G G "," G G "," G G ","BE EB","BEEEDEDEEEB","BBBBBBBBBBB"," AHHHA "},
+ {" AAA ","AA BAB AA","ACGGEGEGGCA"," G G "," G G "," G G "," G G "," G G ","ACGGEGEGGCA","AA BAB AA"," AAA "},
+ {" "," B B "," EGGEGEGGE "," G G "," G G "," G G "," G G "," G G "," EGGEGEGGE "," B B "," "},
+ {" "," AB BA "," EECEEECEE "," EGGEEEGGE ","ACGGGEGGGCA","AEGGGDGGGEA","ACGGGEGGGCA"," EGGEEEGGE "," EECEEECEE "," AB BA "," "},
+ {" "," AB BA "," AB BA "," BBB "," A A A ","AA F AA"," A A A "," BBB "," AB BA "," AB BA "," "}
+ }))
+ .addElement('A', ofBlock(sBlockCasingsTT, 4))
+ .addElement('B', ofBlock(sBlockCasingsTT, 5))
+ .addElement('C', ofBlock(sBlockCasingsTT, 6))
+ .addElement('D', ofBlock(sBlockCasingsTT, 10))
+ .addElement('E', ofBlock(sBlockCasingsTT, 12))
+ .addElement('F', ofHatchAdderOptional(GT_MetaTileEntity_EM_annihilation::addElementalToMachineList, textureOffset + 4,2, sBlockCasingsTT, 4))
+ .addElement('G', ofBlock(QuantumGlassBlock.INSTANCE, 0))
+ .addElement('H', ofHatchAdderOptional(GT_MetaTileEntity_EM_annihilation::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0))
+ .build();
+ //endregion
+
public GT_MetaTileEntity_EM_annihilation(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
@@ -77,7 +81,7 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 5, 5, 0);
+ return structureCheck_EM("main", 5, 5, 0);
}
@Override
@@ -107,7 +111,12 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 5, 5, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 5, 5, 0, hintsOnly, stackSize);
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_EM_annihilation> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@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 06476fb62e..448c930351 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,12 +1,12 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
-import com.github.technus.tectech.mechanics.structure.IStructureDefinition;
-import com.github.technus.tectech.mechanics.structure.StructureDefinition;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import com.github.technus.tectech.util.CommonValues;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -17,14 +17,14 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import static com.github.technus.tectech.mechanics.structure.StructureUtility.ofBlock;
-import static com.github.technus.tectech.mechanics.structure.StructureUtility.ofHatchAdderOptional;
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;
import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_decay.URANIUM_INGOT_MASS_DIFF;
import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_decay.URANIUM_MASS_TO_EU_INSTANT;
-import static gregtech.api.enums.GT_Values.E;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -49,92 +49,90 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E
//per dim disable thingies
//region structure actual
- private static final IStructureDefinition<GT_MetaTileEntity_EM_bhg> STRUCTURE_DEFINITION= StructureDefinition
- .<GT_MetaTileEntity_EM_bhg>builder()
- .addShapeOldApi("t1",new String[][]{
- {"\u000B", "M0000000", "L00 00", "L0 0", "L0 !!! 0", "L0 !.! 0", "L0 !!! 0", "L0 0", "L00 00", "M0000000",},
- {"\u0008", "O0A0", "O0A0", "O0A0", "O0A0", "N11111", "M1101011", "I000010010010000", "M1111111", "I000010010010000", "M1101011", "N11111", "O0A0", "O0A0", "O0A0", "O0A0",},
- {"\u0006", "O0A0", "O0A0", "O0A0", "P1", "P1", "M1111111", "L11E11", "L1B222B1", "G000B1A23332A1B000", "J111A23332A111", "G000B1A23332A1B000", "L1B222B1", "L11E11", "M1111111", "P1", "P1", "O0A0", "O0A0", "O0A0",},
- {"\u0005", "O0A0", "O0A0", "P1", "P1", "\u0004", "F00Q00", "H11M11", "F00Q00", "\u0004", "P1", "P1", "O0A0", "O0A0",},
- {"\u0004", "O0A0", "N00000", "P1", "P4", "P4", "\u0003", "F0S0", "E00S00", "F0144M4410", "E00S00", "F0S0", "\u0003", "P4", "P4", "P1", "N00000", "O0A0",},
- {"\u0003", "O0A0", "O0A0", "P1", "M2224222", "\u0004", "G2Q2", "G2Q2", "D00A2Q2A00", "F14Q41", "D00A2Q2A00", "G2Q2", "G2Q2", "\u0004", "M2224222", "P1", "O0A0", "O0A0",},
- {"\u0002", "O0A0", "N00000", "P1", "P4", "\u0006", "D0W0", "C00W00", "D014S410", "C00W00", "D0W0", "\u0006", "P4", "P1", "N00000", "O0A0",},
- {"\u0001", "O0A0", "O0A0", "P1", "M2224222", "\u0006", "E2U2", "E2U2", "B00A2U2A00", "D14U41", "B00A2U2A00", "E2U2", "E2U2", "\u0006", "M2224222", "P1", "O0A0", "O0A0",},
- {"\u0001", "O0A0", "P1", "P4", "\u0009", "B0[0", "C14W41", "B0[0", "\u0009", "P4", "P1", "O0A0",},
- {E, "O0A0", "O0A0", "P1", "P4", "\u0009", "A00[00", "C14W41", "A00[00", "\u0009", "P4", "P1", "O0A0", "O0A0",},
- {E, "O0A0", "P1", "\u000B", "A0]0", "B1[1", "A0]0", "\u000B", "P1", "O0A0",},
- {E, "O0A0", "P1", "\u000B", "A0]0", "B1[1", "A0]0", "\u000B", "P1", "O0A0",},
- {"O0A0", "O0A0", "M1111111", "\u0009", "B1[1", "B1[1", "001[100", "B1[1", "001[100", "B1[1", "B1[1", "\u0009", "M1111111", "O0A0", "O0A0",},
- {"O0A0", "N11111", "L11E11", "\u0001", "G2Q2", E, "E2U2", "\u0003", "B1[1", "B1[1", "A1]1", "01]10", "A1]1", "01]10", "A1]1", "B1[1", "B1[1", "\u0003", "E2U2", E, "G2Q2", "\u0001", "L11E11", "N11111", "O0A0",},
- {"O0A0", "M1101011", "L1B222B1", E, "F0S0", "G2Q2", "D0W0", "E2U2", "\u0003", "B1[1", "A1]1", "A1]1", "002[200", "A12[21", "002[200", "A1]1", "A1]1", "B1[1", "\u0003", "E2U2", "D0W0", "G2Q2", "F0S0", E, "L1B222B1", "M1101011", "O0A0",},
- {"L000000000", "I000010010010000", "G000B1A23332A1B000", "F00Q00", "E00S00", "D00A2Q2A00", "C00W00", "B00A2U2A00", "B0[0", "A00[00", "A0]0", "A0]0", "001[100", "01]10", "002[200", "003[300", "013[310", "003[300", "002[200", "01]10", "001[100", "A0]0", "A0]0", "A00[00", "B0[0", "B00A2U2A00", "C00W00", "D00A2Q2A00", "E00S00", "F00Q00", "G000B1A23332A1B000", "I000010010010000", "L000000000",},
- {"O0A0", "M1111111", "J111A23332A111", "H11M11", "F0144M4410", "F14Q41", "D014S410", "D14U41", "C14W41", "C14W41", "B1[1", "B1[1", "B1[1", "A1]1", "A12[21", "013[310", "A13[31", "013[310", "A12[21", "A1]1", "B1[1", "B1[1", "B1[1", "C14W41", "C14W41", "D14U41", "D014S410", "F14Q41", "F0144M4410", "H11M11", "J111A23332A111", "M1111111", "O0A0",},
- {"L000000000", "I000010010010000", "G000B1A23332A1B000", "F00Q00", "E00S00", "D00A2Q2A00", "C00W00", "B00A2U2A00", "B0[0", "A00[00", "A0]0", "A0]0", "001[100", "01]10", "002[200", "003[300", "013[310", "003[300", "002[200", "01]10", "001[100", "A0]0", "A0]0", "A00[00", "B0[0", "B00A2U2A00", "C00W00", "D00A2Q2A00", "E00S00", "F00Q00", "G000B1A23332A1B000", "I000010010010000", "L000000000",},
- {"O0A0", "M1101011", "L1B222B1", E, "F0S0", "G2Q2", "D0W0", "E2U2", "\u0003", "B1[1", "A1]1", "A1]1", "002[200", "A12[21", "002[200", "A1]1", "A1]1", "B1[1", "\u0003", "E2U2", "D0W0", "G2Q2", "F0S0", E, "L1B222B1", "M1101011", "O0A0",},
- {"O0A0", "N11111", "L11E11", "\u0001", "G2Q2", E, "E2U2", "\u0003", "B1[1", "B1[1", "A1]1", "01]10", "A1]1", "01]10", "A1]1", "B1[1", "B1[1", "\u0003", "E2U2", E, "G2Q2", "\u0001", "L11E11", "N11111", "O0A0",},
- {"O0A0", "O0A0", "M1111111", "\u0009", "B1[1", "B1[1", "001[100", "B1[1", "001[100", "B1[1", "B1[1", "\u0009", "M1111111", "O0A0", "O0A0",},
- {E, "O0A0", "P1", "\u000B", "A0]0", "B1[1", "A0]0", "\u000B", "P1", "O0A0",},
- {E, "O0A0", "P1", "\u000B", "A0]0", "B1[1", "A0]0", "\u000B", "P1", "O0A0",},
- {E, "O0A0", "O0A0", "P1", "P4", "\u0009", "A00[00", "C14W41", "A00[00", "\u0009", "P4", "P1", "O0A0", "O0A0",},
- {"\u0001", "O0A0", "P1", "P4", "\u0009", "B0[0", "C14W41", "B0[0", "\u0009", "P4", "P1", "O0A0",},
- {"\u0001", "O0A0", "O0A0", "P1", "M2224222", "\u0006", "E2U2", "E2U2", "B00A2U2A00", "D14U41", "B00A2U2A00", "E2U2", "E2U2", "\u0006", "M2224222", "P1", "O0A0", "O0A0",},
- {"\u0002", "O0A0", "N00000", "P1", "P4", "\u0006", "D0W0", "C00W00", "D014S410", "C00W00", "D0W0", "\u0006", "P4", "P1", "N00000", "O0A0",},
- {"\u0003", "O0A0", "O0A0", "P1", "M2224222", "\u0004", "G2Q2", "G2Q2", "D00A2Q2A00", "F14Q41", "D00A2Q2A00", "G2Q2", "G2Q2", "\u0004", "M2224222", "P1", "O0A0", "O0A0",},
- {"\u0004", "O0A0", "N00000", "P1", "P4", "P4", "\u0003", "F0S0", "E00S00", "F0144M4410", "E00S00", "F0S0", "\u0003", "P4", "P4", "P1", "N00000", "O0A0",},
- {"\u0005", "O0A0", "O0A0", "P1", "P1", "\u0004", "F00Q00", "H11M11", "F00Q00", "\u0004", "P1", "P1", "O0A0", "O0A0",},
- {"\u0006", "O0A0", "O0A0", "O0A0", "P1", "P1", "M1111111", "L11E11", "L1B222B1", "G000B1A23332A1B000", "J111A23332A111", "G000B1A23332A1B000", "L1B222B1", "L11E11", "M1111111", "P1", "P1", "O0A0", "O0A0", "O0A0",},
- {"\u0008", "O0A0", "O0A0", "O0A0", "O0A0", "N11111", "M1101011", "I000010010010000", "M1111111", "I000010010010000", "M1101011", "N11111", "O0A0", "O0A0", "O0A0", "O0A0",},
- {"\u000B", "O0A0", "O0A0", "O0A0", "L000000000", "O0A0", "L000000000", "O0A0", "O0A0", "O0A0",},
- })
- .addShapeOldApi("t2",new String[][]{
- {"\u000B", "M0000000", "L00 00", "L0 0", "L0 !!! 0", "L0 !.! 0", "L0 !!! 0", "L0 0", "L00 00", "M0000000",},
- {"\u0008", "O0A0", "M550A055", "L5550A0555", "K55550A05555", "J5555111115555", "J5551101011555", "I000010010010000", "M1111111", "I000010010010000", "J5551101011555", "J5555111115555", "K55550A05555", "L5550A0555", "M550A055", "O0A0",},
- {"\u0006", "O0A0", "M550A055", "K55550A05555", "J555C1C555", "I555D1D555", "I55B1111111B55", "H55B11E11B55", "H55B1B222B1B55", "G000B1A23332A1B000", "J111A23332A111", "G000B1A23332A1B000", "H55B1B222B1B55", "H55B11E11B55", "I55B1111111B55", "I555D1D555", "J555C1C555", "K55550A05555", "M550A055", "O0A0",},
- {"\u0005", "O0A0", "L5550A0555", "J555C1C555", "I55E1E55", "H55M55", "H5O5", "G55O55", "G5Q5", "G5Q5", "F00Q00", "H11M11", "F00Q00", "G5Q5", "G5Q5", "G55O55", "H5O5", "H55M55", "I55E1E55", "J555C1C555", "L5550A0555", "O0A0",},
- {"\u0004", "O0A0", "K55500000555", "I555D1D555", "H55F4F55", "G55G4G55", "G5Q5", "F55Q55", "F5S5", "F5S5", "F0S0", "E00S00", "F0144M4410", "E00S00", "F0S0", "F5S5", "F5S5", "F55Q55", "G5Q5", "G55G4G55", "H55F4F55", "I555D1D555", "K55500000555", "O0A0",},
- {"\u0003", "O0A0", "J555550A055555", "H555E1E555", "G55D2224222D55", "F55Q55", "F5S5", "E55S55", "E5U5", "E5U5", "E5A2Q2A5", "E5A2Q2A5", "D00A2Q2A00", "F14Q41", "D00A2Q2A00", "E5A2Q2A5", "E5A2Q2A5", "E5U5", "E5U5", "E55S55", "F5S5", "F55Q55", "G55D2224222D55", "H555E1E555", "J555550A055555", "O0A0",},
- {"\u0002", "O0A0", "K55500000555", "H555E1E555", "G55G4G55", "F5S5", "E55S55", "E5U5", "E5U5", "D5W5", "D5W5", "D5W5", "D0W0", "C00W00", "D014S410", "C00W00", "D0W0", "D5W5", "D5W5", "D5W5", "E5U5", "E5U5", "E55S55", "F5S5", "G55G4G55", "H555E1E555", "K55500000555", "O0A0",},
- {"\u0001", "O0A0", "L5550A0555", "I555D1D555", "G55D2224222D55", "F5S5", "E5U5", "E5U5", "D5W5", "D5W5", "D5W5", "C5Y5", "C5A2U2A5", "C5A2U2A5", "B00A2U2A00", "D14U41", "B00A2U2A00", "C5A2U2A5", "C5A2U2A5", "C5Y5", "D5W5", "D5W5", "D5W5", "E5U5", "E5U5", "F5S5", "G55D2224222D55", "I555D1D555", "L5550A0555", "O0A0",},
- {"\u0001", "M550A055", "J555C1C555", "H55F4F55", "F55Q55", "E55S55", "E5U5", "D5W5", "D5W5", "C5Y5", "C5Y5", "C5Y5", "B5[5", "B5[5", "B0[0", "C14W41", "B0[0", "B5[5", "B5[5", "C5Y5", "C5Y5", "C5Y5", "D5W5", "D5W5", "E5U5", "E55S55", "F55Q55", "H55F4F55", "J555C1C555", "M550A055",},
- {E, "O0A0", "K55550A05555", "I55E1E55", "G55G4G55", "F5S5", "E5U5", "D5W5", "D5W5", "C5Y5", "C5Y5", "B5[5", "B5[5", "B5[5", "B5[5", "A00[00", "C14W41", "A00[00", "B5[5", "B5[5", "B5[5", "B5[5", "C5Y5", "C5Y5", "D5W5", "D5W5", "E5U5", "F5S5", "G55G4G55", "I55E1E55", "K55550A05555", "O0A0",},
- {E, "M550A055", "J555C1C555", "H55M55", "G5Q5", "E55S55", "E5U5", "D5W5", "C5Y5", "C5Y5", "B5[5", "B5[5", "B5[5", "A5]5", "A5]5", "A0]0", "B1[1", "A0]0", "A5]5", "A5]5", "B5[5", "B5[5", "B5[5", "C5Y5", "C5Y5", "D5W5", "E5U5", "E55S55", "G5Q5", "H55M55", "J555C1C555", "M550A055",},
- {E, "L5550A0555", "I555D1D555", "H5O5", "F55Q55", "E5U5", "D5W5", "D5W5", "C5Y5", "B5[5", "B5[5", "B5[5", "A5]5", "A5]5", "A5]5", "A0]0", "B1[1", "A0]0", "A5]5", "A5]5", "A5]5", "B5[5", "B5[5", "B5[5", "C5Y5", "D5W5", "D5W5", "E5U5", "F55Q55", "H5O5", "I555D1D555", "L5550A0555",},
- {"O0A0", "K55550A05555", "I55B1111111B55", "G55O55", "F5S5", "E5U5", "D5W5", "C5Y5", "C5Y5", "B5[5", "B5[5", "A5]5", "A5]5", "A51[15", "A51[15", "001[100", "B1[1", "001[100", "A51[15", "A51[15", "A5]5", "A5]5", "B5[5", "B5[5", "C5Y5", "C5Y5", "D5W5", "E5U5", "F5S5", "G55O55", "I55B1111111B55", "K55550A05555", "O0A0",},
- {"O0A0", "J5555111115555", "H55B11E11B55", "G5Q5", "F5S5", "E5A2Q2A5", "D5W5", "C5A2U2A5", "B5[5", "B5[5", "A5]5", "A5]5", "A51[15", "A51[15", "A1]1", "01]10", "A1]1", "01]10", "A1]1", "A51[15", "A51[15", "A5]5", "A5]5", "B5[5", "B5[5", "C5A2U2A5", "D5W5", "E5A2Q2A5", "F5S5", "G5Q5", "H55B11E11B55", "J5555111115555", "O0A0",},
- {"O0A0", "J5551101011555", "H55B1B222B1B55", "G5Q5", "F0S0", "E5A2Q2A5", "D0W0", "C5A2U2A5", "B5[5", "B5[5", "A5]5", "A5]5", "A51[15", "A1]1", "A1]1", "002[200", "A12[21", "002[200", "A1]1", "A1]1", "A51[15", "A5]5", "A5]5", "B5[5", "B5[5", "C5A2U2A5", "D0W0", "E5A2Q2A5", "F0S0", "G5Q5", "H55B1B222B1B55", "J5551101011555", "O0A0",},
- {"L000000000", "I000010010010000", "G000B1A23332A1B000", "F00Q00", "E00S00", "D00A2Q2A00", "C00W00", "B00A2U2A00", "B0[0", "A00[00", "A0]0", "A0]0", "001[100", "01]10", "002[200", "003[300", "013[310", "003[300", "002[200", "01]10", "001[100", "A0]0", "A0]0", "A00[00", "B0[0", "B00A2U2A00", "C00W00", "D00A2Q2A00", "E00S00", "F00Q00", "G000B1A23332A1B000", "I000010010010000", "L000000000",},
- {"O0A0", "M1111111", "J111A23332A111", "H11M11", "F0144M4410", "F14Q41", "D014S410", "D14U41", "C14W41", "C14W41", "B1[1", "B1[1", "B1[1", "A1]1", "A12[21", "013[310", "A13[31", "013[310", "A12[21", "A1]1", "B1[1", "B1[1", "B1[1", "C14W41", "C14W41", "D14U41", "D014S410", "F14Q41", "F0144M4410", "H11M11", "J111A23332A111", "M1111111", "O0A0",},
- {"L000000000", "I000010010010000", "G000B1A23332A1B000", "F00Q00", "E00S00", "D00A2Q2A00", "C00W00", "B00A2U2A00", "B0[0", "A00[00", "A0]0", "A0]0", "001[100", "01]10", "002[200", "003[300", "013[310", "003[300", "002[200", "01]10", "001[100", "A0]0", "A0]0", "A00[00", "B0[0", "B00A2U2A00", "C00W00", "D00A2Q2A00", "E00S00", "F00Q00", "G000B1A23332A1B000", "I000010010010000", "L000000000",},
- {"O0A0", "J5551101011555", "H55B1B222B1B55", "G5Q5", "F0S0", "E5A2Q2A5", "D0W0", "C5A2U2A5", "B5[5", "B5[5", "A5]5", "A5]5", "A51[15", "A1]1", "A1]1", "002[200", "A12[21", "002[200", "A1]1", "A1]1", "A51[15", "A5]5", "A5]5", "B5[5", "B5[5", "C5A2U2A5", "D0W0", "E5A2Q2A5", "F0S0", "G5Q5", "H55B1B222B1B55", "J5551101011555", "O0A0",},
- {"O0A0", "J5555111115555", "H55B11E11B55", "G5Q5", "F5S5", "E5A2Q2A5", "D5W5", "C5A2U2A5", "B5[5", "B5[5", "A5]5", "A5]5", "A51[15", "A51[15", "A1]1", "01]10", "A1]1", "01]10", "A1]1", "A51[15", "A51[15", "A5]5", "A5]5", "B5[5", "B5[5", "C5A2U2A5", "D5W5", "E5A2Q2A5", "F5S5", "G5Q5", "H55B11E11B55", "J5555111115555", "O0A0",},
- {"O0A0", "K55550A05555", "I55B1111111B55", "G55O55", "F5S5", "E5U5", "D5W5", "C5Y5", "C5Y5", "B5[5", "B5[5", "A5]5", "A5]5", "A51[15", "A51[15", "001[100", "B1[1", "001[100", "A51[15", "A51[15", "A5]5", "A5]5", "B5[5", "B5[5", "C5Y5", "C5Y5", "D5W5", "E5U5", "F5S5", "G55O55", "I55B1111111B55", "K55550A05555", "O0A0",},
- {E, "L5550A0555", "I555D1D555", "H5O5", "F55Q55", "E5U5", "D5W5", "D5W5", "C5Y5", "B5[5", "B5[5", "B5[5", "A5]5", "A5]5", "A5]5", "A0]0", "B1[1", "A0]0", "A5]5", "A5]5", "A5]5", "B5[5", "B5[5", "B5[5", "C5Y5", "D5W5", "D5W5", "E5U5", "F55Q55", "H5O5", "I555D1D555", "L5550A0555",},
- {E, "M550A055", "J555C1C555", "H55M55", "G5Q5", "E55S55", "E5U5", "D5W5", "C5Y5", "C5Y5", "B5[5", "B5[5", "B5[5", "A5]5", "A5]5", "A0]0", "B1[1", "A0]0", "A5]5", "A5]5", "B5[5", "B5[5", "B5[5", "C5Y5", "C5Y5", "D5W5", "E5U5", "E55S55", "G5Q5", "H55M55", "J555C1C555", "M550A055",},
- {E, "O0A0", "K55550A05555", "I55E1E55", "G55G4G55", "F5S5", "E5U5", "D5W5", "D5W5", "C5Y5", "C5Y5", "B5[5", "B5[5", "B5[5", "B5[5", "A00[00", "C14W41", "A00[00", "B5[5", "B5[5", "B5[5", "B5[5", "C5Y5", "C5Y5", "D5W5", "D5W5", "E5U5", "F5S5", "G55G4G55", "I55E1E55", "K55550A05555", "O0A0",},
- {"\u0001", "M550A055", "J555C1C555", "H55F4F55", "F55Q55", "E55S55", "E5U5", "D5W5", "D5W5", "C5Y5", "C5Y5", "C5Y5", "B5[5", "B5[5", "B0[0", "C14W41", "B0[0", "B5[5", "B5[5", "C5Y5", "C5Y5", "C5Y5", "D5W5", "D5W5", "E5U5", "E55S55", "F55Q55", "H55F4F55", "J555C1C555", "M550A055",},
- {"\u0001", "O0A0", "L5550A0555", "I555D1D555", "G55D2224222D55", "F5S5", "E5U5", "E5U5", "D5W5", "D5W5", "D5W5", "C5Y5", "C5A2U2A5", "C5A2U2A5", "B00A2U2A00", "D14U41", "B00A2U2A00", "C5A2U2A5", "C5A2U2A5", "C5Y5", "D5W5", "D5W5", "D5W5", "E5U5", "E5U5", "F5S5", "G55D2224222D55", "I555D1D555", "L5550A0555", "O0A0",},
- {"\u0002", "O0A0", "K55500000555", "H555E1E555", "G55G4G55", "F5S5", "E55S55", "E5U5", "E5U5", "D5W5", "D5W5", "D5W5", "D0W0", "C00W00", "D014S410", "C00W00", "D0W0", "D5W5", "D5W5", "D5W5", "E5U5", "E5U5", "E55S55", "F5S5", "G55G4G55", "H555E1E555", "K55500000555", "O0A0",},
- {"\u0003", "O0A0", "J555550A055555", "H555E1E555", "G55D2224222D55", "F55Q55", "F5S5", "E55S55", "E5U5", "E5U5", "E5A2Q2A5", "E5A2Q2A5", "D00A2Q2A00", "F14Q41", "D00A2Q2A00", "E5A2Q2A5", "E5A2Q2A5", "E5U5", "E5U5", "E55S55", "F5S5", "F55Q55", "G55D2224222D55", "H555E1E555", "J555550A055555", "O0A0",},
- {"\u0004", "O0A0", "K55500000555", "I555D1D555", "H55F4F55", "G55G4G55", "G5Q5", "F55Q55", "F5S5", "F5S5", "F0S0", "E00S00", "F0144M4410", "E00S00", "F0S0", "F5S5", "F5S5", "F55Q55", "G5Q5", "G55G4G55", "H55F4F55", "I555D1D555", "K55500000555", "O0A0",},
- {"\u0005", "O0A0", "L5550A0555", "J555C1C555", "I55E1E55", "H55M55", "H5O5", "G55O55", "G5Q5", "G5Q5", "F00Q00", "H11M11", "F00Q00", "G5Q5", "G5Q5", "G55O55", "H5O5", "H55M55", "I55E1E55", "J555C1C555", "L5550A0555", "O0A0",},
- {"\u0006", "O0A0", "M550A055", "K55550A05555", "J555C1C555", "I555D1D555", "I55B1111111B55", "H55B11E11B55", "H55B1B222B1B55", "G000B1A23332A1B000", "J111A23332A111", "G000B1A23332A1B000", "H55B1B222B1B55", "H55B11E11B55", "I55B1111111B55", "I555D1D555", "J555C1C555", "K55550A05555", "M550A055", "O0A0",},
- {"\u0008", "O0A0", "M550A055", "L5550A0555", "K55550A05555", "J5555111115555", "J5551101011555", "I000010010010000", "M1111111", "I000010010010000", "J5551101011555", "J5555111115555", "K55550A05555", "L5550A0555", "M550A055", "O0A0",},
- {"\u000B", "O0A0", "O0A0", "O0A0", "L000000000", "O0A0", "L000000000", "O0A0", "O0A0", "O0A0",},
- })
- .addElement('0', ofBlock(sBlockCasingsTT,12))
- .addElement('1', ofBlock(sBlockCasingsTT,13))
- .addElement('2', ofBlock(sBlockCasingsTT,14))
- .addElement('3', ofBlock(sBlockCasingsTT,10))
- .addElement('4', ofBlock(sBlockCasingsTT,11))
- .addElement('5', ofBlock(QuantumGlassBlock.INSTANCE,0))
- .addElement(' ', ofHatchAdderOptional(GT_MetaTileEntity_EM_bhg::addClassicToMachineList,
- textureOffset,1,sBlockCasingsTT,0))
- .addElement('!', ofHatchAdderOptional(GT_MetaTileEntity_EM_bhg::addElementalToMachineList,
- textureOffset + 4,2,sBlockCasingsTT,4))
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_bhg> STRUCTURE_DEFINITION=
+ StructureDefinition.<GT_MetaTileEntity_EM_bhg>builder()
+ .addShape("main_t1", transpose(new String[][]{
+ {" "," "," "," "," "," "," "," "," "," "," "," "," C C "," C C "," C C "," CCCCCCCCC "," C C "," CCCCCCCCC "," C C "," C C "," C C "," "," "," "," "," "," "," "," "," "," "," "," "},
+ {" "," "," "," "," "," "," "," "," "," C C "," C C "," C C "," C C "," DDDDD "," DDCDCDD "," CCCCDCCDCCDCCCC "," DDDDDDD "," CCCCDCCDCCDCCCC "," DDCDCDD "," DDDDD "," C C "," C C "," C C "," C C "," "," "," "," "," "," "," "," "," "},
+ {" "," "," "," "," "," "," "," C C "," C C "," C C "," D "," D "," DDDDDDD "," DD DD "," D EEE D "," CCC D EAAAE D CCC "," DDD EAAAE DDD "," CCC D EAAAE D CCC "," D EEE D "," DD DD "," DDDDDDD "," D "," D "," C C "," C C "," C C "," "," "," "," "," "," "," "},
+ {" "," "," "," "," "," "," C C "," C C "," D "," D "," "," "," "," "," "," CC CC "," DD DD "," CC CC "," "," "," "," "," "," D "," D "," C C "," C C "," "," "," "," "," "," "},
+ {" "," "," "," "," "," C C "," CCCCC "," D "," B "," B "," "," "," "," "," C C "," CC CC "," CDBB BBDC "," CC CC "," C C "," "," "," "," "," B "," B "," D "," CCCCC "," C C "," "," "," "," "," "},
+ {" "," "," "," "," C C "," C C "," D "," EEEBEEE "," "," "," "," "," "," E E "," E E "," CC E E CC "," DB BD "," CC E E CC "," E E "," E E "," "," "," "," "," "," EEEBEEE "," D "," C C "," C C "," "," "," "," "},
+ {" "," "," "," C C "," CCCCC "," D "," B "," "," "," "," "," "," "," "," C C "," CC CC "," CDB BDC "," CC CC "," C C "," "," "," "," "," "," "," "," B "," D "," CCCCC "," C C "," "," "," "},
+ {" "," "," C C "," C C "," D "," EEEBEEE "," "," "," "," "," "," "," "," E E "," E E "," CC E E CC "," DB BD "," CC E E CC "," E E "," E E "," "," "," "," "," "," "," "," EEEBEEE "," D "," C C "," C C "," "," "},
+ {" "," "," C C "," D "," B "," "," "," "," "," "," "," "," "," "," "," C C "," DB BD "," C C "," "," "," "," "," "," "," "," "," "," "," B "," D "," C C "," "," "},
+ {" "," C C "," C C "," D "," B "," "," "," "," "," "," "," "," "," "," "," CC CC "," DB BD "," CC CC "," "," "," "," "," "," "," "," "," "," "," B "," D "," C C "," C C "," "},
+ {" "," C C "," D "," "," "," "," "," "," "," "," "," "," "," "," "," C C "," D D "," C C "," "," "," "," "," "," "," "," "," "," "," "," "," D "," C C "," "},
+ {" "," C C "," D "," "," "," "," "," "," "," "," "," "," "," "," "," C C "," D D "," C C "," "," "," "," "," "," "," "," "," "," "," "," "," D "," C C "," "},
+ {" CCCCCCC "," C C "," DDDDDDD "," "," "," "," "," "," "," "," "," "," "," D D "," D D ","CCD DCC"," D D ","CCD DCC"," D D "," D D "," "," "," "," "," "," "," "," "," "," "," DDDDDDD "," C C "," C C "},
+ {" CCHHHHHCC "," DDDDD "," DD DD "," "," "," E E "," "," E E "," "," "," "," "," D D "," D D "," D D ","CD DC"," D D ","CD DC"," D D "," D D "," D D "," "," "," "," "," E E "," "," E E "," "," "," DD DD "," DDDDD "," C C "},
+ {" CHHHHHHHC "," DDCDCDD "," D EEE D "," "," C C "," E E "," C C "," E E "," "," "," "," "," D D "," D D "," D D ","CCE ECC"," DE ED ","CCE ECC"," D D "," D D "," D D "," "," "," "," "," E E "," C C "," E E "," C C "," "," D EEE D "," DDCDCDD "," C C "},
+ {" CHHFFFHHC "," CCCCDCCDCCDCCCC "," CCC D EAAAE D CCC "," CC CC "," CC CC "," CC E E CC "," CC CC "," CC E E CC "," C C "," CC CC "," C C "," C C ","CCD DCC","CD DC","CCE ECC","CCA ACC","CDA ADC","CCA ACC","CCE ECC","CD DC","CCD DCC"," C C "," C C "," CC CC "," C C "," CC E E CC "," CC CC "," CC E E CC "," CC CC "," CC CC "," CCC D EAAAE D CCC "," CCCCDCCDCCDCCCC "," CCCCCCCCC "},
+ {" CHHF~FHHC "," DDDDDDD "," DDD EAAAE DDD "," DD DD "," CDBB BBDC "," DB BD "," CDB BDC "," DB BD "," DB BD "," DB BD "," D D "," D D "," D D "," D D "," DE ED ","CDA ADC"," DA AD ","CDA ADC"," DE ED "," D D "," D D "," D D "," D D "," DB BD "," DB BD "," DB BD "," CDB BDC "," DB BD "," CDBB BBDC "," DD DD "," DDD EAAAE DDD "," DDDDDDD "," C C "},
+ {" CHHFFFHHC "," CCCCDCCDCCDCCCC "," CCC D EAAAE D CCC "," CC CC "," CC CC "," CC E E CC "," CC CC "," CC E E CC "," C C "," CC CC "," C C "," C C ","CCD DCC","CD DC","CCE ECC","CCA ACC","CDA ADC","CCA ACC","CCE ECC","CD DC","CCD DCC"," C C "," C C "," CC CC "," C C "," CC E E CC "," CC CC "," CC E E CC "," CC CC "," CC CC "," CCC D EAAAE D CCC "," CCCCDCCDCCDCCCC "," CCCCCCCCC "},
+ {" CHHHHHHHC "," DDCDCDD "," D EEE D "," "," C C "," E E "," C C "," E E "," "," "," "," "," D D "," D D "," D D ","CCE ECC"," DE ED ","CCE ECC"," D D "," D D "," D D "," "," "," "," "," E E "," C C "," E E "," C C "," "," D EEE D "," DDCDCDD "," C C "},
+ {" CCHHHHHCC "," DDDDD "," DD DD "," "," "," E E "," "," E E "," "," "," "," "," D D "," D D "," D D ","CD DC"," D D ","CD DC"," D D "," D D "," D D "," "," "," "," "," E E "," "," E E "," "," "," DD DD "," DDDDD "," C C "},
+ {" CCCCCCC "," C C "," DDDDDDD "," "," "," "," "," "," "," "," "," "," "," D D "," D D ","CCD DCC"," D D ","CCD DCC"," D D "," D D "," "," "," "," "," "," "," "," "," "," "," DDDDDDD "," C C "," C C "},
+ {" "," C C "," D "," "," "," "," "," "," "," "," "," "," "," "," "," C C "," D D "," C C "," "," "," "," "," "," "," "," "," "," "," "," "," D "," C C "," "},
+ {" "," C C "," D "," "," "," "," "," "," "," "," "," "," "," "," "," C C "," D D "," C C "," "," "," "," "," "," "," "," "," "," "," "," "," D "," C C "," "},
+ {" "," C C "," C C "," D "," B "," "," "," "," "," "," "," "," "," "," "," CC CC "," DB BD "," CC CC "," "," "," "," "," "," "," "," "," "," "," B "," D "," C C "," C C "," "},
+ {" "," "," C C "," D "," B "," "," "," "," "," "," "," "," "," "," "," C C "," DB BD "," C C "," "," "," "," "," "," "," "," "," "," "," B "," D "," C C "," "," "},
+ {" "," "," C C "," C C "," D "," EEEBEEE "," "," "," "," "," "," "," "," E E "," E E "," CC E E CC "," DB BD "," CC E E CC "," E E "," E E "," "," "," "," "," "," "," "," EEEBEEE "," D "," C C "," C C "," "," "},
+ {" "," "," "," C C "," CCCCC "," D "," B "," "," "," "," "," "," "," "," C C "," CC CC "," CDB BDC "," CC CC "," C C "," "," "," "," "," "," "," "," B "," D "," CCCCC "," C C "," "," "," "},
+ {" "," "," "," "," C C "," C C "," D "," EEEBEEE "," "," "," "," "," "," E E "," E E "," CC E E CC "," DB BD "," CC E E CC "," E E "," E E "," "," "," "," "," "," EEEBEEE "," D "," C C "," C C "," "," "," "," "},
+ {" "," "," "," "," "," C C "," CCCCC "," D "," B "," B "," "," "," "," "," C C "," CC CC "," CDBB BBDC "," CC CC "," C C "," "," "," "," "," B "," B "," D "," CCCCC "," C C "," "," "," "," "," "},
+ {" "," "," "," "," "," "," C C "," C C "," D "," D "," "," "," "," "," "," CC CC "," DD DD "," CC CC "," "," "," "," D "," D "," D "," D "," C C "," C C "," "," "," "," "," "," "},
+ {" "," "," "," "," "," "," "," C C "," C C "," C C "," D "," D "," DDDDDDD "," DD DD "," D EEE D "," CCC D EAAAE D CCC "," DDD EAAAE DDD "," CCC D EAAAE D CCC "," D EEE D "," DD DD "," DDDDDDD "," D "," D "," C C "," C C "," C C "," "," "," "," "," "," "," "},
+ {" "," "," "," "," "," "," "," "," "," C C "," C C "," C C "," C C "," DDDDD "," DDCDCDD "," CCCCDCCDCCDCCCC "," DDDDDDD "," CCCCDCCDCCDCCCC "," DDCDCDD "," DDDDD "," C C "," C C "," C C "," C C "," "," "," "," "," "," "," "," "," "},
+ {" "," "," "," "," "," "," "," "," "," "," "," "," C C "," C C "," C C "," CCCCCCCCC "," C C "," CCCCCCCCC "," C C "," C C "," C C "," "," "," "," "," "," "," "," "," "," "," "," "}
+ }))
+ .addShape("main_t2", transpose(new String[][]{
+ {" "," "," "," "," "," "," "," "," "," "," "," "," C C "," C C "," C C "," CCCCCCCCC "," C C "," CCCCCCCCC "," C C "," C C "," C C "," "," "," "," "," "," "," "," "," "," "," "," "},
+ {" "," "," "," "," "," "," "," "," "," C C "," GGC CGG "," GGGC CGGG "," GGGGC CGGGG "," GGGGDDDDDGGGG "," GGGDDCDCDDGGG "," CCCCDCCDCCDCCCC "," DDDDDDD "," CCCCDCCDCCDCCCC "," GGGDDCDCDDGGG "," GGGGDDDDDGGGG "," GGGGC CGGGG "," GGGC CGGG "," GGC CGG "," C C "," "," "," "," "," "," "," "," "," "},
+ {" "," "," "," "," "," "," "," C C "," GGC CGG "," GGGGC CGGGG "," GGG D GGG "," GGG D GGG "," GG DDDDDDD GG "," GG DD DD GG "," GG D EEE D GG "," CCC D EAAAE D CCC "," DDD EAAAE DDD "," CCC D EAAAE D CCC "," GG D EEE D GG "," GG DD DD GG "," GG DDDDDDD GG "," GGG D GGG "," GGG D GGG "," GGGGC CGGGG "," GGC CGG "," C C "," "," "," "," "," "," "," "},
+ {" "," "," "," "," "," "," C C "," GGGC CGGG "," GGG D GGG "," GG D GG "," GG GG "," G G "," GG GG "," G G "," G G "," CC CC "," DD DD "," CC CC "," G G "," G G "," GG GG "," G G "," GG GG "," GG D GG "," GGG D GGG "," GGGC CGGG "," C C "," "," "," "," "," "," "},
+ {" "," "," "," "," "," C C "," GGGCCCCCGGG "," GGG D GGG "," GG B GG "," GG B GG "," G G "," GG GG "," G G "," G G "," C C "," CC CC "," CDBB BBDC "," CC CC "," C C "," G G "," G G "," GG GG "," G G "," GG B GG "," GG B GG "," GGG D GGG "," GGGCCCCCGGG "," C C "," "," "," "," "," "},
+ {" "," "," "," "," C C "," GGGGGC CGGGGG "," GGG D GGG "," GG EEEBEEE GG "," GG GG "," G G "," GG GG "," G G "," G G "," G E E G "," G E E G "," CC E E CC "," DB BD "," CC E E CC "," G E E G "," G E E G "," G G "," G G "," GG GG "," G G "," GG GG "," GG EEEBEEE GG "," GGG D GGG "," GGGGGC CGGGGG "," C C "," "," "," "," "},
+ {" "," "," "," C C "," GGGCCCCCGGG "," GGG D GGG "," GG B GG "," G G "," GG GG "," G G "," G G "," G G "," G G "," G G "," C C "," CC CC "," CDB BDC "," CC CC "," C C "," G G "," G G "," G G "," G G "," G G "," GG GG "," G G "," GG B GG "," GGG D GGG "," GGGCCCCCGGG "," C C "," "," "," "},
+ {" "," "," C C "," GGGC CGGG "," GGG D GGG "," GG EEEBEEE GG "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G E E G "," G E E G "," CC E E CC "," DB BD "," CC E E CC "," G E E G "," G E E G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," GG EEEBEEE GG "," GGG D GGG "," GGGC CGGG "," C C "," "," "},
+ {" "," "," GGC CGG "," GGG D GGG "," GG B GG "," GG GG "," GG GG "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," C C "," DB BD "," C C "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," GG GG "," GG GG "," GG B GG "," GGG D GGG "," GGC CGG "," "," "},
+ {" "," C C "," GGGGC CGGGG "," GG D GG "," GG B GG "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," CC CC "," DB BD "," CC CC "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," GG B GG "," GG D GG "," GGGGC CGGGG "," C C "," "},
+ {" "," GGC CGG "," GGG D GGG "," GG GG "," G G "," GG GG "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," C C "," D D "," C C "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," GG GG "," G G "," GG GG "," GGG D GGG "," GGC CGG "," "},
+ {" "," GGGC CGGG "," GGG D GGG "," G G "," GG GG "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," C C "," D D "," C C "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," GG GG "," G G "," GGG D GGG "," GGGC CGGG "," "},
+ {" CCCCCCC "," GGGGC CGGGG "," GG DDDDDDD GG "," GG GG "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," GD DG "," GD DG ","CCD DCC"," D D ","CCD DCC"," GD DG "," GD DG "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," GG GG "," GG DDDDDDD GG "," GGGGC CGGGG "," C C "},
+ {" CCHHHHHCC "," GGGGDDDDDGGGG "," GG DD DD GG "," G G "," G G "," G E E G "," G G "," G E E G "," G G "," G G "," G G "," G G "," GD DG "," GD DG "," D D ","CD DC"," D D ","CD DC"," D D "," GD DG "," GD DG "," G G "," G G "," G G "," G G "," G E E G "," G G "," G E E G "," G G "," G G "," GG DD DD GG "," GGGGDDDDDGGGG "," C C "},
+ {" CHHHHHHHC "," GGGDDCDCDDGGG "," GG D EEE D GG "," G G "," C C "," G E E G "," C C "," G E E G "," G G "," G G "," G G "," G G "," GD DG "," D D "," D D ","CCE ECC"," DE ED ","CCE ECC"," D D "," D D "," GD DG "," G G "," G G "," G G "," G G "," G E E G "," C C "," G E E G "," C C "," G G "," GG D EEE D GG "," GGGDDCDCDDGGG "," C C "},
+ {" CHHFFFHHC "," CCCCDCCDCCDCCCC "," CCC D EAAAE D CCC "," CC CC "," CC CC "," CC E E CC "," CC CC "," CC E E CC "," C C "," CC CC "," C C "," C C ","CCD DCC","CD DC","CCE ECC","CCA ACC","CDA ADC","CCA ACC","CCE ECC","CD DC","CCD DCC"," C C "," C C "," CC CC "," C C "," CC E E CC "," CC CC "," CC E E CC "," CC CC "," CC CC "," CCC D EAAAE D CCC "," CCCCDCCDCCDCCCC "," CCCCCCCCC "},
+ {" CHHF~FHHC "," DDDDDDD "," DDD EAAAE DDD "," DD DD "," CDBB BBDC "," DB BD "," CDB BDC "," DB BD "," DB BD "," DB BD "," D D "," D D "," D D "," D D "," DE ED ","CDA ADC"," DA AD ","CDA ADC"," DE ED "," D D "," D D "," D D "," D D "," DB BD "," DB BD "," DB BD "," CDB BDC "," DB BD "," CDBB BBDC "," DD DD "," DDD EAAAE DDD "," DDDDDDD "," C C "},
+ {" CHHFFFHHC "," CCCCDCCDCCDCCCC "," CCC D EAAAE D CCC "," CC CC "," CC CC "," CC E E CC "," CC CC "," CC E E CC "," C C "," CC CC "," C C "," C C ","CCD DCC","CD DC","CCE ECC","CCA ACC","CDA ADC","CCA ACC","CCE ECC","CD DC","CCD DCC"," C C "," C C "," CC CC "," C C "," CC E E CC "," CC CC "," CC E E CC "," CC CC "," CC CC "," CCC D EAAAE D CCC "," CCCCDCCDCCDCCCC "," CCCCCCCCC "},
+ {" CHHHHHHHC "," GGGDDCDCDDGGG "," GG D EEE D GG "," G G "," C C "," G E E G "," C C "," G E E G "," G G "," G G "," G G "," G G "," GD DG "," D D "," D D ","CCE ECC"," DE ED ","CCE ECC"," D D "," D D "," GD DG "," G G "," G G "," G G "," G G "," G E E G "," C C "," G E E G "," C C "," G G "," GG D EEE D GG "," GGGDDCDCDDGGG "," C C "},
+ {" CCHHHHHCC "," GGGGDDDDDGGGG "," GG DD DD GG "," G G "," G G "," G E E G "," G G "," G E E G "," G G "," G G "," G G "," G G "," GD DG "," GD DG "," D D ","CD DC"," D D ","CD DC"," D D "," GD DG "," GD DG "," G G "," G G "," G G "," G G "," G E E G "," G G "," G E E G "," G G "," G G "," GG DD DD GG "," GGGGDDDDDGGGG "," C C "},
+ {" CCCCCCC "," GGGGC CGGGG "," GG DDDDDDD GG "," GG GG "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," GD DG "," GD DG ","CCD DCC"," D D ","CCD DCC"," GD DG "," GD DG "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," GG GG "," GG DDDDDDD GG "," GGGGC CGGGG "," C C "},
+ {" "," GGGC CGGG "," GGG D GGG "," G G "," GG GG "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," C C "," D D "," C C "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," GG GG "," G G "," GGG D GGG "," GGGC CGGG "," "},
+ {" "," GGC CGG "," GGG D GGG "," GG GG "," G G "," GG GG "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," C C "," D D "," C C "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," GG GG "," G G "," GG GG "," GGG D GGG "," GGC CGG "," "},
+ {" "," C C "," GGGGC CGGGG "," GG D GG "," GG B GG "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," CC CC "," DB BD "," CC CC "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," GG B GG "," GG D GG "," GGGGC CGGGG "," C C "," "},
+ {" "," "," GGC CGG "," GGG D GGG "," GG B GG "," GG GG "," GG GG "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," C C "," DB BD "," C C "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," GG GG "," GG GG "," GG B GG "," GGG D GGG "," GGC CGG "," "," "},
+ {" "," "," C C "," GGGC CGGG "," GGG D GGG "," GG EEEBEEE GG "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," G E E G "," G E E G "," CC E E CC "," DB BD "," CC E E CC "," G E E G "," G E E G "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," GG EEEBEEE GG "," GGG D GGG "," GGGC CGGG "," C C "," "," "},
+ {" "," "," "," C C "," GGGCCCCCGGG "," GGG D GGG "," GG B GG "," G G "," GG GG "," G G "," G G "," G G "," G G "," G G "," C C "," CC CC "," CDB BDC "," CC CC "," C C "," G G "," G G "," G G "," G G "," G G "," GG GG "," G G "," GG B GG "," GGG D GGG "," GGGCCCCCGGG "," C C "," "," "," "},
+ {" "," "," "," "," C C "," GGGGGC CGGGGG "," GGG D GGG "," GG EEEBEEE GG "," GG GG "," G G "," GG GG "," G G "," G G "," G E E G "," G E E G "," CC E E CC "," DB BD "," CC E E CC "," G E E G "," G E E G "," G G "," G G "," GG GG "," G G "," GG GG "," GG EEEBEEE GG "," GGG D GGG "," GGGGGC CGGGGG "," C C "," "," "," "," "},
+ {" "," "," "," "," "," C C "," GGGCCCCCGGG "," GGG D GGG "," GG B GG "," GG B GG "," G G "," GG GG "," G G "," G G "," C C "," CC CC "," CDBB BBDC "," CC CC "," C C "," G G "," G G "," GG GG "," G G "," GG B GG "," GG B GG "," GGG D GGG "," GGGCCCCCGGG "," C C "," "," "," "," "," "},
+ {" "," "," "," "," "," "," C C "," GGGC CGGG "," GGG D GGG "," GG D GG "," GG GG "," G G "," GG GG "," G G "," G G "," CC CC "," DD DD "," CC CC "," G G "," G G "," GG GG "," G D G "," GG D GG "," GG D GG "," GGG D GGG "," GGGC CGGG "," C C "," "," "," "," "," "," "},
+ {" "," "," "," "," "," "," "," C C "," GGC CGG "," GGGGC CGGGG "," GGG D GGG "," GGG D GGG "," GG DDDDDDD GG "," GG DD DD GG "," GG D EEE D GG "," CCC D EAAAE D CCC "," DDD EAAAE DDD "," CCC D EAAAE D CCC "," GG D EEE D GG "," GG DD DD GG "," GG DDDDDDD GG "," GGG D GGG "," GGG D GGG "," GGGGC CGGGG "," GGC CGG "," C C "," "," "," "," "," "," "," "},
+ {" "," "," "," "," "," "," "," "," "," C C "," GGC CGG "," GGGC CGGG "," GGGGC CGGGG "," GGGGDDDDDGGGG "," GGGDDCDCDDGGG "," CCCCDCCDCCDCCCC "," DDDDDDD "," CCCCDCCDCCDCCCC "," GGGDDCDCDDGGG "," GGGGDDDDDGGGG "," GGGGC CGGGG "," GGGC CGGG "," GGC CGG "," C C "," "," "," "," "," "," "," "," "," "},
+ {" "," "," "," "," "," "," "," "," "," "," "," "," C C "," C C "," C C "," CCCCCCCCC "," C C "," CCCCCCCCC "," C C "," C C "," C C "," "," "," "," "," "," "," "," "," "," "," "," "}
+ }))
+ .addElement('A', ofBlock(sBlockCasingsTT, 10))
+ .addElement('B', ofBlock(sBlockCasingsTT, 11))
+ .addElement('C', ofBlock(sBlockCasingsTT, 12))
+ .addElement('D', ofBlock(sBlockCasingsTT, 13))
+ .addElement('E', ofBlock(sBlockCasingsTT, 14))
+ .addElement('F', ofHatchAdderOptional(GT_MetaTileEntity_EM_bhg::addElementalToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4))
+ .addElement('G', ofBlock(QuantumGlassBlock.INSTANCE, 0))
+ .addElement('H', ofHatchAdderOptional(GT_MetaTileEntity_EM_bhg::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0))
.build();
@Override
- public IStructureDefinition<? extends GT_MetaTileEntity_MultiblockBase_EM> getStructure_EM() {
+ public IStructureDefinition<GT_MetaTileEntity_EM_bhg> getStructure_EM() {
return STRUCTURE_DEFINITION;
}
@@ -308,7 +306,12 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- structureBuild_EM((stackSize.stackSize&1)==1?"t1":"t2", 16, 16, 0, hintsOnly,stackSize);
+ try {
+ structureBuild_EM((stackSize.stackSize & 1) == 1 ? "main_t1" : "main_t2", 16, 16, 0, hintsOnly, stackSize);
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
}
@Override
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 6a6a707399..31d41fb39e 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,10 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.Structure;
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;
@@ -12,7 +9,10 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.*;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.util.Util;
-import com.github.technus.tectech.util.Vec3Impl;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+import com.gtnewhorizon.structurelib.util.Vec3Impl;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -22,7 +22,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
-import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
@@ -30,13 +29,15 @@ import net.minecraft.util.ResourceLocation;
import java.util.ArrayList;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
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;
import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*;
import static com.github.technus.tectech.util.CommonValues.MULTI_CHECK_AT;
import static com.github.technus.tectech.util.CommonValues.V;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -51,23 +52,44 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB
//endregion
//region structure
- private static final String[][] front = new String[][]{{"A ", "A ", "A. ", "A ",},};
- private static final String[][] terminator = new String[][]{{"A ", "A ", "A ", "A ",},};
- private static final String[][] cap = new String[][]{{"-01", "A22", "A22", "-01",},};
- private static final String[][] slice = new String[][]{{"-01", "A!2", "A!2", "-01",},};
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{2, 1, 3};
- private static final IHatchAdder<GT_MetaTileEntity_EM_computer>[] addingMethods = adders(
- GT_MetaTileEntity_EM_computer::addToMachineList,
- GT_MetaTileEntity_EM_computer::addRackToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset + 1, textureOffset + 3};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{1, 3};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.computer.hint.0"),//1 - Classic/Data Hatches or Computer casing
translateToLocal("gt.blockmachines.multimachine.em.computer.hint.1"),//2 - Rack Hatches or Advanced computer casing
};
+
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_computer> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_EM_computer>builder()
+ .addShape("front", transpose(new String[][]{
+ {" AA"},
+ {" AA"},
+ {" ~A"},
+ {" AA"}
+ }))
+ .addShape("cap", transpose(new String[][]{
+ {"-CB"},
+ {" DD"},
+ {" DD"},
+ {"-CB"}
+ }))
+ .addShape("slice", transpose(new String[][]{
+ {"-CB"},
+ {" ED"},
+ {" ED"},
+ {"-CB"}
+ }))
+ .addShape("back", transpose(new String[][]{
+ {" AA"},
+ {" AA"},
+ {" AA"},
+ {" AA"}
+ }))
+ .addElement('A', ofHatchAdderOptional(GT_MetaTileEntity_EM_computer::addToMachineList, textureOffset + 1, 1, sBlockCasingsTT, 1))
+ .addElement('B', ofBlock(sBlockCasingsTT, 1))
+ .addElement('C', ofBlock(sBlockCasingsTT, 2))
+ .addElement('D', ofBlock(sBlockCasingsTT, 3))
+ .addElement('E', ofHatchAdderOptional(GT_MetaTileEntity_EM_computer::addRackToMachineList, textureOffset + 3, 2, sBlockCasingsTT, 3))
+ .build();
//endregion
//region parameters
@@ -129,15 +151,15 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB
}
}
eRacks.clear();
- if (!structureCheck_EM(front, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, 0)) {
+ if (!structureCheck_EM("front", 1, 2, 0)) {
return false;
}
- if (!structureCheck_EM(cap, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, -1)) {
+ if (!structureCheck_EM("cap", 1, 2, -1)) {
return false;
}
byte offset = -2, totalLen = 4;
while (offset > -16) {
- if (!structureCheck_EM(slice, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, offset)) {
+ if (!structureCheck_EM("slice", 1, 2, offset)) {
break;
}
totalLen++;
@@ -146,10 +168,10 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB
if (totalLen > 17) {
return false;
}
- if (!structureCheck_EM(cap, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, ++offset)) {
+ if (!structureCheck_EM("cap", 1, 2, ++offset)) {
return false;
}
- if (!structureCheck_EM(terminator, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, --offset)) {
+ if (!structureCheck_EM("back", 1, 2, --offset)) {
return false;
}
eCertainMode = (byte) Math.min(totalLen / 3, 5);
@@ -246,7 +268,10 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB
@Override
public void outputAfterRecipe_EM() {
if (!eOutputData.isEmpty()) {
- Vec3Impl pos = new Vec3Impl(getBaseMetaTileEntity());
+ Vec3Impl pos = new Vec3Impl(getBaseMetaTileEntity().getXCoord(),
+ getBaseMetaTileEntity().getYCoord(),
+ getBaseMetaTileEntity().getZCoord());
+
QuantumDataPacket pack = new QuantumDataPacket(eAvailableData / eOutputData.size()).unifyTraceWith(pos);
if (pack == null) {
return;
@@ -359,16 +384,21 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
IGregTechTileEntity igt = getBaseMetaTileEntity();
- Structure.builder(front, blockType, blockMeta, 1, 2, 0, igt, getExtendedFacing(), hintsOnly);
- Structure.builder(cap, blockType, blockMeta, 1, 2, -1, igt, getExtendedFacing(), hintsOnly);
+ structureBuild_EM("front", 1, 2, 0, hintsOnly, stackSize);
+ structureBuild_EM("cap", 1, 2, -1, hintsOnly, stackSize);
byte offset = -2;
for (int rackSlices = Math.min(stackSize.stackSize, 12); rackSlices > 0; rackSlices--) {
- Structure.builder(slice, blockType, blockMeta, 1, 2, offset--, igt, getExtendedFacing(), hintsOnly);
+ structureBuild_EM("slice", 1 , 2, offset--, hintsOnly, stackSize);
}
- Structure.builder(cap, blockType, blockMeta, 1, 2, offset--, igt, getExtendedFacing(), hintsOnly);
- Structure.builder(terminator, blockType, blockMeta, 1, 2, offset, igt, getExtendedFacing(), hintsOnly);
+ structureBuild_EM("cap", 1, 2, offset--, hintsOnly, stackSize);
+ structureBuild_EM("back", 1, 2, offset, hintsOnly, stackSize);
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_EM_computer> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@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 7d8204c07f..9c631c8af6 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,27 +1,28 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.Structure;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import com.github.technus.tectech.util.CommonValues;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
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;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -36,32 +37,30 @@ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockB
//endregion
//region structure
- private static final String[][] shape = new String[][]{
- {"A000", "0 0", "0 . 0", "0 0", "A000",},
- {"00000", "00000", "00000", "00000", "00000",},
- {"0C0", "A!!!", "A!1!", "A!!!", "0C0",},
- {"22222", "22222", "22122", "22222", "22222",},
- {"23432", "33333", "43134", "33333", "23432",},
- {"23332", "33333", "33533", "33333", "23332",},
- {"23432", "33333", "43134", "33333", "23432",},
- {"22222", "22222", "22122", "22222", "22222",},
- {"0C0", "A!!!", "A!1!", "A!!!", "0C0",},
- {"00000", "00000", "00000", "00000", "00000",},
- {"A000", "0 0", "0 0", "0 0", "A000",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{4, 10, 5, 0, 6, 9};
- private static final IHatchAdder<GT_MetaTileEntity_EM_crafting>[] addingMethods = adders(
- GT_MetaTileEntity_EM_crafting::addClassicToMachineList,
- GT_MetaTileEntity_EM_crafting::addElementalToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.crafter.hint.0"),//1 - Classic Hatches or High Power Casing
translateToLocal("gt.blockmachines.multimachine.em.crafter.hint.1"),//2 - Elemental Hatches or Molecular Casing
};
+
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_crafting> STRUCTURE_DEFINITION= StructureDefinition
+ .<GT_MetaTileEntity_EM_crafting>builder()
+ .addShape("main", transpose(new String[][]{
+ {" AAA ","AAAAA","A A","BBBBB","BGCGB","BGGGB","BGCGB","BBBBB","A A","AAAAA"," AAA "},
+ {"AHHHA","AAAAA"," FFF ","BBBBB","GGGGG","GGGGG","GGGGG","BBBBB"," FFF ","AAAAA","AHHHA"},
+ {"AH~HA","AAAAA"," FEF ","BBEBB","CGEGC","GGDGG","CGEGC","BBEBB"," FEF ","AAAAA","AHHHA"},
+ {"AHHHA","AAAAA"," FFF ","BBBBB","GGGGG","GGGGG","GGGGG","BBBBB"," FFF ","AAAAA","AHHHA"},
+ {" AAA ","AAAAA","A A","BBBBB","BGCGB","BGGGB","BGCGB","BBBBB","A A","AAAAA"," AAA "}
+ }))
+ .addElement('A', ofBlock(sBlockCasingsTT, 4))
+ .addElement('B', ofBlock(sBlockCasingsTT, 5))
+ .addElement('C', ofBlock(sBlockCasingsTT, 6))
+ .addElement('D', ofBlock(sBlockCasingsTT, 9))
+ .addElement('E', ofBlock(sBlockCasingsTT, 10))
+ .addElement('F', ofHatchAdderOptional(GT_MetaTileEntity_EM_crafting::addElementalToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4))
+ .addElement('G', ofBlock(QuantumGlassBlock.INSTANCE, 0))
+ .addElement('H', ofHatchAdderOptional(GT_MetaTileEntity_EM_crafting::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0))
+ .build();
//endregion
public GT_MetaTileEntity_EM_crafting(int aID, String aName, String aNameRegional) {
@@ -79,7 +78,7 @@ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockB
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0);
+ return structureCheck_EM("main", 2, 2, 0);
}
@Override
@@ -109,7 +108,12 @@ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockB
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 2, 2, 0, hintsOnly, stackSize);
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_EM_crafting> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@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 582be290ac..bea2b8a0ba 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,10 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.Reference;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
import com.github.technus.tectech.mechanics.dataTransport.InventoryDataPacket;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.Structure;
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;
@@ -12,6 +9,9 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContaine
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import com.github.technus.tectech.util.CommonValues;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -20,7 +20,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_DataAccess;
-import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
@@ -28,12 +27,14 @@ import net.minecraft.util.ResourceLocation;
import java.util.ArrayList;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
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;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
import static com.github.technus.tectech.util.CommonValues.V;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {
@@ -43,24 +44,24 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB
//endregion
//region structure
- private static final String[][] shape = new String[][]{
- {"0 0", "0 . 0", "0 0",},
- {"0!!!0", "01110", "0!!!0",},
- {"0!!!0", "0!!!0", "0!!!0",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{2, 1};
- private static final IHatchAdder<GT_MetaTileEntity_EM_dataBank>[] addingMethods = adders(
- GT_MetaTileEntity_EM_dataBank::addClassicToMachineList,
- GT_MetaTileEntity_EM_dataBank::addDataBankHatchToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 1};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 1};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.databank.hint.0"),//1 - Classic Hatches or high power casing
translateToLocal("gt.blockmachines.multimachine.em.databank.hint.1"),//2 - Data Access/Data Bank Master Hatches or computer casing
};
+
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_dataBank> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_EM_dataBank>builder()
+ .addShape("main", transpose(new String[][]{
+ {"BCCCB","BDDDB","BDDDB"},
+ {"BC~CB","BAAAB","BDDDB"},
+ {"BCCCB","BDDDB","BDDDB"}
+ }))
+ .addElement('A', ofBlock(sBlockCasingsTT, 1))
+ .addElement('B', ofBlock(sBlockCasingsTT, 2))
+ .addElement('C', ofHatchAdderOptional(GT_MetaTileEntity_EM_dataBank::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0))
+ .addElement('D', ofHatchAdderOptional(GT_MetaTileEntity_EM_dataBank::addDataBankHatchToMachineList, textureOffset + 1, 2, sBlockCasingsTT, 1))
+ .build();
//endregion
public GT_MetaTileEntity_EM_dataBank(int aID, String aName, String aNameRegional) {
@@ -80,7 +81,7 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
eDataAccessHatches.clear();
eStacksDataOutputs.clear();
- return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 1, 0);
+ return structureCheck_EM("main", 2, 1, 0);
}
@Override
@@ -174,7 +175,12 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 2, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 2, 1, 0, hintsOnly, stackSize);
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_EM_dataBank> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@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 1978d2acfc..75a1a7686f 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,10 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMInstanceStack;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.Structure;
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.GT_MetaTileEntity_MultiblockBase_EM;
@@ -13,6 +10,9 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunctio
import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import com.github.technus.tectech.util.CommonValues;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -21,9 +21,9 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.util.GT_Utility;
import ic2.core.init.MainConfig;
import ic2.core.util.ConfigUtil;
-import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@@ -32,13 +32,15 @@ import net.minecraft.util.EnumChatFormatting;
import org.apache.commons.lang3.reflect.FieldUtils;
import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.EM_COUNT_PER_MATERIAL_AMOUNT;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
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;
import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.STATUS_OK;
import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.STATUS_TOO_LOW;
import static com.github.technus.tectech.util.CommonValues.VN;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
import static net.minecraft.util.StatCollector.translateToLocalFormatted;
@@ -58,30 +60,28 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase
//endregion
//region structure
- private static final String[][] shape = new String[][]{
- {"0C0", "A ", "A . ", "A ", "0C0",},
- {"00000", "00000", "00000", "00000", "00000",},
- {"0C0", "A!!!", "A!0!", "A!!!", "0C0",},
- {"01110", "12221", "12221", "12221", "01110",},
- {"01310", "12221", "32223", "12221", "01310",},
- {"01110", "12221", "12221", "12221", "01110",},
- {"0C0", "A!!!", "A!0!", "A!!!", "0C0",},
- {"00000", "00000", "00000", "00000", "00000",},
- {"0C0", "A ", "A ", "A ", "0C0",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{4, 5, 8, 6};
- private static final IHatchAdder<GT_MetaTileEntity_EM_decay>[] addingMethods = adders(
- GT_MetaTileEntity_EM_decay::addClassicToMachineList,
- GT_MetaTileEntity_EM_decay::addElementalToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.decay.hint.0"),//1 - Classic Hatches or High Power Casing
translateToLocal("gt.blockmachines.multimachine.em.decay.hint.1"),//2 - Elemental Hatches or Molecular Casing
};
+
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_decay> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_EM_decay>builder()
+ .addShape("main",transpose(new String[][]{
+ {"A A","AAAAA","A A","ABBBA","ABCBA","ABBBA","A A","AAAAA","A A"},
+ {" FFF ","AAAAA"," EEE ","BDDDB","BDDDB","BDDDB"," EEE ","AAAAA"," FFF "},
+ {" F~F ","AAAAA"," EAE ","BDDDB","CDDDC","BDDDB"," EAE ","AAAAA"," FFF "},
+ {" FFF ","AAAAA"," EEE ","BDDDB","BDDDB","BDDDB"," EEE ","AAAAA"," FFF "},
+ {"A A","AAAAA","A A","ABBBA","ABCBA","ABBBA","A A","AAAAA","A A"}
+ }))
+ .addElement('A', ofBlock(sBlockCasingsTT, 4))
+ .addElement('B', ofBlock(sBlockCasingsTT, 5))
+ .addElement('C', ofBlock(sBlockCasingsTT, 6))
+ .addElement('D', ofBlock(sBlockCasingsTT, 8))
+ .addElement('E', ofHatchAdderOptional(GT_MetaTileEntity_EM_decay::addElementalToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4))
+ .addElement('F', ofHatchAdderOptional(GT_MetaTileEntity_EM_decay::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0))
+ .build();
//endregion
//region parameters
@@ -110,7 +110,7 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0);
+ return structureCheck_EM("main", 2, 2, 0);
}
@Override
@@ -189,21 +189,30 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase
return new String[]{
translateToLocalFormatted("tt.keyword.Progress", clientLocale) + ":",
- EnumChatFormatting.GREEN + Integer.toString(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " +
- EnumChatFormatting.YELLOW + mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s",
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " +
+ EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s",
translateToLocalFormatted("tt.keyphrase.Energy_Hatches", clientLocale) + ":",
- EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " +
- EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU",
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " +
+ EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU",
(mEUt <= 0 ? translateToLocalFormatted("tt.keyphrase.Probably_uses", clientLocale) + ": " : translateToLocalFormatted("tt.keyphrase.Probably_makes", clientLocale) + ": ") +
- EnumChatFormatting.RED + Math.abs(mEUt) + EnumChatFormatting.RESET + " EU/t at " +
- EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A",
- translateToLocalFormatted("tt.keyphrase.Tier_Rating", clientLocale) + ": " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET +
- " " + translateToLocalFormatted("tt.keyphrase.Amp_Rating", clientLocale) + ": " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A",
- translateToLocalFormatted("tt.keyword.Problems", clientLocale) + ": " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET +
- " " + translateToLocalFormatted("tt.keyword.Efficiency", clientLocale) + ": " + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %",
- translateToLocalFormatted("tt.keyword.PowerPass", clientLocale) + ": " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET +
- " " + translateToLocalFormatted("tt.keyword.SafeVoid", clientLocale) + ": " + EnumChatFormatting.BLUE + eSafeVoid,
- translateToLocalFormatted("tt.keyword.Computation", clientLocale) + ": " + EnumChatFormatting.GREEN + eAvailableData + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW + eRequiredData + EnumChatFormatting.RESET,
+ EnumChatFormatting.RED + GT_Utility.formatNumbers(Math.abs(mEUt)) + EnumChatFormatting.RESET + " EU/t at " +
+ EnumChatFormatting.RED + GT_Utility.formatNumbers(eAmpereFlow) + EnumChatFormatting.RESET + " A",
+ translateToLocalFormatted("tt.keyphrase.Tier_Rating", clientLocale) + ": " +
+ EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " +
+ EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + " " +
+ translateToLocalFormatted("tt.keyphrase.Amp_Rating", clientLocale) + ": " +
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(eMaxAmpereFlow) + EnumChatFormatting.RESET + " A",
+ translateToLocalFormatted("tt.keyword.Problems", clientLocale) + ": " +
+ EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " " +
+ translateToLocalFormatted("tt.keyword.Efficiency", clientLocale) + ": " +
+ EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %",
+ translateToLocalFormatted("tt.keyword.PowerPass", clientLocale) + ": " +
+ EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + " " +
+ translateToLocalFormatted("tt.keyword.SafeVoid", clientLocale) + ": " +
+ EnumChatFormatting.BLUE + eSafeVoid,
+ translateToLocalFormatted("tt.keyword.Computation", clientLocale) + ": " +
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(eAvailableData) + EnumChatFormatting.RESET + " / " +
+ EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(eRequiredData) + EnumChatFormatting.RESET,
};
}
@@ -248,11 +257,16 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 2, 2, 0, hintsOnly, stackSize);
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_EM_decay> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@Override
public String[] getStructureDescription(ItemStack stackSize) {
return description;
}
-} \ No newline at end of file
+}
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 7d5961f219..23fd332a2e 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,23 +1,22 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMInstanceStack;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.IEMStack;
import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMDequantizationInfo;
import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.OreDictionaryStack;
-import com.github.technus.tectech.mechanics.structure.Structure;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
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.util.CommonValues;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
@@ -29,10 +28,14 @@ import java.util.ArrayList;
import static com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition.STABLE_RAW_LIFE_TIME;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.EMAtomDefinition.refMass;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.EMAtomDefinition.refUnstableMass;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
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.casing.TT_Container_Casings.sHintCasingsTT;
import static com.github.technus.tectech.util.CommonValues.V;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -41,21 +44,22 @@ import static net.minecraft.util.StatCollector.translateToLocal;
public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {
//region structure
//use multi A energy inputs, use less power the longer it runs
- private static final String[][] shape = new String[][]{
- {" ", " . ", " ",},
- {"010", "111", "010",},
- {"\"\"\"", "\"1\"", "\"\"\"",},
- {"121", "2!2", "121",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE};
- private static final byte[] blockMeta = new byte[]{0, 4, 0};
- private static final IHatchAdder<GT_MetaTileEntity_EM_dequantizer>[] addingMethods = adders(
- GT_MetaTileEntity_EM_dequantizer::addClassicToMachineList,
- GT_MetaTileEntity_EM_dequantizer::addElementalInputToMachineList,
- GT_MetaTileEntity_EM_dequantizer::addElementalMufflerToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4, 4};
+
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_dequantizer> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_EM_dequantizer>builder()
+ .addShape("main", transpose(new String[][]{
+ {"CCC","ABA","EEE","BDB"},
+ {"C~C","BBB","EBE","DFD"},
+ {"CCC","ABA","EEE","BDB"}
+ }))
+ .addElement('A', ofBlock(sBlockCasingsTT, 0))
+ .addElement('B', ofBlock(sBlockCasingsTT, 4))
+ .addElement('C', ofHatchAdderOptional(GT_MetaTileEntity_EM_dequantizer::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0))
+ .addElement('D', ofBlock(QuantumGlassBlock.INSTANCE, 0))
+ .addElement('E', ofHatchAdderOptional(GT_MetaTileEntity_EM_dequantizer::addElementalMufflerToMachineList, textureOffset + 4, 3, sBlockCasingsTT, 4))
+ .addElement('F', ofHatchAdder(GT_MetaTileEntity_EM_dequantizer::addElementalInputToMachineList, textureOffset + 4, sHintCasingsTT, 1))
+ .build();
+
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.emtomatter.hint.0"),//1 - Classic Hatches or High Power Casing"
@@ -92,7 +96,7 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0);
+ return structureCheck_EM("main", 1, 1, 0);
}
@Override
@@ -138,11 +142,16 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 1, 1, 0, hintsOnly, stackSize);
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_EM_dequantizer> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@Override
public String[] getStructureDescription(ItemStack stackSize) {
return description;
}
-} \ No newline at end of file
+}
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 82fd2df5ed..18416e70f6 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
@@ -3,20 +3,19 @@ package com.github.technus.tectech.thing.metaTileEntity.multi;
import cofh.api.energy.IEnergyContainerItem;
import com.github.technus.tectech.Reference;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.Structure;
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.util.CommonValues;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
-import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -24,10 +23,12 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
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.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
import static gregtech.api.GregTech_API.mEUtoRF;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -35,22 +36,24 @@ import static net.minecraft.util.StatCollector.translateToLocal;
*/
public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {
//region structure
- private static final String[][] shape = new String[][]{
- {" ", "000", "1.1", "000", " ",},
- {" ", "010", "111", "010", " ",},
- {" ", "000", "111", "000", " ",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{7, 4};
- private static final IHatchAdder<GT_MetaTileEntity_EM_infuser>[] addingMethods = adders(
- GT_MetaTileEntity_EM_infuser::addClassicToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.infuser.hint"),//1 - Classic Hatches or High Power Casing
};
+
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_infuser> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_EM_infuser>builder()
+ .addShape("main", transpose(new String[][]{
+ {"CCC","CCC","CCC"},
+ {"BBB","BAB","BBB"},
+ {"A~A","AAA","AAA"},
+ {"BBB","BAB","BBB"},
+ {"CCC","CCC","CCC"}
+ }))
+ .addElement('A', ofBlock(sBlockCasingsTT, 4))
+ .addElement('B', ofBlock(sBlockCasingsTT, 7))
+ .addElement('C', ofHatchAdderOptional(GT_MetaTileEntity_EM_infuser::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0))
+ .build();
//endregion
public GT_MetaTileEntity_EM_infuser(int aID, String aName, String aNameRegional) {
@@ -114,7 +117,7 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, 0);
+ return structureCheck_EM("main", 1, 2, 0);
}
@Override
@@ -185,7 +188,12 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 1, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 1, 2, 0, hintsOnly, stackSize);
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_EM_infuser> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@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 d4e85de6f9..451443fa8a 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,8 +1,5 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.Structure;
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.GT_MetaTileEntity_MultiblockBase_EM;
@@ -10,19 +7,21 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.INameFunction;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunction;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters;
import com.github.technus.tectech.util.CommonValues;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Utility;
-import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
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.*;
import static com.github.technus.tectech.util.CommonValues.V;
-import static gregtech.api.enums.GT_Values.E;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -31,32 +30,32 @@ import static net.minecraft.util.StatCollector.translateToLocal;
public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {
//region structure
//use multi A energy inputs, use less power the longer it runs
- private static final String[][] shape = new String[][]{
- {" ", " . ", " ",},
- {"000", "000", "000",},
- {"!!!", "!0!", "!!!",},
- {"!!!", "!!!", "!!!",},
- };
- private static final String[][] shapeBig = new String[][]{
- {E, "A ", "A . ", "A ",},
- {"A!!!", "!000!", "!010!", "!000!", "A!!!",},
- {"!!!!!", "!000!", "!000!", "!000!", "!!!!!",},
- {"A!!!", "!000!", "!000!", "!000!", "A!!!",},
- {"A!!!", "!!!!!", "!!!!!", "!!!!!", "A!!!",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{4, 5};
- private static final IHatchAdder<GT_MetaTileEntity_EM_junction>[] addingMethods = adders(
- GT_MetaTileEntity_EM_junction::addClassicToMachineList,
- GT_MetaTileEntity_EM_junction::addElementalToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.junction.hint.0"),//1 - Classic Hatches or High Power Casing
translateToLocal("gt.blockmachines.multimachine.em.junction.hint.1"),//2 - Elemental Hatches or Molecular Casing
};
+
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_junction> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_EM_junction>builder()
+ .addShape("main", new String[][]{
+ {"CCC", "C~C", "CCC"},
+ {"AAA", "AAA", "AAA"},
+ {"DDD", "DAD", "DDD"},
+ {"DDD", "DDD", "DDD"}
+ })
+ .addShape("mainBig", new String[][]{
+ {" ", " CCC ", " C~C ", " CCC ", " "},
+ {" DDD ", "DAAAD", "DABAD", "DAAAD", " DDD "},
+ {"DDDDD", "DAAAD", "DAAAD", "DAAAD", "DDDDD"},
+ {" DDD ", "DAAAD", "DAAAD", "DAAAD", " DDD "},
+ {" DDD ", "DDDDD", "DDDDD", "DDDDD", " DDD "}
+ })
+ .addElement('A', ofBlock(sBlockCasingsTT, 4))
+ .addElement('B', ofBlock(sBlockCasingsTT, 5))
+ .addElement('C', ofHatchAdderOptional(GT_MetaTileEntity_EM_junction::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0))
+ .addElement('D', ofHatchAdderOptional(GT_MetaTileEntity_EM_junction::addElementalToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4))
+ .build();
//endregion
//region parameters
@@ -106,9 +105,9 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
int meta = iGregTechTileEntity.getMetaIDAtSide(GT_Utility.getOppositeSide(iGregTechTileEntity.getFrontFacing()));
if (meta == 4) {
- return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0);
+ return structureCheck_EM("main", 1, 1, 0);
} else if (meta == 5) {
- return structureCheck_EM(shapeBig, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0);
+ return structureCheck_EM("mainBig", 2, 2, 0);
}
return false;
}
@@ -177,7 +176,16 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ if ((stackSize.stackSize & 1) == 1) {
+ structureBuild_EM("main", 1, 1, 0, hintsOnly, stackSize);
+ } else {
+ structureBuild_EM("mainBig", 2, 2, 0, hintsOnly, stackSize);
+ }
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_EM_junction> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@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 be036050be..19148d2f77 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
@@ -2,24 +2,23 @@ package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.Reference;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMInstanceStack;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.IEMStack;
import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMFluidQuantizationInfo;
import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMItemQuantizationInfo;
import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMOredictQuantizationInfo;
-import com.github.technus.tectech.mechanics.structure.Structure;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.util.CommonValues;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
@@ -33,13 +32,16 @@ import static com.github.technus.tectech.mechanics.elementalMatter.core.definiti
import static com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition.STABLE_RAW_LIFE_TIME;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.EMAtomDefinition.refMass;
import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.EMAtomDefinition.refUnstableMass;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
import static com.github.technus.tectech.recipe.TT_recipeAdder.nullFluid;
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.TT_Container_Casings.sBlockCasingsTT;
import static com.github.technus.tectech.util.CommonValues.V;
import static com.github.technus.tectech.util.Util.isInputEqual;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -48,21 +50,21 @@ import static net.minecraft.util.StatCollector.translateToLocal;
public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {
//region structure
//use multi A energy inputs, use less power the longer it runs
- private static final String[][] shape = new String[][]{
- {" ", " . ", " ",},
- {"010", "101", "010",},
- {"\"\"\"", "\"0\"", "\"\"\"",},
- {"202", "0!0", "202",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE};
- private static final byte[] blockMeta = new byte[]{4, 0, 0};
- private static final IHatchAdder<GT_MetaTileEntity_EM_quantizer>[] addingMethods = adders(
- GT_MetaTileEntity_EM_quantizer::addClassicToMachineList,
- GT_MetaTileEntity_EM_quantizer::addElementalOutputToMachineList,
- GT_MetaTileEntity_EM_quantizer::addElementalMufflerToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4, 4};
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_quantizer> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_EM_quantizer>builder()
+ .addShape("main", transpose(new String[][]{
+ {"CCC","BAB","EEE","DBD"},
+ {"C~C","ABA","EBE","BFB"},
+ {"CCC","BAB","EEE","DBD"}
+ }))
+ .addElement('A', ofBlock(sBlockCasingsTT, 0))
+ .addElement('B', ofBlock(sBlockCasingsTT, 4))
+ .addElement('C', ofHatchAdderOptional(GT_MetaTileEntity_EM_quantizer::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0))
+ .addElement('D', ofBlock(QuantumGlassBlock.INSTANCE, 0))
+ .addElement('E', ofHatchAdderOptional(GT_MetaTileEntity_EM_quantizer::addElementalMufflerToMachineList, textureOffset + 4, 3, sBlockCasingsTT, 4))
+ .addElement('F', ofHatchAdder(GT_MetaTileEntity_EM_quantizer::addElementalOutputToMachineList,textureOffset + 4, 2))
+ .build();
+
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.mattertoem.hint.0"),//1 - Classic Hatches or High Power Casing
@@ -86,7 +88,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0);
+ return structureCheck_EM("main", 1, 1, 0);
}
@Override
@@ -198,11 +200,16 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 1, 1, 0, hintsOnly, stackSize);
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_EM_quantizer> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@Override
public String[] getStructureDescription(ItemStack stackSize) {
return description;
}
-} \ No newline at end of file
+}
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 889b4cfec3..f5fc1fa3af 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,14 +1,14 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.Structure;
import com.github.technus.tectech.recipe.TT_recipe;
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.render.TT_RenderedExtendedFacingTexture;
import com.github.technus.tectech.util.CommonValues;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Textures;
@@ -22,10 +22,8 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
@@ -36,7 +34,6 @@ import org.apache.commons.lang3.reflect.FieldUtils;
import java.util.ArrayList;
import java.util.LinkedHashMap;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
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;
@@ -45,7 +42,10 @@ import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileE
import static com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine.machine;
import static com.github.technus.tectech.util.CommonValues.V;
import static com.github.technus.tectech.util.CommonValues.VN;
-import static gregtech.api.enums.GT_Values.E;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
import static net.minecraft.util.StatCollector.translateToLocalFormatted;
@@ -64,32 +64,33 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB
private static LinkedHashMap<String, String> lServerNames;
- private String clientLocale = "en_US";
- //endregion
-
- //region structure
- private static final String[][] shape = new String[][]{
- {E, "000", E, E, E, "000"/*,E,*/},
- {"A0", "010", "A1", "A!", "A1", "010", "A0",},
- {"A0", "010", E, E, E, "010", "A0",},
- {"000", "010", E, E, E, "010", "000",},
- {"000", "212", "010", "0.0", "010", "212", "000",},
- {"000", "212", "111", "111", "111", "212", "000",},
- {"000", "222", " ", " ", " ", "222", "000",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{1, 3, 2};
- private static final IHatchAdder<GT_MetaTileEntity_EM_research>[] addingMethods = adders(
- GT_MetaTileEntity_EM_research::addClassicToMachineList,
- GT_MetaTileEntity_EM_research::addHolderToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset + 1, textureOffset + 3};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, Blocks.air};
- private static final byte[] blockMetaFallback = new byte[]{1, 0};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.research.hint.0"),//1 - Classic/Data Hatches or Computer casing
translateToLocal("gt.blockmachines.multimachine.em.research.hint.1"),//2 - Holder Hatch
};
+
+ private String clientLocale = "en_US";
+ //endregion
+
+ //region structure
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_research> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_EM_research>builder()
+ .addShape("main", transpose(new String[][]{
+ {" ", " A ", " A ", "AAA", "AAA", "AAA", "AAA"},
+ {"AAA", "ACA", "ACA", "ACA", "BCB", "BCB", "BBB"},
+ {" ", " C ", " ", " ", "ACA", "CCC", "DDD"},
+ {" ", " E ", " ", " ", "A~A", "CCC", "DDD"},
+ {" ", " C ", " ", " ", "ACA", "CCC", "DDD"},
+ {"AAA", "ACA", "ACA", "ACA", "BCB", "BCB", "BBB"},
+ {" ", " A ", " A ", "AAA", "AAA", "AAA", "AAA"}
+ }))
+ .addElement('A', ofBlock(sBlockCasingsTT, 1))
+ .addElement('B', ofBlock(sBlockCasingsTT, 2))
+ .addElement('C', ofBlock(sBlockCasingsTT, 3))
+ .addElement('D', ofHatchAdderOptional(GT_MetaTileEntity_EM_research::addClassicToMachineList, textureOffset + 1,1, sBlockCasingsTT,1))
+ .addElement('E', ofHatchAdder(GT_MetaTileEntity_EM_research::addHolderToMachineList, 3, 2))
+ .build();
//endregion
public GT_MetaTileEntity_EM_research(int aID, String aName, String aNameRegional) {
@@ -262,7 +263,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB
}
eHolders.clear();
- if (!structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 3, 4)) {
+ if (!structureCheck_EM("main", 1, 3, 4)) {
return false;
}
@@ -378,21 +379,31 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB
return new String[]{
translateToLocalFormatted("tt.keyphrase.Energy_Hatches", clientLocale) + ":",
- EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " +
- EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU",
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " +
+ EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU",
(mEUt <= 0 ? translateToLocalFormatted("tt.keyphrase.Probably_uses", clientLocale) + ": " : translateToLocalFormatted("tt.keyphrase.Probably_makes", clientLocale) + ": ") +
- EnumChatFormatting.RED + Math.abs(mEUt) + EnumChatFormatting.RESET + " EU/t " + translateToLocalFormatted("tt.keyword.at", clientLocale) + " " +
- EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A",
- translateToLocalFormatted("tt.keyphrase.Tier_Rating", clientLocale) + ": " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET +
- " " + translateToLocalFormatted("tt.keyphrase.Amp_Rating", clientLocale) + ": " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A",
- translateToLocalFormatted("tt.keyword.Problems", clientLocale) + ": " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET +
- " " + translateToLocalFormatted("tt.keyword.Efficiency", clientLocale) + ": " + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %",
- translateToLocalFormatted("tt.keyword.PowerPass", clientLocale) + ": " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET +
- " " + translateToLocalFormatted("tt.keyword.SafeVoid", clientLocale) + ": " + EnumChatFormatting.BLUE + eSafeVoid,
- translateToLocalFormatted("tt.keyphrase.Computation_Available", clientLocale) + ": " + EnumChatFormatting.GREEN + eAvailableData + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW + eRequiredData + EnumChatFormatting.RESET,
+ EnumChatFormatting.RED + GT_Utility.formatNumbers(Math.abs(mEUt)) + EnumChatFormatting.RESET + " EU/t " +
+ translateToLocalFormatted("tt.keyword.at", clientLocale) + " " +
+ EnumChatFormatting.RED + GT_Utility.formatNumbers(eAmpereFlow) + EnumChatFormatting.RESET + " A",
+ translateToLocalFormatted("tt.keyphrase.Tier_Rating", clientLocale) + ": " +
+ EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " +
+ EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + " " +
+ translateToLocalFormatted("tt.keyphrase.Amp_Rating", clientLocale) + ": " +
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(eMaxAmpereFlow) + EnumChatFormatting.RESET + " A",
+ translateToLocalFormatted("tt.keyword.Problems", clientLocale) + ": " +
+ EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " " +
+ translateToLocalFormatted("tt.keyword.Efficiency", clientLocale) + ": " +
+ EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %",
+ translateToLocalFormatted("tt.keyword.PowerPass", clientLocale) + ": " +
+ EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + " " +
+ translateToLocalFormatted("tt.keyword.SafeVoid", clientLocale) + ": " +
+ EnumChatFormatting.BLUE + eSafeVoid,
+ translateToLocalFormatted("tt.keyphrase.Computation_Available", clientLocale) + ": " +
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(eAvailableData) + EnumChatFormatting.RESET + " / " +
+ EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(eRequiredData) + EnumChatFormatting.RESET,
translateToLocalFormatted("tt.keyphrase.Computation_Remaining", clientLocale) + ":",
- EnumChatFormatting.GREEN + Long.toString(computationRemaining / 20L) + EnumChatFormatting.RESET + " / " +
- EnumChatFormatting.YELLOW + computationRequired / 20L
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(computationRemaining / 20L) + EnumChatFormatting.RESET + " / " +
+ EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(computationRequired / 20L)
};
}
@@ -559,7 +570,12 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 1, 3, 4, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 1, 3, 4, hintsOnly, stackSize);
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_EM_research> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@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 89255b331a..62d9e24360 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,13 +1,11 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
+import com.github.technus.tectech.mechanics.elementalMatter.core.EMException;
import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMDefinitionStack;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMInstanceStack;
-import com.github.technus.tectech.mechanics.elementalMatter.core.EMException;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.Structure;
+import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMPrimitiveDefinition;
import com.github.technus.tectech.recipe.TT_recipe;
import com.github.technus.tectech.thing.CustomItemList;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
@@ -16,6 +14,9 @@ import com.github.technus.tectech.thing.item.ElementalDefinitionScanStorage_EM;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.*;
import com.github.technus.tectech.util.CommonValues;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import gregtech.api.enums.ItemList;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -23,6 +24,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energ
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
@@ -35,8 +37,6 @@ import net.minecraftforge.common.util.ForgeDirection;
import org.apache.commons.lang3.reflect.FieldUtils;
import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
-import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMPrimitiveDefinition.nbtE__;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
import static com.github.technus.tectech.recipe.TT_recipe.E_RECIPE_ID;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
@@ -45,6 +45,10 @@ import static com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.G
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.areBitsSet;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
import static net.minecraft.util.StatCollector.translateToLocalFormatted;
@@ -61,7 +65,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
private TT_recipe.TT_EMRecipe.TT_EMRecipe eRecipe;
private EMDefinitionStack objectResearched;
private EMInstanceStackMap objectsScanned;
- private String machineType;
+ private String machineType;
private long computationRemaining, computationRequired;
private int[] scanComplexity;
@@ -69,26 +73,6 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
//endregion
//region structure
- private static final String[][] shape = new String[][]{
- {" ", " 222 ", " 2.2 ", " 222 ", " ",},
- {"00000", "00000", "00000", "00000", "00000",},
- {"00100", "01110", "11111", "01110", "00100",},
- {"01110", "1---1", "1---1", "1---1", "01110",},
- {"01110", "1---1", "1-A-1", "1---1", "01110",},
- {"01110", "1---1", "1---1", "1---1", "01110",},
- {"00100", "01110", "11\"11", "01110", "00100",},
- {"#####", "#000#", "#0!0#", "#000#", "#####",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{4, 0, 0};
- private static final IHatchAdder<GT_MetaTileEntity_EM_scanner>[] addingMethods = adders(
- GT_MetaTileEntity_EM_scanner::addClassicToMachineList,
- GT_MetaTileEntity_EM_scanner::addElementalInputToMachineList,
- GT_MetaTileEntity_EM_scanner::addElementalOutputToMachineList,
- GT_MetaTileEntity_EM_scanner::addElementalMufflerToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4, 4, 4};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.scanner.hint.0"),//1 - Classic Hatches or High Power Casing
@@ -96,6 +80,24 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
translateToLocal("gt.blockmachines.multimachine.em.scanner.hint.2"),//3 - Elemental Output Hatches or Molecular Casing
translateToLocal("gt.blockmachines.multimachine.em.scanner.hint.3"),//4 - Elemental Overflow Hatches or Molecular Casing
};
+
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_scanner> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_EM_scanner>builder()
+ .addShape("main", transpose(new String[][]{
+ {"CCCCC","BBBBB","BBDBB","BDDDB","BDDDB","BDDDB","BBDBB","EEEEE"},
+ {"CAAAC","BBBBB","BDDDB","D---D","D---D","D---D","BDDDB","EBBBE"},
+ {"CA~AC","BBBBB","DDDDD","D---D","D---D","D---D","DDGDD","EBFBE"},
+ {"CAAAC","BBBBB","BDDDB","D---D","D---D","D---D","BDDDB","EBBBE"},
+ {"CCCCC","BBBBB","BBDBB","BDDDB","BDDDB","BDDDB","BBDBB","EEEEE"}
+ }))
+ .addElement('A', ofBlock(sBlockCasingsTT, 0))
+ .addElement('B', ofBlock(sBlockCasingsTT, 4))
+ .addElement('C', ofHatchAdderOptional(GT_MetaTileEntity_EM_scanner::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0))
+ .addElement('D', ofBlock(QuantumGlassBlock.INSTANCE, 0))
+ .addElement('E', ofHatchAdderOptional(GT_MetaTileEntity_EM_scanner::addElementalMufflerToMachineList, textureOffset + 4, 4, sBlockCasingsTT, 4))
+ .addElement('F', ofHatchAdder(GT_MetaTileEntity_EM_scanner::addElementalInputToMachineList, textureOffset + 4, 2))
+ .addElement('G', ofHatchAdder(GT_MetaTileEntity_EM_scanner::addElementalOutputToMachineList, textureOffset + 4, 3))
+ .build();
//endregion
//region parameters
@@ -108,9 +110,12 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
return LedStatus.STATUS_WRONG;
}
v = (int) v;
- if (v == 0) return LedStatus.STATUS_NEUTRAL;
- if (v >= SCAN_GET_CLASS_TYPE) return LedStatus.STATUS_TOO_HIGH;
- if (v < 0) return LedStatus.STATUS_TOO_LOW;
+ if (v == 0)
+ return LedStatus.STATUS_NEUTRAL;
+ if (v >= SCAN_GET_CLASS_TYPE)
+ return LedStatus.STATUS_TOO_HIGH;
+ if (v < 0)
+ return LedStatus.STATUS_TOO_LOW;
return LedStatus.STATUS_OK;
};
protected Parameters.Group.ParameterIn[] scanConfiguration;
@@ -209,7 +214,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- if (!structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0)) {
+ if (!structureCheck_EM("main", 2, 2, 0)) {
return false;
}
return eInputHatches.size() == 1 && eOutputHatches.size() == 1 && eOutputHatches.get(0).getBaseMetaTileEntity().getFrontFacing() == iGregTechTileEntity.getFrontFacing();
@@ -347,21 +352,31 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
return new String[]{
translateToLocalFormatted("tt.keyphrase.Energy_Hatches", clientLocale) + ":",
- EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " +
- EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU",
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " +
+ EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU",
(mEUt <= 0 ? translateToLocalFormatted("tt.keyphrase.Probably_uses", clientLocale) + ": " : translateToLocalFormatted("tt.keyphrase.Probably_makes", clientLocale) + ": ") +
- EnumChatFormatting.RED + Math.abs(mEUt) + EnumChatFormatting.RESET + " EU/t " + translateToLocalFormatted("tt.keyword.at", clientLocale) + " " +
- EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A",
- translateToLocalFormatted("tt.keyphrase.Tier_Rating", clientLocale) + ": " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET +
- " " + translateToLocalFormatted("tt.keyphrase.Amp_Rating", clientLocale) + ": " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A",
- translateToLocalFormatted("tt.keyword.Problems", clientLocale) + ": " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET +
- " " + translateToLocalFormatted("tt.keyword.Efficiency", clientLocale) + ": " + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %",
- translateToLocalFormatted("tt.keyword.PowerPass", clientLocale) + ": " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET +
- " " + translateToLocalFormatted("tt.keyword.SafeVoid", clientLocale) + ": " + EnumChatFormatting.BLUE + eSafeVoid,
- translateToLocalFormatted("tt.keyphrase.Computation_Available", clientLocale) + ": " + EnumChatFormatting.GREEN + eAvailableData + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW + eRequiredData + EnumChatFormatting.RESET,
+ EnumChatFormatting.RED + GT_Utility.formatNumbers(Math.abs(mEUt)) + EnumChatFormatting.RESET + " EU/t " +
+ translateToLocalFormatted("tt.keyword.at", clientLocale) + " " +
+ EnumChatFormatting.RED + GT_Utility.formatNumbers(eAmpereFlow) + EnumChatFormatting.RESET + " A",
+ translateToLocalFormatted("tt.keyphrase.Tier_Rating", clientLocale) + ": " +
+ EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " +
+ EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + " " +
+ translateToLocalFormatted("tt.keyphrase.Amp_Rating", clientLocale) + ": " +
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(eMaxAmpereFlow) + EnumChatFormatting.RESET + " A",
+ translateToLocalFormatted("tt.keyword.Problems", clientLocale) + ": " +
+ EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " " +
+ translateToLocalFormatted("tt.keyword.Efficiency", clientLocale) + ": " +
+ EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %",
+ translateToLocalFormatted("tt.keyword.PowerPass", clientLocale) + ": " +
+ EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + " " +
+ translateToLocalFormatted("tt.keyword.SafeVoid", clientLocale) + ": " +
+ EnumChatFormatting.BLUE + eSafeVoid,
+ translateToLocalFormatted("tt.keyphrase.Computation_Available", clientLocale) + ": " +
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(eAvailableData) + EnumChatFormatting.RESET + " / " +
+ EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(eRequiredData) + EnumChatFormatting.RESET,
translateToLocalFormatted("tt.keyphrase.Computation_Remaining", clientLocale) + ":",
- EnumChatFormatting.GREEN + Long.toString(computationRemaining / 20L) + EnumChatFormatting.RESET + " / " +
- EnumChatFormatting.YELLOW + computationRequired / 20L
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(computationRemaining / 20L) + EnumChatFormatting.RESET + " / " +
+ EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(computationRequired / 20L)
};
}
@@ -410,7 +425,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
computationRequired = aNBT.getLong("eComputationRequired");
if (aNBT.hasKey("eObject")) {
objectResearched = EMDefinitionStack.fromNBT(TecTech.definitionsRegistry,aNBT.getCompoundTag("eObject"));
- if (objectResearched.getDefinition() == nbtE__) {
+ if (objectResearched.getDefinition() == EMPrimitiveDefinition.nbtE__) {
objectResearched = null;
}
} else {
@@ -516,11 +531,16 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 2, 2, 0, hintsOnly, stackSize);
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_EM_scanner> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@Override
public String[] getStructureDescription(ItemStack stackSize) {
return description;
}
-} \ No newline at end of file
+}
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 dcd85af99d..0ff238e4c3 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,20 +1,21 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.Structure;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.util.CommonValues;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
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.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -22,26 +23,29 @@ import static net.minecraft.util.StatCollector.translateToLocal;
*/
public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {
//region structure
- private static final String[][] shape = new String[][]{
- {"A010", "0 0", "1 . 1", "0 0", "A010",},
- {"23232", "32223", "22222", "32223", "23232",},
- {"12!21", "22422", "!444!", "22422", "12!21",},
- {"23232", "32223", "22222", "32223", "23232",},
- {"A010", "0 0", "1 1", "0 0", "A010",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{4, 0, 5, 6, 9};
- private static final IHatchAdder<GT_MetaTileEntity_EM_stabilizer>[] addingMethods = adders(
- GT_MetaTileEntity_EM_stabilizer::addClassicToMachineList,
- GT_MetaTileEntity_EM_stabilizer::addElementalToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.stabilizer.hint.0"),//1 - Classic Hatches or High Power Casing
translateToLocal("gt.blockmachines.multimachine.em.stabilizer.hint.1"),//2 - Elemental Hatches or Molecular Casing
};
+
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_stabilizer> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_EM_stabilizer>builder()
+ .addShape("main", transpose(new String[][]{
+ {" AFA ","BCBCB","FBGBF","BCBCB"," AFA "},
+ {"AEEEA","CBBBC","BBDBB","CBBBC","AEEEA"},
+ {"FE~EF","BBBBB","GDDDG","BBBBB","FEEEF"},
+ {"AEEEA","CBBBC","BBDBB","CBBBC","AEEEA"},
+ {" AFA ","BCBCB","FBGBF","BCBCB"," AFA "}
+ }))
+ .addElement('A', ofBlock(sBlockCasingsTT, 4))
+ .addElement('B', ofBlock(sBlockCasingsTT, 5))
+ .addElement('C', ofBlock(sBlockCasingsTT, 6))
+ .addElement('D', ofBlock(sBlockCasingsTT, 9))
+ .addElement('E', ofHatchAdderOptional(GT_MetaTileEntity_EM_stabilizer::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0))
+ .addElement('F', ofBlock(QuantumGlassBlock.INSTANCE, 0))
+ .addElement('G', ofHatchAdderOptional(GT_MetaTileEntity_EM_stabilizer::addElementalToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4))
+ .build();
//endregion
public GT_MetaTileEntity_EM_stabilizer(int aID, String aName, String aNameRegional) {
@@ -59,7 +63,7 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0);
+ return structureCheck_EM("main", 2, 2, 0);
}
@Override
@@ -73,7 +77,12 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 2, 2, 0, hintsOnly, stackSize);
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_EM_stabilizer> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@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 5ade4ec965..1ca125977d 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,10 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.Reference;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.Structure;
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.GT_MetaTileEntity_MultiblockBase_EM;
@@ -13,24 +10,28 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunctio
import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import com.github.technus.tectech.util.CommonValues;
-import com.github.technus.tectech.util.Vec3Impl;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+import com.gtnewhorizon.structurelib.util.Vec3Impl;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
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;
import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*;
import static com.github.technus.tectech.util.CommonValues.V;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -38,22 +39,21 @@ import static net.minecraft.util.StatCollector.translateToLocal;
*/
public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {
//region structure
- private static final String[][] shape = new String[][]{
- {" ", " . ", " ",},
- {" ", " 0 ", " ",},
- {" ", " ", " ",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{3};
- private static final IHatchAdder<GT_MetaTileEntity_EM_switch>[] addingMethods = adders(
- GT_MetaTileEntity_EM_switch::addClassicToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset + 1};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{1};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
"1 - Classic/Data Hatches or Computer casing",//1 - Classic/Data Hatches or Computer casing
};
+
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_switch> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_EM_switch>builder()
+ .addShape("main", transpose(new String[][]{
+ {"BBB","BBB","BBB"},
+ {"B~B","BAB","BBB"},
+ {"BBB","BBB","BBB"}
+ }))
+ .addElement('A', ofBlock(sBlockCasingsTT, 3))
+ .addElement('B', ofHatchAdderOptional(GT_MetaTileEntity_EM_switch::addClassicToMachineList, textureOffset + 1, 1, sBlockCasingsTT, 1))
+ .build();
//endregion
//region parameters
@@ -99,7 +99,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0);
+ return structureCheck_EM("main", 1, 1, 0);
}
@Override
@@ -134,7 +134,10 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas
}
}
- Vec3Impl pos = new Vec3Impl(getBaseMetaTileEntity());
+ Vec3Impl pos = new Vec3Impl(getBaseMetaTileEntity().getXCoord(),
+ getBaseMetaTileEntity().getYCoord(),
+ getBaseMetaTileEntity().getZCoord());
+
QuantumDataPacket pack = new QuantumDataPacket(0L).unifyTraceWith(pos);
if (pack == null) {
return;
@@ -223,7 +226,12 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 1, 1, 0, hintsOnly, stackSize);
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_EM_switch> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@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 3e288ccafa..b2f7da7bc3 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,14 +1,14 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.Reference;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
-import com.github.technus.tectech.mechanics.structure.IStructureDefinition;
-import com.github.technus.tectech.mechanics.structure.StructureDefinition;
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.render.TT_RenderedExtendedFacingTexture;
import com.github.technus.tectech.util.CommonValues;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -20,12 +20,13 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
-import static com.github.technus.tectech.mechanics.structure.StructureUtility.*;
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;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sHintCasingsTT;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
import static gregtech.api.GregTech_API.sBlockCasings1;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
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 fa51447e9f..7b85d3406a 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,28 +1,28 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.Structure;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import com.github.technus.tectech.util.CommonValues;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
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;
-import static gregtech.api.enums.GT_Values.E;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -35,32 +35,33 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB
//endregion
//region structure
- private static final String[][] shape = new String[][]{
- {E, E, E, "C ", "C . ", "C "/*,E,E,E,*/},
- {E, E, "D0", "C000", "B00100", "C000", "D0"/*,E,E,*/},
- {E, E, "D0", "C2A2", "B0C0", "C2A2", "D0"/*,E,E,*/},
- {E, "D0", "D0", E, "A00C00", E, "D0", "D0"/*,E,*/},
- {E, "D0", E, E, "A0E0", E, E, "D0"/*,E,*/},
- {"D0", "D0", E, E, "00E00", E, E, "D0", "D0",},
- {"B00000", "A0033300", "003C300", "03E30", "03E30", "03E30", "003C300", "A0033300", "B00000",},
- {"B0!!!0", "A 31113 ", "031222130", "!12C21!", "!12C21!", "!12C21!", "031222130", "A 31113 ", "B0!!!0",},
- {"B0!!!0", "A 31113 ", "031444130", "!14C41!", "!14C41!", "!14C41!", "031444130", "A 31113 ", "B0!!!0",},
- {"B0!!!0", "A 31113 ", "031222130", "!12C21!", "!12C21!", "!12C21!", "031222130", "A 31113 ", "B0!!!0",},
- {"B00000", "A0033300", "003C300", "03E30", "03E30", "03E30", "003C300", "A0033300", "B00000",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{12, 10, 0, 5, 11};
- private static final IHatchAdder<GT_MetaTileEntity_EM_wormhole>[] addingMethods = adders(
- GT_MetaTileEntity_EM_wormhole::addClassicToMachineList,
- GT_MetaTileEntity_EM_wormhole::addElementalToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.wormhole.hint.0"),//1 - Classic Hatches or High Power Casing
translateToLocal("gt.blockmachines.multimachine.em.wormhole.hint.1"),//2 - Elemental Hatches or Molecular Casing
};
+
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_wormhole> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_EM_wormhole>builder()
+ .addShape("main", transpose(new String[][]{
+ {" "," "," "," "," "," D "," DDDDD "," DGGGD "," DGGGD "," DGGGD "," DDDDD "},
+ {" "," "," "," D "," D "," D "," DDAAADD "," EABBBAE "," EABBBAE "," EABBBAE "," DDAAADD "},
+ {" "," D "," D "," D "," "," ","DDA ADD","DABFFFBAD","DABCCCBAD","DABFFFBAD","DDA ADD"},
+ {" EEE "," DDD "," F F "," "," "," ","DA AD","GBF FBG","GBC CBG","GBF FBG","DA AD"},
+ {" E~E "," DDBDD "," D D "," DD DD "," D D ","DD DD","DA AD","GBF FBG","GBC CBG","GBF FBG","DA AD"},
+ {" EEE "," DDD "," F F "," "," "," ","DA AD","GBF FBG","GBC CBG","GBF FBG","DA AD"},
+ {" "," D "," D "," D "," "," ","DDA ADD","DABFFFBAD","DABCCCBAD","DABFFFBAD","DDA ADD"},
+ {" "," "," "," D "," D "," D "," DDAAADD "," EABBBAE "," EABBBAE "," EABBBAE "," DDAAADD "},
+ {" "," "," "," "," "," D "," DDDDD "," DGGGD "," DGGGD "," DGGGD "," DDDDD "}
+ }))
+ .addElement('A', ofBlock(sBlockCasingsTT, 5))
+ .addElement('B', ofBlock(sBlockCasingsTT, 10))
+ .addElement('C', ofBlock(sBlockCasingsTT, 11))
+ .addElement('D', ofBlock(sBlockCasingsTT, 12))
+ .addElement('E', ofHatchAdderOptional(GT_MetaTileEntity_EM_wormhole::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0))
+ .addElement('F', ofBlock(QuantumGlassBlock.INSTANCE, 0))
+ .addElement('G', ofHatchAdderOptional(GT_MetaTileEntity_EM_wormhole::addElementalToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4))
+ .build();
//endregion
public GT_MetaTileEntity_EM_wormhole(int aID, String aName, String aNameRegional) {
@@ -78,7 +79,7 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 4, 4, 0);
+ return structureCheck_EM("main", 4, 4, 0);
}
@Override
@@ -108,7 +109,12 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 4, 4, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 4, 4, 0, hintsOnly, stackSize);
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_EM_wormhole> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@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 674ffe8c3e..b99ed26f5b 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,20 +1,19 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.Reference;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.Structure;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.*;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import com.github.technus.tectech.util.CommonValues;
-import com.github.technus.tectech.util.Vec3Impl;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+import com.gtnewhorizon.structurelib.util.Vec3Impl;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
@@ -27,10 +26,12 @@ import java.util.ArrayList;
import java.util.HashSet;
import static com.github.technus.tectech.loader.MainLoader.microwaving;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
import static com.github.technus.tectech.recipe.TT_recipeAdder.nullItem;
import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
import static gregtech.api.GregTech_API.sBlockCasings4;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.AxisAlignedBB.getBoundingBox;
import static net.minecraft.util.StatCollector.translateToLocal;
@@ -44,26 +45,23 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock
//region structure
//use multi A energy inputs, use less power the longer it runs
- private static final String[][] shape = new String[][]{
- {"00000", "00000", "00.00", "0 0",},
- {"0---0", "0---0", "0---0", " 000 ",},
- {"0---0", "0---0", "0---0", " 000 ",},
- {"0---0", "0---0", "0---0", " 000 ",},
- {"00000", "00000", "00000", "0 0",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasings4};
- private static final byte[] blockMeta = new byte[]{1};
-
- private static final IHatchAdder<GT_MetaTileEntity_TM_microwave>[] addingMethods = adders(
- GT_MetaTileEntity_TM_microwave::addClassicToMachineList);
- private static final short[] casingTextures = new short[]{49};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasings4};
- private static final byte[] blockMetaFallback = new byte[]{1};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.tm.microwave.hint.0"),//1 - Classic Hatches or Clean Stainless Steel Casing
translateToLocal("gt.blockmachines.multimachine.tm.microwave.hint.1"),//Also acts like a hopper so give it an Output Bus
};
+
+ private static final IStructureDefinition<GT_MetaTileEntity_TM_microwave> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_TM_microwave>builder()
+ .addShape("main", transpose(new String[][]{
+ {"AAAAA","A---A","A---A","A---A","AAAAA"},
+ {"AAAAA","A---A","A---A","A---A","AAAAA"},
+ {"AA~AA","A---A","A---A","A---A","AAAAA"},
+ {"ABBBA","BAAAB","BAAAB","BAAAB","ABBBA"}
+ }))
+ .addElement('A', ofBlock(sBlockCasings4, 1))
+ .addElement('B', ofHatchAdderOptional(GT_MetaTileEntity_TM_microwave::addClassicToMachineList, 49, 1, sBlockCasings4, 1))
+ .build();
//endregion
//region parameters
@@ -101,7 +99,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0);
+ return structureCheck_EM("main", 2, 2, 0);
}
@Override
@@ -249,7 +247,12 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 2, 2, 0, hintsOnly, stackSize);
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_TM_microwave> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@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 38e14b9a6f..427f448e2a 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,27 +1,32 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-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.render.TT_RenderedExtendedFacingTexture;
-import com.github.technus.tectech.util.CommonValues;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
-import static gregtech.api.GregTech_API.sBlockCasings4;
-import static net.minecraft.util.StatCollector.translateToLocal;
+@Deprecated
public class GT_MetaTileEntity_TM_proccessingStack extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {
+ protected GT_MetaTileEntity_TM_proccessingStack(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ @Override
+ public void construct(ItemStack stackSize, boolean hintsOnly) {
+
+ }
+
+ @Override
+ public String[] getStructureDescription(ItemStack stackSize) {
+ return new String[0];
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return null;
+ }
+ /*
//region variables
private boolean hasBeenPausedThisCycle = false;
//endregion
@@ -131,4 +136,5 @@ public class GT_MetaTileEntity_TM_proccessingStack extends GT_MetaTileEntity_Mul
public String[] getStructureDescription(ItemStack stackSize) {
return description;
}
+ */
} \ No newline at end of file
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 c2f475888f..0778feb1fd 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
@@ -2,11 +2,8 @@ package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.loader.NetworkDispatcher;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
import com.github.technus.tectech.mechanics.spark.RendererMessage;
import com.github.technus.tectech.mechanics.spark.ThaumSpark;
-import com.github.technus.tectech.mechanics.structure.Structure;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
import com.github.technus.tectech.mechanics.tesla.ITeslaConnectable;
import com.github.technus.tectech.mechanics.tesla.ITeslaConnectableSimple;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Capacitor;
@@ -19,10 +16,12 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunctio
import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import com.github.technus.tectech.util.CommonValues;
-import com.github.technus.tectech.util.Vec3Impl;
-import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
import com.google.common.collect.MultimapBuilder;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+import com.gtnewhorizon.structurelib.util.Vec3Impl;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Materials;
@@ -31,7 +30,6 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.*;
-import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -41,14 +39,16 @@ import net.minecraftforge.fluids.FluidStack;
import java.util.ArrayList;
import java.util.HashSet;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
import static com.github.technus.tectech.mechanics.tesla.ITeslaConnectable.TeslaUtil.*;
+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.sBlockCasingsBA0;
import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*;
import static com.github.technus.tectech.util.CommonValues.V;
-import static gregtech.api.enums.GT_Values.E;
-import static java.lang.Math.*;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
+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, ITeslaConnectable {
@@ -100,35 +100,45 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
//endregion
//region structure
- private static final String[][] shape = new String[][]{//3 16 0
- {"\u000F", "A . ",},
- {E, "B000", "B000", "B000", "\u0001", "B000", E, "B000", E, "B000", E, "B000", "\u0001", "B111", " 22222 ",},
- {"B000", "A00000", "A00000", "A00000", "B000", E, "A0A!A0", E, "A0A!A0", E, "A0A!A0", E, "A0A!A0", "\u0001", "A1C1", " 21112 ",},
- {"B000", "A00000", "A00000", "A00000", "B030", "C3", "A0!3!0", "C3", "A0!3!0", "C3", "A0!3!0", "C3", "A0!3!0", "C3", "C3", "A1A3A1", " 21212 ",},
- {"B000", "A00000", "A00000", "A00000", "B000", E, "A0A!A0", E, "A0A!A0", E, "A0A!A0", E, "A0A!A0", "\u0001", "A1C1", " 21112 ",},
- {E, "B000", "B000", "B000", "\u0001", "B000", E, "B000", E, "B000", E, "B000", "\u0001", "B111", " 22222 ",},
- {"\u000F", "A ",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsBA0, sBlockCasingsBA0, sBlockCasingsBA0, sBlockCasingsBA0};
- private static final byte[] blockMetaT0 = new byte[]{7, 0, 6, 8};
- private static final byte[] blockMetaT1 = new byte[]{7, 1, 6, 8};
- private static final byte[] blockMetaT2 = new byte[]{7, 2, 6, 8};
- private static final byte[] blockMetaT3 = new byte[]{7, 3, 6, 8};
- private static final byte[] blockMetaT4 = new byte[]{7, 4, 6, 8};
- private static final byte[] blockMetaT5 = new byte[]{7, 5, 6, 8};
- private static final byte[] blockMetaT6 = new byte[]{7, 9, 6, 8};
- private static final byte[][] blockMetas = new byte[][]{blockMetaT0, blockMetaT1, blockMetaT2, blockMetaT3, blockMetaT4, blockMetaT5, blockMetaT6};
- private static final IHatchAdder<GT_MetaTileEntity_TM_teslaCoil>[] addingMethods = adders(
- GT_MetaTileEntity_TM_teslaCoil::addCapacitorToMachineList,
- GT_MetaTileEntity_TM_teslaCoil::addFrameToMachineList);
- private static final short[] casingTextures = new short[]{(texturePage << 7) + 16 + 6, 0};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsBA0, null};
- private static final byte[] blockMetaFallback = new byte[]{6, 0};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.hint.0"),//1 - Classic Hatches, Capacitor Hatches or Tesla Base Casing
translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.hint.1"),//2 - Titanium Frames
};
+
+ private static final IStructureDefinition<GT_MetaTileEntity_TM_teslaCoil> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_TM_teslaCoil>builder()
+ .addShape("main", transpose(new String[][]{
+ {" "," "," BBB "," BBB "," BBB "," "," "},
+ {" "," BBB "," BBBBB "," BBBBB "," BBBBB "," BBB "," "},
+ {" "," BBB "," BBBBB "," BBBBB "," BBBBB "," BBB "," "},
+ {" "," BBB "," BBBBB "," BBBBB "," BBBBB "," BBB "," "},
+ {" "," "," BBB "," BCB "," BBB "," "," "},
+ {" "," "," "," C "," "," "," "},
+ {" "," BBB "," B F B "," BFCFB "," B F B "," BBB "," "},
+ {" "," "," "," C "," "," "," "},
+ {" "," BBB "," B F B "," BFCFB "," B F B "," BBB "," "},
+ {" "," "," "," C "," "," "," "},
+ {" "," BBB "," B F B "," BFCFB "," B F B "," BBB "," "},
+ {" "," "," "," C "," "," "," "},
+ {" "," BBB "," B F B "," BFCFB "," B F B "," BBB "," "},
+ {" "," "," "," C "," "," "," "},
+ {" "," "," "," C "," "," "," "},
+ {" "," DDD "," D D "," D C D "," D D "," DDD "," "},
+ {" EE~EE ","EAAAAAE","EADDDAE","EADADAE","EADDDAE"," AAAAAE"," EEEEE "}
+ }))
+ .addElement('A', ofBlock(sBlockCasingsBA0, 6))
+ .addElement('B', ofBlock(sBlockCasingsBA0, 7))
+ .addElement('C', ofBlock(sBlockCasingsBA0, 8))
+ .addElement('D', defer(t -> ofBlock(sBlockCasingsBA0, t.getCoilWindingMeta())))
+ .addElement('E', ofHatchAdderOptional(GT_MetaTileEntity_TM_teslaCoil::addCapacitorToMachineList, textureOffset + 16 + 6, 1, sBlockCasingsBA0, 6))
+ .addElement('F', ofHatchAdder(GT_MetaTileEntity_TM_teslaCoil::addFrameToMachineList, 0, 2))
+ .build();
+
+ public int getCoilWindingMeta() {
+ Vec3Impl xyzOffsets = getExtendedFacing().getWorldOffset(new Vec3Impl(0, -1, 1));
+ return this.getBaseMetaTileEntity().getMetaIDOffset(xyzOffsets.get0(), xyzOffsets.get1(), xyzOffsets.get2());
+ }
//endregion
//region parameters
@@ -348,7 +358,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
mTier = 6;
}//Hacky remap because the ZPM coils were added later
- if (structureCheck_EM(shape, blockType, blockMetas[mTier], addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 3, 16, 0) && eCapacitorHatches.size() > 0) {
+ if (structureCheck_EM("main", 3, 16, 0)) {
for (GT_MetaTileEntity_Hatch_Capacitor cap : eCapacitorHatches) {
if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(cap)) {
cap.getBaseMetaTileEntity().setActive(iGregTechTileEntity.isActive());
@@ -360,11 +370,15 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
oldRotation = (byte) getExtendedFacing().ordinal();
oldOrientation = iGregTechTileEntity.getFrontFacing();
+ Vec3Impl posBMTE = new Vec3Impl(getBaseMetaTileEntity().getXCoord(),
+ getBaseMetaTileEntity().getYCoord(),
+ getBaseMetaTileEntity().getZCoord());
+
//Calculate coordinates of the middle bottom
- posTop = getExtendedFacing().getWorldOffset(new Vec3Impl(0, 0, 2)).add(getBaseMetaTileEntity());
+ posTop = getExtendedFacing().getWorldOffset(new Vec3Impl(0, 0, 2)).add(posBMTE);
//Calculate coordinates of the top sphere
- posTop = getExtendedFacing().getWorldOffset(new Vec3Impl(0, -14, 2)).add(getBaseMetaTileEntity());
+ posTop = getExtendedFacing().getWorldOffset(new Vec3Impl(0, -14, 2)).add(posBMTE);
}
return true;
}
@@ -681,8 +695,13 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
}
@Override
+ public IStructureDefinition<GT_MetaTileEntity_TM_teslaCoil> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
+ }
+
+ @Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMetas[(stackSize.stackSize - 1) % 7], 3, 16, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 3, 16, 0, hintsOnly, stackSize);
}
@Override
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 2fe43cb8e1..86d61fb4ca 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,25 +2,23 @@ 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.loader.NetworkDispatcher;
-import com.github.technus.tectech.mechanics.alignment.AlignmentLimits;
-import com.github.technus.tectech.mechanics.alignment.AlignmentMessage;
-import com.github.technus.tectech.mechanics.alignment.IAlignment;
-import com.github.technus.tectech.mechanics.alignment.IAlignmentLimits;
-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.mechanics.elementalMatter.core.EMException;
import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMDefinitionStack;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMInstanceStack;
-import com.github.technus.tectech.mechanics.elementalMatter.core.EMException;
-import com.github.technus.tectech.mechanics.structure.IStructureDefinition;
-import com.github.technus.tectech.mechanics.structure.Structure;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
import com.github.technus.tectech.thing.metaTileEntity.hatch.*;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import com.github.technus.tectech.util.Util;
-import com.github.technus.tectech.util.Vec3Impl;
+import com.gtnewhorizon.structurelib.StructureLibAPI;
+import com.gtnewhorizon.structurelib.alignment.IAlignment;
+import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
+import com.gtnewhorizon.structurelib.alignment.IAlignmentProvider;
+import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing;
+import com.gtnewhorizon.structurelib.alignment.enumerable.Flip;
+import com.gtnewhorizon.structurelib.alignment.enumerable.Rotation;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.util.Vec3Impl;
+import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -33,7 +31,6 @@ import gregtech.api.metatileentity.implementations.*;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.common.GT_Pollution;
-import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.InventoryPlayer;
@@ -144,7 +141,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
private boolean explodedThisTick = false;
//front rotation val
- private IAlignmentLimits alignmentLimits = AlignmentLimits.UNLIMITED;
+ private IAlignmentLimits alignmentLimits = IAlignmentLimits.UNLIMITED;
private ExtendedFacing extendedFacing = ExtendedFacing.DEFAULT;
//endregion
@@ -175,9 +172,12 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
IGregTechTileEntity base = getBaseMetaTileEntity();
mMachine = false;
if (getBaseMetaTileEntity().isServerSide()) {
- NetworkDispatcher.INSTANCE.sendToAllAround(new AlignmentMessage.AlignmentData(this),
- base.getWorld().provider.dimensionId,
- base.getXCoord(), base.getYCoord(), base.getZCoord(), 512);
+ //NetworkDispatcher.INSTANCE.sendToAllAround(new AlignmentMessage.AlignmentData(this),
+ // base.getWorld().provider.dimensionId,
+ // base.getXCoord(), base.getYCoord(), base.getZCoord(), 512);
+ StructureLibAPI.sendAlignment((IAlignmentProvider) base,
+ new NetworkRegistry.TargetPoint(base.getWorld().provider.dimensionId,
+ base.getXCoord(), base.getYCoord(), base.getZCoord(), 512));
}else{
base.issueTextureUpdate();
}
@@ -190,11 +190,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
}
@Override
- public void setAlignmentLimits(IAlignmentLimits limits) {
- alignmentLimits=limits;
- }
-
- @Override
public boolean isFacingValid(byte aFacing) {
return canSetToDirectionAny(ForgeDirection.getOrientation(aFacing));
}
@@ -230,22 +225,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
getExtendedFacing(), baseMetaTileEntity.getXCoord(), baseMetaTileEntity.getYCoord(),
baseMetaTileEntity.getZCoord(), horizontalOffset, verticalOffset, depthOffset, hintsOnly);
}
-
- @Deprecated
- @SuppressWarnings("unchecked")
- public final <T extends GT_MetaTileEntity_MultiblockBase_EM> 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
- IHatchAdder<T>[] 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) {
- return Structure.checker(structure, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback,
- horizontalOffset, verticalOffset, depthOffset, (T)this, getExtendedFacing(), !mMachine);
- }
-
//endregion
//region METHODS TO OVERRIDE - general functionality, recipe check, output
@@ -387,21 +366,23 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
return new String[]{
"Progress:",
- EnumChatFormatting.GREEN + Integer.toString(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " +
- EnumChatFormatting.YELLOW + mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s",
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " +
+ EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s",
"Energy Hatches:",
- EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " +
- EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU",
+ EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " +
+ EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU",
(mEUt * eAmpereFlow <= 0 ? "Probably uses: " : "Probably makes: ") +
- EnumChatFormatting.RED + Math.abs(mEUt) + EnumChatFormatting.RESET + " EU/t at " +
- EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A",
- "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET +
- " Amp Rating: " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A",
+ EnumChatFormatting.RED + GT_Utility.formatNumbers(Math.abs(mEUt)) + EnumChatFormatting.RESET + " EU/t at " +
+ EnumChatFormatting.RED + GT_Utility.formatNumbers(eAmpereFlow) + EnumChatFormatting.RESET + " A",
+ "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " +
+ EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET +
+ " Amp Rating: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(eMaxAmpereFlow) + EnumChatFormatting.RESET + " A",
"Problems: " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET +
" Efficiency: " + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %",
"PowerPass: " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET +
" SafeVoid: " + EnumChatFormatting.BLUE + eSafeVoid,
- "Computation: " + EnumChatFormatting.GREEN + eAvailableData + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW + eRequiredData + EnumChatFormatting.RESET
+ "Computation: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(eAvailableData) + EnumChatFormatting.RESET + " / " +
+ EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(eRequiredData) + EnumChatFormatting.RESET
};
}
@@ -648,7 +629,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
*/
protected long getAvailableData_EM() {
long result = 0;
- Vec3Impl pos = new Vec3Impl(getBaseMetaTileEntity());
+ Vec3Impl pos = new Vec3Impl(getBaseMetaTileEntity().getXCoord(),
+ getBaseMetaTileEntity().getYCoord(),
+ getBaseMetaTileEntity().getZCoord());
for (GT_MetaTileEntity_Hatch_InputData in : eInputData) {
if (in.q != null) {
Long value = in.q.contentIfNotInTrace(pos);
@@ -1095,7 +1078,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 AlignmentMessage.AlignmentQuery(this));
+ StructureLibAPI.queryAlignment((IAlignmentProvider) aBaseMetaTileEntity);
}
onFirstTick_EM(aBaseMetaTileEntity);
}
@@ -1675,7 +1658,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
addEnergyOutput_EM((long) mEUt * (long) mEfficiency / getMaxEfficiency(aStack), eAmpereFlow);
} else if (euFlow < 0) {
if (!drainEnergyInput_EM(mEUt, (long) mEUt * getMaxEfficiency(aStack) / Math.max(1000L, mEfficiency), eAmpereFlow)) {
- stopMachine();
+ criticalStopMachine();
return false;
}
}
@@ -1688,7 +1671,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
addEnergyOutput_EM((long) mEUt * (long) mEfficiency / getMaxEfficiency(aStack), eAmpereFlow);
} else if (euFlow < 0) {
if (!drainEnergyInput((long) mEUt * getMaxEfficiency(aStack) / Math.max(1000L, mEfficiency), eAmpereFlow)) {
- stopMachine();
+ criticalStopMachine();
return false;
}
}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedExtendedFacingTexture.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedExtendedFacingTexture.java
index 44bfa4445d..5ed53634de 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedExtendedFacingTexture.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedExtendedFacingTexture.java
@@ -1,8 +1,8 @@
package com.github.technus.tectech.thing.metaTileEntity.multi.base.render;
-import com.github.technus.tectech.mechanics.alignment.IAlignmentProvider;
-import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
import com.github.technus.tectech.util.LightingHelper;
+import com.gtnewhorizon.structurelib.alignment.IAlignmentProvider;
+import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing;
import gregtech.api.enums.Dyes;
import gregtech.api.interfaces.IColorModulationContainer;
import gregtech.api.interfaces.IIconContainer;
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_collider/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_collider/GT_MetaTileEntity_EM_collider.java
index cf8f26ff02..ebf005d7d8 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_collider/GT_MetaTileEntity_EM_collider.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_collider/GT_MetaTileEntity_EM_collider.java
@@ -3,17 +3,14 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.em_collider;
import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.EMComplexAspectDefinition;
import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.EMPrimalAspectDefinition;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
import com.github.technus.tectech.mechanics.elementalMatter.core.decay.EMDecayResult;
-import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap;
+import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.EMPrimitiveTemplate;
import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMDefinitionStackMap;
+import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMInstanceStack;
-import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.EMPrimitiveTemplate;
import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.EMAtomDefinition;
import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.EMHadronDefinition;
import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMQuarkDefinition;
-import com.github.technus.tectech.mechanics.structure.IStructureDefinition;
-import com.github.technus.tectech.mechanics.structure.StructureDefinition;
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.hatch.GT_MetaTileEntity_Hatch_InputElemental;
@@ -23,6 +20,10 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunctio
import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import com.github.technus.tectech.util.CommonValues;
+import com.gtnewhorizon.structurelib.StructureLibAPI;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -39,12 +40,13 @@ import java.util.HashMap;
import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMTransformationRegistry.EM_COUNT_PER_MATERIAL_AMOUNT;
-import static com.github.technus.tectech.mechanics.structure.StructureUtility.*;
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;
import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*;
import static com.github.technus.tectech.util.DoubleCount.add;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -294,49 +296,6 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB
//region structure
//use multi A energy inputs, use less power the longer it runs
- private static final IStructureDefinition<GT_MetaTileEntity_EM_collider> STRUCTURE_DEFINITION = StructureDefinition
- .<GT_MetaTileEntity_EM_collider>builder()
- .addShapeOldApi("main", new String[][]{
- {"I0A0A0", "I00000", "I0A0A0",},
- {"H0000000", "G001111100", "H0000000",},
- {"F22223332222", "F41155555114", "F22223332222",},
- {"E2000000000002", "E4155111115514", "E2000000000002",},
- {"D20000E00002", "D41511E11514", "D20000E00002",},
- {"C2000I0002", "C4151I1514", "C2000I0002",},
- {"B2000K0002", "B4151K1514", "B2000K0002",},
- {"B200M002", "A0151M1510", "B200M002",},
- {"A0200M0020", "A0151M1510", "A0200M0020",},
- {"0020O0200", "0151O1510", "0020O0200",},
- {"A030O030", "0151O1510", "A030O030",},
- {"0030O0300", "0151O1510", "0030O0300",},
- {"A030O030", "0151O1510", "A030O030",},
- {"0020O0200", "0151O1510", "0020O0200",},
- {"A0200M0020", "A0151M1510", "A0200M0020",},
- {"B200M002", "A0151M1510", "B200M002",},
- {"B2000K0002", "B4151K1514", "B2000K0002",},
- {"C2000I0002", "C4151I1514", "C2000I0002",},
- {"D200002&&&200002", "D415112&.&211514", "D200002&&&200002",},
- {"E20!!22222!!02", "E4155111115514", "E20!!22222!!02",},
- {"F2222#$#2222", "F41155555114", "F2222#$#2222",},
- })
- .addElement('0', ofBlock(sBlockCasingsTT, 4))
- .addElement('1', ofBlock(sBlockCasingsTT, 7))
- .addElement('2', defer(t -> (int) t.eTier, (t, item) -> 2 - (item.stackSize & 1),
- error(), ofBlock(sBlockCasingsTT, 4), ofBlock(sBlockCasingsTT, 5)))
- .addElement('3', ofBlock(QuantumGlassBlock.INSTANCE, 0))
- .addElement('4', defer(t -> (int) t.eTier, (t, item) -> 2 - (item.stackSize & 1),
- error(), ofBlock(sBlockCasingsTT, 4), ofBlock(sBlockCasingsTT, 6)))
- .addElement('5', defer(t -> (int) t.eTier, (t, item) -> 2 - (item.stackSize & 1),
- error(), ofBlock(sBlockCasingsTT, 8), ofBlock(sBlockCasingsTT, 9)))
- .addElement('&', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addClassicToMachineList,
- textureOffset, 1, sBlockCasingsTT, 0))
- .addElement('!', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addElementalInputToMachineList,
- textureOffset + 4, 2, sBlockCasingsTT, 4))
- .addElement('$', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addElementalOutputToMachineList,
- textureOffset + 4, 3, sBlockCasingsTT, 4))
- .addElement('#', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addElementalMufflerToMachineList,
- textureOffset + 4, 4, sBlockCasingsTT, 4))
- .build();
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.collider.hint.0"),//1 - Classic Hatches or High Power Casing
@@ -346,8 +305,27 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB
translateToLocal("gt.blockmachines.multimachine.em.collider.hint.4"),//General - Another Controller facing opposite direction
};
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_collider> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_EM_collider>builder()
+ .addShape("main", transpose(new String[][]{
+ {" A A A "," AAAAAAA "," BBBBIIIBBBB "," BAAAAAAAAAAAB "," BAAAA AAAAB "," BAAA AAAB "," BAAA AAAB "," BAA AAB "," ABAA AABA ","AABA ABAA"," AIA AIA ","AAIA AIAA"," AIA AIA ","AABA ABAA"," ABAA AABA "," BAA AAB "," BAAA AAAB "," BAAA AAAB "," BAAAABJJJBAAAAB "," BAHHBBBBBHHAB "," BBBBGFGBBBB "},
+ {" AAAAA "," AADDDDDAA "," CDDEEEEEDDC "," CDEEDDDDDEEDC "," CDEDD DDEDC "," CDED DEDC "," CDED DEDC "," ADED DEDA "," ADED DEDA ","ADED DEDA","ADED DEDA","ADED DEDA","ADED DEDA","ADED DEDA"," ADED DEDA "," ADED DEDA "," CDED DEDC "," CDED DEDC "," CDEDDBJ~JBDDEDC "," CDEEDDDDDEEDC "," CDDEEEEEDDC "},
+ {" A A A "," AAAAAAA "," BBBBIIIBBBB "," BAAAAAAAAAAAB "," BAAAA AAAAB "," BAAA AAAB "," BAAA AAAB "," BAA AAB "," ABAA AABA ","AABA ABAA"," AIA AIA ","AAIA AIAA"," AIA AIA ","AABA ABAA"," ABAA AABA "," BAA AAB "," BAAA AAAB "," BAAA AAAB "," BAAAABJJJBAAAAB "," BAHHBBBBBHHAB "," BBBBGFGBBBB "}
+ }))
+ .addElement('A', ofBlock(sBlockCasingsTT, 4))
+ .addElement('B', defer(t -> (int) t.eTier, (t, item) -> 2 - (item.stackSize & 1), error(), ofBlock(sBlockCasingsTT, 4), ofBlock(sBlockCasingsTT, 5)))
+ .addElement('C', defer(t -> (int) t.eTier, (t, item) -> 2 - (item.stackSize & 1), error(), ofBlock(sBlockCasingsTT, 4), ofBlock(sBlockCasingsTT, 6)))
+ .addElement('D', ofBlock(sBlockCasingsTT, 7))
+ .addElement('E', defer(t -> (int) t.eTier, (t, item) -> 2 - (item.stackSize & 1), error(), ofBlock(sBlockCasingsTT, 8), ofBlock(sBlockCasingsTT, 9)))
+ .addElement('F', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addElementalOutputToMachineList, textureOffset + 4, 3, sBlockCasingsTT, 4))
+ .addElement('G', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addElementalMufflerToMachineList, textureOffset + 4, 4, sBlockCasingsTT, 4))
+ .addElement('H', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addElementalInputToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4))
+ .addElement('I', ofBlock(QuantumGlassBlock.INSTANCE, 0))
+ .addElement('J', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0))
+ .build();
+
@Override
- public IStructureDefinition<? extends GT_MetaTileEntity_MultiblockBase_EM> getStructure_EM() {
+ public IStructureDefinition<GT_MetaTileEntity_EM_collider> getStructure_EM() {
return STRUCTURE_DEFINITION;
}
@@ -693,7 +671,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB
int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY * 4;
int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 4;
if (hintsOnly) {
- TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(),
+ StructureLibAPI.hintParticle(iGregTechTileEntity.getWorld(),
iGregTechTileEntity.getXCoord() + xDir,
iGregTechTileEntity.getYCoord() + yDir,
iGregTechTileEntity.getZCoord() + zDir,
@@ -706,4 +684,4 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB
public String[] getStructureDescription(ItemStack stackSize) {
return description;
}
-} \ No newline at end of file
+}
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 e653c1a357..d6570a0b4e 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,15 +1,15 @@
package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.Structure;
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.block.QuantumStuffBlock;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.*;
import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.util.Util;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.block.Block;
@@ -23,10 +23,11 @@ import net.minecraftforge.common.util.ForgeDirection;
import java.util.HashMap;
import java.util.function.Supplier;
-import static com.github.technus.tectech.mechanics.structure.Structure.adders;
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.*;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
/**
@@ -41,26 +42,28 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa
//endregion
//region structure
- private static final String[][] shape = new String[][]{
- {"B0", "A ", "0 - 0", "A ", "B0",},
- {"A000", "00000", "00.00", "00000", "A000",},
- {"A121", "1---1", "2---2", "1---1", "A121",},
- {"A131", "1---1", "3-A-3", "1---1", "A131",},
- {"A121", "1---1", "2---2", "1---1", "A121",},
- {"A000", "00000", "00-00", "00000", "A000",},
- {"B0", "A!!!", "0!!!0", "A!!!", "B0",},};
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{4, 0, 5, 6};
- private static final IHatchAdder<GT_MetaTileEntity_EM_machine>[] addingMethods = adders(
- GT_MetaTileEntity_EM_machine::addClassicToMachineList,
- GT_MetaTileEntity_EM_machine::addElementalToMachineList);
- private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.em.processing.hint.0"),//1 - Classic Hatches or High Power Casing
- translateToLocal("gt.blockmachines.multimachine.em.processing.hint.1"),};//2 - Elemental Hatches or Molecular Casing
+ translateToLocal("gt.blockmachines.multimachine.em.processing.hint.1"),//2 - Elemental Hatches or Molecular Casing
+ };
+
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_machine> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_EM_machine>builder()
+ .addShape("main", new String[][]{
+ {" A "," AAA "," EBE "," ECE "," EBE "," AAA "," A "},
+ {" DDD ","AAAAA","E---E","E---E","E---E","AAAAA"," FFF "},
+ {"AD-DA","AA~AA","B---B","C---C","B---B","AA-AA","AFFFA"},
+ {" DDD ","AAAAA","E---E","E---E","E---E","AAAAA"," FFF "},
+ {" A "," AAA "," EBE "," ECE "," EBE "," AAA "," A "}
+ })
+ .addElement('A', ofBlock(sBlockCasingsTT, 4))
+ .addElement('B', ofBlock(sBlockCasingsTT, 5))
+ .addElement('C', ofBlock(sBlockCasingsTT, 6))
+ .addElement('D', ofHatchAdderOptional(GT_MetaTileEntity_EM_machine::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0))
+ .addElement('E', ofBlock(QuantumGlassBlock.INSTANCE, 0))
+ .addElement('F', ofHatchAdderOptional(GT_MetaTileEntity_EM_machine::addElementalToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4))
+ .build();
//endregion
//region parameters
@@ -190,7 +193,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 1);
+ return structureCheck_EM("main", 2, 2, 1);
}
@Override
@@ -354,11 +357,16 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- Structure.builder(shape, blockType, blockMeta, 2, 2, 1, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly);
+ structureBuild_EM("main", 2, 2, 1, hintsOnly, stackSize);
+ }
+
+ @Override
+ public IStructureDefinition<GT_MetaTileEntity_EM_machine> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@Override
public String[] getStructureDescription(ItemStack stackSize) {
return description;
}
-} \ No newline at end of file
+}
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 d942786916..748b680faa 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
@@ -272,11 +272,11 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine
int time=itemStack.stackTagCompound.getInteger("time");
int EUt=itemStack.stackTagCompound.getInteger("eu");
font.drawString("Assembly Line Recipe", 7, 8, 0x80a0ff);
- font.drawString(GT_Utility.trans("152","Total: ") + ((long)time * EUt) + " EU",7,93, 0x80a0ff);
- font.drawString(GT_Utility.trans("153","Usage: ") + EUt + " EU/t",7,103, 0x80a0ff);
- font.drawString(GT_Utility.trans("154","Voltage: ") + EUt + " EU",7,113, 0x80a0ff);
+ font.drawString(GT_Utility.trans("152","Total: ") + GT_Utility.formatNumbers((long)time * EUt) + " EU",7,93, 0x80a0ff);
+ font.drawString(GT_Utility.trans("153","Usage: ") + GT_Utility.formatNumbers(EUt) + " EU/t",7,103, 0x80a0ff);
+ font.drawString(GT_Utility.trans("154","Voltage: ") + GT_Utility.formatNumbers(EUt) + " EU",7,113, 0x80a0ff);
font.drawString(GT_Utility.trans("155","Amperage: ") + 1 ,7,123, 0x80a0ff);
- font.drawString( GT_Utility.trans("158","Time: ")+String.format("%.2f " + GT_Utility.trans("161"," secs"), 0.05F * time), 7,133, 0x80a0ff);
+ font.drawString( GT_Utility.trans("158","Time: ") + GT_Utility.formatNumbers(0.05d * time) + GT_Utility.trans("161"," secs"), 7,133, 0x80a0ff);
for(Map.Entry<GT_Slot_Holo,ItemStack> entry:slots.entrySet()){
gui.renderItemSimple(entry.getKey(),entry.getValue());
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 3b194c516b..01d5e2321e 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,12 +1,12 @@
package com.github.technus.tectech.thing.metaTileEntity.single;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing;
-import com.github.technus.tectech.mechanics.structure.StructureUtility;
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 com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.util.Util;
+import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing;
+import com.gtnewhorizon.structurelib.structure.StructureUtility;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -20,9 +20,13 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.util.ForgeDirection;
+import java.util.Comparator;
+import java.util.function.Function;
+
import static com.github.technus.tectech.thing.metaTileEntity.Textures.MACHINE_CASINGS_TT;
import static net.minecraft.util.StatCollector.translateToLocal;
@@ -115,11 +119,18 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isAllowedToWork()) {
- String pseudoJavaCode = StructureUtility.getPseudoJavaCode(aBaseMetaTileEntity.getWorld(),
- ExtendedFacing.of(ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing())),
+// String pseudoJavaCode = StructureUtility.getPseudoJavaCode(aBaseMetaTileEntity.getWorld(),
+// ExtendedFacing.of(ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing())),
+// aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(),
+// numbers[0], numbers[1], numbers[2],
+// numbers[3], numbers[4], numbers[5],false);
+ String pseudoJavaCode = StructureUtility.getPseudoJavaCode(
+ aBaseMetaTileEntity.getWorld(), ExtendedFacing.of(ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing())),
aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(),
numbers[0], numbers[1], numbers[2],
- numbers[3], numbers[4], numbers[5],false);
+ te -> te.getClass().getCanonicalName(),
+ numbers[3], numbers[4], numbers[5],
+ false);
TecTech.LOGGER.info(pseudoJavaCode);
result = pseudoJavaCode.split("\\n");
aBaseMetaTileEntity.disableWorking();
@@ -129,11 +140,18 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti
@Override
public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
IGregTechTileEntity aBaseMetaTileEntity = getBaseMetaTileEntity();
- String pseudoJavaCode = StructureUtility.getPseudoJavaCode(aBaseMetaTileEntity.getWorld(),
- ExtendedFacing.of(ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing())),
+// String pseudoJavaCode = StructureUtility.getPseudoJavaCode(aBaseMetaTileEntity.getWorld(),
+// ExtendedFacing.of(ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing())),
+// aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(),
+// numbers[0], numbers[1], numbers[2],
+// numbers[3], numbers[4], numbers[5],true);
+ String pseudoJavaCode = StructureUtility.getPseudoJavaCode(
+ aBaseMetaTileEntity.getWorld(), ExtendedFacing.of(ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing())),
aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(),
numbers[0], numbers[1], numbers[2],
- numbers[3], numbers[4], numbers[5],true);
+ te -> te.getClass().getCanonicalName(),
+ numbers[3], numbers[4], numbers[5],
+ false);
TecTech.LOGGER.info(pseudoJavaCode);
result = pseudoJavaCode.split("\\n");
aBaseMetaTileEntity.disableWorking();
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 274389b01a..3b240e4c56 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
@@ -8,10 +8,10 @@ import com.github.technus.tectech.loader.NetworkDispatcher;
import com.github.technus.tectech.mechanics.spark.RendererMessage;
import com.github.technus.tectech.mechanics.spark.ThaumSpark;
import com.github.technus.tectech.util.Util;
-import com.github.technus.tectech.util.Vec3Impl;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
import com.google.common.collect.MultimapBuilder;
+import com.gtnewhorizon.structurelib.util.Vec3Impl;
import eu.usrv.yamcore.auxiliary.PlayerChatHelper;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -333,7 +333,9 @@ public class GT_MetaTileEntity_TeslaCoil extends GT_MetaTileEntity_BasicBatteryB
@Override
public Vec3Impl getTeslaPosition() {
- return new Vec3Impl(this.getBaseMetaTileEntity());
+ return new Vec3Impl(this.getBaseMetaTileEntity().getXCoord(),
+ this.getBaseMetaTileEntity().getYCoord(),
+ this.getBaseMetaTileEntity().getZCoord());
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/util/Vec3Impl.java b/src/main/java/com/github/technus/tectech/util/Vec3Impl.java
deleted file mode 100644
index 9ba96d741a..0000000000
--- a/src/main/java/com/github/technus/tectech/util/Vec3Impl.java
+++ /dev/null
@@ -1,146 +0,0 @@
-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 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));
- }
-
- 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;
- }
-} \ No newline at end of file
diff --git a/src/main/resources/assets/tectech/lang/en_US.lang b/src/main/resources/assets/tectech/lang/en_US.lang
index 7924545051..79c46b07a2 100644
--- a/src/main/resources/assets/tectech/lang/en_US.lang
+++ b/src/main/resources/assets/tectech/lang/en_US.lang
@@ -314,9 +314,9 @@ gt.blockmachines.hatch.dynamomulti64.tier.11.name=UIV 64A Dynamo Hatch
gt.blockmachines.hatch.dynamomulti04.tier.12.name=UMV 4A Dynamo Hatch
gt.blockmachines.hatch.dynamomulti16.tier.12.name=UMV 16A Dynamo Hatch
gt.blockmachines.hatch.dynamomulti64.tier.12.name=UMV 64A Dynamo Hatch
-gt.blockmachines.hatch.dynamomulti04.tier.13.name=IV 4A Dynamo Hatch
-gt.blockmachines.hatch.dynamomulti16.tier.13.name=IV 16A Dynamo Hatch
-gt.blockmachines.hatch.dynamomulti64.tier.13.name=IV 64A Dynamo Hatch
+gt.blockmachines.hatch.dynamomulti04.tier.13.name=UXV 4A Dynamo Hatch
+gt.blockmachines.hatch.dynamomulti16.tier.13.name=UXV 16A Dynamo Hatch
+gt.blockmachines.hatch.dynamomulti64.tier.13.name=UXV 64A Dynamo Hatch
gt.blockmachines.hatch.dynamomulti.desc.0=Multiple Ampere Energy Extractor for Multiblocks
gt.blockmachines.hatch.dynamomulti.desc.1=Amperes Out
@@ -652,7 +652,7 @@ gt.blockmachines.multimachine.em.scanner.hint.3=4 - Elemental Overflow Hatches o
gt.blockmachines.multimachine.em.scanner.desc.0=What is existing here?
gt.blockmachines.multimachine.em.scanner.desc.1=I HAVE NO IDEA (yet)!
-gt.blockmachines.multimachine.em.research.name=Research station
+gt.blockmachines.multimachine.em.research.name=Research Station
gt.blockmachines.multimachine.em.research.hint.0=1 - Classic/Data Hatches or Computer casing
gt.blockmachines.multimachine.em.research.hint.1=2 - Holder Hatch
gt.blockmachines.multimachine.em.research.desc.0=Philosophers didn't even...
diff --git a/src/main/resources/assets/tectech/lang/zh_CN.lang b/src/main/resources/assets/tectech/lang/zh_CN.lang
index 56cecd80c2..2d594ffb8e 100644
--- a/src/main/resources/assets/tectech/lang/zh_CN.lang
+++ b/src/main/resources/assets/tectech/lang/zh_CN.lang
@@ -50,8 +50,8 @@ item.em.EuMeterGT.desc.1=只需右键方块.
item.em.frontRotate.name=正面旋转扳手
item.em.frontRotate.desc.0=触发正面旋转界面
-item.em.frontRotate.desc.1=仅旋转前面板,
-item.em.frontRotate.desc.2=允许结构旋转.
+item.em.frontRotate.desc.1=可以旋转多方块控制器,
+item.em.frontRotate.desc.2=从而使整个结构可以旋转.
item.em.parametrizerMemoryCard.name=数据化储存卡
item.em.parametrizerMemoryCard.desc.0=存储参数
@@ -313,9 +313,9 @@ gt.blockmachines.hatch.dynamomulti64.tier.11.name=64安UIV动力仓
gt.blockmachines.hatch.dynamomulti04.tier.12.name=4安UMV动力仓
gt.blockmachines.hatch.dynamomulti16.tier.12.name=16安UMV动力仓
gt.blockmachines.hatch.dynamomulti64.tier.12.name=64安UMV动力仓
-gt.blockmachines.hatch.dynamomulti04.tier.13.name=4安IV动力仓
-gt.blockmachines.hatch.dynamomulti16.tier.13.name=16安IV动力仓
-gt.blockmachines.hatch.dynamomulti64.tier.13.name=64安IV动力仓
+gt.blockmachines.hatch.dynamomulti04.tier.13.name=4安UXV动力仓
+gt.blockmachines.hatch.dynamomulti16.tier.13.name=16安UXV动力仓
+gt.blockmachines.hatch.dynamomulti64.tier.13.name=64安UXV动力仓
gt.blockmachines.hatch.dynamomulti.desc.0=从多方块机器以高电流输出能源
gt.blockmachines.hatch.dynamomulti.desc.1=输出电流