From 5d3a02a84779d1381620bc27dc3807726ffcf46d Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 19 Apr 2020 23:16:28 +0200 Subject: Idk why but ok --- .../tectech/mechanics/alignment/IntegerAxisSwap.java | 17 +++++++++++++++++ .../mechanics/alignment/enumerable/ExtendedFacing.java | 7 +++++++ 2 files changed, 24 insertions(+) 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 index 40cb6c3220..1c44164731 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/alignment/IntegerAxisSwap.java +++ b/src/main/java/com/github/technus/tectech/mechanics/alignment/IntegerAxisSwap.java @@ -1,6 +1,7 @@ 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; @@ -40,6 +41,22 @@ public class IntegerAxisSwap { 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]; 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 index 68cc50a5ee..5c8c902484 100644 --- 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 @@ -3,6 +3,7 @@ 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.*; @@ -292,6 +293,9 @@ public enum ExtendedFacing { * @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); } @@ -308,6 +312,9 @@ public enum ExtendedFacing { * @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); } -- cgit From 1fbd3db52ce5e81ffdf563f4c498001b49ba2cbc Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 20 Apr 2020 06:53:12 +0200 Subject: Refactor to provider and add another helper method for compatiblility --- .../tectech/mechanics/alignment/IAlignment.java | 32 ++++++++++++++++------ .../mechanics/alignment/IAlignmentProvider.java | 5 ++++ .../thing/item/FrontRotationTriggerItem.java | 15 ++++++---- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 3 +- .../render/TT_RenderedExtendedFacingTexture.java | 8 ++++-- 5 files changed, 43 insertions(+), 20 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignmentProvider.java 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 index d7b48f8865..a2a6301070 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignment.java +++ b/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignment.java @@ -8,12 +8,25 @@ import net.minecraftforge.common.util.ForgeDirection; import java.util.Arrays; -public interface IAlignment extends IAlignmentLimits { +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(); } @@ -42,14 +55,6 @@ public interface IAlignment extends IAlignmentLimits { setExtendedFacing(getExtendedFacing().with(flip)); } - ExtendedFacing getExtendedFacing(); - - void setExtendedFacing(ExtendedFacing alignment); - - IAlignmentLimits getAlignmentLimits(); - - void setAlignmentLimits(IAlignmentLimits limits); - default boolean toolSetDirection(ForgeDirection direction){ if(direction==null || direction==ForgeDirection.UNKNOWN){ for (int i = 0,j=getDirection().ordinal()+1, valuesLength = Direction.VALUES.length; i < valuesLength; i++) { @@ -75,6 +80,15 @@ public interface IAlignment extends IAlignmentLimits { 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; 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 new file mode 100644 index 0000000000..07dc972aac --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/alignment/IAlignmentProvider.java @@ -0,0 +1,5 @@ +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/thing/item/FrontRotationTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java index efcfcfb7a3..5edc238a91 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.thing.item; import com.github.technus.tectech.mechanics.alignment.IAlignment; +import com.github.technus.tectech.mechanics.alignment.IAlignmentProvider; import com.github.technus.tectech.util.CommonValues; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -42,19 +43,21 @@ public final class FrontRotationTriggerItem extends Item { if (aPlayer instanceof EntityPlayerMP) { if (tTileEntity instanceof IGregTechTileEntity) { IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); - if (metaTE instanceof IAlignment) { + if (metaTE instanceof IAlignmentProvider) { + IAlignment alignment = ((IAlignmentProvider) metaTE).getAlignment(); if(aPlayer.isSneaking()){ - ((IAlignment) metaTE).toolSetFlip(null); + alignment.toolSetFlip(null); }else { - ((IAlignment) metaTE).toolSetRotation(null); + alignment.toolSetRotation(null); } return true; } - } else if (tTileEntity instanceof IAlignment) { + } else if (tTileEntity instanceof IAlignmentProvider) { + IAlignment alignment = ((IAlignmentProvider) tTileEntity).getAlignment(); if(aPlayer.isSneaking()){ - ((IAlignment) tTileEntity).toolSetFlip(null); + alignment.toolSetFlip(null); }else { - ((IAlignment) tTileEntity).toolSetRotation(null); + alignment.toolSetRotation(null); } return true; } 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 52bdd3574f..50e2aa575b 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 @@ -183,8 +183,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public boolean isFacingValid(byte aFacing) { - return getAlignmentLimits() - .isNewExtendedFacingValid(getExtendedFacing().with(ForgeDirection.getOrientation(aFacing))); + return canSetToDirectionAny(ForgeDirection.getOrientation(aFacing)); } @Override 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 4ecea706cc..44fa12ebb8 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,6 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.base.render; -import com.github.technus.tectech.mechanics.alignment.IAlignment; +import com.github.technus.tectech.mechanics.alignment.IAlignmentProvider; import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing; import gregtech.api.enums.Dyes; import gregtech.api.interfaces.IColorModulationContainer; @@ -881,11 +881,13 @@ public class TT_RenderedExtendedFacingTexture implements ITexture,IColorModulati TileEntity te = w.getTileEntity(x, y, z); if (te instanceof IGregTechTileEntity) { IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); - if (meta instanceof IAlignment) { - return ((IAlignment) meta).getExtendedFacing(); + if (meta instanceof IAlignmentProvider) { + return ((IAlignmentProvider) meta).getAlignment().getExtendedFacing(); }else{ return ExtendedFacing.of(ForgeDirection.getOrientation(meta.getBaseMetaTileEntity().getFrontFacing())); } + } else if (te instanceof IAlignmentProvider) { + return ((IAlignmentProvider) te).getAlignment().getExtendedFacing(); } } return ExtendedFacing.DEFAULT; -- cgit From 1c8a7217e61057acb29279a987eff4cafb1a5d78 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 20 Apr 2020 06:58:16 +0200 Subject: Cleanup util --- src/main/java/com/github/technus/tectech/util/Util.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/util/Util.java b/src/main/java/com/github/technus/tectech/util/Util.java index cd055528b1..7e6e177e77 100644 --- a/src/main/java/com/github/technus/tectech/util/Util.java +++ b/src/main/java/com/github/technus/tectech/util/Util.java @@ -40,6 +40,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.lang.reflect.Field; +import java.nio.charset.StandardCharsets; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -190,10 +191,9 @@ public final class Util { } IGregTechTileEntity igt; - IMetaTileEntity imt = aBaseMetaTileEntity.getMetaTileEntity(); - int xyz[]=new int[3]; - int abc[]=new int[3]; + int[] xyz =new int[3]; + int[] abc =new int[3]; int pointer; int baseX = aBaseMetaTileEntity.getXCoord(), baseZ = aBaseMetaTileEntity.getZCoord(), @@ -336,10 +336,8 @@ public final class Util { } //TE Rotation - - - int xyz[]=new int[3]; - int abc[]=new int[3]; + int[] xyz =new int[3]; + int[] abc =new int[3]; int pointer; int baseX = tileEntity.xCoord, @@ -1045,7 +1043,7 @@ public final class Util { String id1=player.getUniqueID().toString(); write(new File(dir, id1 + "."+extension),data); write(new File(dir, id1 + "."+extension+"_bak"),data); - String id2=UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes(forName("UTF-8"))).toString(); + String id2=UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes(StandardCharsets.UTF_8)).toString(); write(new File(dir, id2 + "."+extension),data); write(new File(dir, id2 + "."+extension+"_bak"),data); } -- cgit From 9360d6afe97e029001f411d819f6d80dafdc95a3 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 20 Apr 2020 17:19:19 +0200 Subject: Revoctor Structure util to new package, fix typo --- Baubles-1.7.10-1.0.1.10.jar | Bin 0 -> 95415 bytes EnderCore-1.7.10-0.2.0.39_beta.jar | Bin 0 -> 467824 bytes EnderIO-1.7.10-2.3.0.429_beta.jar | Bin 0 -> 4756103 bytes GalacticraftCore-Dev-1.7-3.0.12.504.jar | Bin 0 -> 10419213 bytes libs/AsieLib-1.7.10-0.4.9-deobf.jar | Bin 0 -> 154691 bytes libs/Computronics-1.7.10-1.6.6-deobf.jar | Bin 0 -> 1143582 bytes libs/GTNewHorizonsCoreMod-1.7.10-1.6.10.jar | Bin 0 -> 3425453 bytes libs/Galacticraft-API-1.7-3.0.12.504.jar | Bin 0 -> 119588 bytes libs/MicdoodleCore-1.7-3.0.12.504.jar | Bin 0 -> 64945 bytes libs/worldedit-forge-mc1.7.10-6.1.1-dist.jar | Bin 0 -> 1461467 bytes .../GT_MetaTileEntity_EM_essentiaDequantizer.java | 8 +- .../GT_MetaTileEntity_EM_essentiaQuantizer.java | 8 +- .../tectech/loader/ConstructableLoader.java | 47 ++ .../mechanics/constructable/IConstructable.java | 16 + .../constructable/IMultiblockInfoContainer.java | 30 ++ .../tectech/mechanics/constructable/Structure.java | 526 +++++++++++++++++++++ .../mechanics/constructible/IConstructable.java | 15 - .../thing/item/ConstructableTriggerItem.java | 115 ++--- .../multi/GT_MetaTileEntity_EM_annihilation.java | 8 +- .../multi/GT_MetaTileEntity_EM_bhg.java | 12 +- .../multi/GT_MetaTileEntity_EM_collider.java | 12 +- .../multi/GT_MetaTileEntity_EM_computer.java | 18 +- .../multi/GT_MetaTileEntity_EM_crafting.java | 8 +- .../multi/GT_MetaTileEntity_EM_dataBank.java | 8 +- .../multi/GT_MetaTileEntity_EM_decay.java | 8 +- .../multi/GT_MetaTileEntity_EM_dequantizer.java | 8 +- .../multi/GT_MetaTileEntity_EM_infuser.java | 8 +- .../multi/GT_MetaTileEntity_EM_junction.java | 8 +- .../multi/GT_MetaTileEntity_EM_quantizer.java | 8 +- .../multi/GT_MetaTileEntity_EM_research.java | 8 +- .../multi/GT_MetaTileEntity_EM_scanner.java | 8 +- .../multi/GT_MetaTileEntity_EM_stabilizer.java | 8 +- .../multi/GT_MetaTileEntity_EM_switch.java | 8 +- .../multi/GT_MetaTileEntity_EM_transformer.java | 8 +- .../multi/GT_MetaTileEntity_EM_wormhole.java | 8 +- .../multi/GT_MetaTileEntity_TM_microwave.java | 8 +- .../GT_MetaTileEntity_TM_proccessingStack.java | 4 +- .../multi/GT_MetaTileEntity_TM_teslaCoil.java | 7 +- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 4 +- .../em_machine/GT_MetaTileEntity_EM_machine.java | 8 +- .../GT_MetaTileEntity_DebugStructureWriter.java | 6 +- .../java/com/github/technus/tectech/util/Util.java | 522 -------------------- 42 files changed, 772 insertions(+), 706 deletions(-) create mode 100644 Baubles-1.7.10-1.0.1.10.jar create mode 100644 EnderCore-1.7.10-0.2.0.39_beta.jar create mode 100644 EnderIO-1.7.10-2.3.0.429_beta.jar create mode 100644 GalacticraftCore-Dev-1.7-3.0.12.504.jar create mode 100644 libs/AsieLib-1.7.10-0.4.9-deobf.jar create mode 100644 libs/Computronics-1.7.10-1.6.6-deobf.jar create mode 100644 libs/GTNewHorizonsCoreMod-1.7.10-1.6.10.jar create mode 100644 libs/Galacticraft-API-1.7-3.0.12.504.jar create mode 100644 libs/MicdoodleCore-1.7-3.0.12.504.jar create mode 100644 libs/worldedit-forge-mc1.7.10-6.1.1-dist.jar create mode 100644 src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/constructable/IConstructable.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/constructable/IMultiblockInfoContainer.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/constructable/Structure.java delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/constructible/IConstructable.java diff --git a/Baubles-1.7.10-1.0.1.10.jar b/Baubles-1.7.10-1.0.1.10.jar new file mode 100644 index 0000000000..40f23088c7 Binary files /dev/null and b/Baubles-1.7.10-1.0.1.10.jar differ diff --git a/EnderCore-1.7.10-0.2.0.39_beta.jar b/EnderCore-1.7.10-0.2.0.39_beta.jar new file mode 100644 index 0000000000..1fdf703497 Binary files /dev/null and b/EnderCore-1.7.10-0.2.0.39_beta.jar differ diff --git a/EnderIO-1.7.10-2.3.0.429_beta.jar b/EnderIO-1.7.10-2.3.0.429_beta.jar new file mode 100644 index 0000000000..9be1d55c41 Binary files /dev/null and b/EnderIO-1.7.10-2.3.0.429_beta.jar differ diff --git a/GalacticraftCore-Dev-1.7-3.0.12.504.jar b/GalacticraftCore-Dev-1.7-3.0.12.504.jar new file mode 100644 index 0000000000..329f7ae19b Binary files /dev/null and b/GalacticraftCore-Dev-1.7-3.0.12.504.jar differ diff --git a/libs/AsieLib-1.7.10-0.4.9-deobf.jar b/libs/AsieLib-1.7.10-0.4.9-deobf.jar new file mode 100644 index 0000000000..78d4f64b4a Binary files /dev/null and b/libs/AsieLib-1.7.10-0.4.9-deobf.jar differ diff --git a/libs/Computronics-1.7.10-1.6.6-deobf.jar b/libs/Computronics-1.7.10-1.6.6-deobf.jar new file mode 100644 index 0000000000..e6f5b07a69 Binary files /dev/null and b/libs/Computronics-1.7.10-1.6.6-deobf.jar differ diff --git a/libs/GTNewHorizonsCoreMod-1.7.10-1.6.10.jar b/libs/GTNewHorizonsCoreMod-1.7.10-1.6.10.jar new file mode 100644 index 0000000000..b579b93cc6 Binary files /dev/null and b/libs/GTNewHorizonsCoreMod-1.7.10-1.6.10.jar differ diff --git a/libs/Galacticraft-API-1.7-3.0.12.504.jar b/libs/Galacticraft-API-1.7-3.0.12.504.jar new file mode 100644 index 0000000000..6935478027 Binary files /dev/null and b/libs/Galacticraft-API-1.7-3.0.12.504.jar differ diff --git a/libs/MicdoodleCore-1.7-3.0.12.504.jar b/libs/MicdoodleCore-1.7-3.0.12.504.jar new file mode 100644 index 0000000000..b678294b0d Binary files /dev/null and b/libs/MicdoodleCore-1.7-3.0.12.504.jar differ diff --git a/libs/worldedit-forge-mc1.7.10-6.1.1-dist.jar b/libs/worldedit-forge-mc1.7.10-6.1.1-dist.jar new file mode 100644 index 0000000000..0361359748 Binary files /dev/null and b/libs/worldedit-forge-mc1.7.10-6.1.1-dist.jar differ 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 ab6b723e09..eb9b97deee 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,5 +1,6 @@ package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition; @@ -7,7 +8,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInsta import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.casing.TT_Container_Casings; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_quantizer; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; @@ -24,7 +25,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import static com.github.technus.tectech.util.CommonValues.V; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat.essentiaContainerCompat; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -123,7 +123,7 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ } @Override - public void construct(int stackSize, boolean hintsOnly) { + public void construct(ItemStack stackSize, boolean hintsOnly) { IGregTechTileEntity iGregTechTileEntity = getBaseMetaTileEntity(); int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX; int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY; @@ -139,7 +139,7 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2); } } - StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, iGregTechTileEntity, getExtendedFacing(), hintsOnly); + Structure.builder(shape, blockType, blockMeta, 1, 1, 0, iGregTechTileEntity, getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java index 309d029b8e..0259aec7a7 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,5 +1,6 @@ package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition; @@ -7,7 +8,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInsta import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.casing.TT_Container_Casings; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_quantizer; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; @@ -24,7 +25,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import static com.github.technus.tectech.util.CommonValues.V; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat.essentiaContainerCompat; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -127,7 +127,7 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu } @Override - public void construct(int stackSize, boolean hintsOnly) { + public void construct(ItemStack stackSize, boolean hintsOnly) { IGregTechTileEntity iGregTechTileEntity = getBaseMetaTileEntity(); int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX; int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY; @@ -143,7 +143,7 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2); } } - StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, iGregTechTileEntity, getExtendedFacing(), hintsOnly); + Structure.builder(shape, blockType, blockMeta, 1, 1, 0, iGregTechTileEntity, getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java b/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java new file mode 100644 index 0000000000..2dc56754f8 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java @@ -0,0 +1,47 @@ +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.constructable.Structure; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; + +import static com.github.technus.tectech.mechanics.constructable.IMultiblockInfoContainer.*; +import static gregtech.api.GregTech_API.sBlockCasings1; + +public class ConstructableLoader implements Runnable { + + @Override + public void run() { + registerMetaClass(GT_MetaTileEntity_ElectricBlastFurnace .class, new IMultiblockInfoContainer() { + //region Structure + private final String[][] shape = new String[][]{ + {"000","\"\"\"","\"\"\""," . ",}, + {"0!0","\"A\"","\"A\""," ",}, + {"000","\"\"\"","\"\"\""," ",}, + }; + private final Block[] blockType = new Block[]{sBlockCasings1}; + private final byte[] blockMeta = new byte[]{11}; + 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, TileEntity tileEntity, ExtendedFacing aSide) { + Structure.builder(shape, blockType, blockMeta, 1, 3, 0, tileEntity, aSide, hintsOnly); + } + + @Override + public String[] getDescription(int stackSize) { + return desc; + } + }); + } +} 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 new file mode 100644 index 0000000000..d7c3c86098 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/constructable/IConstructable.java @@ -0,0 +1,16 @@ +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(int 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 new file mode 100644 index 0000000000..29769fafb8 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/constructable/IMultiblockInfoContainer.java @@ -0,0 +1,30 @@ +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 { + HashMap MULTIBLOCK_MAP = new HashMap<>(); + + static void registerTileClass(Class clazz, IMultiblockInfoContainer info){ + MULTIBLOCK_MAP.put(clazz.getCanonicalName(),info); + } + + static void registerMetaClass(Class clazz, IMultiblockInfoContainer info){ + MULTIBLOCK_MAP.put(clazz.getCanonicalName(),info); + } + + void construct(ItemStack stackSize, boolean hintsOnly, TileEntity tileEntity, ExtendedFacing aSide); + + @SideOnly(Side.CLIENT) + String[] getDescription(int stackSize); +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/constructable/Structure.java b/src/main/java/com/github/technus/tectech/mechanics/constructable/Structure.java new file mode 100644 index 0000000000..00ffb32525 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/constructable/Structure.java @@ -0,0 +1,526 @@ +package com.github.technus.tectech.mechanics.constructable; + +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing; +import com.github.technus.tectech.thing.casing.TT_Container_Casings; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +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.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; +import static gregtech.api.enums.GT_Values.E; + +public class Structure { + private static final Pattern matchE_ = Pattern.compile("(E,(E,)+)"); + + private Structure(){} + + //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller + //This only checks for REGULAR BLOCKS! + public static 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[] addingMethods, + short[] casingTextures, + Block[] blockTypeFallback,//use numbers 0-9 for casing types + byte[] blockMetaFallback,//use numbers 0-9 for casing types + int horizontalOffset, int verticalOffset, int depthOffset, + IGregTechTileEntity aBaseMetaTileEntity, + ExtendedFacing extendedFacing, + boolean forceCheck) { + 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) + if ((pointer = block - '0') >= 0) { + //countable air -> net.minecraft.block.BlockAir + if (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockType[pointer]) { + if (DEBUG_MODE) { + TecTech.LOGGER.info("Struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlock(xyz[0], xyz[1], xyz[2]).getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName()); + } + return false; + } + if (world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != blockMeta[pointer]) { + if (DEBUG_MODE) { + TecTech.LOGGER.info("Struct-meta-id-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) + ' ' + blockMeta[pointer]); + } + return false; + } + } else //noinspection ConstantConditions + if ((pointer = block - ' ') >= 0) { + igt = aBaseMetaTileEntity.getIGregTechTileEntity(xyz[0], xyz[1], xyz[2]); + if (igt == null || !addingMethods[pointer].apply(igt, casingTextures[pointer])) { + if (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockTypeFallback[pointer]) { + if (DEBUG_MODE) { + TecTech.LOGGER.info("Fallback-struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlock(xyz[0], xyz[1], xyz[2]).getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName())); + } + return false; + } + if (world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != 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] + " / " + world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) + ' ' + blockMetaFallback[pointer]); + } + return false; + } + } + } + } + } else if (forceCheck) { + return false; + } + abc[0]++;//block in horizontal layer + } + } + abc[1]--;//horizontal layer + } + abc[2]++;//depth + } + return true; + } + + 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) { + return builder(structure, blockType, blockMeta, horizontalOffset, verticalOffset, depthOffset, + tileEntity.getWorld(),tileEntity.getXCoord(),tileEntity.getYCoord(),tileEntity.getZCoord(), + extendedFacing, hintsOnly); + } + + 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, + TileEntity tileEntity, ExtendedFacing extendedFacing, boolean hintsOnly) { + return builder(structure, blockType, blockMeta, horizontalOffset, verticalOffset, depthOffset, + tileEntity.getWorldObj(),tileEntity.xCoord,tileEntity.yCoord,tileEntity.zCoord, + extendedFacing, hintsOnly); + } + + 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, + World world,int baseX,int baseZ,int baseY, ExtendedFacing extendedFacing, boolean hintsOnly) { + 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] || world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != blockMeta[pointer]) { + TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], blockType[pointer], blockMeta[pointer]); + } + } else if ((pointer = block - ' ') >= 0) { + if (pointer >= 0 && pointer < 12) { + TecTech.proxy.hint_particle(world, 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) { + world.setBlock(xyz[0], xyz[1], xyz[2], blockType[pointer], blockMeta[pointer], 2); + } else if (block - ' ' < 0) { + world.setBlock(xyz[0], xyz[1], xyz[2], TT_Container_Casings.sHintCasingsTT, 15, 2); + } //else { + //switch(pointer){ + // case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: + // world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, pointer, 2); break; + // default:world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 12, 2); + //} + //} + } + } + } + abc[0]++;//block in horizontal layer + } + } + abc[1]--;//horizontal layer + } + abc[2]++;//depth + } + return true; + } + + + public static String[] writer(IGregTechTileEntity aBaseMetaTileEntity, + int horizontalOffset, int verticalOffset, int depthOffset, + int horizontalSize, int verticalSize, int depthSize, boolean ignoreAir) { + //TE Rotation + byte facing = aBaseMetaTileEntity.getFrontFacing(); + World world = aBaseMetaTileEntity.getWorld(); + if (world.isRemote) { + return new String[]{"Not at Client m8"}; + } + + ItemStack[] array = new ItemStack[10]; + + int x, y, z, a, b, c; + 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 - #1 - count block types + c = -depthOffset; + for (int cz = 0; cz < depthSize; cz++) {//front to back + b = verticalOffset; + for (int by = 0; by < verticalSize; by++) {//top to bottom + a = -horizontalOffset; + for (int az = 0; az < horizontalSize; az++) {//left to right + //get x y z from rotation + switch (facing) {//translation + case 4: + x = baseX + c; + z = baseZ + a; + y = baseY + b; + break; + case 3: + x = baseX + a; + z = baseZ - c; + y = baseY + b; + break; + case 5: + x = baseX - c; + z = baseZ - a; + y = baseY + b; + break; + case 2: + x = baseX - a; + z = baseZ + c; + y = baseY + b; + break; + //Things get odd if the block faces up or down... + case 1: + x = baseX + a; + z = baseZ + b; + y = baseY - c; + break;//similar to 3 + case 0: + x = baseX - a; + z = baseZ - b; + y = baseY + c; + break;//similar to 2 + default: + return new String[]{"Invalid rotation"}; + } + + //that must be here since in some cases other axis (b,c) controls y + if (y < 0 || y >= 256) { + return new String[]{"Invalid position"}; + } + + //Check block + Block block = world.getBlock(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + + if (!block.hasTileEntity(meta) && block.getMaterial() != Material.air) { + boolean err = true; + ItemStack is = new ItemStack(block, 1, meta); + for (int i = 0; i < array.length; i++) { + if (array[i] == null) { + array[i] = is; + err = false; + break; + } else if (is.getItem() == array[i].getItem() && is.getItemDamage() == array[i].getItemDamage()) { + err = false; + break; + } + } + if (err) { + return new String[]{"Too much different blocks"}; + } + } + + a++;//block in horizontal layer + } + b--;//horizontal layer + } + c++;//depth + } + + List output = new ArrayList<>(); + + output.add("Offsets: " + horizontalOffset + ' ' + verticalOffset + ' ' + depthOffset); + output.add("Sizes: " + horizontalSize + ' ' + verticalSize + ' ' + depthSize); + output.add(""); + + output.add("ID[]: Name[]"); + output.add(""); + for (int i = 0; i < array.length; i++) { + if (array[i] != null) { + output.add(i + ": " + array[i].getDisplayName()); + } + } + output.add(""); + output.add("ID[]: Block[] BlockMetaID[]"); + output.add(""); + for (int i = 0; i < array.length; i++) { + if (array[i] != null) { + output.add(i + ": " + array[i].getItem().getUnlocalizedName() + ' ' + array[i].getItemDamage()); + } + } + output.add(""); + output.add("String[][]"); + //perform your duties - #2 - write strings + output.add("{"); + c = -depthOffset; + for (int cz = 0; cz < depthSize; cz++) {//front to back + b = verticalOffset; + StringBuilder addMe = new StringBuilder().append('{'); + for (int by = 0; by < verticalSize; by++) {//top to bottom + a = -horizontalOffset; + StringBuilder line = new StringBuilder(); + for (int az = 0; az < horizontalSize; az++) {//left to right + //get x y z from rotation + switch (facing) {//translation + case 4: + x = baseX + c; + z = baseZ + a; + y = baseY + b; + break; + case 3: + x = baseX + a; + z = baseZ - c; + y = baseY + b; + break; + case 5: + x = baseX - c; + z = baseZ - a; + y = baseY + b; + break; + case 2: + x = baseX - a; + z = baseZ + c; + y = baseY + b; + break; + //Things get odd if the block faces up or down... + case 1: + x = baseX + a; + z = baseZ + b; + y = baseY - c; + break;//similar to 3 + case 0: + x = baseX - a; + z = baseZ - b; + y = baseY + c; + break;//similar to 2 + default: + return new String[]{"Invalid rotation"}; + } + + //Check block + Block block = world.getBlock(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + + if (a == 0 && b == 0 && c == 0) { + line.append('.'); + } else if (block.getMaterial() == Material.air) { + line.append('-'); + } else if (block.hasTileEntity(meta)) { + line.append('*'); + } else { + ItemStack stack = new ItemStack(block, 1, meta); + String str = "?";//OH YEAH NPEs + for (int i = 0; i < array.length; i++) { + if (array[i] != null && stack.getItem() == array[i].getItem() && stack.getItemDamage() == array[i].getItemDamage()) { + str = Integer.toString(i); + break; + } + } + line.append(str); + } + a++;//block in horizontal layer + } + if (ignoreAir) { + StringBuilder builder = new StringBuilder(); + char temp = '@'; + for (char ch : line.toString().toCharArray()) { + if (ch == '-') { + temp += 1; + if (temp == '~') { + builder.append('~'); + temp = '@'; + } + } else { + if (temp > '@') { + builder.append(temp); + temp = '@'; + } + builder.append(ch); + } + } + while (builder.length() > 0 && builder.charAt(builder.length() - 1) == '~') { + builder.deleteCharAt(builder.length() - 1); + } + if (builder.length() == 0) { + builder.append("E,"); + } else { + builder.insert(0, '"'); + builder.append('"').append(','); + } + addMe.append(builder); + } else { + if (line.length() == 0) { + line.append("E,"); + } else { + line.insert(0, '"'); + line.append('"').append(','); + } + addMe.append(line); + } + b--;//horizontal layer + } + //region less verbose + addMe.append('}').append(','); + String builtStr = addMe.toString().replaceAll("(E,)+(?=})", E/*Remove Empty strings at end*/); + Matcher matcher = matchE_.matcher(builtStr); + while (matcher.find()) { + byte lenEE = (byte) (matcher.group(1).length() >> 1); + builtStr = builtStr.replaceFirst("E,(E,)+", "\"\\\\u00" + String.format("%02X", lenEE - 1) + "\","); + //builtStr=builtStr.replaceFirst("E,(E,)+\"","\"\\\\u00"+String.format("%02X", lenEE)); + } + //endregion + output.add(builtStr); + c++;//depth + } + output.add("}"); + return output.toArray(new String[0]); + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/constructible/IConstructable.java b/src/main/java/com/github/technus/tectech/mechanics/constructible/IConstructable.java deleted file mode 100644 index fdfa2904fb..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/constructible/IConstructable.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.github.technus.tectech.mechanics.constructible; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Created by Tec on 24.03.2017. - */ -public interface IConstructable { - void construct(int stackSize, boolean hintsOnly); - - @SideOnly(Side.CLIENT) - String[] getStructureDescription(int stackSize); -} - diff --git a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java index 4af6b53658..7b7d1983fa 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java @@ -1,15 +1,15 @@ package com.github.technus.tectech.thing.item; +import com.github.technus.tectech.mechanics.alignment.IAlignment; +import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing; +import com.github.technus.tectech.mechanics.constructable.IMultiblockInfoContainer; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import cpw.mods.fml.common.registry.GameRegistry; -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 gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; -import net.minecraft.block.Block; +import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; @@ -18,14 +18,13 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.util.FakePlayer; +import net.minecraftforge.common.util.ForgeDirection; -import java.util.HashMap; import java.util.List; import static com.github.technus.tectech.Reference.MODID; -import static com.github.technus.tectech.util.Util.StructureBuilder; import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; -import static gregtech.api.GregTech_API.sBlockCasings1; +import static com.github.technus.tectech.mechanics.constructable.IMultiblockInfoContainer.MULTIBLOCK_MAP; import static net.minecraft.util.StatCollector.translateToLocal; /** @@ -34,8 +33,6 @@ import static net.minecraft.util.StatCollector.translateToLocal; public final class ConstructableTriggerItem extends Item { public static ConstructableTriggerItem INSTANCE; - private static HashMap multiblockMap= new HashMap<>(); - private ConstructableTriggerItem() { setUnlocalizedName("em.constructable"); setTextureName(MODID + ":itemConstructable"); @@ -54,14 +51,28 @@ public final class ConstructableTriggerItem extends Item { if (tTileEntity instanceof IGregTechTileEntity) { IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); if (metaTE instanceof IConstructable) { - ((IConstructable) metaTE).construct(aStack.stackSize, false); - } else if (multiblockMap.containsKey(metaTE.getClass().getCanonicalName())) { - multiblockMap.get(metaTE.getClass().getCanonicalName()).construct(aStack.stackSize, false, tTileEntity, ((IGregTechTileEntity) tTileEntity).getFrontFacing()); + ((IConstructable) metaTE).construct(aStack, false); + } else if (MULTIBLOCK_MAP.containsKey(metaTE.getClass().getCanonicalName())) { + IMultiblockInfoContainer iMultiblockInfoContainer = MULTIBLOCK_MAP.get(metaTE.getClass().getCanonicalName()); + if(metaTE instanceof IAlignment){ + iMultiblockInfoContainer.construct(aStack, false, tTileEntity, ( + (IAlignment) metaTE).getExtendedFacing()); + }else { + iMultiblockInfoContainer.construct(aStack, false, tTileEntity, + ExtendedFacing.of(ForgeDirection.getOrientation(((IGregTechTileEntity) tTileEntity).getFrontFacing()))); + } } } else if (tTileEntity instanceof IConstructable) { - ((IConstructable) tTileEntity).construct(aStack.stackSize, false); - } else if (multiblockMap.containsKey(tTileEntity.getClass().getCanonicalName())) { - multiblockMap.get(tTileEntity.getClass().getCanonicalName()).construct(aStack.stackSize, false, tTileEntity, aSide); + ((IConstructable) tTileEntity).construct(aStack, false); + } else if (MULTIBLOCK_MAP.containsKey(tTileEntity.getClass().getCanonicalName())) { + IMultiblockInfoContainer iMultiblockInfoContainer = MULTIBLOCK_MAP.get(tTileEntity.getClass().getCanonicalName()); + 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; @@ -70,21 +81,35 @@ public final class ConstructableTriggerItem extends Item { if(tTileEntity instanceof IGregTechTileEntity) { IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); if (metaTE instanceof IConstructable) { - ((IConstructable) metaTE).construct(aStack.stackSize, true); + ((IConstructable) metaTE).construct(aStack, true); TecTech.proxy.printInchat(((IConstructable) metaTE).getStructureDescription(aStack.stackSize)); return false; - } else if(multiblockMap.containsKey(metaTE.getClass().getCanonicalName())){ - multiblockMap.get(metaTE.getClass().getCanonicalName()).construct(aStack.stackSize,true,tTileEntity,((IGregTechTileEntity) tTileEntity).getFrontFacing()); - TecTech.proxy.printInchat(multiblockMap.get(metaTE.getClass().getCanonicalName()).getDescription(aStack.stackSize)); + } else if(MULTIBLOCK_MAP.containsKey(metaTE.getClass().getCanonicalName())){ + IMultiblockInfoContainer iMultiblockInfoContainer = MULTIBLOCK_MAP.get(metaTE.getClass().getCanonicalName()); + if(metaTE instanceof IAlignment){ + iMultiblockInfoContainer.construct(aStack, true, tTileEntity, ( + (IAlignment) metaTE).getExtendedFacing()); + }else { + iMultiblockInfoContainer.construct(aStack, true, tTileEntity, + ExtendedFacing.of(ForgeDirection.getOrientation(((IGregTechTileEntity) tTileEntity).getFrontFacing()))); + } + TecTech.proxy.printInchat(MULTIBLOCK_MAP.get(metaTE.getClass().getCanonicalName()).getDescription(aStack.stackSize)); return false; } } else if(tTileEntity instanceof IConstructable){ - ((IConstructable) tTileEntity).construct(aStack.stackSize,true); + ((IConstructable) tTileEntity).construct(aStack,true); TecTech.proxy.printInchat(((IConstructable) tTileEntity).getStructureDescription(aStack.stackSize)); return false; - } else if(multiblockMap.containsKey(tTileEntity.getClass().getCanonicalName())){ - multiblockMap.get(tTileEntity.getClass().getCanonicalName()).construct(aStack.stackSize,true,tTileEntity, aSide); - TecTech.proxy.printInchat(multiblockMap.get(tTileEntity.getClass().getCanonicalName()).getDescription(aStack.stackSize)); + } else if(MULTIBLOCK_MAP.containsKey(tTileEntity.getClass().getCanonicalName())){ + IMultiblockInfoContainer iMultiblockInfoContainer = MULTIBLOCK_MAP.get(tTileEntity.getClass().getCanonicalName()); + 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(MULTIBLOCK_MAP.get(tTileEntity.getClass().getCanonicalName()).getDescription(aStack.stackSize)); return false; } //} else { @@ -122,47 +147,5 @@ public final class ConstructableTriggerItem extends Item { public static void run() { INSTANCE = new ConstructableTriggerItem(); GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName()); - - registerMetaClass(GT_MetaTileEntity_ElectricBlastFurnace.class, new IMultiblockInfoContainer() { - //region Structure - private final String[][] shape = new String[][]{ - {"000","\"\"\"","\"\"\""," . ",}, - {"0!0","\"A\"","\"A\""," ",}, - {"000","\"\"\"","\"\"\""," ",}, - }; - private final Block[] blockType = new Block[]{sBlockCasings1}; - private final byte[] blockMeta = new byte[]{11}; - 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(int stackSize, boolean hintsOnly, TileEntity tileEntity, int aSide) { - StructureBuilder(shape, blockType, blockMeta, 1, 3, 0, tileEntity, aSide, hintsOnly); - } - - @Override - public String[] getDescription(int stackSize) { - return desc; - } - }); - } - - public interface IMultiblockInfoContainer { - void construct(int stackSize, boolean hintsOnly, TileEntity tileEntity, int aSide); - @SideOnly(Side.CLIENT) - String[] getDescription(int stackSize); - } - - public static void registerTileClass(Class clazz, IMultiblockInfoContainer info){ - multiblockMap.put(clazz.getCanonicalName(),info); - } - - public static void registerMetaClass(Class clazz, IMultiblockInfoContainer info){ - multiblockMap.put(clazz.getCanonicalName(),info); } } 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 d52a3c23f7..4333d4c8c9 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,8 +1,9 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; @@ -17,7 +18,6 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -103,8 +103,8 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 5, 5, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly) { + Structure.builder(shape, blockType, blockMeta, 5, 5, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java index 74ebae9f57..c5aaa1d66f 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,8 +1,9 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; @@ -17,7 +18,6 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -297,11 +297,11 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E } @Override - public void construct(int stackSize, boolean hintsOnly) { - if ((stackSize & 1) == 1) { - StructureBuilderExtreme(shape, blockType, blockMeta, 16, 16, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly) { + if ((stackSize.stackSize & 1) == 1) { + Structure.builder(shape, blockType, blockMeta, 16, 16, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } else { - StructureBuilderExtreme(shape2, blockType2, blockMeta2, 16, 16, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + Structure.builder(shape2, blockType2, blockMeta2, 16, 16, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index d37fcfdc4b..fe676910ee 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -1,5 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.dComplexAspectDefinition; @@ -13,7 +14,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex. import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eQuarkDefinition; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.casing.TT_Container_Casings; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; @@ -33,7 +34,6 @@ import net.minecraftforge.common.util.ForgeDirection; import java.util.HashMap; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -665,7 +665,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int stackSize, boolean hintsOnly) { + public void construct(ItemStack stackSize, boolean hintsOnly) { IGregTechTileEntity iGregTechTileEntity = getBaseMetaTileEntity(); int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 4; int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY * 4; @@ -681,10 +681,10 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2); } } - if ((stackSize & 1) == 1) { - StructureBuilderExtreme(shape, blockType, blockMeta1, 11, 1, 18, iGregTechTileEntity, getExtendedFacing(), hintsOnly); + if ((stackSize.stackSize & 1) == 1) { + Structure.builder(shape, blockType, blockMeta1, 11, 1, 18, iGregTechTileEntity, getExtendedFacing(), hintsOnly); } else { - StructureBuilderExtreme(shape, blockType, blockMeta2, 11, 1, 18, iGregTechTileEntity, getExtendedFacing(), hintsOnly); + Structure.builder(shape, blockType, blockMeta2, 11, 1, 18, iGregTechTileEntity, getExtendedFacing(), hintsOnly); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java index 1afbdf66e0..433b8b4950 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,11 +1,12 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.util.Util; import com.github.technus.tectech.util.Vec3Impl; import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Rack; @@ -29,7 +30,6 @@ import net.minecraft.util.ResourceLocation; import java.util.ArrayList; import static com.github.technus.tectech.util.CommonValues.V; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -335,18 +335,18 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int stackSize, boolean hintsOnly) { + public void construct(ItemStack stackSize, boolean hintsOnly) { IGregTechTileEntity igt = getBaseMetaTileEntity(); - StructureBuilderExtreme(front, blockType, blockMeta, 1, 2, 0, igt, getExtendedFacing(), hintsOnly); - StructureBuilderExtreme(cap, blockType, blockMeta, 1, 2, -1, igt, getExtendedFacing(), hintsOnly); + Structure.builder(front, blockType, blockMeta, 1, 2, 0, igt, getExtendedFacing(), hintsOnly); + Structure.builder(cap, blockType, blockMeta, 1, 2, -1, igt, getExtendedFacing(), hintsOnly); byte offset = -2; - for (int rackSlices = Math.min(stackSize, 12); rackSlices > 0; rackSlices--) { - StructureBuilderExtreme(slice, blockType, blockMeta, 1, 2, offset--, igt, getExtendedFacing(), hintsOnly); + for (int rackSlices = Math.min(stackSize.stackSize, 12); rackSlices > 0; rackSlices--) { + Structure.builder(slice, blockType, blockMeta, 1, 2, offset--, igt, getExtendedFacing(), hintsOnly); } - StructureBuilderExtreme(cap, blockType, blockMeta, 1, 2, offset--, igt, getExtendedFacing(), hintsOnly); - StructureBuilderExtreme(terminator, blockType, blockMeta, 1, 2, offset, igt, getExtendedFacing(), hintsOnly); + Structure.builder(cap, blockType, blockMeta, 1, 2, offset--, igt, getExtendedFacing(), hintsOnly); + Structure.builder(terminator, blockType, blockMeta, 1, 2, offset, igt, getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java index 3083f36721..7a71f36d3b 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,8 +1,9 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; @@ -17,7 +18,6 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -105,8 +105,8 @@ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly) { + Structure.builder(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java index 57ab6d770d..647bbf4a3b 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,9 +1,10 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.mechanics.dataTransport.InventoryDataPacket; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputDataItems; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputDataItems; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; @@ -28,7 +29,6 @@ import net.minecraft.util.ResourceLocation; import java.util.ArrayList; import static com.github.technus.tectech.util.CommonValues.V; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.recipe.TT_recipeAdder.nullItem; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; @@ -170,8 +170,8 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 2, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly) { + Structure.builder(shape, blockType, blockMeta, 2, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java index ffea7781ee..be28a3d0c8 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,9 +1,10 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; @@ -27,7 +28,6 @@ import net.minecraft.util.EnumChatFormatting; import org.apache.commons.lang3.reflect.FieldUtils; import static com.github.technus.tectech.util.CommonValues.VN; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -243,8 +243,8 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly) { + Structure.builder(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java index cb13abf358..fed03d1845 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,5 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; @@ -7,7 +8,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElem import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aOredictDequantizationInfo; import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.iExchangeInfo; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; @@ -25,7 +26,6 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.ArrayList; import static com.github.technus.tectech.util.CommonValues.V; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition.STABLE_RAW_LIFE_TIME; import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition.refMass; import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition.refUnstableMass; @@ -148,8 +148,8 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly) { + Structure.builder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java index 23a36f0edb..aed3025d4f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -1,10 +1,11 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import cofh.api.energy.IEnergyContainerItem; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; @@ -22,7 +23,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -182,8 +182,8 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 1, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly) { + Structure.builder(shape, blockType, blockMeta, 1, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java index 448f0a5563..8a76ee6ff1 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java @@ -1,7 +1,8 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; @@ -13,7 +14,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import static com.github.technus.tectech.util.CommonValues.V; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; @@ -169,8 +169,8 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly) { + Structure.builder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java index 4696164979..6315a2f295 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java @@ -1,5 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; @@ -11,7 +12,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.transformations import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aOredictQuantizationInfo; import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import cpw.mods.fml.relauncher.Side; @@ -29,7 +30,6 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.ArrayList; import static com.github.technus.tectech.util.CommonValues.V; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.util.Util.isInputEqual; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition.DEFAULT_ENERGY_LEVEL; @@ -197,8 +197,8 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly) { + Structure.builder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java index e9bb65c19f..2a739cb6c7 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,8 +1,9 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.recipe.TT_recipe; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Holder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; @@ -37,7 +38,6 @@ import java.util.LinkedHashMap; import static com.github.technus.tectech.util.CommonValues.V; import static com.github.technus.tectech.util.CommonValues.VN; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.recipe.TT_recipe.E_RECIPE_ID; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; @@ -552,8 +552,8 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 1, 3, 4, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly) { + Structure.builder(shape, blockType, blockMeta, 1, 3, 4, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java index be869b2ba9..48479b9d71 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,5 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; @@ -11,7 +12,7 @@ import com.github.technus.tectech.thing.CustomItemList; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.block.QuantumStuffBlock; import com.github.technus.tectech.thing.item.ElementalDefinitionScanStorage_EM; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; import gregtech.api.enums.ItemList; @@ -34,7 +35,6 @@ import org.apache.commons.lang3.reflect.FieldUtils; import static com.github.technus.tectech.util.CommonValues.V; import static com.github.technus.tectech.util.CommonValues.VN; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.util.Util.areBitsSet; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.cPrimitiveDefinition.nbtE__; @@ -513,8 +513,8 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly) { + Structure.builder(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java index 9c88c4ecf3..ece01f7489 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java @@ -1,8 +1,9 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -11,7 +12,6 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static net.minecraft.util.StatCollector.translateToLocal; @@ -69,8 +69,8 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly) { + Structure.builder(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java index 47949ea36e..39f9441cb7 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,9 +1,10 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputData; import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; @@ -21,7 +22,6 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import static com.github.technus.tectech.util.CommonValues.V; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -216,8 +216,8 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly) { + Structure.builder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java index 81fd5eb6ad..c2e759e96c 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,8 +1,9 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; @@ -20,7 +21,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -149,8 +149,8 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly) { + Structure.builder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java index 1f9d88e4fd..2b2ebdd1a4 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,8 +1,9 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; @@ -17,7 +18,6 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -104,8 +104,8 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 4, 4, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly) { + Structure.builder(shape, blockType, blockMeta, 4, 4, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java index 497efd6f71..9c40d6ebc9 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,8 +1,9 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; 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.Vec3Impl; @@ -24,7 +25,6 @@ import net.minecraft.util.EnumChatFormatting; import java.util.ArrayList; import java.util.HashSet; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.loader.MainLoader.microwaving; import static com.github.technus.tectech.recipe.TT_recipeAdder.nullItem; import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; @@ -245,8 +245,8 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly) { + Structure.builder(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java index bf18a545ef..678f211744 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,7 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.util.CommonValues; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; @@ -121,7 +121,7 @@ public class GT_MetaTileEntity_TM_proccessingStack extends GT_MetaTileEntity_Mul } @Override - public void construct(int stackSize, boolean hintsOnly) { + public void construct(ItemStack stackSize, boolean hintsOnly) { //StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), this, hintsOnly); } 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 85ccc5d881..327b54e561 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java @@ -1,5 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.loader.NetworkDispatcher; @@ -7,7 +8,7 @@ import com.github.technus.tectech.mechanics.data.RendererMessage; import com.github.technus.tectech.mechanics.data.ThaumSpark; import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil; import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil_Ultimate; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Capacitor; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; @@ -821,8 +822,8 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMetas[(stackSize - 1) % 6], 3, 16, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly) { + Structure.builder(shape, blockType, blockMetas[(stackSize.stackSize - 1) % 6], 3, 16, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java index 50e2aa575b..2f23aae431 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 @@ -6,6 +6,7 @@ import com.github.technus.tectech.mechanics.alignment.*; import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing; import com.github.technus.tectech.mechanics.alignment.enumerable.Flip; import com.github.technus.tectech.mechanics.alignment.enumerable.Rotation; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.Util; import com.github.technus.tectech.util.Vec3Impl; import com.github.technus.tectech.loader.NetworkDispatcher; @@ -41,7 +42,6 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import static com.github.technus.tectech.util.CommonValues.*; -import static com.github.technus.tectech.util.Util.StructureCheckerExtreme; import static com.github.technus.tectech.util.Util.getTier; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; @@ -200,7 +200,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt 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 StructureCheckerExtreme(structure, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, + return Structure.checker(structure, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, horizontalOffset, verticalOffset, depthOffset, getBaseMetaTileEntity(), getExtendedFacing(), !mMachine); } 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 dce8f56ce9..f6f3ec9a63 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java @@ -1,12 +1,13 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.util.Util; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.block.QuantumStuffBlock; -import com.github.technus.tectech.mechanics.constructible.IConstructable; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -21,7 +22,6 @@ import net.minecraftforge.common.util.ForgeDirection; import java.util.HashMap; import java.util.function.Supplier; -import static com.github.technus.tectech.util.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; @@ -349,8 +349,8 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 1, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly) { + Structure.builder(shape, blockType, blockMeta, 2, 2, 1, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override 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 f40752bcf5..194d357b1c 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,5 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.single; +import com.github.technus.tectech.mechanics.constructable.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.util.Util; @@ -20,7 +21,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.util.Util.StructureWriter; import static com.github.technus.tectech.thing.metaTileEntity.Textures.MACHINE_CASINGS_TT; import static net.minecraft.util.StatCollector.translateToLocal; @@ -107,7 +107,7 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isAllowedToWork()) { - result = StructureWriter(getBaseMetaTileEntity(), numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5], false); + result = Structure.writer(getBaseMetaTileEntity(), numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5], false); for (String s : result) { TecTech.LOGGER.info(s); } @@ -117,7 +117,7 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - result = StructureWriter(getBaseMetaTileEntity(), numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5], true); + result = Structure.writer(getBaseMetaTileEntity(), numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5], true); for (String s : result) { TecTech.LOGGER.info(s); } diff --git a/src/main/java/com/github/technus/tectech/util/Util.java b/src/main/java/com/github/technus/tectech/util/Util.java index 7e6e177e77..b81506d27c 100644 --- a/src/main/java/com/github/technus/tectech/util/Util.java +++ b/src/main/java/com/github/technus/tectech/util/Util.java @@ -167,528 +167,6 @@ public final class Util { return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; } - //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller - //This only checks for REGULAR BLOCKS! - public static boolean StructureCheckerExtreme( - 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[] addingMethods, - short[] casingTextures, - Block[] blockTypeFallback,//use numbers 0-9 for casing types - byte[] blockMetaFallback,//use numbers 0-9 for casing types - int horizontalOffset, int verticalOffset, int depthOffset, - IGregTechTileEntity aBaseMetaTileEntity, - ExtendedFacing extendedFacing, - boolean forceCheck) { - 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) - if ((pointer = block - '0') >= 0) { - //countable air -> net.minecraft.block.BlockAir - if (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockType[pointer]) { - if (DEBUG_MODE) { - TecTech.LOGGER.info("Struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlock(xyz[0], xyz[1], xyz[2]).getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName()); - } - return false; - } - if (world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != blockMeta[pointer]) { - if (DEBUG_MODE) { - TecTech.LOGGER.info("Struct-meta-id-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) + ' ' + blockMeta[pointer]); - } - return false; - } - } else //noinspection ConstantConditions - if ((pointer = block - ' ') >= 0) { - igt = aBaseMetaTileEntity.getIGregTechTileEntity(xyz[0], xyz[1], xyz[2]); - if (igt == null || !addingMethods[pointer].apply(igt, casingTextures[pointer])) { - if (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockTypeFallback[pointer]) { - if (DEBUG_MODE) { - TecTech.LOGGER.info("Fallback-struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlock(xyz[0], xyz[1], xyz[2]).getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName())); - } - return false; - } - if (world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != 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] + " / " + world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) + ' ' + blockMetaFallback[pointer]); - } - return false; - } - } - } - } - } else if (forceCheck) { - return false; - } - abc[0]++;//block in horizontal layer - } - } - abc[1]--;//horizontal layer - } - abc[2]++;//depth - } - return true; - } - - public static boolean StructureBuilder(String[][] structure,//0-9 casing, +- air no air, A... ignore 'A'-CHAR+1 blocks - Block[] blockType,//use numbers 0-9 for casing types - byte[] blockMeta,//use numbers 0-9 for casing types - int horizontalOffset, int verticalOffset, int depthOffset, - IGregTechTileEntity aBaseMetaTileEntity, boolean hintsOnly) { - byte facing = aBaseMetaTileEntity.getFrontFacing(); - return StructureBuilderExtreme(structure, blockType, blockMeta, - horizontalOffset, verticalOffset, depthOffset, - aBaseMetaTileEntity.getWorld().getTileEntity(aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()), null, - facing, hintsOnly); - } - - public static boolean StructureBuilderExtreme(String[][] structure,//0-9 casing, +- air no air, A... ignore 'A'-CHAR+1 blocks - Block[] blockType,//use numbers 0-9 for casing types - byte[] blockMeta,//use numbers 0-9 for casing types - int horizontalOffset, int verticalOffset, int depthOffset, - IGregTechTileEntity aBaseMetaTileEntity, ExtendedFacing extendedFacing, boolean hintsOnly) { - byte facing = aBaseMetaTileEntity.getFrontFacing(); - return StructureBuilderExtreme(structure, blockType, blockMeta, - horizontalOffset, verticalOffset, depthOffset, - aBaseMetaTileEntity.getWorld().getTileEntity(aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()), extendedFacing, - facing, hintsOnly); - } - - public static boolean StructureBuilder(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, - TileEntity tileEntity, int facing, boolean hintsOnly) { - return StructureBuilderExtreme(structure, blockType, blockMeta, horizontalOffset, verticalOffset, depthOffset, tileEntity, null, facing, hintsOnly); - } - - public static boolean StructureBuilderExtreme(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, - TileEntity tileEntity, ExtendedFacing extendedFacing, int simpleFacing, boolean hintsOnly) { - if (!tileEntity.hasWorldObj()) { - return false; - } - World world = tileEntity.getWorldObj(); - if (!world.isRemote && hintsOnly) { - return false; - } - - //TE Rotation - int[] xyz =new int[3]; - int[] abc =new int[3]; - int pointer; - int - baseX = tileEntity.xCoord, - baseZ = tileEntity.zCoord, - baseY = tileEntity.yCoord; - //a,b,c - relative to block face! - //x,y,z - relative to block position on map! - if (extendedFacing == null) { - extendedFacing=ExtendedFacing.of(ForgeDirection.getOrientation(simpleFacing)); - } - - //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] || world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != blockMeta[pointer]) { - TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], blockType[pointer], blockMeta[pointer]); - } - } else if ((pointer = block - ' ') >= 0) { - if (pointer >= 0 && pointer < 12) { - TecTech.proxy.hint_particle(world, 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) { - world.setBlock(xyz[0], xyz[1], xyz[2], blockType[pointer], blockMeta[pointer], 2); - } else if (block - ' ' < 0) { - world.setBlock(xyz[0], xyz[1], xyz[2], TT_Container_Casings.sHintCasingsTT, 15, 2); - } //else { - //switch(pointer){ - // case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: - // world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, pointer, 2); break; - // default:world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 12, 2); - //} - //} - } - } - } - abc[0]++;//block in horizontal layer - } - } - abc[1]--;//horizontal layer - } - abc[2]++;//depth - } - return true; - } - - - public static String[] StructureWriter(IGregTechTileEntity aBaseMetaTileEntity, - int horizontalOffset, int verticalOffset, int depthOffset, - int horizontalSize, int verticalSize, int depthSize, boolean ignoreAir) { - //TE Rotation - byte facing = aBaseMetaTileEntity.getFrontFacing(); - World world = aBaseMetaTileEntity.getWorld(); - if (world.isRemote) { - return new String[]{"Not at Client m8"}; - } - - ItemStack[] array = new ItemStack[10]; - - int x, y, z, a, b, c; - 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 - #1 - count block types - c = -depthOffset; - for (int cz = 0; cz < depthSize; cz++) {//front to back - b = verticalOffset; - for (int by = 0; by < verticalSize; by++) {//top to bottom - a = -horizontalOffset; - for (int az = 0; az < horizontalSize; az++) {//left to right - //get x y z from rotation - switch (facing) {//translation - case 4: - x = baseX + c; - z = baseZ + a; - y = baseY + b; - break; - case 3: - x = baseX + a; - z = baseZ - c; - y = baseY + b; - break; - case 5: - x = baseX - c; - z = baseZ - a; - y = baseY + b; - break; - case 2: - x = baseX - a; - z = baseZ + c; - y = baseY + b; - break; - //Things get odd if the block faces up or down... - case 1: - x = baseX + a; - z = baseZ + b; - y = baseY - c; - break;//similar to 3 - case 0: - x = baseX - a; - z = baseZ - b; - y = baseY + c; - break;//similar to 2 - default: - return new String[]{"Invalid rotation"}; - } - - //that must be here since in some cases other axis (b,c) controls y - if (y < 0 || y >= 256) { - return new String[]{"Invalid position"}; - } - - //Check block - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - - if (!block.hasTileEntity(meta) && block.getMaterial() != Material.air) { - boolean err = true; - ItemStack is = new ItemStack(block, 1, meta); - for (int i = 0; i < array.length; i++) { - if (array[i] == null) { - array[i] = is; - err = false; - break; - } else if (is.getItem() == array[i].getItem() && is.getItemDamage() == array[i].getItemDamage()) { - err = false; - break; - } - } - if (err) { - return new String[]{"Too much different blocks"}; - } - } - - a++;//block in horizontal layer - } - b--;//horizontal layer - } - c++;//depth - } - - List output = new ArrayList<>(); - - output.add("Offsets: " + horizontalOffset + ' ' + verticalOffset + ' ' + depthOffset); - output.add("Sizes: " + horizontalSize + ' ' + verticalSize + ' ' + depthSize); - output.add(""); - - output.add("ID[]: Name[]"); - output.add(""); - for (int i = 0; i < array.length; i++) { - if (array[i] != null) { - output.add(i + ": " + array[i].getDisplayName()); - } - } - output.add(""); - output.add("ID[]: Block[] BlockMetaID[]"); - output.add(""); - for (int i = 0; i < array.length; i++) { - if (array[i] != null) { - output.add(i + ": " + array[i].getItem().getUnlocalizedName() + ' ' + array[i].getItemDamage()); - } - } - output.add(""); - output.add("String[][]"); - //perform your duties - #2 - write strings - output.add("{"); - c = -depthOffset; - for (int cz = 0; cz < depthSize; cz++) {//front to back - b = verticalOffset; - StringBuilder addMe = new StringBuilder().append('{'); - for (int by = 0; by < verticalSize; by++) {//top to bottom - a = -horizontalOffset; - StringBuilder line = new StringBuilder(); - for (int az = 0; az < horizontalSize; az++) {//left to right - //get x y z from rotation - switch (facing) {//translation - case 4: - x = baseX + c; - z = baseZ + a; - y = baseY + b; - break; - case 3: - x = baseX + a; - z = baseZ - c; - y = baseY + b; - break; - case 5: - x = baseX - c; - z = baseZ - a; - y = baseY + b; - break; - case 2: - x = baseX - a; - z = baseZ + c; - y = baseY + b; - break; - //Things get odd if the block faces up or down... - case 1: - x = baseX + a; - z = baseZ + b; - y = baseY - c; - break;//similar to 3 - case 0: - x = baseX - a; - z = baseZ - b; - y = baseY + c; - break;//similar to 2 - default: - return new String[]{"Invalid rotation"}; - } - - //Check block - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - - if (a == 0 && b == 0 && c == 0) { - line.append('.'); - } else if (block.getMaterial() == Material.air) { - line.append('-'); - } else if (block.hasTileEntity(meta)) { - line.append('*'); - } else { - ItemStack stack = new ItemStack(block, 1, meta); - String str = "?";//OH YEAH NPEs - for (int i = 0; i < array.length; i++) { - if (array[i] != null && stack.getItem() == array[i].getItem() && stack.getItemDamage() == array[i].getItemDamage()) { - str = Integer.toString(i); - break; - } - } - line.append(str); - } - a++;//block in horizontal layer - } - if (ignoreAir) { - StringBuilder builder = new StringBuilder(); - char temp = '@'; - for (char ch : line.toString().toCharArray()) { - if (ch == '-') { - temp += 1; - if (temp == '~') { - builder.append('~'); - temp = '@'; - } - } else { - if (temp > '@') { - builder.append(temp); - temp = '@'; - } - builder.append(ch); - } - } - while (builder.length() > 0 && builder.charAt(builder.length() - 1) == '~') { - builder.deleteCharAt(builder.length() - 1); - } - if (builder.length() == 0) { - builder.append("E,"); - } else { - builder.insert(0, '"'); - builder.append('"').append(','); - } - addMe.append(builder); - } else { - if (line.length() == 0) { - line.append("E,"); - } else { - line.insert(0, '"'); - line.append('"').append(','); - } - addMe.append(line); - } - b--;//horizontal layer - } - //region less verbose - addMe.append('}').append(','); - String builtStr = addMe.toString().replaceAll("(E,)+(?=})", E/*Remove Empty strings at end*/); - Matcher matcher = matchE_.matcher(builtStr); - while (matcher.find()) { - byte lenEE = (byte) (matcher.group(1).length() >> 1); - builtStr = builtStr.replaceFirst("E,(E,)+", "\"\\\\u00" + String.format("%02X", lenEE - 1) + "\","); - //builtStr=builtStr.replaceFirst("E,(E,)+\"","\"\\\\u00"+String.format("%02X", lenEE)); - } - //endregion - output.add(builtStr); - c++;//depth - } - output.add("}"); - return output.toArray(new String[0]); - } - - private static final Pattern matchE_ = Pattern.compile("(E,(E,)+)"); - public static boolean isInputEqual(boolean aDecreaseStacksizeBySuccess, boolean aDontCheckStackSizes, FluidStack[] requiredFluidInputs, ItemStack[] requiredInputs, FluidStack[] givenFluidInputs, ItemStack... givenInputs) { if (!GregTech_API.sPostloadFinished) { return false; -- cgit From dbf60f779468c195fd094e1f3057b09753979262 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 20 Apr 2020 17:21:26 +0200 Subject: run this loader --- src/main/java/com/github/technus/tectech/loader/MainLoader.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 f7bec9adc0..f8fbcda2da 100644 --- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java @@ -121,7 +121,7 @@ public final class MainLoader { } public static void postLoad() { - ProgressManager.ProgressBar progressBarPostLoad = ProgressManager.push("TecTech Post Loader", 5); + ProgressManager.ProgressBar progressBarPostLoad = ProgressManager.push("TecTech Post Loader", 6); progressBarPostLoad.step("Dreamcraft Compatibility"); if(Loader.isModLoaded(Reference.DREAMCRAFT)){ @@ -157,6 +157,10 @@ public final class MainLoader { fixBlocks(); TecTech.LOGGER.info("Blocks nerf done"); + progressBarPostLoad.step("Initialize more constructable stuff"); + new ConstructableLoader().run(); + TecTech.LOGGER.info("Constructable initialized"); + ProgressManager.pop(progressBarPostLoad); } -- cgit From 1899aad0102fec9cc0312b59ed3bc1687447a4bb Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 20 Apr 2020 17:24:17 +0200 Subject: untrack those --- Baubles-1.7.10-1.0.1.10.jar | Bin 95415 -> 0 bytes EnderCore-1.7.10-0.2.0.39_beta.jar | Bin 467824 -> 0 bytes EnderIO-1.7.10-2.3.0.429_beta.jar | Bin 4756103 -> 0 bytes GalacticraftCore-Dev-1.7-3.0.12.504.jar | Bin 10419213 -> 0 bytes libs/AsieLib-1.7.10-0.4.9-deobf.jar | Bin 154691 -> 0 bytes libs/Computronics-1.7.10-1.6.6-deobf.jar | Bin 1143582 -> 0 bytes libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar | Bin 4458558 -> 0 bytes libs/GTNewHorizonsCoreMod-1.7.10-1.6.10.jar | Bin 3425453 -> 0 bytes libs/Galacticraft-API-1.7-3.0.12.504.jar | Bin 119588 -> 0 bytes libs/MicdoodleCore-1.7-3.0.12.504.jar | Bin 64945 -> 0 bytes libs/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar | Bin 988221 -> 0 bytes libs/worldedit-forge-mc1.7.10-6.1.1-dist.jar | Bin 1461467 -> 0 bytes 12 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Baubles-1.7.10-1.0.1.10.jar delete mode 100644 EnderCore-1.7.10-0.2.0.39_beta.jar delete mode 100644 EnderIO-1.7.10-2.3.0.429_beta.jar delete mode 100644 GalacticraftCore-Dev-1.7-3.0.12.504.jar delete mode 100644 libs/AsieLib-1.7.10-0.4.9-deobf.jar delete mode 100644 libs/Computronics-1.7.10-1.6.6-deobf.jar delete mode 100644 libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar delete mode 100644 libs/GTNewHorizonsCoreMod-1.7.10-1.6.10.jar delete mode 100644 libs/Galacticraft-API-1.7-3.0.12.504.jar delete mode 100644 libs/MicdoodleCore-1.7-3.0.12.504.jar delete mode 100644 libs/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar delete mode 100644 libs/worldedit-forge-mc1.7.10-6.1.1-dist.jar diff --git a/Baubles-1.7.10-1.0.1.10.jar b/Baubles-1.7.10-1.0.1.10.jar deleted file mode 100644 index 40f23088c7..0000000000 Binary files a/Baubles-1.7.10-1.0.1.10.jar and /dev/null differ diff --git a/EnderCore-1.7.10-0.2.0.39_beta.jar b/EnderCore-1.7.10-0.2.0.39_beta.jar deleted file mode 100644 index 1fdf703497..0000000000 Binary files a/EnderCore-1.7.10-0.2.0.39_beta.jar and /dev/null differ diff --git a/EnderIO-1.7.10-2.3.0.429_beta.jar b/EnderIO-1.7.10-2.3.0.429_beta.jar deleted file mode 100644 index 9be1d55c41..0000000000 Binary files a/EnderIO-1.7.10-2.3.0.429_beta.jar and /dev/null differ diff --git a/GalacticraftCore-Dev-1.7-3.0.12.504.jar b/GalacticraftCore-Dev-1.7-3.0.12.504.jar deleted file mode 100644 index 329f7ae19b..0000000000 Binary files a/GalacticraftCore-Dev-1.7-3.0.12.504.jar and /dev/null differ diff --git a/libs/AsieLib-1.7.10-0.4.9-deobf.jar b/libs/AsieLib-1.7.10-0.4.9-deobf.jar deleted file mode 100644 index 78d4f64b4a..0000000000 Binary files a/libs/AsieLib-1.7.10-0.4.9-deobf.jar and /dev/null differ diff --git a/libs/Computronics-1.7.10-1.6.6-deobf.jar b/libs/Computronics-1.7.10-1.6.6-deobf.jar deleted file mode 100644 index e6f5b07a69..0000000000 Binary files a/libs/Computronics-1.7.10-1.6.6-deobf.jar and /dev/null differ diff --git a/libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar b/libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar deleted file mode 100644 index 181475fc38..0000000000 Binary files a/libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar and /dev/null differ diff --git a/libs/GTNewHorizonsCoreMod-1.7.10-1.6.10.jar b/libs/GTNewHorizonsCoreMod-1.7.10-1.6.10.jar deleted file mode 100644 index b579b93cc6..0000000000 Binary files a/libs/GTNewHorizonsCoreMod-1.7.10-1.6.10.jar and /dev/null differ diff --git a/libs/Galacticraft-API-1.7-3.0.12.504.jar b/libs/Galacticraft-API-1.7-3.0.12.504.jar deleted file mode 100644 index 6935478027..0000000000 Binary files a/libs/Galacticraft-API-1.7-3.0.12.504.jar and /dev/null differ diff --git a/libs/MicdoodleCore-1.7-3.0.12.504.jar b/libs/MicdoodleCore-1.7-3.0.12.504.jar deleted file mode 100644 index b678294b0d..0000000000 Binary files a/libs/MicdoodleCore-1.7-3.0.12.504.jar and /dev/null differ diff --git a/libs/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar b/libs/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar deleted file mode 100644 index e854bf7df9..0000000000 Binary files a/libs/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar and /dev/null differ diff --git a/libs/worldedit-forge-mc1.7.10-6.1.1-dist.jar b/libs/worldedit-forge-mc1.7.10-6.1.1-dist.jar deleted file mode 100644 index 0361359748..0000000000 Binary files a/libs/worldedit-forge-mc1.7.10-6.1.1-dist.jar and /dev/null differ -- cgit From bd8530d9043b1c873bd0a52e55911069a126bb88 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 20 Apr 2020 17:29:15 +0200 Subject: This need to exist --- libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar | Bin 0 -> 4458558 bytes libs/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar | Bin 0 -> 988221 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar create mode 100644 libs/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar diff --git a/libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar b/libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar new file mode 100644 index 0000000000..181475fc38 Binary files /dev/null and b/libs/GT-PlusPlus-1.7.0-prerelease-8-final.jar differ diff --git a/libs/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar b/libs/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar new file mode 100644 index 0000000000..e854bf7df9 Binary files /dev/null and b/libs/OpenModularTurrets-1.7.10-2.2.10-237-deobf.jar differ -- cgit From 5dc7c8557880c55e6ee4d63150a24d24bc1529ac Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 20 Apr 2020 17:29:40 +0200 Subject: ignore that --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index e97facd823..02507f643c 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,9 @@ GregTech.lang mods/ classes/ logs/ +libs/AsieLib-1.7.10-0.4.9-deobf.jar +libs/Computronics-1.7.10-1.6.6-deobf.jar +libs/Galacticraft-API-1.7-3.0.12.504.jar +libs/GTNewHorizonsCoreMod-1.7.10-1.6.10.jar +libs/MicdoodleCore-1.7-3.0.12.504.jar +libs/worldedit-forge-mc1.7.10-6.1.1-dist.jar -- cgit From 8f03f87dcf3ee70ff9d1cd6e7d496a4aab9fc0c1 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 20 Apr 2020 17:44:52 +0200 Subject: that spacebar... --- .../java/com/github/technus/tectech/loader/ConstructableLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java b/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java index 2dc56754f8..93752cc02f 100644 --- a/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java @@ -16,7 +16,7 @@ public class ConstructableLoader implements Runnable { @Override public void run() { - registerMetaClass(GT_MetaTileEntity_ElectricBlastFurnace .class, new IMultiblockInfoContainer() { + registerMetaClass(GT_MetaTileEntity_ElectricBlastFurnace.class, new IMultiblockInfoContainer() { //region Structure private final String[][] shape = new String[][]{ {"000","\"\"\"","\"\"\""," . ",}, -- cgit From 06ba23f08d8a1694c102a4ccd44a562a95a3f76f Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 25 Apr 2020 07:49:42 +0200 Subject: compat for new advanced smd parts (#27) If you just edit DreamCraft recipe loader you can push yourself @Dream-Master --- build.properties | 4 +- .../dreamcraft/DreamCraftRecipeLoader.java | 52 +++++++++++----------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/build.properties b/build.properties index 8dd601eb38..c75d05a3da 100644 --- a/build.properties +++ b/build.properties @@ -6,8 +6,8 @@ ic2.version=2.2.790-experimental codechickenlib.version=1.1.3.140 codechickencore.version=1.0.7.47 nei.version=1.0.5.120 -gregtech.jenkinsbuild=512 -gregtech.version=5.09.33.41 +gregtech.jenkinsbuild=520 +gregtech.version=5.09.33.42-Test cofhcore.version=[1.7.10]3.1.4-329-dev yamcore.version=0.5.79 baubles.version=1.0.1.10 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 86468de1b2..b863e35901 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 @@ -971,10 +971,10 @@ public class DreamCraftRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tritanium, 2), ItemList.Circuit_Wetwaresupercomputer.get(2L), ItemList.ZPM_Coil.get(16L), - ItemList.Circuit_Parts_CapacitorSMD.get(64L), - ItemList.Circuit_Parts_ResistorSMD.get(64L), - ItemList.Circuit_Parts_TransistorSMD.get(64L), - ItemList.Circuit_Parts_DiodeSMD.get(64L), + ItemList.Circuit_Parts_CapacitorASMD.get(16L), + ItemList.Circuit_Parts_ResistorASMD.get(16L), + ItemList.Circuit_Parts_TransistorASMD.get(16L), + 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), @@ -989,10 +989,10 @@ public class DreamCraftRecipeLoader implements Runnable { 48000, 128, 500000, 8, new ItemStack[]{ ItemList.Circuit_Board_Bio_Ultra.get(2L), ItemList.Circuit_Biowarecomputer.get(2L), - ItemList.Circuit_Parts_TransistorSMD.get(16L), - ItemList.Circuit_Parts_ResistorSMD.get(16L), - ItemList.Circuit_Parts_CapacitorSMD.get(16L), - ItemList.Circuit_Parts_DiodeSMD.get(48L), + ItemList.Circuit_Parts_TransistorASMD.get(16L), + ItemList.Circuit_Parts_ResistorASMD.get(16L), + ItemList.Circuit_Parts_CapacitorASMD.get(16L), + ItemList.Circuit_Parts_DiodeASMD.get(16L), ItemList.Circuit_Chip_NOR.get(32L), ItemList.Circuit_Chip_Ram.get(64L), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.NiobiumTitanium, 32L), @@ -1009,10 +1009,10 @@ public class DreamCraftRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tritanium, 4L), ItemList.Circuit_Biowaresupercomputer.get(2L), ItemList.UV_Coil.get(16L), - ItemList.Circuit_Parts_CapacitorSMD.get(64L), - ItemList.Circuit_Parts_ResistorSMD.get(64L), - ItemList.Circuit_Parts_TransistorSMD.get(64L), - ItemList.Circuit_Parts_DiodeSMD.get(64L), + ItemList.Circuit_Parts_CapacitorASMD.get(24L), + ItemList.Circuit_Parts_ResistorASMD.get(24L), + ItemList.Circuit_Parts_TransistorASMD.get(24L), + 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), @@ -1028,10 +1028,10 @@ public class DreamCraftRecipeLoader implements Runnable { 192000, 512, 2000000, 32, new ItemStack[]{ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tritanium, 8), ItemList.Circuit_Biomainframe.get(2L), - ItemList.Circuit_Parts_CapacitorSMD.get(64L), - ItemList.Circuit_Parts_ResistorSMD.get(64L), - ItemList.Circuit_Parts_TransistorSMD.get(64L), - ItemList.Circuit_Parts_DiodeSMD.get(64L), + ItemList.Circuit_Parts_CapacitorASMD.get(32L), + ItemList.Circuit_Parts_ResistorASMD.get(32L), + ItemList.Circuit_Parts_TransistorASMD.get(32L), + ItemList.Circuit_Parts_DiodeASMD.get(32L), ItemList.Circuit_Chip_Ram.get(64L), ItemList.Circuit_Chip_NPIC.get(64L), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Draconium, 64), @@ -1050,10 +1050,10 @@ public class DreamCraftRecipeLoader implements Runnable { ItemList.Circuit_Board_Bio_Ultra.get(1L), getItemContainer("PicoWafer").get(4L), getItemContainer("NanoCircuit").get(2L), - ItemList.Circuit_Parts_TransistorSMD.get(64L), - ItemList.Circuit_Parts_ResistorSMD.get(64L), - ItemList.Circuit_Parts_CapacitorSMD.get(64L), - ItemList.Circuit_Parts_DiodeSMD.get(64L), + ItemList.Circuit_Parts_TransistorASMD.get(484L), + ItemList.Circuit_Parts_ResistorASMD.get(48L), + ItemList.Circuit_Parts_CapacitorASMD.get(48L), + ItemList.Circuit_Parts_DiodeASMD.get(48L), ItemList.Circuit_Chip_PPIC.get(64L), GT_OreDictUnificator.get(OrePrefixes.foil, Materials.NiobiumTitanium, 16), GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Osmium, 32), @@ -1069,10 +1069,10 @@ public class DreamCraftRecipeLoader implements Runnable { 720000, 2048, 8000000, 128, new ItemStack[]{ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 16), getItemContainer("PikoCircuit").get(8L), - ItemList.Circuit_Parts_CapacitorSMD.get(64L), - ItemList.Circuit_Parts_DiodeSMD.get(64L), - ItemList.Circuit_Parts_TransistorSMD.get(64L), - ItemList.Circuit_Parts_ResistorSMD.get(64L), + ItemList.Circuit_Parts_CapacitorASMD.get(64L), + ItemList.Circuit_Parts_DiodeASMD.get(64L), + ItemList.Circuit_Parts_TransistorASMD.get(64L), + ItemList.Circuit_Parts_ResistorASMD.get(64L), ItemList.Circuit_Chip_QPIC.get(64L), GT_OreDictUnificator.get(OrePrefixes.foil, Materials.NiobiumTitanium, 64), GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Indium, 64), @@ -1153,7 +1153,7 @@ public class DreamCraftRecipeLoader implements Runnable { ItemList.Field_Generator_UV.get(2), ItemList.Circuit_Wafer_HPIC.get(64), ItemList.Circuit_Wafer_HPIC.get(64), - ItemList.Circuit_Parts_DiodeSMD.get(64), + ItemList.Circuit_Parts_DiodeASMD.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorUHV, 32), }, new FluidStack[]{ Materials.SolderingAlloy.getMolten(2880), @@ -1172,7 +1172,7 @@ public class DreamCraftRecipeLoader implements Runnable { ItemList.Circuit_Wafer_UHPIC.get(64), ItemList.Circuit_Wafer_UHPIC.get(64), ItemList.Circuit_Wafer_SoC2.get(32), - ItemList.Circuit_Parts_DiodeSMD.get(64), + ItemList.Circuit_Parts_DiodeASMD.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Neutronium, 64), }, new FluidStack[]{ Materials.SolderingAlloy.getMolten(3760), -- cgit From 2254062705725663f6b50ebd11dcd4ac8b5d1431 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 25 Apr 2020 23:12:49 +0200 Subject: new structure api --- .../GT_MetaTileEntity_EM_essentiaDequantizer.java | 6 +- .../GT_MetaTileEntity_EM_essentiaQuantizer.java | 6 +- .../tectech/loader/ConstructableLoader.java | 4 +- .../alignment/enumerable/ExtendedFacing.java | 17 +- .../mechanics/constructable/IConstructable.java | 2 +- .../constructable/IMultiblockInfoContainer.java | 2 +- .../tectech/mechanics/constructable/Structure.java | 526 --------------------- .../tectech/mechanics/structure/IBlockAdder.java | 14 + .../mechanics/structure/IBlockPosConsumer.java | 7 + .../tectech/mechanics/structure/IHatchAdder.java | 14 + .../mechanics/structure/IStructureDefinition.java | 137 ++++++ .../mechanics/structure/IStructureElement.java | 47 ++ .../structure/IStructureElementProvider.java | 5 + .../mechanics/structure/IStructureFallback.java | 40 ++ .../structure/IStructureFallbackProvider.java | 40 ++ .../mechanics/structure/IStructureNavigate.java | 23 + .../tectech/mechanics/structure/ITileAdder.java | 12 + .../tectech/mechanics/structure/Structure.java | 265 +++++++++++ .../mechanics/structure/StructureDefinition.java | 170 +++++++ .../mechanics/structure/StructureUtility.java | 469 ++++++++++++++++++ .../thing/item/ConstructableTriggerItem.java | 13 +- .../multi/GT_MetaTileEntity_EM_annihilation.java | 6 +- .../multi/GT_MetaTileEntity_EM_bhg.java | 6 +- .../multi/GT_MetaTileEntity_EM_collider.java | 5 +- .../multi/GT_MetaTileEntity_EM_computer.java | 5 +- .../multi/GT_MetaTileEntity_EM_crafting.java | 6 +- .../multi/GT_MetaTileEntity_EM_dataBank.java | 6 +- .../multi/GT_MetaTileEntity_EM_decay.java | 5 +- .../multi/GT_MetaTileEntity_EM_dequantizer.java | 6 +- .../multi/GT_MetaTileEntity_EM_infuser.java | 6 +- .../multi/GT_MetaTileEntity_EM_junction.java | 5 +- .../multi/GT_MetaTileEntity_EM_quantizer.java | 6 +- .../multi/GT_MetaTileEntity_EM_research.java | 6 +- .../multi/GT_MetaTileEntity_EM_scanner.java | 5 +- .../multi/GT_MetaTileEntity_EM_stabilizer.java | 6 +- .../multi/GT_MetaTileEntity_EM_switch.java | 5 +- .../multi/GT_MetaTileEntity_EM_transformer.java | 41 +- .../multi/GT_MetaTileEntity_EM_wormhole.java | 6 +- .../multi/GT_MetaTileEntity_TM_microwave.java | 5 +- .../GT_MetaTileEntity_TM_proccessingStack.java | 4 +- .../multi/GT_MetaTileEntity_TM_teslaCoil.java | 5 +- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 25 +- .../metaTileEntity/multi/base/IHatchAdder.java | 8 - .../em_machine/GT_MetaTileEntity_EM_machine.java | 5 +- .../GT_MetaTileEntity_DebugStructureWriter.java | 35 +- .../java/com/github/technus/tectech/util/Util.java | 16 - .../com/github/technus/tectech/util/Vec3Impl.java | 28 +- 47 files changed, 1405 insertions(+), 676 deletions(-) delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/constructable/Structure.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IBlockPosConsumer.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IHatchAdder.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementProvider.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallback.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallbackProvider.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java 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 eb9b97deee..df5054ab4a 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,6 +1,6 @@ package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition; @@ -11,7 +11,7 @@ import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_quantizer; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -143,7 +143,7 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ } @Override - public String[] getStructureDescription(int stackSize) { + public String[] getStructureDescription(ItemStack stackSize) { return description; } } \ 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 0259aec7a7..d48c345e8e 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,6 +1,6 @@ package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition; @@ -11,7 +11,7 @@ import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_quantizer; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -147,7 +147,7 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu } @Override - public String[] getStructureDescription(int stackSize) { + public String[] getStructureDescription(ItemStack stackSize) { return description; } } \ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java b/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java index 93752cc02f..665889dc1f 100644 --- a/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java @@ -2,7 +2,7 @@ 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.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; @@ -39,7 +39,7 @@ public class ConstructableLoader implements Runnable { } @Override - public String[] getDescription(int stackSize) { + public String[] getDescription(ItemStack stackSize) { return desc; } }); 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 index 5c8c902484..2a93bcc540 100644 --- 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 @@ -12,7 +12,6 @@ import static com.github.technus.tectech.mechanics.alignment.IAlignment.FLIPS_CO import static com.github.technus.tectech.mechanics.alignment.IAlignment.ROTATIONS_COUNT; import static java.lang.Math.abs; import static java.util.Arrays.stream; -import static java.util.stream.Collectors.reducing; import static java.util.stream.Collectors.toMap; public enum ExtendedFacing { @@ -144,32 +143,32 @@ public enum ExtendedFacing { switch (direction){ case DOWN: a= ForgeDirection.WEST; - b= ForgeDirection.NORTH; + b= ForgeDirection.SOUTH; c= ForgeDirection.UP; break; case UP: a= ForgeDirection.EAST; - b= ForgeDirection.NORTH; + b= ForgeDirection.SOUTH; c= ForgeDirection.DOWN; break; case NORTH: a= ForgeDirection.WEST; - b= ForgeDirection.UP; + b= ForgeDirection.DOWN; c= ForgeDirection.SOUTH; break; case SOUTH: a= ForgeDirection.EAST; - b= ForgeDirection.UP; + b= ForgeDirection.DOWN; c= ForgeDirection.NORTH; break; case WEST: a= ForgeDirection.SOUTH; - b= ForgeDirection.UP; + b= ForgeDirection.DOWN; c= ForgeDirection.EAST; break; case EAST: a= ForgeDirection.NORTH; - b= ForgeDirection.UP; + b= ForgeDirection.DOWN; c= ForgeDirection.WEST; break; default:throw new RuntimeException("Is impossible..."); @@ -187,7 +186,7 @@ public enum ExtendedFacing { default:throw new RuntimeException("Even more impossible..."); } switch (rotation) { - case COUNTER_CLOCKWISE: { + case CLOCKWISE: { ForgeDirection _a=a; a =b; b =_a.getOpposite(); @@ -197,7 +196,7 @@ public enum ExtendedFacing { a=a.getOpposite(); b=b.getOpposite(); break; - case CLOCKWISE: { + case COUNTER_CLOCKWISE: { ForgeDirection _a=a; a =b.getOpposite(); b =_a; 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 index d7c3c86098..1de0381f1f 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/constructable/IConstructable.java +++ b/src/main/java/com/github/technus/tectech/mechanics/constructable/IConstructable.java @@ -11,6 +11,6 @@ public interface IConstructable { void construct(ItemStack stackSize, boolean hintsOnly); @SideOnly(Side.CLIENT) - String[] getStructureDescription(int stackSize); + 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 index 29769fafb8..2506342f72 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/constructable/IMultiblockInfoContainer.java +++ b/src/main/java/com/github/technus/tectech/mechanics/constructable/IMultiblockInfoContainer.java @@ -26,5 +26,5 @@ public interface IMultiblockInfoContainer { void construct(ItemStack stackSize, boolean hintsOnly, TileEntity tileEntity, ExtendedFacing aSide); @SideOnly(Side.CLIENT) - String[] getDescription(int stackSize); + String[] getDescription(ItemStack stackSize); } diff --git a/src/main/java/com/github/technus/tectech/mechanics/constructable/Structure.java b/src/main/java/com/github/technus/tectech/mechanics/constructable/Structure.java deleted file mode 100644 index 00ffb32525..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/constructable/Structure.java +++ /dev/null @@ -1,526 +0,0 @@ -package com.github.technus.tectech.mechanics.constructable; - -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing; -import com.github.technus.tectech.thing.casing.TT_Container_Casings; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; -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.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; -import static gregtech.api.enums.GT_Values.E; - -public class Structure { - private static final Pattern matchE_ = Pattern.compile("(E,(E,)+)"); - - private Structure(){} - - //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller - //This only checks for REGULAR BLOCKS! - public static 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[] addingMethods, - short[] casingTextures, - Block[] blockTypeFallback,//use numbers 0-9 for casing types - byte[] blockMetaFallback,//use numbers 0-9 for casing types - int horizontalOffset, int verticalOffset, int depthOffset, - IGregTechTileEntity aBaseMetaTileEntity, - ExtendedFacing extendedFacing, - boolean forceCheck) { - 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) - if ((pointer = block - '0') >= 0) { - //countable air -> net.minecraft.block.BlockAir - if (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockType[pointer]) { - if (DEBUG_MODE) { - TecTech.LOGGER.info("Struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlock(xyz[0], xyz[1], xyz[2]).getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName()); - } - return false; - } - if (world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != blockMeta[pointer]) { - if (DEBUG_MODE) { - TecTech.LOGGER.info("Struct-meta-id-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) + ' ' + blockMeta[pointer]); - } - return false; - } - } else //noinspection ConstantConditions - if ((pointer = block - ' ') >= 0) { - igt = aBaseMetaTileEntity.getIGregTechTileEntity(xyz[0], xyz[1], xyz[2]); - if (igt == null || !addingMethods[pointer].apply(igt, casingTextures[pointer])) { - if (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockTypeFallback[pointer]) { - if (DEBUG_MODE) { - TecTech.LOGGER.info("Fallback-struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlock(xyz[0], xyz[1], xyz[2]).getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName())); - } - return false; - } - if (world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != 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] + " / " + world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) + ' ' + blockMetaFallback[pointer]); - } - return false; - } - } - } - } - } else if (forceCheck) { - return false; - } - abc[0]++;//block in horizontal layer - } - } - abc[1]--;//horizontal layer - } - abc[2]++;//depth - } - return true; - } - - 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) { - return builder(structure, blockType, blockMeta, horizontalOffset, verticalOffset, depthOffset, - tileEntity.getWorld(),tileEntity.getXCoord(),tileEntity.getYCoord(),tileEntity.getZCoord(), - extendedFacing, hintsOnly); - } - - 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, - TileEntity tileEntity, ExtendedFacing extendedFacing, boolean hintsOnly) { - return builder(structure, blockType, blockMeta, horizontalOffset, verticalOffset, depthOffset, - tileEntity.getWorldObj(),tileEntity.xCoord,tileEntity.yCoord,tileEntity.zCoord, - extendedFacing, hintsOnly); - } - - 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, - World world,int baseX,int baseZ,int baseY, ExtendedFacing extendedFacing, boolean hintsOnly) { - 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] || world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != blockMeta[pointer]) { - TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], blockType[pointer], blockMeta[pointer]); - } - } else if ((pointer = block - ' ') >= 0) { - if (pointer >= 0 && pointer < 12) { - TecTech.proxy.hint_particle(world, 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) { - world.setBlock(xyz[0], xyz[1], xyz[2], blockType[pointer], blockMeta[pointer], 2); - } else if (block - ' ' < 0) { - world.setBlock(xyz[0], xyz[1], xyz[2], TT_Container_Casings.sHintCasingsTT, 15, 2); - } //else { - //switch(pointer){ - // case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: - // world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, pointer, 2); break; - // default:world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 12, 2); - //} - //} - } - } - } - abc[0]++;//block in horizontal layer - } - } - abc[1]--;//horizontal layer - } - abc[2]++;//depth - } - return true; - } - - - public static String[] writer(IGregTechTileEntity aBaseMetaTileEntity, - int horizontalOffset, int verticalOffset, int depthOffset, - int horizontalSize, int verticalSize, int depthSize, boolean ignoreAir) { - //TE Rotation - byte facing = aBaseMetaTileEntity.getFrontFacing(); - World world = aBaseMetaTileEntity.getWorld(); - if (world.isRemote) { - return new String[]{"Not at Client m8"}; - } - - ItemStack[] array = new ItemStack[10]; - - int x, y, z, a, b, c; - 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 - #1 - count block types - c = -depthOffset; - for (int cz = 0; cz < depthSize; cz++) {//front to back - b = verticalOffset; - for (int by = 0; by < verticalSize; by++) {//top to bottom - a = -horizontalOffset; - for (int az = 0; az < horizontalSize; az++) {//left to right - //get x y z from rotation - switch (facing) {//translation - case 4: - x = baseX + c; - z = baseZ + a; - y = baseY + b; - break; - case 3: - x = baseX + a; - z = baseZ - c; - y = baseY + b; - break; - case 5: - x = baseX - c; - z = baseZ - a; - y = baseY + b; - break; - case 2: - x = baseX - a; - z = baseZ + c; - y = baseY + b; - break; - //Things get odd if the block faces up or down... - case 1: - x = baseX + a; - z = baseZ + b; - y = baseY - c; - break;//similar to 3 - case 0: - x = baseX - a; - z = baseZ - b; - y = baseY + c; - break;//similar to 2 - default: - return new String[]{"Invalid rotation"}; - } - - //that must be here since in some cases other axis (b,c) controls y - if (y < 0 || y >= 256) { - return new String[]{"Invalid position"}; - } - - //Check block - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - - if (!block.hasTileEntity(meta) && block.getMaterial() != Material.air) { - boolean err = true; - ItemStack is = new ItemStack(block, 1, meta); - for (int i = 0; i < array.length; i++) { - if (array[i] == null) { - array[i] = is; - err = false; - break; - } else if (is.getItem() == array[i].getItem() && is.getItemDamage() == array[i].getItemDamage()) { - err = false; - break; - } - } - if (err) { - return new String[]{"Too much different blocks"}; - } - } - - a++;//block in horizontal layer - } - b--;//horizontal layer - } - c++;//depth - } - - List output = new ArrayList<>(); - - output.add("Offsets: " + horizontalOffset + ' ' + verticalOffset + ' ' + depthOffset); - output.add("Sizes: " + horizontalSize + ' ' + verticalSize + ' ' + depthSize); - output.add(""); - - output.add("ID[]: Name[]"); - output.add(""); - for (int i = 0; i < array.length; i++) { - if (array[i] != null) { - output.add(i + ": " + array[i].getDisplayName()); - } - } - output.add(""); - output.add("ID[]: Block[] BlockMetaID[]"); - output.add(""); - for (int i = 0; i < array.length; i++) { - if (array[i] != null) { - output.add(i + ": " + array[i].getItem().getUnlocalizedName() + ' ' + array[i].getItemDamage()); - } - } - output.add(""); - output.add("String[][]"); - //perform your duties - #2 - write strings - output.add("{"); - c = -depthOffset; - for (int cz = 0; cz < depthSize; cz++) {//front to back - b = verticalOffset; - StringBuilder addMe = new StringBuilder().append('{'); - for (int by = 0; by < verticalSize; by++) {//top to bottom - a = -horizontalOffset; - StringBuilder line = new StringBuilder(); - for (int az = 0; az < horizontalSize; az++) {//left to right - //get x y z from rotation - switch (facing) {//translation - case 4: - x = baseX + c; - z = baseZ + a; - y = baseY + b; - break; - case 3: - x = baseX + a; - z = baseZ - c; - y = baseY + b; - break; - case 5: - x = baseX - c; - z = baseZ - a; - y = baseY + b; - break; - case 2: - x = baseX - a; - z = baseZ + c; - y = baseY + b; - break; - //Things get odd if the block faces up or down... - case 1: - x = baseX + a; - z = baseZ + b; - y = baseY - c; - break;//similar to 3 - case 0: - x = baseX - a; - z = baseZ - b; - y = baseY + c; - break;//similar to 2 - default: - return new String[]{"Invalid rotation"}; - } - - //Check block - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - - if (a == 0 && b == 0 && c == 0) { - line.append('.'); - } else if (block.getMaterial() == Material.air) { - line.append('-'); - } else if (block.hasTileEntity(meta)) { - line.append('*'); - } else { - ItemStack stack = new ItemStack(block, 1, meta); - String str = "?";//OH YEAH NPEs - for (int i = 0; i < array.length; i++) { - if (array[i] != null && stack.getItem() == array[i].getItem() && stack.getItemDamage() == array[i].getItemDamage()) { - str = Integer.toString(i); - break; - } - } - line.append(str); - } - a++;//block in horizontal layer - } - if (ignoreAir) { - StringBuilder builder = new StringBuilder(); - char temp = '@'; - for (char ch : line.toString().toCharArray()) { - if (ch == '-') { - temp += 1; - if (temp == '~') { - builder.append('~'); - temp = '@'; - } - } else { - if (temp > '@') { - builder.append(temp); - temp = '@'; - } - builder.append(ch); - } - } - while (builder.length() > 0 && builder.charAt(builder.length() - 1) == '~') { - builder.deleteCharAt(builder.length() - 1); - } - if (builder.length() == 0) { - builder.append("E,"); - } else { - builder.insert(0, '"'); - builder.append('"').append(','); - } - addMe.append(builder); - } else { - if (line.length() == 0) { - line.append("E,"); - } else { - line.insert(0, '"'); - line.append('"').append(','); - } - addMe.append(line); - } - b--;//horizontal layer - } - //region less verbose - addMe.append('}').append(','); - String builtStr = addMe.toString().replaceAll("(E,)+(?=})", E/*Remove Empty strings at end*/); - Matcher matcher = matchE_.matcher(builtStr); - while (matcher.find()) { - byte lenEE = (byte) (matcher.group(1).length() >> 1); - builtStr = builtStr.replaceFirst("E,(E,)+", "\"\\\\u00" + String.format("%02X", lenEE - 1) + "\","); - //builtStr=builtStr.replaceFirst("E,(E,)+\"","\"\\\\u00"+String.format("%02X", lenEE)); - } - //endregion - output.add(builtStr); - c++;//depth - } - output.add("}"); - return output.toArray(new String[0]); - } -} diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java new file mode 100644 index 0000000000..3dda99fed2 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java @@ -0,0 +1,14 @@ +package com.github.technus.tectech.mechanics.structure; + + +import net.minecraft.block.Block; + +public interface IBlockAdder { + /** + * Callback on block added + * @param block block attempted to add + * @param meta meta of block attempted to add + * @return is structure still valid + */ + boolean apply(Block block, Integer meta); +} 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 new file mode 100644 index 0000000000..c3ea2d3e3f --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockPosConsumer.java @@ -0,0 +1,7 @@ +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/IHatchAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IHatchAdder.java new file mode 100644 index 0000000000..10d4c398ec --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IHatchAdder.java @@ -0,0 +1,14 @@ +package com.github.technus.tectech.mechanics.structure; + + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; + +public interface IHatchAdder { + /** + * Callback to add hatch + * @param iGregTechTileEntity hatch + * @param aShort requested texture index, or null if not... + * @return managed to add hatch (structure still valid) + */ + boolean apply(IGregTechTileEntity iGregTechTileEntity, Short aShort); +} 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 new file mode 100644 index 0000000000..656151dc86 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java @@ -0,0 +1,137 @@ +package com.github.technus.tectech.mechanics.structure; + +import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing; +import net.minecraft.world.World; + +public interface IStructureDefinition { + /** + * Used internally + * @param name same name as for other methods here + * @return the array of elements to process + */ + IStructureElementProvider[] getElementsFor(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,getElementsFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ, + basePositionA, basePositionB, basePositionC,false,forceCheckAllBlocks); + } + + default boolean hints(T object,String piece, World world, ExtendedFacing extendedFacing, + int basePositionX, int basePositionY, int basePositionZ, + int basePositionA, int basePositionB, int basePositionC) { + return iterate(object,getElementsFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ, + basePositionA, basePositionB, basePositionC,true,null); + } + + default boolean build(T object,String piece, World world, ExtendedFacing extendedFacing, + int basePositionX, int basePositionY, int basePositionZ, + int basePositionA, int basePositionB, int basePositionC) { + return iterate(object,getElementsFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ, + basePositionA, basePositionB, basePositionC,false,null); + } + + default boolean buildOrHints(T object,String piece, World world, ExtendedFacing extendedFacing, + int basePositionX, int basePositionY, int basePositionZ, + int basePositionA, int basePositionB, int basePositionC, + boolean hintsOnly){ + return iterate(object,getElementsFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ, + basePositionA, basePositionB, basePositionC,hintsOnly,null); + } + + static boolean iterate(T object, IStructureElementProvider[] 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 (IStructureElementProvider elementProvider : elements) { + IStructureElement element=elementProvider.getStructureElement(object); + 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])){ + return false; + } + }else { + return false; + } + + abc[0] =(element.resetA()?basePositionA:abc[0])+element.getStepA(); + abc[1] =(element.resetB()?basePositionA:abc[1])+element.getStepB(); + abc[2] =(element.resetC()?basePositionA:abc[2])+element.getStepC(); + } + } else { + for (IStructureElementProvider elementProvider : elements) { + IStructureElement element=elementProvider.getStructureElement(object); + 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])){ + return false; + } + } + + abc[0] =(element.resetA()?basePositionA:abc[0])+element.getStepA(); + abc[1] =(element.resetB()?basePositionA:abc[1])+element.getStepB(); + abc[2] =(element.resetC()?basePositionA:abc[2])+element.getStepC(); + } + } + }else { + if(hintsOnly) { + for (IStructureElementProvider elementProvider : elements) { + IStructureElement element=elementProvider.getStructureElement(object); + extendedFacing.getWorldOffset(abc, xyz); + xyz[0] += basePositionX; + xyz[1] += basePositionY; + xyz[2] += basePositionZ; + + if (world.blockExists(xyz[0], xyz[1], xyz[2])) { + element.spawnHint(object, world, xyz[0], xyz[1], xyz[2]); + } + + abc[0] =(element.resetA()?basePositionA:abc[0])+element.getStepA(); + abc[1] =(element.resetB()?basePositionA:abc[1])+element.getStepB(); + abc[2] =(element.resetC()?basePositionA:abc[2])+element.getStepC(); + } + } else { + for (IStructureElementProvider elementProvider : elements) { + IStructureElement element=elementProvider.getStructureElement(object); + 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]); + } + + abc[0] =(element.resetA()?basePositionA:abc[0])+element.getStepA(); + abc[1] =(element.resetB()?basePositionA:abc[1])+element.getStepB(); + abc[2] =(element.resetC()?basePositionA:abc[2])+element.getStepC(); + } + } + } + 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 new file mode 100644 index 0000000000..d33eac4119 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java @@ -0,0 +1,47 @@ +package com.github.technus.tectech.mechanics.structure; + +import net.minecraft.world.World; + +/** + * Use StructureUtility to instantiate + */ +public interface IStructureElement extends IStructureElementProvider { + boolean check(T t,World world,int x,int y,int z); + + default boolean spawnHint(T t,World world,int x,int y,int z){ + return false; + } + + default boolean placeBlock(T t,World world,int x,int y,int z){ + return false; + } + + 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; + } + + @Override + default IStructureElement getStructureElement(T object){ + return this; + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementProvider.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementProvider.java new file mode 100644 index 0000000000..b38c2164c3 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementProvider.java @@ -0,0 +1,5 @@ +package com.github.technus.tectech.mechanics.structure; + +public interface IStructureElementProvider { + IStructureElement getStructureElement(T object); +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallback.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallback.java new file mode 100644 index 0000000000..354aaf60e9 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallback.java @@ -0,0 +1,40 @@ +package com.github.technus.tectech.mechanics.structure; + +import net.minecraft.world.World; + +/** + * Use StructureUtility to instantiate + */ +public interface IStructureFallback extends IStructureElement { + IStructureElement[] fallbacks(); + + @Override + default boolean check(T t, World world, int x, int y, int z){ + for (IStructureElement 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) { + for (IStructureElement fallback : fallbacks()) { + if (fallback.spawnHint(t, world, x, y, z)) { + return true; + } + } + return false; + } + + @Override + default boolean placeBlock(T t, World world, int x, int y, int z) { + for (IStructureElement fallback : fallbacks()) { + if (fallback.placeBlock(t, world, x, y, z)) { + return true; + } + } + return false; + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallbackProvider.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallbackProvider.java new file mode 100644 index 0000000000..c0c24eaec4 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallbackProvider.java @@ -0,0 +1,40 @@ +package com.github.technus.tectech.mechanics.structure; + +import net.minecraft.world.World; + +/** + * Use StructureUtility to instantiate + */ +public interface IStructureFallbackProvider extends IStructureElement { + IStructureElementProvider[] fallbacks(); + + @Override + default boolean check(T t,World world, int x, int y, int z){ + for (IStructureElementProvider fallback : fallbacks()) { + if (fallback.getStructureElement(t).check(t, world, x, y, z)) { + return true; + } + } + return false; + } + + @Override + default boolean spawnHint(T t,World world, int x, int y, int z) { + for (IStructureElementProvider fallback : fallbacks()) { + if (fallback.getStructureElement(t).spawnHint(t, world, x, y, z)) { + return true; + } + } + return false; + } + + @Override + default boolean placeBlock(T t,World world, int x, int y, int z) { + for (IStructureElementProvider fallback : fallbacks()) { + if (fallback.getStructureElement(t).placeBlock(t, world, x, y, z)) { + return true; + } + } + 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 new file mode 100644 index 0000000000..bba3dc5239 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java @@ -0,0 +1,23 @@ +package com.github.technus.tectech.mechanics.structure; + +import net.minecraft.world.World; + +/** + * Use StructureUtility to instantiate + */ +public interface IStructureNavigate extends IStructureElement { + @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) { + return true; + } + + @Override + default boolean placeBlock(T t, World world, int x, int y, int z) { + return true; + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java new file mode 100644 index 0000000000..9d983e1c4d --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java @@ -0,0 +1,12 @@ +package com.github.technus.tectech.mechanics.structure; + +import net.minecraft.tileentity.TileEntity; + +public interface ITileAdder { + /** + * Callback to add hatch + * @param tileEntity tile + * @return managed to add hatch (structure still valid) + */ + boolean apply(TileEntity tileEntity); +} 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 new file mode 100644 index 0000000000..77c47ad19e --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java @@ -0,0 +1,265 @@ +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.thing.casing.TT_Container_Casings; +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.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +import java.util.regex.Pattern; + +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; + +@Deprecated +public class Structure { + private static final Pattern MATCH_E = Pattern.compile("(E,(E,)+)"); + + private Structure(){} + + //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller + //This only checks for REGULAR BLOCKS! + public static 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[] addingMethods, + short[] casingTextures, + Block[] blockTypeFallback,//use numbers 0-9 for casing types + byte[] blockMetaFallback,//use numbers 0-9 for casing types + int horizontalOffset, int verticalOffset, int depthOffset, + IGregTechTileEntity aBaseMetaTileEntity, + ExtendedFacing extendedFacing, + boolean forceCheck) { + 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) + if ((pointer = block - '0') >= 0) { + //countable air -> net.minecraft.block.BlockAir + if (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockType[pointer]) { + if (DEBUG_MODE) { + TecTech.LOGGER.info("Struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlock(xyz[0], xyz[1], xyz[2]).getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName()); + } + return false; + } + if (world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != blockMeta[pointer]) { + if (DEBUG_MODE) { + TecTech.LOGGER.info("Struct-meta-id-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) + ' ' + blockMeta[pointer]); + } + return false; + } + } else if ((pointer = block - ' ') >= 0) { + igt = aBaseMetaTileEntity.getIGregTechTileEntity(xyz[0], xyz[1], xyz[2]); + if (igt == null || !addingMethods[pointer].apply(igt, casingTextures[pointer])) { + if (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockTypeFallback[pointer]) { + if (DEBUG_MODE) { + TecTech.LOGGER.info("Fallback-struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlock(xyz[0], xyz[1], xyz[2]).getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName())); + } + return false; + } + if (world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != 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] + " / " + world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) + ' ' + blockMetaFallback[pointer]); + } + return false; + } + } + } + } + } else if (forceCheck) { + return false; + } + abc[0]++;//block in horizontal layer + } + } + abc[1]++;//horizontal layer + } + abc[2]++;//depth + } + return true; + } + + 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) { + return builder(structure, blockType, blockMeta, horizontalOffset, verticalOffset, depthOffset, + tileEntity.getWorld(), tileEntity.getXCoord(), tileEntity.getYCoord(), tileEntity.getZCoord(), + extendedFacing, hintsOnly); + } + + 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, + TileEntity tileEntity, ExtendedFacing extendedFacing, boolean hintsOnly) { + return builder(structure, blockType, blockMeta, horizontalOffset, verticalOffset, depthOffset, + tileEntity.getWorldObj(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, + extendedFacing, hintsOnly); + } + + 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, + World world, int baseX, int baseY, int baseZ, ExtendedFacing extendedFacing, boolean hintsOnly) { + 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] || world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != blockMeta[pointer]) { + TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], blockType[pointer], blockMeta[pointer]); + } + } else if ((pointer = block - ' ') >= 0) { + if (pointer < 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) { + 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 new file mode 100644 index 0000000000..52386d8373 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java @@ -0,0 +1,170 @@ +package com.github.technus.tectech.mechanics.structure; + +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 implements IStructureDefinition { + private final Map> elements; + private final Map shapes; + private final Map[]> compiled; + + public static Builder builder() { + return new Builder<>(); + } + + private StructureDefinition( + Map> elements, + Map shapes, + Map[]> compiled) { + this.elements =elements; + this.shapes=shapes; + this.compiled =compiled; + } + + public static class Builder { + private static final char A='\uA000'; + private static final char B='\uB000'; + private static final char C='\uC000'; + private static final char D='\uD000'; + private final Map> elements; + private final Map shapes; + + private Builder() { + elements = new HashMap<>(); + shapes = new HashMap<>(); + } + + public Map> getElements() { + return elements; + } + + public Map getShapes() { + return shapes; + } + + /** + * 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(a,b) + * next string[] is next slice(a,b,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 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; + char d=D; + for (int i = 0; i < builder.length(); i++) { + char ch = builder.charAt(i); + if(ch ==' ' || ch =='.'){ + builder.setCharAt(i,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){ + builder.setCharAt(i-1,d); + addElement(d,step(a,b,c)); + a=0; + b=0; + c=0; + d++; + } + } + + 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 addElement(Character name, IStructureElementProvider structurePiece) { + elements.put(name, structurePiece); + return this; + } + + public IStructureDefinition build() { + if(DEBUG_MODE){ + return new StructureDefinition<>(new HashMap<>(elements), new HashMap<>(shapes), compileMap()); + }else { + return compileMap()::get; + } + } + + @SuppressWarnings("unchecked") + private Map[]> compileMap() { + List mising = new ArrayList<>(); + shapes.values().stream().map(CharSequence::chars).forEach(intStream -> intStream.forEach(c -> { + IStructureElementProvider iStructureElement = elements.get((char) c); + if (iStructureElement == null) { + mising.add(c); + } + })); + if (mising.isEmpty()) { + Map[]> map = new HashMap<>(); + shapes.forEach((key, value) -> { + IStructureElementProvider[] compiled = new IStructureElementProvider[value.length()]; + for (char i = 0; i < compiled.length; i++) { + compiled[i] = this.elements.get(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> getElements(){ + return elements; + } + + public Map getShapes() { + return shapes; + } + + public Map[]> getCompiled() { + return compiled; + } + + @Override + public IStructureElementProvider[] getElementsFor(String name) { + return compiled.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 new file mode 100644 index 0000000000..71eb2065e8 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -0,0 +1,469 @@ +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.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.tileentity.TileEntity; +import net.minecraft.world.World; + +import java.util.*; + +public class StructureUtility { + private static final String NICE_CHARS ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`~!@#$%^&*()_=|[]{};:'<>,./?"; + private static final Map STEP = new HashMap<>(); + private static final IStructureElement AIR= (t, world, x, y, z) -> world.getBlock(x, y, z).getMaterial() == Material.air; + private static final IStructureElement NOT_AIR= (t, world, x, y, z) -> world.getBlock(x, y, z).getMaterial() != Material.air; + + private StructureUtility(){ + + } + + @SuppressWarnings("unchecked") + public static IStructureElement isAir(){ + return AIR; + } + + @SuppressWarnings("unchecked") + public static IStructureElement notAir(){ + return NOT_AIR; + } + + /** + * Does not allow Block duplicates (with different meta) + */ + public static IStructureElement ofBlocksFlat(Map blocsMap,Block hintBlock,int hintMeta){ + if(blocsMap==null || blocsMap.isEmpty() || hintBlock==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + return blocsMap.getOrDefault(world.getBlock(x, y, z), -1) == world.getBlockMetadata(x, y, z); + } + + @Override + public boolean placeBlock(T t, World world, int x, int y, int z) { + world.setBlock(x,y,z,hintBlock,hintMeta,2); + return true; + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,hintBlock,hintMeta); + return true; + } + }; + } + + /** + * Allows block duplicates (with different meta) + */ + public static IStructureElement ofBlocks(Map> blocsMap,Block hintBlock,int hintMeta){ + if(blocsMap==null || blocsMap.isEmpty() || hintBlock==null){ + throw new IllegalArgumentException(); + } + for (Set value : blocsMap.values()) { + if(value.isEmpty()){ + throw new IllegalArgumentException(); + } + } + return new IStructureElement() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + return blocsMap.getOrDefault(world.getBlock(x, y, z), Collections.emptySet()).contains(world.getBlockMetadata(x, y, z)); + } + + @Override + public boolean placeBlock(T t, World world, int x, int y, int z) { + world.setBlock(x,y,z,hintBlock,hintMeta,2); + return true; + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,hintBlock,hintMeta); + return true; + } + }; + } + + public static IStructureElement ofBlock(Block block, int meta,Block hintBlock,int hintMeta){ + if(block==null || hintBlock==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + return block == world.getBlock(x, y, z) && meta == world.getBlockMetadata(x, y, z); + } + + @Override + public boolean placeBlock(T t, World world, int x, int y, int z) { + world.setBlock(x,y,z,hintBlock,hintMeta,2); + return true; + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,hintBlock,hintMeta); + return true; + } + }; + } + + public static IStructureElement ofBlock(Block block, int meta){ + return ofBlock(block, meta,block,meta); + } + + public static IStructureElement ofBlockAdder(IBlockAdder iBlockAdder,Block hintBlock,int hintMeta){ + if(iBlockAdder==null ||hintBlock==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + return iBlockAdder.apply(world.getBlock(x, y, z), world.getBlockMetadata(x, y, z)); + } + + @Override + public boolean placeBlock(T t, World world, int x, int y, int z) { + world.setBlock(x,y,z,hintBlock,hintMeta,2); + return true; + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,hintBlock,hintMeta); + return true; + } + }; + } + + public static IStructureElement ofTileAdder(ITileAdder iTileAdder,Block hintBlock,int hintMeta){ + if(iTileAdder==null ||hintBlock==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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(tileEntity); + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,hintBlock,hintMeta); + return true; + } + }; + } + + public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, Short textureIndex,Block hintBlock,int hintMeta){ + if(iHatchAdder==null ||hintBlock==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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((IGregTechTileEntity) tileEntity, textureIndex); + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,hintBlock,hintMeta); + return true; + } + }; + } + + public static IStructureNavigate 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()); + } + }); + } + + public static IStructureNavigate step(int a,int b, int c){ + return step(new Vec3Impl(a,b,c)); + } + + private static IStructureNavigate stepA(int a,int b, int c){ + return new IStructureNavigate() { + @Override + public int getStepA() { + return a; + } + + @Override + public int getStepB() { + return b; + } + + @Override + public int getStepC() { + return c; + } + }; + } + + private static IStructureNavigate stepB(int a,int b, int c){ + return new IStructureNavigate() { + @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 IStructureNavigate stepC(int a,int b, int c){ + return new IStructureNavigate() { + @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; + } + }; + } + + public static IStructureFallback ofElementChain(IStructureElement... elementChain){ + if(elementChain==null || elementChain.length==0){ + throw new IllegalArgumentException(); + } + for (IStructureElementProvider iStructureElement : elementChain) { + if(iStructureElement==null){ + throw new IllegalArgumentException(); + } + } + return () -> elementChain; + } + + public static IStructureFallbackProvider ofProviderChain(IStructureElementProvider... elementChain){ + if(elementChain==null || elementChain.length==0){ + throw new IllegalArgumentException(); + } + for (IStructureElementProvider iStructureElement : elementChain) { + if(iStructureElement==null){ + throw new IllegalArgumentException(); + } + } + return () -> elementChain; + } + + /** + * Use only to get pseudo code... + * @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) { + Map> blocks = new TreeMap<>(Comparator.comparing(Block::getUnlocalizedName)); + Set> tiles = new TreeSet<>(Comparator.comparing(Class::getCanonicalName)); + Set> 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(world.getBlockMetadata(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 map = new HashMap<>(); + StringBuilder builder = new StringBuilder(); + { + int i = 0; + char c; + builder.append("\n\nStructure:\n") + .append("\nBlocks:\n"); + for (Map.Entry> entry : blocks.entrySet()) { + Block block = entry.getKey(); + Set 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 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 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'); + builder.append("\nScan:\n") + .append("new String[][]{{\n") + .append(" \""); + + 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) { + builder.append(map.get(block.getUnlocalizedName() + '\0' + world.getBlockMetadata(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, + 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]; + + 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(); + } + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java index 7b7d1983fa..4160ae2aba 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java @@ -1,15 +1,14 @@ package com.github.technus.tectech.thing.item; +import com.github.technus.tectech.TecTech; import com.github.technus.tectech.mechanics.alignment.IAlignment; import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.constructable.IMultiblockInfoContainer; import com.github.technus.tectech.util.CommonValues; -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; @@ -82,7 +81,7 @@ public final class ConstructableTriggerItem extends Item { IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); if (metaTE instanceof IConstructable) { ((IConstructable) metaTE).construct(aStack, true); - TecTech.proxy.printInchat(((IConstructable) metaTE).getStructureDescription(aStack.stackSize)); + TecTech.proxy.printInchat(((IConstructable) metaTE).getStructureDescription(aStack)); return false; } else if(MULTIBLOCK_MAP.containsKey(metaTE.getClass().getCanonicalName())){ IMultiblockInfoContainer iMultiblockInfoContainer = MULTIBLOCK_MAP.get(metaTE.getClass().getCanonicalName()); @@ -93,12 +92,12 @@ public final class ConstructableTriggerItem extends Item { iMultiblockInfoContainer.construct(aStack, true, tTileEntity, ExtendedFacing.of(ForgeDirection.getOrientation(((IGregTechTileEntity) tTileEntity).getFrontFacing()))); } - TecTech.proxy.printInchat(MULTIBLOCK_MAP.get(metaTE.getClass().getCanonicalName()).getDescription(aStack.stackSize)); + TecTech.proxy.printInchat(MULTIBLOCK_MAP.get(metaTE.getClass().getCanonicalName()).getDescription(aStack)); return false; } } else if(tTileEntity instanceof IConstructable){ ((IConstructable) tTileEntity).construct(aStack,true); - TecTech.proxy.printInchat(((IConstructable) tTileEntity).getStructureDescription(aStack.stackSize)); + TecTech.proxy.printInchat(((IConstructable) tTileEntity).getStructureDescription(aStack)); return false; } else if(MULTIBLOCK_MAP.containsKey(tTileEntity.getClass().getCanonicalName())){ IMultiblockInfoContainer iMultiblockInfoContainer = MULTIBLOCK_MAP.get(tTileEntity.getClass().getCanonicalName()); @@ -109,7 +108,7 @@ public final class ConstructableTriggerItem extends Item { iMultiblockInfoContainer.construct(aStack, true, tTileEntity, ExtendedFacing.of(ForgeDirection.getOrientation(aSide))); } - TecTech.proxy.printInchat(MULTIBLOCK_MAP.get(tTileEntity.getClass().getCanonicalName()).getDescription(aStack.stackSize)); + TecTech.proxy.printInchat(MULTIBLOCK_MAP.get(tTileEntity.getClass().getCanonicalName()).getDescription(aStack)); return false; } //} else { 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 4333d4c8c9..4151dbfec0 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java @@ -1,11 +1,11 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -108,7 +108,7 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl } @Override - public String[] getStructureDescription(int stackSize) { + 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_bhg.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java index c5aaa1d66f..d90f4af8d2 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java @@ -1,11 +1,11 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -306,7 +306,7 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E } @Override - public String[] getStructureDescription(int stackSize) { + 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_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index fe676910ee..490ca2084b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.dComplexAspectDefinition; @@ -689,7 +690,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } @Override - public String[] getStructureDescription(int stackSize) { + 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_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java index 433b8b4950..e70cc10926 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,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.util.Util; @@ -350,7 +351,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override - public String[] getStructureDescription(int stackSize) { + 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_crafting.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java index 7a71f36d3b..a9e5b2f8a1 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java @@ -1,11 +1,11 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -110,7 +110,7 @@ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockB } @Override - public String[] getStructureDescription(int stackSize) { + 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_dataBank.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java index 647bbf4a3b..d5c9162d1d 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,6 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.mechanics.dataTransport.InventoryDataPacket; @@ -10,7 +10,7 @@ import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_H import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -175,7 +175,7 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB } @Override - public String[] getStructureDescription(int stackSize) { + 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_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java index be28a3d0c8..3b17dfa9b9 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,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; @@ -248,7 +249,7 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase } @Override - public String[] getStructureDescription(int stackSize) { + 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 fed03d1845..5dfa38294b 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,6 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; @@ -11,7 +11,7 @@ import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -153,7 +153,7 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo } @Override - public String[] getStructureDescription(int stackSize) { + 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 aed3025d4f..1fff071e9c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -1,7 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import cofh.api.energy.IEnergyContainerItem; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; @@ -9,7 +9,7 @@ import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -187,7 +187,7 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa } @Override - public String[] getStructureDescription(int stackSize) { + 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_junction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java index 8a76ee6ff1..199bb8ee6f 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,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; @@ -174,7 +175,7 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB } @Override - public String[] getStructureDescription(int stackSize) { + 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_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java index 6315a2f295..ab86c0494f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java @@ -1,6 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; @@ -14,7 +14,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.transformations import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -202,7 +202,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock } @Override - public String[] getStructureDescription(int stackSize) { + 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 2a739cb6c7..c6f9c810a8 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java @@ -1,13 +1,13 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.recipe.TT_recipe; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Holder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.ItemList; @@ -557,7 +557,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } @Override - public String[] getStructureDescription(int stackSize) { + public String[] getStructureDescription(ItemStack stackSize) { return description; } } 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 48479b9d71..896d0f41bc 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; @@ -518,7 +519,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa } @Override - public String[] getStructureDescription(int stackSize) { + 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 ece01f7489..140383caac 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,11 +1,11 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -74,7 +74,7 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc } @Override - public String[] getStructureDescription(int stackSize) { + 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_switch.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java index 39f9441cb7..7398889c89 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,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket; @@ -221,7 +222,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas } @Override - public String[] getStructureDescription(int stackSize) { + 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_transformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java index c2e759e96c..4e2f916f2f 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,26 +1,27 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; -import com.github.technus.tectech.util.CommonValues; 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.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; +import com.github.technus.tectech.util.CommonValues; 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.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; +import static com.github.technus.tectech.mechanics.structure.StructureUtility.ofBlock; +import static com.github.technus.tectech.mechanics.structure.StructureUtility.ofHatchAdder; 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; @@ -32,21 +33,25 @@ import static net.minecraft.util.StatCollector.translateToLocal; */ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure - private static final String[][] shape = new String[][]{ - {" ", " . ", " ",}, - {" ", " 0 ", " ",}, - {" ", " ", " ",}, - }; - private static final Block[] blockType = new Block[]{sBlockCasings1}; - private static final byte[] blockMeta = new byte[]{15}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addEnergyIOToMachineList}; - 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.transformer.hint"),//1 - Energy IO Hatches or High Power Casing }; + private static final IStructureDefinition STRUCTURE_DEFINITION = + StructureDefinition.builder() + .addShape("main",new String[][]{ + {"111", "1.1", "111",}, + {"111", "101", "111",}, + {"111", "111", "111",}, + }) + .addElement('0', ofBlock(sBlockCasings1,15)) + .addElement('1', trafo->ofHatchAdder(trafo::addEnergyIOToMachineList,textureOffset,sBlockCasingsTT,0)) + .build(); + + @Override + public IStructureDefinition getStructure_EM() { + return STRUCTURE_DEFINITION; + } //endregion public GT_MetaTileEntity_EM_transformer(int aID, String aName, String aNameRegional) { @@ -78,7 +83,7 @@ public class GT_MetaTileEntity_EM_transformer 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 @@ -150,11 +155,11 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo @Override public void construct(ItemStack stackSize, boolean hintsOnly) { - Structure.builder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + //Structure.builder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override - public String[] getStructureDescription(int stackSize) { + 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_wormhole.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java index 2b2ebdd1a4..f909d000c7 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java @@ -1,11 +1,11 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -109,7 +109,7 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB } @Override - public String[] getStructureDescription(int stackSize) { + 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_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java index 9c40d6ebc9..ba926f1ace 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,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.mechanics.constructable.IConstructable; @@ -250,7 +251,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock } @Override - public String[] getStructureDescription(int stackSize) { + 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_proccessingStack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java index 678f211744..47f36014ac 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 @@ -5,7 +5,7 @@ import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -126,7 +126,7 @@ public class GT_MetaTileEntity_TM_proccessingStack extends GT_MetaTileEntity_Mul } @Override - public String[] getStructureDescription(int stackSize) { + 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 327b54e561..a4a234f9b4 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.loader.NetworkDispatcher; @@ -827,7 +828,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock } @Override - public String[] getStructureDescription(int stackSize) { + 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/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java index 2f23aae431..7735678f72 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 @@ -6,7 +6,9 @@ import com.github.technus.tectech.mechanics.alignment.*; import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing; import com.github.technus.tectech.mechanics.alignment.enumerable.Flip; import com.github.technus.tectech.mechanics.alignment.enumerable.Rotation; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IStructureDefinition; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.Util; import com.github.technus.tectech.util.Vec3Impl; import com.github.technus.tectech.loader.NetworkDispatcher; @@ -191,6 +193,27 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt toolSetDirection(ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing())); } + /** + * Gets structure + * @return STATIC INSTANCE OF STRUCTURE + */ + public IStructureDefinition getStructure_EM(){ + throw new NoSuchMethodError("Implement it as STATIC INSTANCE"); + } + + @SuppressWarnings("unchecked") + private IStructureDefinition getStructure_EM_Internal(){ + return (IStructureDefinition)getStructure_EM(); + } + + public final boolean structureCheck_EM(String piece,int horizontalOffset, int verticalOffset, int depthOffset) { + IGregTechTileEntity baseMetaTileEntity = getBaseMetaTileEntity(); + return getStructure_EM_Internal().check(this,piece, baseMetaTileEntity.getWorld(),getExtendedFacing(), + baseMetaTileEntity.getXCoord(),baseMetaTileEntity.getYCoord(),baseMetaTileEntity.getZCoord(), + horizontalOffset,verticalOffset,depthOffset,!mMachine); + } + + @Deprecated public final boolean structureCheck_EM( String[][] structure,//0-9 casing, +- air no air, a-z ignore Block[] blockType,//use numbers 0-9 for casing types diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java deleted file mode 100644 index b695472012..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.multi.base; - - -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; - -public interface IHatchAdder { - Boolean apply(IGregTechTileEntity iGregTechTileEntity, Short aShort); -} 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 f6f3ec9a63..722580a221 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,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.util.Util; @@ -354,7 +355,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa } @Override - public String[] getStructureDescription(int stackSize) { + 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_DebugStructureWriter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java index 194d357b1c..42f25ddfde 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,11 +1,12 @@ package com.github.technus.tectech.thing.metaTileEntity.single; -import com.github.technus.tectech.mechanics.constructable.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.util.Util; +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 cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -20,6 +21,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.util.ForgeDirection; import static com.github.technus.tectech.thing.metaTileEntity.Textures.MACHINE_CASINGS_TT; import static net.minecraft.util.StatCollector.translateToLocal; @@ -105,21 +107,22 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti } @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (aBaseMetaTileEntity.isAllowedToWork()) { - result = Structure.writer(getBaseMetaTileEntity(), numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5], false); - for (String s : result) { - TecTech.LOGGER.info(s); - } - aBaseMetaTileEntity.disableWorking(); - } + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + super.onFirstTick(aBaseMetaTileEntity); + aBaseMetaTileEntity.disableWorking(); } @Override - public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - result = Structure.writer(getBaseMetaTileEntity(), numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5], true); - for (String s : result) { - TecTech.LOGGER.info(s); + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isAllowedToWork()) { + 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]); + TecTech.LOGGER.info(pseudoJavaCode); + result = pseudoJavaCode.split("\\n"); + aBaseMetaTileEntity.disableWorking(); } } @@ -129,8 +132,6 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti return true; } aBaseMetaTileEntity.openGUI(aPlayer); - //if (TecTechConfig.DEBUG_MODE && aPlayer.getHeldItem() != null) - // TecTech.LOGGER.info("UnlocalizedName: " + getUniqueIdentifier(aPlayer.getHeldItem())); return true; } diff --git a/src/main/java/com/github/technus/tectech/util/Util.java b/src/main/java/com/github/technus/tectech/util/Util.java index b81506d27c..1843770e3a 100644 --- a/src/main/java/com/github/technus/tectech/util/Util.java +++ b/src/main/java/com/github/technus/tectech/util/Util.java @@ -1,22 +1,14 @@ package com.github.technus.tectech.util; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing; -import com.github.technus.tectech.thing.casing.TT_Container_Casings; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.ObfuscationReflectionHelper; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; @@ -25,14 +17,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.server.MinecraftServer; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.storage.IPlayerFileData; import net.minecraft.world.storage.SaveHandler; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.StringUtils; @@ -42,12 +32,6 @@ import java.io.FileOutputStream; import java.lang.reflect.Field; import java.nio.charset.StandardCharsets; import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; -import static gregtech.api.enums.GT_Values.E; -import static java.nio.charset.Charset.forName; /** * Created by Tec on 21.03.2017. diff --git a/src/main/java/com/github/technus/tectech/util/Vec3Impl.java b/src/main/java/com/github/technus/tectech/util/Vec3Impl.java index 84e6497560..9ba96d741a 100644 --- a/src/main/java/com/github/technus/tectech/util/Vec3Impl.java +++ b/src/main/java/com/github/technus/tectech/util/Vec3Impl.java @@ -20,20 +20,6 @@ public class Vec3Impl implements Comparable { this(baseMetaTileEntity.getXCoord(),baseMetaTileEntity.getYCoord(),baseMetaTileEntity.getZCoord()); } - public boolean equals(Object o) { - if (this == o) { - return true; - } else if (o instanceof Vec3Impl) { - Vec3Impl vec3i = (Vec3Impl)o; - return val0 == vec3i.val0 && val1 == vec3i.val1 && val2 == vec3i.val2; - } - return false; - } - - public int hashCode() { - return (val1 + val2 * 31) * 31 + val0; - } - public int compareTo(Vec3Impl o) { return val1 == o.val1 ? val2 == o.val2 ? val0 - o.val0 : val2 - o.val2 : val1 - o.val1; } @@ -143,4 +129,18 @@ public class Vec3Impl implements Comparable { 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 -- cgit From 43ca64a9e686b84d56225d1d5a08b81e637549b6 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 25 Apr 2020 23:12:49 +0200 Subject: new structure api --- .../GT_MetaTileEntity_EM_essentiaDequantizer.java | 6 +- .../GT_MetaTileEntity_EM_essentiaQuantizer.java | 6 +- .../tectech/loader/ConstructableLoader.java | 4 +- .../alignment/enumerable/ExtendedFacing.java | 17 +- .../mechanics/constructable/IConstructable.java | 2 +- .../constructable/IMultiblockInfoContainer.java | 2 +- .../tectech/mechanics/constructable/Structure.java | 526 --------------------- .../tectech/mechanics/structure/IBlockAdder.java | 14 + .../mechanics/structure/IBlockPosConsumer.java | 7 + .../tectech/mechanics/structure/IHatchAdder.java | 14 + .../mechanics/structure/IStructureDefinition.java | 137 ++++++ .../mechanics/structure/IStructureElement.java | 47 ++ .../structure/IStructureElementProvider.java | 5 + .../mechanics/structure/IStructureFallback.java | 40 ++ .../structure/IStructureFallbackProvider.java | 40 ++ .../mechanics/structure/IStructureNavigate.java | 23 + .../tectech/mechanics/structure/ITileAdder.java | 12 + .../tectech/mechanics/structure/Structure.java | 265 +++++++++++ .../mechanics/structure/StructureDefinition.java | 170 +++++++ .../mechanics/structure/StructureUtility.java | 473 ++++++++++++++++++ .../thing/item/ConstructableTriggerItem.java | 13 +- .../multi/GT_MetaTileEntity_EM_annihilation.java | 6 +- .../multi/GT_MetaTileEntity_EM_bhg.java | 6 +- .../multi/GT_MetaTileEntity_EM_collider.java | 5 +- .../multi/GT_MetaTileEntity_EM_computer.java | 5 +- .../multi/GT_MetaTileEntity_EM_crafting.java | 6 +- .../multi/GT_MetaTileEntity_EM_dataBank.java | 6 +- .../multi/GT_MetaTileEntity_EM_decay.java | 5 +- .../multi/GT_MetaTileEntity_EM_dequantizer.java | 6 +- .../multi/GT_MetaTileEntity_EM_infuser.java | 6 +- .../multi/GT_MetaTileEntity_EM_junction.java | 5 +- .../multi/GT_MetaTileEntity_EM_quantizer.java | 6 +- .../multi/GT_MetaTileEntity_EM_research.java | 6 +- .../multi/GT_MetaTileEntity_EM_scanner.java | 5 +- .../multi/GT_MetaTileEntity_EM_stabilizer.java | 6 +- .../multi/GT_MetaTileEntity_EM_switch.java | 5 +- .../multi/GT_MetaTileEntity_EM_transformer.java | 41 +- .../multi/GT_MetaTileEntity_EM_wormhole.java | 6 +- .../multi/GT_MetaTileEntity_TM_microwave.java | 5 +- .../GT_MetaTileEntity_TM_proccessingStack.java | 4 +- .../multi/GT_MetaTileEntity_TM_teslaCoil.java | 5 +- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 25 +- .../metaTileEntity/multi/base/IHatchAdder.java | 8 - .../em_machine/GT_MetaTileEntity_EM_machine.java | 5 +- .../GT_MetaTileEntity_DebugStructureWriter.java | 35 +- .../java/com/github/technus/tectech/util/Util.java | 16 - .../com/github/technus/tectech/util/Vec3Impl.java | 28 +- 47 files changed, 1409 insertions(+), 676 deletions(-) delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/constructable/Structure.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IBlockPosConsumer.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IHatchAdder.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementProvider.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallback.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallbackProvider.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java 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 eb9b97deee..df5054ab4a 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,6 +1,6 @@ package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition; @@ -11,7 +11,7 @@ import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_quantizer; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -143,7 +143,7 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ } @Override - public String[] getStructureDescription(int stackSize) { + public String[] getStructureDescription(ItemStack stackSize) { return description; } } \ 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 0259aec7a7..d48c345e8e 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,6 +1,6 @@ package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition; @@ -11,7 +11,7 @@ import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_quantizer; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -147,7 +147,7 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu } @Override - public String[] getStructureDescription(int stackSize) { + public String[] getStructureDescription(ItemStack stackSize) { return description; } } \ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java b/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java index 93752cc02f..665889dc1f 100644 --- a/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java @@ -2,7 +2,7 @@ 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.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; @@ -39,7 +39,7 @@ public class ConstructableLoader implements Runnable { } @Override - public String[] getDescription(int stackSize) { + public String[] getDescription(ItemStack stackSize) { return desc; } }); 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 index 5c8c902484..2a93bcc540 100644 --- 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 @@ -12,7 +12,6 @@ import static com.github.technus.tectech.mechanics.alignment.IAlignment.FLIPS_CO import static com.github.technus.tectech.mechanics.alignment.IAlignment.ROTATIONS_COUNT; import static java.lang.Math.abs; import static java.util.Arrays.stream; -import static java.util.stream.Collectors.reducing; import static java.util.stream.Collectors.toMap; public enum ExtendedFacing { @@ -144,32 +143,32 @@ public enum ExtendedFacing { switch (direction){ case DOWN: a= ForgeDirection.WEST; - b= ForgeDirection.NORTH; + b= ForgeDirection.SOUTH; c= ForgeDirection.UP; break; case UP: a= ForgeDirection.EAST; - b= ForgeDirection.NORTH; + b= ForgeDirection.SOUTH; c= ForgeDirection.DOWN; break; case NORTH: a= ForgeDirection.WEST; - b= ForgeDirection.UP; + b= ForgeDirection.DOWN; c= ForgeDirection.SOUTH; break; case SOUTH: a= ForgeDirection.EAST; - b= ForgeDirection.UP; + b= ForgeDirection.DOWN; c= ForgeDirection.NORTH; break; case WEST: a= ForgeDirection.SOUTH; - b= ForgeDirection.UP; + b= ForgeDirection.DOWN; c= ForgeDirection.EAST; break; case EAST: a= ForgeDirection.NORTH; - b= ForgeDirection.UP; + b= ForgeDirection.DOWN; c= ForgeDirection.WEST; break; default:throw new RuntimeException("Is impossible..."); @@ -187,7 +186,7 @@ public enum ExtendedFacing { default:throw new RuntimeException("Even more impossible..."); } switch (rotation) { - case COUNTER_CLOCKWISE: { + case CLOCKWISE: { ForgeDirection _a=a; a =b; b =_a.getOpposite(); @@ -197,7 +196,7 @@ public enum ExtendedFacing { a=a.getOpposite(); b=b.getOpposite(); break; - case CLOCKWISE: { + case COUNTER_CLOCKWISE: { ForgeDirection _a=a; a =b.getOpposite(); b =_a; 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 index d7c3c86098..1de0381f1f 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/constructable/IConstructable.java +++ b/src/main/java/com/github/technus/tectech/mechanics/constructable/IConstructable.java @@ -11,6 +11,6 @@ public interface IConstructable { void construct(ItemStack stackSize, boolean hintsOnly); @SideOnly(Side.CLIENT) - String[] getStructureDescription(int stackSize); + 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 index 29769fafb8..2506342f72 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/constructable/IMultiblockInfoContainer.java +++ b/src/main/java/com/github/technus/tectech/mechanics/constructable/IMultiblockInfoContainer.java @@ -26,5 +26,5 @@ public interface IMultiblockInfoContainer { void construct(ItemStack stackSize, boolean hintsOnly, TileEntity tileEntity, ExtendedFacing aSide); @SideOnly(Side.CLIENT) - String[] getDescription(int stackSize); + String[] getDescription(ItemStack stackSize); } diff --git a/src/main/java/com/github/technus/tectech/mechanics/constructable/Structure.java b/src/main/java/com/github/technus/tectech/mechanics/constructable/Structure.java deleted file mode 100644 index 00ffb32525..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/constructable/Structure.java +++ /dev/null @@ -1,526 +0,0 @@ -package com.github.technus.tectech.mechanics.constructable; - -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing; -import com.github.technus.tectech.thing.casing.TT_Container_Casings; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; -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.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; -import static gregtech.api.enums.GT_Values.E; - -public class Structure { - private static final Pattern matchE_ = Pattern.compile("(E,(E,)+)"); - - private Structure(){} - - //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller - //This only checks for REGULAR BLOCKS! - public static 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[] addingMethods, - short[] casingTextures, - Block[] blockTypeFallback,//use numbers 0-9 for casing types - byte[] blockMetaFallback,//use numbers 0-9 for casing types - int horizontalOffset, int verticalOffset, int depthOffset, - IGregTechTileEntity aBaseMetaTileEntity, - ExtendedFacing extendedFacing, - boolean forceCheck) { - 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) - if ((pointer = block - '0') >= 0) { - //countable air -> net.minecraft.block.BlockAir - if (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockType[pointer]) { - if (DEBUG_MODE) { - TecTech.LOGGER.info("Struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlock(xyz[0], xyz[1], xyz[2]).getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName()); - } - return false; - } - if (world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != blockMeta[pointer]) { - if (DEBUG_MODE) { - TecTech.LOGGER.info("Struct-meta-id-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) + ' ' + blockMeta[pointer]); - } - return false; - } - } else //noinspection ConstantConditions - if ((pointer = block - ' ') >= 0) { - igt = aBaseMetaTileEntity.getIGregTechTileEntity(xyz[0], xyz[1], xyz[2]); - if (igt == null || !addingMethods[pointer].apply(igt, casingTextures[pointer])) { - if (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockTypeFallback[pointer]) { - if (DEBUG_MODE) { - TecTech.LOGGER.info("Fallback-struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlock(xyz[0], xyz[1], xyz[2]).getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName())); - } - return false; - } - if (world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != 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] + " / " + world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) + ' ' + blockMetaFallback[pointer]); - } - return false; - } - } - } - } - } else if (forceCheck) { - return false; - } - abc[0]++;//block in horizontal layer - } - } - abc[1]--;//horizontal layer - } - abc[2]++;//depth - } - return true; - } - - 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) { - return builder(structure, blockType, blockMeta, horizontalOffset, verticalOffset, depthOffset, - tileEntity.getWorld(),tileEntity.getXCoord(),tileEntity.getYCoord(),tileEntity.getZCoord(), - extendedFacing, hintsOnly); - } - - 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, - TileEntity tileEntity, ExtendedFacing extendedFacing, boolean hintsOnly) { - return builder(structure, blockType, blockMeta, horizontalOffset, verticalOffset, depthOffset, - tileEntity.getWorldObj(),tileEntity.xCoord,tileEntity.yCoord,tileEntity.zCoord, - extendedFacing, hintsOnly); - } - - 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, - World world,int baseX,int baseZ,int baseY, ExtendedFacing extendedFacing, boolean hintsOnly) { - 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] || world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != blockMeta[pointer]) { - TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], blockType[pointer], blockMeta[pointer]); - } - } else if ((pointer = block - ' ') >= 0) { - if (pointer >= 0 && pointer < 12) { - TecTech.proxy.hint_particle(world, 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) { - world.setBlock(xyz[0], xyz[1], xyz[2], blockType[pointer], blockMeta[pointer], 2); - } else if (block - ' ' < 0) { - world.setBlock(xyz[0], xyz[1], xyz[2], TT_Container_Casings.sHintCasingsTT, 15, 2); - } //else { - //switch(pointer){ - // case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: - // world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, pointer, 2); break; - // default:world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 12, 2); - //} - //} - } - } - } - abc[0]++;//block in horizontal layer - } - } - abc[1]--;//horizontal layer - } - abc[2]++;//depth - } - return true; - } - - - public static String[] writer(IGregTechTileEntity aBaseMetaTileEntity, - int horizontalOffset, int verticalOffset, int depthOffset, - int horizontalSize, int verticalSize, int depthSize, boolean ignoreAir) { - //TE Rotation - byte facing = aBaseMetaTileEntity.getFrontFacing(); - World world = aBaseMetaTileEntity.getWorld(); - if (world.isRemote) { - return new String[]{"Not at Client m8"}; - } - - ItemStack[] array = new ItemStack[10]; - - int x, y, z, a, b, c; - 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 - #1 - count block types - c = -depthOffset; - for (int cz = 0; cz < depthSize; cz++) {//front to back - b = verticalOffset; - for (int by = 0; by < verticalSize; by++) {//top to bottom - a = -horizontalOffset; - for (int az = 0; az < horizontalSize; az++) {//left to right - //get x y z from rotation - switch (facing) {//translation - case 4: - x = baseX + c; - z = baseZ + a; - y = baseY + b; - break; - case 3: - x = baseX + a; - z = baseZ - c; - y = baseY + b; - break; - case 5: - x = baseX - c; - z = baseZ - a; - y = baseY + b; - break; - case 2: - x = baseX - a; - z = baseZ + c; - y = baseY + b; - break; - //Things get odd if the block faces up or down... - case 1: - x = baseX + a; - z = baseZ + b; - y = baseY - c; - break;//similar to 3 - case 0: - x = baseX - a; - z = baseZ - b; - y = baseY + c; - break;//similar to 2 - default: - return new String[]{"Invalid rotation"}; - } - - //that must be here since in some cases other axis (b,c) controls y - if (y < 0 || y >= 256) { - return new String[]{"Invalid position"}; - } - - //Check block - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - - if (!block.hasTileEntity(meta) && block.getMaterial() != Material.air) { - boolean err = true; - ItemStack is = new ItemStack(block, 1, meta); - for (int i = 0; i < array.length; i++) { - if (array[i] == null) { - array[i] = is; - err = false; - break; - } else if (is.getItem() == array[i].getItem() && is.getItemDamage() == array[i].getItemDamage()) { - err = false; - break; - } - } - if (err) { - return new String[]{"Too much different blocks"}; - } - } - - a++;//block in horizontal layer - } - b--;//horizontal layer - } - c++;//depth - } - - List output = new ArrayList<>(); - - output.add("Offsets: " + horizontalOffset + ' ' + verticalOffset + ' ' + depthOffset); - output.add("Sizes: " + horizontalSize + ' ' + verticalSize + ' ' + depthSize); - output.add(""); - - output.add("ID[]: Name[]"); - output.add(""); - for (int i = 0; i < array.length; i++) { - if (array[i] != null) { - output.add(i + ": " + array[i].getDisplayName()); - } - } - output.add(""); - output.add("ID[]: Block[] BlockMetaID[]"); - output.add(""); - for (int i = 0; i < array.length; i++) { - if (array[i] != null) { - output.add(i + ": " + array[i].getItem().getUnlocalizedName() + ' ' + array[i].getItemDamage()); - } - } - output.add(""); - output.add("String[][]"); - //perform your duties - #2 - write strings - output.add("{"); - c = -depthOffset; - for (int cz = 0; cz < depthSize; cz++) {//front to back - b = verticalOffset; - StringBuilder addMe = new StringBuilder().append('{'); - for (int by = 0; by < verticalSize; by++) {//top to bottom - a = -horizontalOffset; - StringBuilder line = new StringBuilder(); - for (int az = 0; az < horizontalSize; az++) {//left to right - //get x y z from rotation - switch (facing) {//translation - case 4: - x = baseX + c; - z = baseZ + a; - y = baseY + b; - break; - case 3: - x = baseX + a; - z = baseZ - c; - y = baseY + b; - break; - case 5: - x = baseX - c; - z = baseZ - a; - y = baseY + b; - break; - case 2: - x = baseX - a; - z = baseZ + c; - y = baseY + b; - break; - //Things get odd if the block faces up or down... - case 1: - x = baseX + a; - z = baseZ + b; - y = baseY - c; - break;//similar to 3 - case 0: - x = baseX - a; - z = baseZ - b; - y = baseY + c; - break;//similar to 2 - default: - return new String[]{"Invalid rotation"}; - } - - //Check block - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - - if (a == 0 && b == 0 && c == 0) { - line.append('.'); - } else if (block.getMaterial() == Material.air) { - line.append('-'); - } else if (block.hasTileEntity(meta)) { - line.append('*'); - } else { - ItemStack stack = new ItemStack(block, 1, meta); - String str = "?";//OH YEAH NPEs - for (int i = 0; i < array.length; i++) { - if (array[i] != null && stack.getItem() == array[i].getItem() && stack.getItemDamage() == array[i].getItemDamage()) { - str = Integer.toString(i); - break; - } - } - line.append(str); - } - a++;//block in horizontal layer - } - if (ignoreAir) { - StringBuilder builder = new StringBuilder(); - char temp = '@'; - for (char ch : line.toString().toCharArray()) { - if (ch == '-') { - temp += 1; - if (temp == '~') { - builder.append('~'); - temp = '@'; - } - } else { - if (temp > '@') { - builder.append(temp); - temp = '@'; - } - builder.append(ch); - } - } - while (builder.length() > 0 && builder.charAt(builder.length() - 1) == '~') { - builder.deleteCharAt(builder.length() - 1); - } - if (builder.length() == 0) { - builder.append("E,"); - } else { - builder.insert(0, '"'); - builder.append('"').append(','); - } - addMe.append(builder); - } else { - if (line.length() == 0) { - line.append("E,"); - } else { - line.insert(0, '"'); - line.append('"').append(','); - } - addMe.append(line); - } - b--;//horizontal layer - } - //region less verbose - addMe.append('}').append(','); - String builtStr = addMe.toString().replaceAll("(E,)+(?=})", E/*Remove Empty strings at end*/); - Matcher matcher = matchE_.matcher(builtStr); - while (matcher.find()) { - byte lenEE = (byte) (matcher.group(1).length() >> 1); - builtStr = builtStr.replaceFirst("E,(E,)+", "\"\\\\u00" + String.format("%02X", lenEE - 1) + "\","); - //builtStr=builtStr.replaceFirst("E,(E,)+\"","\"\\\\u00"+String.format("%02X", lenEE)); - } - //endregion - output.add(builtStr); - c++;//depth - } - output.add("}"); - return output.toArray(new String[0]); - } -} diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java new file mode 100644 index 0000000000..3dda99fed2 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java @@ -0,0 +1,14 @@ +package com.github.technus.tectech.mechanics.structure; + + +import net.minecraft.block.Block; + +public interface IBlockAdder { + /** + * Callback on block added + * @param block block attempted to add + * @param meta meta of block attempted to add + * @return is structure still valid + */ + boolean apply(Block block, Integer meta); +} 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 new file mode 100644 index 0000000000..c3ea2d3e3f --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockPosConsumer.java @@ -0,0 +1,7 @@ +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/IHatchAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IHatchAdder.java new file mode 100644 index 0000000000..10d4c398ec --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IHatchAdder.java @@ -0,0 +1,14 @@ +package com.github.technus.tectech.mechanics.structure; + + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; + +public interface IHatchAdder { + /** + * Callback to add hatch + * @param iGregTechTileEntity hatch + * @param aShort requested texture index, or null if not... + * @return managed to add hatch (structure still valid) + */ + boolean apply(IGregTechTileEntity iGregTechTileEntity, Short aShort); +} 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 new file mode 100644 index 0000000000..656151dc86 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java @@ -0,0 +1,137 @@ +package com.github.technus.tectech.mechanics.structure; + +import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing; +import net.minecraft.world.World; + +public interface IStructureDefinition { + /** + * Used internally + * @param name same name as for other methods here + * @return the array of elements to process + */ + IStructureElementProvider[] getElementsFor(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,getElementsFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ, + basePositionA, basePositionB, basePositionC,false,forceCheckAllBlocks); + } + + default boolean hints(T object,String piece, World world, ExtendedFacing extendedFacing, + int basePositionX, int basePositionY, int basePositionZ, + int basePositionA, int basePositionB, int basePositionC) { + return iterate(object,getElementsFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ, + basePositionA, basePositionB, basePositionC,true,null); + } + + default boolean build(T object,String piece, World world, ExtendedFacing extendedFacing, + int basePositionX, int basePositionY, int basePositionZ, + int basePositionA, int basePositionB, int basePositionC) { + return iterate(object,getElementsFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ, + basePositionA, basePositionB, basePositionC,false,null); + } + + default boolean buildOrHints(T object,String piece, World world, ExtendedFacing extendedFacing, + int basePositionX, int basePositionY, int basePositionZ, + int basePositionA, int basePositionB, int basePositionC, + boolean hintsOnly){ + return iterate(object,getElementsFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ, + basePositionA, basePositionB, basePositionC,hintsOnly,null); + } + + static boolean iterate(T object, IStructureElementProvider[] 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 (IStructureElementProvider elementProvider : elements) { + IStructureElement element=elementProvider.getStructureElement(object); + 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])){ + return false; + } + }else { + return false; + } + + abc[0] =(element.resetA()?basePositionA:abc[0])+element.getStepA(); + abc[1] =(element.resetB()?basePositionA:abc[1])+element.getStepB(); + abc[2] =(element.resetC()?basePositionA:abc[2])+element.getStepC(); + } + } else { + for (IStructureElementProvider elementProvider : elements) { + IStructureElement element=elementProvider.getStructureElement(object); + 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])){ + return false; + } + } + + abc[0] =(element.resetA()?basePositionA:abc[0])+element.getStepA(); + abc[1] =(element.resetB()?basePositionA:abc[1])+element.getStepB(); + abc[2] =(element.resetC()?basePositionA:abc[2])+element.getStepC(); + } + } + }else { + if(hintsOnly) { + for (IStructureElementProvider elementProvider : elements) { + IStructureElement element=elementProvider.getStructureElement(object); + extendedFacing.getWorldOffset(abc, xyz); + xyz[0] += basePositionX; + xyz[1] += basePositionY; + xyz[2] += basePositionZ; + + if (world.blockExists(xyz[0], xyz[1], xyz[2])) { + element.spawnHint(object, world, xyz[0], xyz[1], xyz[2]); + } + + abc[0] =(element.resetA()?basePositionA:abc[0])+element.getStepA(); + abc[1] =(element.resetB()?basePositionA:abc[1])+element.getStepB(); + abc[2] =(element.resetC()?basePositionA:abc[2])+element.getStepC(); + } + } else { + for (IStructureElementProvider elementProvider : elements) { + IStructureElement element=elementProvider.getStructureElement(object); + 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]); + } + + abc[0] =(element.resetA()?basePositionA:abc[0])+element.getStepA(); + abc[1] =(element.resetB()?basePositionA:abc[1])+element.getStepB(); + abc[2] =(element.resetC()?basePositionA:abc[2])+element.getStepC(); + } + } + } + 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 new file mode 100644 index 0000000000..d33eac4119 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java @@ -0,0 +1,47 @@ +package com.github.technus.tectech.mechanics.structure; + +import net.minecraft.world.World; + +/** + * Use StructureUtility to instantiate + */ +public interface IStructureElement extends IStructureElementProvider { + boolean check(T t,World world,int x,int y,int z); + + default boolean spawnHint(T t,World world,int x,int y,int z){ + return false; + } + + default boolean placeBlock(T t,World world,int x,int y,int z){ + return false; + } + + 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; + } + + @Override + default IStructureElement getStructureElement(T object){ + return this; + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementProvider.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementProvider.java new file mode 100644 index 0000000000..b38c2164c3 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementProvider.java @@ -0,0 +1,5 @@ +package com.github.technus.tectech.mechanics.structure; + +public interface IStructureElementProvider { + IStructureElement getStructureElement(T object); +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallback.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallback.java new file mode 100644 index 0000000000..354aaf60e9 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallback.java @@ -0,0 +1,40 @@ +package com.github.technus.tectech.mechanics.structure; + +import net.minecraft.world.World; + +/** + * Use StructureUtility to instantiate + */ +public interface IStructureFallback extends IStructureElement { + IStructureElement[] fallbacks(); + + @Override + default boolean check(T t, World world, int x, int y, int z){ + for (IStructureElement 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) { + for (IStructureElement fallback : fallbacks()) { + if (fallback.spawnHint(t, world, x, y, z)) { + return true; + } + } + return false; + } + + @Override + default boolean placeBlock(T t, World world, int x, int y, int z) { + for (IStructureElement fallback : fallbacks()) { + if (fallback.placeBlock(t, world, x, y, z)) { + return true; + } + } + return false; + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallbackProvider.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallbackProvider.java new file mode 100644 index 0000000000..c0c24eaec4 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallbackProvider.java @@ -0,0 +1,40 @@ +package com.github.technus.tectech.mechanics.structure; + +import net.minecraft.world.World; + +/** + * Use StructureUtility to instantiate + */ +public interface IStructureFallbackProvider extends IStructureElement { + IStructureElementProvider[] fallbacks(); + + @Override + default boolean check(T t,World world, int x, int y, int z){ + for (IStructureElementProvider fallback : fallbacks()) { + if (fallback.getStructureElement(t).check(t, world, x, y, z)) { + return true; + } + } + return false; + } + + @Override + default boolean spawnHint(T t,World world, int x, int y, int z) { + for (IStructureElementProvider fallback : fallbacks()) { + if (fallback.getStructureElement(t).spawnHint(t, world, x, y, z)) { + return true; + } + } + return false; + } + + @Override + default boolean placeBlock(T t,World world, int x, int y, int z) { + for (IStructureElementProvider fallback : fallbacks()) { + if (fallback.getStructureElement(t).placeBlock(t, world, x, y, z)) { + return true; + } + } + 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 new file mode 100644 index 0000000000..bba3dc5239 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java @@ -0,0 +1,23 @@ +package com.github.technus.tectech.mechanics.structure; + +import net.minecraft.world.World; + +/** + * Use StructureUtility to instantiate + */ +public interface IStructureNavigate extends IStructureElement { + @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) { + return true; + } + + @Override + default boolean placeBlock(T t, World world, int x, int y, int z) { + return true; + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java new file mode 100644 index 0000000000..9d983e1c4d --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java @@ -0,0 +1,12 @@ +package com.github.technus.tectech.mechanics.structure; + +import net.minecraft.tileentity.TileEntity; + +public interface ITileAdder { + /** + * Callback to add hatch + * @param tileEntity tile + * @return managed to add hatch (structure still valid) + */ + boolean apply(TileEntity tileEntity); +} 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 new file mode 100644 index 0000000000..77c47ad19e --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java @@ -0,0 +1,265 @@ +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.thing.casing.TT_Container_Casings; +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.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +import java.util.regex.Pattern; + +import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; + +@Deprecated +public class Structure { + private static final Pattern MATCH_E = Pattern.compile("(E,(E,)+)"); + + private Structure(){} + + //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller + //This only checks for REGULAR BLOCKS! + public static 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[] addingMethods, + short[] casingTextures, + Block[] blockTypeFallback,//use numbers 0-9 for casing types + byte[] blockMetaFallback,//use numbers 0-9 for casing types + int horizontalOffset, int verticalOffset, int depthOffset, + IGregTechTileEntity aBaseMetaTileEntity, + ExtendedFacing extendedFacing, + boolean forceCheck) { + 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) + if ((pointer = block - '0') >= 0) { + //countable air -> net.minecraft.block.BlockAir + if (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockType[pointer]) { + if (DEBUG_MODE) { + TecTech.LOGGER.info("Struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlock(xyz[0], xyz[1], xyz[2]).getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName()); + } + return false; + } + if (world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != blockMeta[pointer]) { + if (DEBUG_MODE) { + TecTech.LOGGER.info("Struct-meta-id-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) + ' ' + blockMeta[pointer]); + } + return false; + } + } else if ((pointer = block - ' ') >= 0) { + igt = aBaseMetaTileEntity.getIGregTechTileEntity(xyz[0], xyz[1], xyz[2]); + if (igt == null || !addingMethods[pointer].apply(igt, casingTextures[pointer])) { + if (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockTypeFallback[pointer]) { + if (DEBUG_MODE) { + TecTech.LOGGER.info("Fallback-struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlock(xyz[0], xyz[1], xyz[2]).getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName())); + } + return false; + } + if (world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != 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] + " / " + world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) + ' ' + blockMetaFallback[pointer]); + } + return false; + } + } + } + } + } else if (forceCheck) { + return false; + } + abc[0]++;//block in horizontal layer + } + } + abc[1]++;//horizontal layer + } + abc[2]++;//depth + } + return true; + } + + 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) { + return builder(structure, blockType, blockMeta, horizontalOffset, verticalOffset, depthOffset, + tileEntity.getWorld(), tileEntity.getXCoord(), tileEntity.getYCoord(), tileEntity.getZCoord(), + extendedFacing, hintsOnly); + } + + 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, + TileEntity tileEntity, ExtendedFacing extendedFacing, boolean hintsOnly) { + return builder(structure, blockType, blockMeta, horizontalOffset, verticalOffset, depthOffset, + tileEntity.getWorldObj(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, + extendedFacing, hintsOnly); + } + + 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, + World world, int baseX, int baseY, int baseZ, ExtendedFacing extendedFacing, boolean hintsOnly) { + 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] || world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != blockMeta[pointer]) { + TecTech.proxy.hint_particle(world, xyz[0], xyz[1], xyz[2], blockType[pointer], blockMeta[pointer]); + } + } else if ((pointer = block - ' ') >= 0) { + if (pointer < 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) { + 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 new file mode 100644 index 0000000000..52386d8373 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java @@ -0,0 +1,170 @@ +package com.github.technus.tectech.mechanics.structure; + +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 implements IStructureDefinition { + private final Map> elements; + private final Map shapes; + private final Map[]> compiled; + + public static Builder builder() { + return new Builder<>(); + } + + private StructureDefinition( + Map> elements, + Map shapes, + Map[]> compiled) { + this.elements =elements; + this.shapes=shapes; + this.compiled =compiled; + } + + public static class Builder { + private static final char A='\uA000'; + private static final char B='\uB000'; + private static final char C='\uC000'; + private static final char D='\uD000'; + private final Map> elements; + private final Map shapes; + + private Builder() { + elements = new HashMap<>(); + shapes = new HashMap<>(); + } + + public Map> getElements() { + return elements; + } + + public Map getShapes() { + return shapes; + } + + /** + * 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(a,b) + * next string[] is next slice(a,b,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 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; + char d=D; + for (int i = 0; i < builder.length(); i++) { + char ch = builder.charAt(i); + if(ch ==' ' || ch =='.'){ + builder.setCharAt(i,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){ + builder.setCharAt(i-1,d); + addElement(d,step(a,b,c)); + a=0; + b=0; + c=0; + d++; + } + } + + 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 addElement(Character name, IStructureElementProvider structurePiece) { + elements.put(name, structurePiece); + return this; + } + + public IStructureDefinition build() { + if(DEBUG_MODE){ + return new StructureDefinition<>(new HashMap<>(elements), new HashMap<>(shapes), compileMap()); + }else { + return compileMap()::get; + } + } + + @SuppressWarnings("unchecked") + private Map[]> compileMap() { + List mising = new ArrayList<>(); + shapes.values().stream().map(CharSequence::chars).forEach(intStream -> intStream.forEach(c -> { + IStructureElementProvider iStructureElement = elements.get((char) c); + if (iStructureElement == null) { + mising.add(c); + } + })); + if (mising.isEmpty()) { + Map[]> map = new HashMap<>(); + shapes.forEach((key, value) -> { + IStructureElementProvider[] compiled = new IStructureElementProvider[value.length()]; + for (char i = 0; i < compiled.length; i++) { + compiled[i] = this.elements.get(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> getElements(){ + return elements; + } + + public Map getShapes() { + return shapes; + } + + public Map[]> getCompiled() { + return compiled; + } + + @Override + public IStructureElementProvider[] getElementsFor(String name) { + return compiled.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 new file mode 100644 index 0000000000..69f5a6e43c --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -0,0 +1,473 @@ +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.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.tileentity.TileEntity; +import net.minecraft.world.World; + +import java.util.*; + +public class StructureUtility { + private static final String NICE_CHARS ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`~!@#$%^&*()_=|[]{};:'<>,./?"; + @SuppressWarnings("rawtypes") + private static final Map STEP = new HashMap<>(); + @SuppressWarnings("rawtypes") + private static final IStructureElement AIR= (t, world, x, y, z) -> world.getBlock(x, y, z).getMaterial() == Material.air; + @SuppressWarnings("rawtypes") + private static final IStructureElement NOT_AIR= (t, world, x, y, z) -> world.getBlock(x, y, z).getMaterial() != Material.air; + + private StructureUtility(){ + + } + + @SuppressWarnings("unchecked") + public static IStructureElement isAir(){ + return AIR; + } + + @SuppressWarnings("unchecked") + public static IStructureElement notAir(){ + return NOT_AIR; + } + + /** + * Does not allow Block duplicates (with different meta) + */ + public static IStructureElement ofBlocksFlat(Map blocsMap,Block hintBlock,int hintMeta){ + if(blocsMap==null || blocsMap.isEmpty() || hintBlock==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + return blocsMap.getOrDefault(world.getBlock(x, y, z), -1) == world.getBlockMetadata(x, y, z); + } + + @Override + public boolean placeBlock(T t, World world, int x, int y, int z) { + world.setBlock(x,y,z,hintBlock,hintMeta,2); + return true; + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,hintBlock,hintMeta); + return true; + } + }; + } + + /** + * Allows block duplicates (with different meta) + */ + public static IStructureElement ofBlocks(Map> blocsMap,Block hintBlock,int hintMeta){ + if(blocsMap==null || blocsMap.isEmpty() || hintBlock==null){ + throw new IllegalArgumentException(); + } + for (Set value : blocsMap.values()) { + if(value.isEmpty()){ + throw new IllegalArgumentException(); + } + } + return new IStructureElement() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + return blocsMap.getOrDefault(world.getBlock(x, y, z), Collections.emptySet()).contains(world.getBlockMetadata(x, y, z)); + } + + @Override + public boolean placeBlock(T t, World world, int x, int y, int z) { + world.setBlock(x,y,z,hintBlock,hintMeta,2); + return true; + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,hintBlock,hintMeta); + return true; + } + }; + } + + public static IStructureElement ofBlock(Block block, int meta,Block hintBlock,int hintMeta){ + if(block==null || hintBlock==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + return block == world.getBlock(x, y, z) && meta == world.getBlockMetadata(x, y, z); + } + + @Override + public boolean placeBlock(T t, World world, int x, int y, int z) { + world.setBlock(x,y,z,hintBlock,hintMeta,2); + return true; + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,hintBlock,hintMeta); + return true; + } + }; + } + + public static IStructureElement ofBlock(Block block, int meta){ + return ofBlock(block, meta,block,meta); + } + + public static IStructureElement ofBlockAdder(IBlockAdder iBlockAdder,Block hintBlock,int hintMeta){ + if(iBlockAdder==null ||hintBlock==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + return iBlockAdder.apply(world.getBlock(x, y, z), world.getBlockMetadata(x, y, z)); + } + + @Override + public boolean placeBlock(T t, World world, int x, int y, int z) { + world.setBlock(x,y,z,hintBlock,hintMeta,2); + return true; + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,hintBlock,hintMeta); + return true; + } + }; + } + + public static IStructureElement ofTileAdder(ITileAdder iTileAdder,Block hintBlock,int hintMeta){ + if(iTileAdder==null ||hintBlock==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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(tileEntity); + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,hintBlock,hintMeta); + return true; + } + }; + } + + public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, Short textureIndex,Block hintBlock,int hintMeta){ + if(iHatchAdder==null ||hintBlock==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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((IGregTechTileEntity) tileEntity, textureIndex); + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,hintBlock,hintMeta); + return true; + } + }; + } + + @SuppressWarnings("unchecked") + public static IStructureNavigate 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()); + } + }); + } + + public static IStructureNavigate step(int a,int b, int c){ + return step(new Vec3Impl(a,b,c)); + } + + private static IStructureNavigate stepA(int a,int b, int c){ + return new IStructureNavigate() { + @Override + public int getStepA() { + return a; + } + + @Override + public int getStepB() { + return b; + } + + @Override + public int getStepC() { + return c; + } + }; + } + + private static IStructureNavigate stepB(int a,int b, int c){ + return new IStructureNavigate() { + @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 IStructureNavigate stepC(int a,int b, int c){ + return new IStructureNavigate() { + @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; + } + }; + } + + public static IStructureFallback ofElementChain(IStructureElement... elementChain){ + if(elementChain==null || elementChain.length==0){ + throw new IllegalArgumentException(); + } + for (IStructureElementProvider iStructureElement : elementChain) { + if(iStructureElement==null){ + throw new IllegalArgumentException(); + } + } + return () -> elementChain; + } + + public static IStructureFallbackProvider ofProviderChain(IStructureElementProvider... elementChain){ + if(elementChain==null || elementChain.length==0){ + throw new IllegalArgumentException(); + } + for (IStructureElementProvider iStructureElement : elementChain) { + if(iStructureElement==null){ + throw new IllegalArgumentException(); + } + } + return () -> elementChain; + } + + /** + * Use only to get pseudo code... + * @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) { + Map> blocks = new TreeMap<>(Comparator.comparing(Block::getUnlocalizedName)); + Set> tiles = new TreeSet<>(Comparator.comparing(Class::getCanonicalName)); + Set> 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(world.getBlockMetadata(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 map = new HashMap<>(); + StringBuilder builder = new StringBuilder(); + { + int i = 0; + char c; + builder.append("\n\nStructure:\n") + .append("\nBlocks:\n"); + for (Map.Entry> entry : blocks.entrySet()) { + Block block = entry.getKey(); + Set 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 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 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'); + builder.append("\nScan:\n") + .append("new String[][]{{\n") + .append(" \""); + + 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) { + builder.append(map.get(block.getUnlocalizedName() + '\0' + world.getBlockMetadata(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, + 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]; + + 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(); + } + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java index 7b7d1983fa..4160ae2aba 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java @@ -1,15 +1,14 @@ package com.github.technus.tectech.thing.item; +import com.github.technus.tectech.TecTech; import com.github.technus.tectech.mechanics.alignment.IAlignment; import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.constructable.IMultiblockInfoContainer; import com.github.technus.tectech.util.CommonValues; -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; @@ -82,7 +81,7 @@ public final class ConstructableTriggerItem extends Item { IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); if (metaTE instanceof IConstructable) { ((IConstructable) metaTE).construct(aStack, true); - TecTech.proxy.printInchat(((IConstructable) metaTE).getStructureDescription(aStack.stackSize)); + TecTech.proxy.printInchat(((IConstructable) metaTE).getStructureDescription(aStack)); return false; } else if(MULTIBLOCK_MAP.containsKey(metaTE.getClass().getCanonicalName())){ IMultiblockInfoContainer iMultiblockInfoContainer = MULTIBLOCK_MAP.get(metaTE.getClass().getCanonicalName()); @@ -93,12 +92,12 @@ public final class ConstructableTriggerItem extends Item { iMultiblockInfoContainer.construct(aStack, true, tTileEntity, ExtendedFacing.of(ForgeDirection.getOrientation(((IGregTechTileEntity) tTileEntity).getFrontFacing()))); } - TecTech.proxy.printInchat(MULTIBLOCK_MAP.get(metaTE.getClass().getCanonicalName()).getDescription(aStack.stackSize)); + TecTech.proxy.printInchat(MULTIBLOCK_MAP.get(metaTE.getClass().getCanonicalName()).getDescription(aStack)); return false; } } else if(tTileEntity instanceof IConstructable){ ((IConstructable) tTileEntity).construct(aStack,true); - TecTech.proxy.printInchat(((IConstructable) tTileEntity).getStructureDescription(aStack.stackSize)); + TecTech.proxy.printInchat(((IConstructable) tTileEntity).getStructureDescription(aStack)); return false; } else if(MULTIBLOCK_MAP.containsKey(tTileEntity.getClass().getCanonicalName())){ IMultiblockInfoContainer iMultiblockInfoContainer = MULTIBLOCK_MAP.get(tTileEntity.getClass().getCanonicalName()); @@ -109,7 +108,7 @@ public final class ConstructableTriggerItem extends Item { iMultiblockInfoContainer.construct(aStack, true, tTileEntity, ExtendedFacing.of(ForgeDirection.getOrientation(aSide))); } - TecTech.proxy.printInchat(MULTIBLOCK_MAP.get(tTileEntity.getClass().getCanonicalName()).getDescription(aStack.stackSize)); + TecTech.proxy.printInchat(MULTIBLOCK_MAP.get(tTileEntity.getClass().getCanonicalName()).getDescription(aStack)); return false; } //} else { 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 4333d4c8c9..4151dbfec0 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java @@ -1,11 +1,11 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -108,7 +108,7 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl } @Override - public String[] getStructureDescription(int stackSize) { + 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_bhg.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java index c5aaa1d66f..d90f4af8d2 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java @@ -1,11 +1,11 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -306,7 +306,7 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E } @Override - public String[] getStructureDescription(int stackSize) { + 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_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index fe676910ee..490ca2084b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.dComplexAspectDefinition; @@ -689,7 +690,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } @Override - public String[] getStructureDescription(int stackSize) { + 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_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java index 433b8b4950..e70cc10926 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,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.util.Util; @@ -350,7 +351,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override - public String[] getStructureDescription(int stackSize) { + 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_crafting.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java index 7a71f36d3b..a9e5b2f8a1 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java @@ -1,11 +1,11 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -110,7 +110,7 @@ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockB } @Override - public String[] getStructureDescription(int stackSize) { + 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_dataBank.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java index 647bbf4a3b..d5c9162d1d 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,6 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.mechanics.dataTransport.InventoryDataPacket; @@ -10,7 +10,7 @@ import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_H import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -175,7 +175,7 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB } @Override - public String[] getStructureDescription(int stackSize) { + 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_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java index be28a3d0c8..3b17dfa9b9 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,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; @@ -248,7 +249,7 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase } @Override - public String[] getStructureDescription(int stackSize) { + 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 fed03d1845..5dfa38294b 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,6 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; @@ -11,7 +11,7 @@ import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -153,7 +153,7 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo } @Override - public String[] getStructureDescription(int stackSize) { + 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 aed3025d4f..1fff071e9c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -1,7 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import cofh.api.energy.IEnergyContainerItem; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; @@ -9,7 +9,7 @@ import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -187,7 +187,7 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa } @Override - public String[] getStructureDescription(int stackSize) { + 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_junction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java index 8a76ee6ff1..199bb8ee6f 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,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; @@ -174,7 +175,7 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB } @Override - public String[] getStructureDescription(int stackSize) { + 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_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java index 6315a2f295..ab86c0494f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java @@ -1,6 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; @@ -14,7 +14,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.transformations import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -202,7 +202,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock } @Override - public String[] getStructureDescription(int stackSize) { + 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 2a739cb6c7..c6f9c810a8 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java @@ -1,13 +1,13 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.recipe.TT_recipe; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Holder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.ItemList; @@ -557,7 +557,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } @Override - public String[] getStructureDescription(int stackSize) { + public String[] getStructureDescription(ItemStack stackSize) { return description; } } 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 48479b9d71..896d0f41bc 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; @@ -518,7 +519,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa } @Override - public String[] getStructureDescription(int stackSize) { + 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 ece01f7489..140383caac 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,11 +1,11 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -74,7 +74,7 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc } @Override - public String[] getStructureDescription(int stackSize) { + 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_switch.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java index 39f9441cb7..7398889c89 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,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket; @@ -221,7 +222,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas } @Override - public String[] getStructureDescription(int stackSize) { + 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_transformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java index c2e759e96c..4e2f916f2f 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,26 +1,27 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; -import com.github.technus.tectech.util.CommonValues; 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.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; +import com.github.technus.tectech.util.CommonValues; 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.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; +import static com.github.technus.tectech.mechanics.structure.StructureUtility.ofBlock; +import static com.github.technus.tectech.mechanics.structure.StructureUtility.ofHatchAdder; 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; @@ -32,21 +33,25 @@ import static net.minecraft.util.StatCollector.translateToLocal; */ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure - private static final String[][] shape = new String[][]{ - {" ", " . ", " ",}, - {" ", " 0 ", " ",}, - {" ", " ", " ",}, - }; - private static final Block[] blockType = new Block[]{sBlockCasings1}; - private static final byte[] blockMeta = new byte[]{15}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addEnergyIOToMachineList}; - 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.transformer.hint"),//1 - Energy IO Hatches or High Power Casing }; + private static final IStructureDefinition STRUCTURE_DEFINITION = + StructureDefinition.builder() + .addShape("main",new String[][]{ + {"111", "1.1", "111",}, + {"111", "101", "111",}, + {"111", "111", "111",}, + }) + .addElement('0', ofBlock(sBlockCasings1,15)) + .addElement('1', trafo->ofHatchAdder(trafo::addEnergyIOToMachineList,textureOffset,sBlockCasingsTT,0)) + .build(); + + @Override + public IStructureDefinition getStructure_EM() { + return STRUCTURE_DEFINITION; + } //endregion public GT_MetaTileEntity_EM_transformer(int aID, String aName, String aNameRegional) { @@ -78,7 +83,7 @@ public class GT_MetaTileEntity_EM_transformer 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 @@ -150,11 +155,11 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo @Override public void construct(ItemStack stackSize, boolean hintsOnly) { - Structure.builder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + //Structure.builder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override - public String[] getStructureDescription(int stackSize) { + 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_wormhole.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java index 2b2ebdd1a4..f909d000c7 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java @@ -1,11 +1,11 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -109,7 +109,7 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB } @Override - public String[] getStructureDescription(int stackSize) { + 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_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java index 9c40d6ebc9..ba926f1ace 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,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.mechanics.constructable.IConstructable; @@ -250,7 +251,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock } @Override - public String[] getStructureDescription(int stackSize) { + 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_proccessingStack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java index 678f211744..47f36014ac 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 @@ -5,7 +5,7 @@ import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -126,7 +126,7 @@ public class GT_MetaTileEntity_TM_proccessingStack extends GT_MetaTileEntity_Mul } @Override - public String[] getStructureDescription(int stackSize) { + 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 327b54e561..a4a234f9b4 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.loader.NetworkDispatcher; @@ -827,7 +828,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock } @Override - public String[] getStructureDescription(int stackSize) { + 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/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java index 2f23aae431..7735678f72 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 @@ -6,7 +6,9 @@ import com.github.technus.tectech.mechanics.alignment.*; import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing; import com.github.technus.tectech.mechanics.alignment.enumerable.Flip; import com.github.technus.tectech.mechanics.alignment.enumerable.Rotation; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IStructureDefinition; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.Util; import com.github.technus.tectech.util.Vec3Impl; import com.github.technus.tectech.loader.NetworkDispatcher; @@ -191,6 +193,27 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt toolSetDirection(ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing())); } + /** + * Gets structure + * @return STATIC INSTANCE OF STRUCTURE + */ + public IStructureDefinition getStructure_EM(){ + throw new NoSuchMethodError("Implement it as STATIC INSTANCE"); + } + + @SuppressWarnings("unchecked") + private IStructureDefinition getStructure_EM_Internal(){ + return (IStructureDefinition)getStructure_EM(); + } + + public final boolean structureCheck_EM(String piece,int horizontalOffset, int verticalOffset, int depthOffset) { + IGregTechTileEntity baseMetaTileEntity = getBaseMetaTileEntity(); + return getStructure_EM_Internal().check(this,piece, baseMetaTileEntity.getWorld(),getExtendedFacing(), + baseMetaTileEntity.getXCoord(),baseMetaTileEntity.getYCoord(),baseMetaTileEntity.getZCoord(), + horizontalOffset,verticalOffset,depthOffset,!mMachine); + } + + @Deprecated public final boolean structureCheck_EM( String[][] structure,//0-9 casing, +- air no air, a-z ignore Block[] blockType,//use numbers 0-9 for casing types diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java deleted file mode 100644 index b695472012..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.multi.base; - - -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; - -public interface IHatchAdder { - Boolean apply(IGregTechTileEntity iGregTechTileEntity, Short aShort); -} 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 f6f3ec9a63..722580a221 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,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; -import com.github.technus.tectech.mechanics.constructable.Structure; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.util.Util; @@ -354,7 +355,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa } @Override - public String[] getStructureDescription(int stackSize) { + 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_DebugStructureWriter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java index 194d357b1c..42f25ddfde 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,11 +1,12 @@ package com.github.technus.tectech.thing.metaTileEntity.single; -import com.github.technus.tectech.mechanics.constructable.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.util.Util; +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 cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -20,6 +21,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.util.ForgeDirection; import static com.github.technus.tectech.thing.metaTileEntity.Textures.MACHINE_CASINGS_TT; import static net.minecraft.util.StatCollector.translateToLocal; @@ -105,21 +107,22 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti } @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (aBaseMetaTileEntity.isAllowedToWork()) { - result = Structure.writer(getBaseMetaTileEntity(), numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5], false); - for (String s : result) { - TecTech.LOGGER.info(s); - } - aBaseMetaTileEntity.disableWorking(); - } + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + super.onFirstTick(aBaseMetaTileEntity); + aBaseMetaTileEntity.disableWorking(); } @Override - public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - result = Structure.writer(getBaseMetaTileEntity(), numbers[0], numbers[1], numbers[2], numbers[3], numbers[4], numbers[5], true); - for (String s : result) { - TecTech.LOGGER.info(s); + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isAllowedToWork()) { + 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]); + TecTech.LOGGER.info(pseudoJavaCode); + result = pseudoJavaCode.split("\\n"); + aBaseMetaTileEntity.disableWorking(); } } @@ -129,8 +132,6 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti return true; } aBaseMetaTileEntity.openGUI(aPlayer); - //if (TecTechConfig.DEBUG_MODE && aPlayer.getHeldItem() != null) - // TecTech.LOGGER.info("UnlocalizedName: " + getUniqueIdentifier(aPlayer.getHeldItem())); return true; } diff --git a/src/main/java/com/github/technus/tectech/util/Util.java b/src/main/java/com/github/technus/tectech/util/Util.java index b81506d27c..1843770e3a 100644 --- a/src/main/java/com/github/technus/tectech/util/Util.java +++ b/src/main/java/com/github/technus/tectech/util/Util.java @@ -1,22 +1,14 @@ package com.github.technus.tectech.util; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing; -import com.github.technus.tectech.thing.casing.TT_Container_Casings; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.ObfuscationReflectionHelper; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; @@ -25,14 +17,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.server.MinecraftServer; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.storage.IPlayerFileData; import net.minecraft.world.storage.SaveHandler; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.StringUtils; @@ -42,12 +32,6 @@ import java.io.FileOutputStream; import java.lang.reflect.Field; import java.nio.charset.StandardCharsets; import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; -import static gregtech.api.enums.GT_Values.E; -import static java.nio.charset.Charset.forName; /** * Created by Tec on 21.03.2017. diff --git a/src/main/java/com/github/technus/tectech/util/Vec3Impl.java b/src/main/java/com/github/technus/tectech/util/Vec3Impl.java index 84e6497560..9ba96d741a 100644 --- a/src/main/java/com/github/technus/tectech/util/Vec3Impl.java +++ b/src/main/java/com/github/technus/tectech/util/Vec3Impl.java @@ -20,20 +20,6 @@ public class Vec3Impl implements Comparable { this(baseMetaTileEntity.getXCoord(),baseMetaTileEntity.getYCoord(),baseMetaTileEntity.getZCoord()); } - public boolean equals(Object o) { - if (this == o) { - return true; - } else if (o instanceof Vec3Impl) { - Vec3Impl vec3i = (Vec3Impl)o; - return val0 == vec3i.val0 && val1 == vec3i.val1 && val2 == vec3i.val2; - } - return false; - } - - public int hashCode() { - return (val1 + val2 * 31) * 31 + val0; - } - public int compareTo(Vec3Impl o) { return val1 == o.val1 ? val2 == o.val2 ? val0 - o.val0 : val2 - o.val2 : val1 - o.val1; } @@ -143,4 +129,18 @@ public class Vec3Impl implements Comparable { 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 -- cgit From 7ddc00ec1d41bb22218e16e66a306336cff4a761 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 25 Apr 2020 23:54:10 +0200 Subject: Finish example implementation on transformer --- .../metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java | 2 +- .../multi/base/GT_MetaTileEntity_MultiblockBase_EM.java | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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 4e2f916f2f..6d83b80d9a 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 @@ -155,7 +155,7 @@ public class GT_MetaTileEntity_EM_transformer 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); } @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 7735678f72..cf78a18a74 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 @@ -213,6 +213,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt horizontalOffset,verticalOffset,depthOffset,!mMachine); } + public final boolean structureBuild_EM(String piece,int horizontalOffset, int verticalOffset, int depthOffset,boolean hintsOnly) { + IGregTechTileEntity baseMetaTileEntity = getBaseMetaTileEntity(); + return getStructure_EM_Internal().buildOrHints(this,piece, baseMetaTileEntity.getWorld(),getExtendedFacing(), + baseMetaTileEntity.getXCoord(),baseMetaTileEntity.getYCoord(),baseMetaTileEntity.getZCoord(), + horizontalOffset,verticalOffset,depthOffset,hintsOnly); + } + @Deprecated public final boolean structureCheck_EM( String[][] structure,//0-9 casing, +- air no air, a-z ignore -- cgit From a66cc45857e9a414f7d2d8c4257871212007596b Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 00:12:00 +0200 Subject: Fix compilation issues --- .../technus/tectech/mechanics/structure/StructureDefinition.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 index 52386d8373..79176c3f25 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java @@ -80,6 +80,7 @@ public class StructureDefinition implements IStructureDefinition { char ch = builder.charAt(i); if(ch ==' ' || ch =='.'){ builder.setCharAt(i,A); + ch=A; } if(ch==A){ a++; @@ -138,8 +139,8 @@ public class StructureDefinition implements IStructureDefinition { Map[]> map = new HashMap<>(); shapes.forEach((key, value) -> { IStructureElementProvider[] compiled = new IStructureElementProvider[value.length()]; - for (char i = 0; i < compiled.length; i++) { - compiled[i] = this.elements.get(i); + for (int i = 0; i < value.length(); i++) { + compiled[i] = elements.get(value.charAt(i)); } map.put(key, compiled); }); -- cgit From 5ab4d194f5e46ab71b07eac45b3980b80411864a Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 00:29:14 +0200 Subject: Add hint blocks and fallbacks --- .../mechanics/structure/StructureUtility.java | 48 +++++++++++++++++++++- .../multi/GT_MetaTileEntity_EM_transformer.java | 9 ++-- 2 files changed, 52 insertions(+), 5 deletions(-) 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 index 69f5a6e43c..fe7a0d7510 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -13,14 +13,51 @@ import net.minecraft.world.World; import java.util.*; +import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sHintCasingsTT; + public class StructureUtility { private static final String NICE_CHARS ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`~!@#$%^&*()_=|[]{};:'<>,./?"; @SuppressWarnings("rawtypes") private static final Map STEP = new HashMap<>(); @SuppressWarnings("rawtypes") - private static final IStructureElement AIR= (t, world, x, y, z) -> world.getBlock(x, y, z).getMaterial() == Material.air; + 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) { + TecTech.proxy.hint_particle(world,x,y,z,sHintCasingsTT,13); + return true; + } + }; + @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) { + TecTech.proxy.hint_particle(world,x,y,z,sHintCasingsTT,14); + return true; + } + }; @SuppressWarnings("rawtypes") - private static final IStructureElement NOT_AIR= (t, world, x, y, z) -> world.getBlock(x, y, z).getMaterial() != Material.air; + 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) { + TecTech.proxy.hint_particle(world,x,y,z,sHintCasingsTT,15); + return true; + } + }; private StructureUtility(){ @@ -36,6 +73,11 @@ public class StructureUtility { return NOT_AIR; } + @SuppressWarnings("unchecked") + public static IStructureElement error(){ + return ERROR; + } + /** * Does not allow Block duplicates (with different meta) */ @@ -277,6 +319,7 @@ public class StructureUtility { }; } + @SafeVarargs public static IStructureFallback ofElementChain(IStructureElement... elementChain){ if(elementChain==null || elementChain.length==0){ throw new IllegalArgumentException(); @@ -289,6 +332,7 @@ public class StructureUtility { return () -> elementChain; } + @SafeVarargs public static IStructureFallbackProvider ofProviderChain(IStructureElementProvider... elementChain){ if(elementChain==null || elementChain.length==0){ throw new IllegalArgumentException(); 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 6d83b80d9a..62c2b981a1 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 @@ -20,11 +20,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; -import static com.github.technus.tectech.mechanics.structure.StructureUtility.ofBlock; -import static com.github.technus.tectech.mechanics.structure.StructureUtility.ofHatchAdder; +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 gregtech.api.GregTech_API.sBlockCasings1; import static net.minecraft.util.StatCollector.translateToLocal; @@ -45,7 +45,10 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo {"111", "111", "111",}, }) .addElement('0', ofBlock(sBlockCasings1,15)) - .addElement('1', trafo->ofHatchAdder(trafo::addEnergyIOToMachineList,textureOffset,sBlockCasingsTT,0)) + .addElement('1', ofProviderChain( + trafo->ofHatchAdder(trafo::addEnergyIOToMachineList,textureOffset,sHintCasingsTT,0), + ofBlock(sBlockCasingsTT,0) + )) .build(); @Override -- cgit From f740e2e7665c3a2aecca1ca912755353e875ad4c Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 00:30:34 +0200 Subject: Add hint only helpers for blocks --- .../mechanics/structure/StructureUtility.java | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) 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 index fe7a0d7510..6feb07196d 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -76,6 +76,73 @@ public class StructureUtility { @SuppressWarnings("unchecked") public static IStructureElement error(){ return ERROR; + } /** + * Does not allow Block duplicates (with different meta) + */ + public static IStructureElement ofHintFlat(Map blocsMap,Block hintBlock,int hintMeta){ + if(blocsMap==null || blocsMap.isEmpty() || hintBlock==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + return blocsMap.getOrDefault(world.getBlock(x, y, z), -1) == world.getBlockMetadata(x, y, z); + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,hintBlock,hintMeta); + return true; + } + }; + } + + /** + * Allows block duplicates (with different meta) + */ + public static IStructureElement ofHint(Map> blocsMap,Block hintBlock,int hintMeta){ + if(blocsMap==null || blocsMap.isEmpty() || hintBlock==null){ + throw new IllegalArgumentException(); + } + for (Set value : blocsMap.values()) { + if(value.isEmpty()){ + throw new IllegalArgumentException(); + } + } + return new IStructureElement() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + return blocsMap.getOrDefault(world.getBlock(x, y, z), Collections.emptySet()).contains(world.getBlockMetadata(x, y, z)); + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,hintBlock,hintMeta); + return true; + } + }; + } + + public static IStructureElement ofHint(Block block, int meta,Block hintBlock,int hintMeta){ + if(block==null || hintBlock==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + return block == world.getBlock(x, y, z) && meta == world.getBlockMetadata(x, y, z); + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,hintBlock,hintMeta); + return true; + } + }; + } + + public static IStructureElement ofHint(Block block, int meta){ + return ofHint(block, meta,block,meta); } /** -- cgit From 5314ad9da0ea1e776c1576ae13a6bb9ba5d5c019 Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 06:32:52 +0200 Subject: Drop element provider by reworking T into calls properly --- .../GT_MetaTileEntity_EM_essentiaDequantizer.java | 2 +- .../GT_MetaTileEntity_EM_essentiaQuantizer.java | 2 +- .../tectech/mechanics/structure/IBlockAdder.java | 4 +-- .../tectech/mechanics/structure/IHatchAdder.java | 4 +-- .../mechanics/structure/IStructureDefinition.java | 16 ++++----- .../mechanics/structure/IStructureElement.java | 7 +--- .../structure/IStructureElementProvider.java | 5 --- .../structure/IStructureFallbackProvider.java | 40 ---------------------- .../tectech/mechanics/structure/ITileAdder.java | 4 +-- .../tectech/mechanics/structure/Structure.java | 1 + .../mechanics/structure/StructureDefinition.java | 28 +++++++-------- .../mechanics/structure/StructureUtility.java | 27 ++++----------- .../multi/GT_MetaTileEntity_EM_annihilation.java | 2 +- .../multi/GT_MetaTileEntity_EM_bhg.java | 2 +- .../multi/GT_MetaTileEntity_EM_collider.java | 2 +- .../multi/GT_MetaTileEntity_EM_computer.java | 2 +- .../multi/GT_MetaTileEntity_EM_crafting.java | 2 +- .../multi/GT_MetaTileEntity_EM_dataBank.java | 2 +- .../multi/GT_MetaTileEntity_EM_decay.java | 2 +- .../multi/GT_MetaTileEntity_EM_dequantizer.java | 2 +- .../multi/GT_MetaTileEntity_EM_infuser.java | 2 +- .../multi/GT_MetaTileEntity_EM_junction.java | 2 +- .../multi/GT_MetaTileEntity_EM_quantizer.java | 2 +- .../multi/GT_MetaTileEntity_EM_research.java | 2 +- .../multi/GT_MetaTileEntity_EM_scanner.java | 2 +- .../multi/GT_MetaTileEntity_EM_stabilizer.java | 2 +- .../multi/GT_MetaTileEntity_EM_switch.java | 2 +- .../multi/GT_MetaTileEntity_EM_transformer.java | 4 +-- .../multi/GT_MetaTileEntity_EM_wormhole.java | 2 +- .../multi/GT_MetaTileEntity_TM_microwave.java | 2 +- .../GT_MetaTileEntity_TM_proccessingStack.java | 2 +- .../multi/GT_MetaTileEntity_TM_teslaCoil.java | 2 +- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 1 - .../metaTileEntity/multi/base/IHatchAdder.java | 15 ++++++++ .../em_machine/GT_MetaTileEntity_EM_machine.java | 2 +- 35 files changed, 74 insertions(+), 126 deletions(-) delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementProvider.java delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallbackProvider.java create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java 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 df5054ab4a..0ab4893000 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 @@ -11,7 +11,7 @@ import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_quantizer; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; 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 d48c345e8e..c2ae9f3fdb 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 @@ -11,7 +11,7 @@ import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_quantizer; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java index 3dda99fed2..85d6f1be3f 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java @@ -3,12 +3,12 @@ package com.github.technus.tectech.mechanics.structure; import net.minecraft.block.Block; -public interface IBlockAdder { +public interface IBlockAdder { /** * Callback on block added * @param block block attempted to add * @param meta meta of block attempted to add * @return is structure still valid */ - boolean apply(Block block, Integer meta); + boolean apply(T t,Block block, Integer meta); } diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IHatchAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IHatchAdder.java index 10d4c398ec..6e5aca5be3 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IHatchAdder.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IHatchAdder.java @@ -3,12 +3,12 @@ package com.github.technus.tectech.mechanics.structure; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -public interface IHatchAdder { +public interface IHatchAdder { /** * Callback to add hatch * @param iGregTechTileEntity hatch * @param aShort requested texture index, or null if not... * @return managed to add hatch (structure still valid) */ - boolean apply(IGregTechTileEntity iGregTechTileEntity, Short aShort); + boolean apply(T t,IGregTechTileEntity iGregTechTileEntity, Short aShort); } 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 index 656151dc86..1152713d5e 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java @@ -9,7 +9,7 @@ public interface IStructureDefinition { * @param name same name as for other methods here * @return the array of elements to process */ - IStructureElementProvider[] getElementsFor(String name); + IStructureElement[] getElementsFor(String name); default boolean check(T object,String piece, World world, ExtendedFacing extendedFacing, int basePositionX, int basePositionY, int basePositionZ, @@ -41,7 +41,7 @@ public interface IStructureDefinition { basePositionA, basePositionB, basePositionC,hintsOnly,null); } - static boolean iterate(T object, IStructureElementProvider[] elements, World world, ExtendedFacing extendedFacing, + static boolean iterate(T object, IStructureElement[] elements, World world, ExtendedFacing extendedFacing, int basePositionX, int basePositionY, int basePositionZ, int basePositionA, int basePositionB, int basePositionC, boolean hintsOnly, Boolean checkBlocksIfNotNullForceCheckAllIfTrue){ @@ -59,8 +59,7 @@ public interface IStructureDefinition { if(checkBlocksIfNotNullForceCheckAllIfTrue!=null){ if(checkBlocksIfNotNullForceCheckAllIfTrue){ - for (IStructureElementProvider elementProvider : elements) { - IStructureElement element=elementProvider.getStructureElement(object); + for (IStructureElement element : elements) { extendedFacing.getWorldOffset(abc, xyz); xyz[0] += basePositionX; xyz[1] += basePositionY; @@ -79,8 +78,7 @@ public interface IStructureDefinition { abc[2] =(element.resetC()?basePositionA:abc[2])+element.getStepC(); } } else { - for (IStructureElementProvider elementProvider : elements) { - IStructureElement element=elementProvider.getStructureElement(object); + for (IStructureElement element : elements) { extendedFacing.getWorldOffset(abc, xyz); xyz[0] += basePositionX; xyz[1] += basePositionY; @@ -99,8 +97,7 @@ public interface IStructureDefinition { } }else { if(hintsOnly) { - for (IStructureElementProvider elementProvider : elements) { - IStructureElement element=elementProvider.getStructureElement(object); + for (IStructureElement element : elements) { extendedFacing.getWorldOffset(abc, xyz); xyz[0] += basePositionX; xyz[1] += basePositionY; @@ -115,8 +112,7 @@ public interface IStructureDefinition { abc[2] =(element.resetC()?basePositionA:abc[2])+element.getStepC(); } } else { - for (IStructureElementProvider elementProvider : elements) { - IStructureElement element=elementProvider.getStructureElement(object); + for (IStructureElement element : elements) { extendedFacing.getWorldOffset(abc, xyz); xyz[0] += basePositionX; xyz[1] += basePositionY; 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 index d33eac4119..78997648ab 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java @@ -5,7 +5,7 @@ import net.minecraft.world.World; /** * Use StructureUtility to instantiate */ -public interface IStructureElement extends IStructureElementProvider { +public interface IStructureElement { boolean check(T t,World world,int x,int y,int z); default boolean spawnHint(T t,World world,int x,int y,int z){ @@ -39,9 +39,4 @@ public interface IStructureElement extends IStructureElementProvider { default boolean resetC(){ return false; } - - @Override - default IStructureElement getStructureElement(T object){ - return this; - } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementProvider.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementProvider.java deleted file mode 100644 index b38c2164c3..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementProvider.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.github.technus.tectech.mechanics.structure; - -public interface IStructureElementProvider { - IStructureElement getStructureElement(T object); -} diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallbackProvider.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallbackProvider.java deleted file mode 100644 index c0c24eaec4..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallbackProvider.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.github.technus.tectech.mechanics.structure; - -import net.minecraft.world.World; - -/** - * Use StructureUtility to instantiate - */ -public interface IStructureFallbackProvider extends IStructureElement { - IStructureElementProvider[] fallbacks(); - - @Override - default boolean check(T t,World world, int x, int y, int z){ - for (IStructureElementProvider fallback : fallbacks()) { - if (fallback.getStructureElement(t).check(t, world, x, y, z)) { - return true; - } - } - return false; - } - - @Override - default boolean spawnHint(T t,World world, int x, int y, int z) { - for (IStructureElementProvider fallback : fallbacks()) { - if (fallback.getStructureElement(t).spawnHint(t, world, x, y, z)) { - return true; - } - } - return false; - } - - @Override - default boolean placeBlock(T t,World world, int x, int y, int z) { - for (IStructureElementProvider fallback : fallbacks()) { - if (fallback.getStructureElement(t).placeBlock(t, world, x, y, z)) { - return true; - } - } - return false; - } -} diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java index 9d983e1c4d..bdb619984a 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java @@ -2,11 +2,11 @@ package com.github.technus.tectech.mechanics.structure; import net.minecraft.tileentity.TileEntity; -public interface ITileAdder { +public interface ITileAdder { /** * Callback to add hatch * @param tileEntity tile * @return managed to add hatch (structure still valid) */ - boolean apply(TileEntity tileEntity); + boolean apply(T t,TileEntity tileEntity); } 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 index 77c47ad19e..5da14f58f9 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java @@ -3,6 +3,7 @@ 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.thing.casing.TT_Container_Casings; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; import net.minecraft.block.material.Material; 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 index 79176c3f25..c8262e8473 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java @@ -6,18 +6,18 @@ import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; public class StructureDefinition implements IStructureDefinition { - private final Map> elements; + private final Map> elements; private final Map shapes; - private final Map[]> compiled; + private final Map[]> compiled; public static Builder builder() { return new Builder<>(); } private StructureDefinition( - Map> elements, + Map> elements, Map shapes, - Map[]> compiled) { + Map[]> compiled) { this.elements =elements; this.shapes=shapes; this.compiled =compiled; @@ -28,7 +28,7 @@ public class StructureDefinition implements IStructureDefinition { private static final char B='\uB000'; private static final char C='\uC000'; private static final char D='\uD000'; - private final Map> elements; + private final Map> elements; private final Map shapes; private Builder() { @@ -36,7 +36,7 @@ public class StructureDefinition implements IStructureDefinition { shapes = new HashMap<>(); } - public Map> getElements() { + public Map> getElements() { return elements; } @@ -113,7 +113,7 @@ public class StructureDefinition implements IStructureDefinition { return this; } - public Builder addElement(Character name, IStructureElementProvider structurePiece) { + public Builder addElement(Character name, IStructureElement structurePiece) { elements.put(name, structurePiece); return this; } @@ -127,18 +127,18 @@ public class StructureDefinition implements IStructureDefinition { } @SuppressWarnings("unchecked") - private Map[]> compileMap() { + private Map[]> compileMap() { List mising = new ArrayList<>(); shapes.values().stream().map(CharSequence::chars).forEach(intStream -> intStream.forEach(c -> { - IStructureElementProvider iStructureElement = elements.get((char) c); + IStructureElement iStructureElement = elements.get((char) c); if (iStructureElement == null) { mising.add(c); } })); if (mising.isEmpty()) { - Map[]> map = new HashMap<>(); + Map[]> map = new HashMap<>(); shapes.forEach((key, value) -> { - IStructureElementProvider[] compiled = new IStructureElementProvider[value.length()]; + IStructureElement[] compiled = new IStructureElement[value.length()]; for (int i = 0; i < value.length(); i++) { compiled[i] = elements.get(value.charAt(i)); } @@ -152,7 +152,7 @@ public class StructureDefinition implements IStructureDefinition { } } - public Map> getElements(){ + public Map> getElements(){ return elements; } @@ -160,12 +160,12 @@ public class StructureDefinition implements IStructureDefinition { return shapes; } - public Map[]> getCompiled() { + public Map[]> getCompiled() { return compiled; } @Override - public IStructureElementProvider[] getElementsFor(String name) { + public IStructureElement[] getElementsFor(String name) { return compiled.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 index 6feb07196d..3d13ca86e2 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -232,14 +232,14 @@ public class StructureUtility { return ofBlock(block, meta,block,meta); } - public static IStructureElement ofBlockAdder(IBlockAdder iBlockAdder,Block hintBlock,int hintMeta){ + public static IStructureElement ofBlockAdder(IBlockAdder iBlockAdder,Block hintBlock,int hintMeta){ if(iBlockAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); } return new IStructureElement() { @Override public boolean check(T t, World world, int x, int y, int z) { - return iBlockAdder.apply(world.getBlock(x, y, z), world.getBlockMetadata(x, y, z)); + return iBlockAdder.apply(t,world.getBlock(x, y, z), world.getBlockMetadata(x, y, z)); } @Override @@ -256,7 +256,7 @@ public class StructureUtility { }; } - public static IStructureElement ofTileAdder(ITileAdder iTileAdder,Block hintBlock,int hintMeta){ + public static IStructureElement ofTileAdder(ITileAdder iTileAdder,Block hintBlock,int hintMeta){ if(iTileAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); } @@ -264,7 +264,7 @@ public class StructureUtility { @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(tileEntity); + return tileEntity instanceof IGregTechTileEntity && iTileAdder.apply(t,tileEntity); } @Override @@ -275,7 +275,7 @@ public class StructureUtility { }; } - public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, Short textureIndex,Block hintBlock,int hintMeta){ + public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, Short textureIndex, Block hintBlock, int hintMeta){ if(iHatchAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); } @@ -283,7 +283,7 @@ public class StructureUtility { @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((IGregTechTileEntity) tileEntity, textureIndex); + return tileEntity instanceof IGregTechTileEntity && iHatchAdder.apply(t,(IGregTechTileEntity) tileEntity, textureIndex); } @Override @@ -391,20 +391,7 @@ public class StructureUtility { if(elementChain==null || elementChain.length==0){ throw new IllegalArgumentException(); } - for (IStructureElementProvider iStructureElement : elementChain) { - if(iStructureElement==null){ - throw new IllegalArgumentException(); - } - } - return () -> elementChain; - } - - @SafeVarargs - public static IStructureFallbackProvider ofProviderChain(IStructureElementProvider... elementChain){ - if(elementChain==null || elementChain.length==0){ - throw new IllegalArgumentException(); - } - for (IStructureElementProvider iStructureElement : elementChain) { + for (IStructureElement iStructureElement : elementChain) { if(iStructureElement==null){ throw new IllegalArgumentException(); } 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 4151dbfec0..36a89650fd 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 @@ -5,7 +5,7 @@ import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; 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 d90f4af8d2..aeb569efff 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 @@ -5,7 +5,7 @@ import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index 490ca2084b..0816f6d9ee 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -1,6 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; 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 e70cc10926..0aaa87bab4 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,6 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; 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 a9e5b2f8a1..b7904b3219 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 @@ -5,7 +5,7 @@ import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; 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 d5c9162d1d..a00c9b9041 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 @@ -10,7 +10,7 @@ import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_H 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.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; 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 3b17dfa9b9..2dafe62db6 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,6 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; 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 5dfa38294b..77f73edc63 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 @@ -11,7 +11,7 @@ import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; 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 1fff071e9c..c07be438d4 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 @@ -9,7 +9,7 @@ import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; 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 199bb8ee6f..b7555a4163 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,6 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.mechanics.constructable.IConstructable; 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 ab86c0494f..935f3b3997 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 @@ -14,7 +14,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.transformations import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; 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 c6f9c810a8..72a3c241ba 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 @@ -7,7 +7,7 @@ import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Holder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.ItemList; 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 896d0f41bc..3db6f66eb0 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java @@ -1,6 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; 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 140383caac..7219429d11 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 @@ -5,7 +5,7 @@ import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; 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 7398889c89..043b266f62 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,6 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; 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 62c2b981a1..1381c1b0f7 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 @@ -45,8 +45,8 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo {"111", "111", "111",}, }) .addElement('0', ofBlock(sBlockCasings1,15)) - .addElement('1', ofProviderChain( - trafo->ofHatchAdder(trafo::addEnergyIOToMachineList,textureOffset,sHintCasingsTT,0), + .addElement('1', ofElementChain( + ofHatchAdder(GT_MetaTileEntity_EM_transformer::addEnergyIOToMachineList,textureOffset,sHintCasingsTT,0), ofBlock(sBlockCasingsTT,0) )) .build(); 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 f909d000c7..1d06a3b0d7 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 @@ -5,7 +5,7 @@ import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; 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 ba926f1ace..a320a8b35a 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,6 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; 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 47f36014ac..e800037850 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 @@ -5,7 +5,7 @@ import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; 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 a4a234f9b4..6a9991451b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java @@ -1,6 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; 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 cf78a18a74..8cf1cee16d 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 @@ -6,7 +6,6 @@ import com.github.technus.tectech.mechanics.alignment.*; import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing; import com.github.technus.tectech.mechanics.alignment.enumerable.Flip; import com.github.technus.tectech.mechanics.alignment.enumerable.Rotation; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; import com.github.technus.tectech.mechanics.structure.IStructureDefinition; import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.Util; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java new file mode 100644 index 0000000000..539fcf4f38 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java @@ -0,0 +1,15 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.base; + + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; + +@Deprecated +public interface IHatchAdder { + /** + * Callback to add hatch + * @param iGregTechTileEntity hatch + * @param aShort requested texture index, or null if not... + * @return managed to add hatch (structure still valid) + */ + boolean apply(IGregTechTileEntity iGregTechTileEntity, Short aShort); +} 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 722580a221..5c3296f980 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,6 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; -- cgit From a94138b2c1dccb88d1cce040fda5f29fe10dfa2c Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 07:21:56 +0200 Subject: Refactor old api for fully static context --- .../GT_MetaTileEntity_EM_essentiaDequantizer.java | 19 ++++++++------- .../GT_MetaTileEntity_EM_essentiaQuantizer.java | 19 ++++++++------- .../tectech/mechanics/structure/Structure.java | 16 +++++++++---- .../multi/GT_MetaTileEntity_EM_annihilation.java | 11 +++++---- .../multi/GT_MetaTileEntity_EM_bhg.java | 7 ++++-- .../multi/GT_MetaTileEntity_EM_collider.java | 24 +++++++++++-------- .../multi/GT_MetaTileEntity_EM_computer.java | 19 ++++++++------- .../multi/GT_MetaTileEntity_EM_crafting.java | 11 +++++---- .../multi/GT_MetaTileEntity_EM_dataBank.java | 15 +++++++----- .../multi/GT_MetaTileEntity_EM_decay.java | 20 ++++++++++------ .../multi/GT_MetaTileEntity_EM_dequantizer.java | 19 ++++++++------- .../multi/GT_MetaTileEntity_EM_infuser.java | 10 ++++---- .../multi/GT_MetaTileEntity_EM_junction.java | 18 +++++++++----- .../multi/GT_MetaTileEntity_EM_quantizer.java | 21 ++++++++-------- .../multi/GT_MetaTileEntity_EM_research.java | 15 +++++++----- .../multi/GT_MetaTileEntity_EM_scanner.java | 25 +++++++++---------- .../multi/GT_MetaTileEntity_EM_stabilizer.java | 11 +++++---- .../multi/GT_MetaTileEntity_EM_switch.java | 19 +++++++++------ .../multi/GT_MetaTileEntity_EM_wormhole.java | 11 +++++---- .../multi/GT_MetaTileEntity_TM_microwave.java | 10 ++++---- .../GT_MetaTileEntity_TM_proccessingStack.java | 8 ++++--- .../multi/GT_MetaTileEntity_TM_teslaCoil.java | 28 +++++++++++++++------- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 27 ++++++++++++--------- .../metaTileEntity/multi/base/IHatchAdder.java | 15 ------------ .../em_machine/GT_MetaTileEntity_EM_machine.java | 15 +++++++----- 25 files changed, 239 insertions(+), 174 deletions(-) delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java 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 0ab4893000..0ce33b31b3 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,17 +1,17 @@ package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.casing.TT_Container_Casings; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_quantizer; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.util.CommonValues; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -24,10 +24,11 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; -import static com.github.technus.tectech.util.CommonValues.V; import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat.essentiaContainerCompat; +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 net.minecraft.util.StatCollector.translateToLocal; @@ -46,10 +47,10 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ }; private static final Block[] blockType = new Block[]{QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{0, 0, 4, 8}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{ - this::addClassicToMachineList, - this::addElementalInputToMachineList, - this::addElementalMufflerToMachineList}; + private static final IHatchAdder[] 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}; 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 c2ae9f3fdb..98daad91c3 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,17 +1,17 @@ package com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.casing.TT_Container_Casings; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_quantizer; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.util.CommonValues; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -24,10 +24,11 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; -import static com.github.technus.tectech.util.CommonValues.V; import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat.essentiaContainerCompat; +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 net.minecraft.util.StatCollector.translateToLocal; @@ -46,10 +47,10 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu }; private static final Block[] blockType = new Block[]{QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{0, 4, 0, 8}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{ - this::addClassicToMachineList, - this::addElementalOutputToMachineList, - this::addElementalMufflerToMachineList}; + private static final IHatchAdder[] 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}; 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 index 5da14f58f9..7eda9b690a 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java @@ -3,7 +3,7 @@ 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.thing.casing.TT_Container_Casings; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -22,20 +22,26 @@ public class Structure { private Structure(){} + @SafeVarargs + public static IHatchAdder[] adders(IHatchAdder... iHatchAdder){ + return iHatchAdder; + } + //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller //This only checks for REGULAR BLOCKS! - public static boolean checker( + public static 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[] addingMethods, + IHatchAdder[] addingMethods, short[] casingTextures, Block[] blockTypeFallback,//use numbers 0-9 for casing types byte[] blockMetaFallback,//use numbers 0-9 for casing types int horizontalOffset, int verticalOffset, int depthOffset, - IGregTechTileEntity aBaseMetaTileEntity, + T metaTile, ExtendedFacing extendedFacing, boolean forceCheck) { + IGregTechTileEntity aBaseMetaTileEntity = metaTile.getBaseMetaTileEntity(); World world = aBaseMetaTileEntity.getWorld(); if (world.isRemote) { return false; @@ -117,7 +123,7 @@ public class Structure { } } else if ((pointer = block - ' ') >= 0) { igt = aBaseMetaTileEntity.getIGregTechTileEntity(xyz[0], xyz[1], xyz[2]); - if (igt == null || !addingMethods[pointer].apply(igt, casingTextures[pointer])) { + if (igt == null || !addingMethods[pointer].apply(metaTile,igt, casingTextures[pointer])) { if (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockTypeFallback[pointer]) { if (DEBUG_MODE) { TecTech.LOGGER.info("Fallback-struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + world.getBlock(xyz[0], xyz[1], xyz[2]).getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName())); 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 36a89650fd..4eb2028dd8 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,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.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; +import com.github.technus.tectech.util.CommonValues; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -18,6 +18,7 @@ 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; @@ -48,7 +49,9 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl }; 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 final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; + private static final IHatchAdder[] 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}; 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 aeb569efff..0dc949bc2f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java @@ -1,11 +1,11 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -18,6 +18,7 @@ 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; @@ -84,7 +85,9 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{12, 13, 14, 10, 11}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; + private static final IHatchAdder[] addingMethods = adders( + GT_MetaTileEntity_EM_bhg::addClassicToMachineList, + GT_MetaTileEntity_EM_bhg::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}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index 0816f6d9ee..8df3122381 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -1,11 +1,9 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; -import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.dComplexAspectDefinition; import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalMutableDefinitionStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; @@ -13,12 +11,17 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElem import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition; import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dHadronDefinition; import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eQuarkDefinition; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.casing.TT_Container_Casings; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +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.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; +import com.github.technus.tectech.util.CommonValues; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -35,6 +38,7 @@ import net.minecraftforge.common.util.ForgeDirection; import java.util.HashMap; +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; @@ -329,11 +333,11 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB }; private static final byte[] blockMeta1 = new byte[]{4, 7, 4, 0, 4, 8}; private static final byte[] blockMeta2 = new byte[]{4, 7, 5, 0, 6, 9}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{ - this::addClassicToMachineList, - this::addElementalInputToMachineList, - this::addElementalOutputToMachineList, - this::addElementalMufflerToMachineList}; + private static final IHatchAdder[] addingMethods = adders( + GT_MetaTileEntity_EM_collider::addClassicToMachineList, + GT_MetaTileEntity_EM_collider::addElementalInputToMachineList, + GT_MetaTileEntity_EM_collider::addElementalOutputToMachineList, + GT_MetaTileEntity_EM_collider::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}; 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 0aaa87bab4..c6a6e584df 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,18 +1,18 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; -import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.util.Util; -import com.github.technus.tectech.util.Vec3Impl; -import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket; import com.github.technus.tectech.mechanics.constructable.IConstructable; +import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket; +import com.github.technus.tectech.mechanics.structure.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; 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 cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -30,11 +30,12 @@ import net.minecraft.util.ResourceLocation; import java.util.ArrayList; -import static com.github.technus.tectech.util.CommonValues.V; +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 net.minecraft.util.StatCollector.translateToLocal; /** @@ -55,7 +56,9 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB 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 final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addToMachineList, this::addRackToMachineList}; + private static final IHatchAdder[] 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}; 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 b7904b3219..7e338da853 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,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.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; +import com.github.technus.tectech.util.CommonValues; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -18,6 +18,7 @@ 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; @@ -50,7 +51,9 @@ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockB }; 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 final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; + private static final IHatchAdder[] 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}; 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 a00c9b9041..319141e55c 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,17 +1,17 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; -import com.github.technus.tectech.mechanics.dataTransport.InventoryDataPacket; import com.github.technus.tectech.mechanics.constructable.IConstructable; +import com.github.technus.tectech.mechanics.dataTransport.InventoryDataPacket; +import com.github.technus.tectech.mechanics.structure.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; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; +import com.github.technus.tectech.util.CommonValues; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -28,11 +28,12 @@ import net.minecraft.util.ResourceLocation; import java.util.ArrayList; -import static com.github.technus.tectech.util.CommonValues.V; +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 net.minecraft.util.StatCollector.translateToLocal; public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { @@ -49,7 +50,9 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{2, 1}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addDataBankHatchToMachineList}; + private static final IHatchAdder[] 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}; 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 2dafe62db6..0d243db7e8 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,15 +1,18 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; -import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.mechanics.constructable.IConstructable; +import com.github.technus.tectech.mechanics.structure.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.*; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +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.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; +import com.github.technus.tectech.util.CommonValues; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -28,12 +31,13 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import org.apache.commons.lang3.reflect.FieldUtils; -import static com.github.technus.tectech.util.CommonValues.VN; +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 net.minecraft.util.StatCollector.translateToLocal; import static net.minecraft.util.StatCollector.translateToLocalFormatted; @@ -66,7 +70,9 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 5, 8, 6}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; + private static final IHatchAdder[] 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}; 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 77f73edc63..1b17eaa4a6 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,17 +1,17 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElementalDefinition; import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aOredictDequantizationInfo; import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.iExchangeInfo; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.util.CommonValues; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -25,12 +25,13 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.ArrayList; -import static com.github.technus.tectech.util.CommonValues.V; import static com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition.STABLE_RAW_LIFE_TIME; import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition.refMass; import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition.refUnstableMass; +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 net.minecraft.util.StatCollector.translateToLocal; /** @@ -47,10 +48,10 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE}; private static final byte[] blockMeta = new byte[]{0, 4, 0}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{ - this::addClassicToMachineList, - this::addElementalInputToMachineList, - this::addElementalMufflerToMachineList}; + private static final IHatchAdder[] 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}; 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 c07be438d4..224e7afc86 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -1,15 +1,15 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import cofh.api.energy.IEnergyContainerItem; -import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.mechanics.constructable.IConstructable; +import com.github.technus.tectech.mechanics.structure.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.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.util.CommonValues; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -24,6 +24,7 @@ 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 gregtech.api.GregTech_API.mEUtoRF; @@ -41,7 +42,8 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{7, 4}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList}; + private static final IHatchAdder[] 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}; 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 b7555a4163..c4c0189431 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,12 +1,15 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; -import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.mechanics.constructable.IConstructable; +import com.github.technus.tectech.mechanics.structure.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.*; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +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 gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; @@ -14,10 +17,11 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.util.CommonValues.V; +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 net.minecraft.util.StatCollector.translateToLocal; @@ -42,7 +46,9 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 5}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; + private static final IHatchAdder[] 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}; 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 935f3b3997..1d2ef85ace 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java @@ -1,9 +1,8 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElementalDefinition; @@ -11,10 +10,11 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.transformations import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aItemQuantizationInfo; import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aOredictQuantizationInfo; import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.util.CommonValues; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -29,17 +29,18 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.ArrayList; -import static com.github.technus.tectech.util.CommonValues.V; -import static com.github.technus.tectech.util.Util.isInputEqual; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition.DEFAULT_ENERGY_LEVEL; import static com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElementalDefinition.STABLE_RAW_LIFE_TIME; import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition.refMass; import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition.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 net.minecraft.util.StatCollector.translateToLocal; /** @@ -56,10 +57,10 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE}; private static final byte[] blockMeta = new byte[]{4, 0, 0}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{ - this::addClassicToMachineList, - this::addElementalOutputToMachineList, - this::addElementalMufflerToMachineList}; + private static final IHatchAdder[] 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}; 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 72a3c241ba..9ef566a9d3 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.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.recipe.TT_recipe; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Holder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; +import com.github.technus.tectech.util.CommonValues; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; @@ -36,14 +36,15 @@ import org.apache.commons.lang3.reflect.FieldUtils; import java.util.ArrayList; import java.util.LinkedHashMap; -import static com.github.technus.tectech.util.CommonValues.V; -import static com.github.technus.tectech.util.CommonValues.VN; +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; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_crafting.crafter; import static com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine.machine; +import static com.github.technus.tectech.util.CommonValues.V; +import static com.github.technus.tectech.util.CommonValues.VN; import static gregtech.api.enums.GT_Values.E; import static net.minecraft.util.StatCollector.translateToLocal; import static net.minecraft.util.StatCollector.translateToLocalFormatted; @@ -77,7 +78,9 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{1, 3, 2}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addHolderToMachineList}; + private static final IHatchAdder[] 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}; 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 3db6f66eb0..25da9bfe5a 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,21 +1,21 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; -import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.recipe.TT_recipe; import com.github.technus.tectech.thing.CustomItemList; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.block.QuantumStuffBlock; import com.github.technus.tectech.thing.item.ElementalDefinitionScanStorage_EM; -import com.github.technus.tectech.mechanics.constructable.IConstructable; 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 gregtech.api.enums.ItemList; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -34,16 +34,17 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.ForgeDirection; import org.apache.commons.lang3.reflect.FieldUtils; -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.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.cPrimitiveDefinition.nbtE__; +import static com.github.technus.tectech.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; import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_crafting.crafter; import static com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine.machine; +import static com.github.technus.tectech.util.CommonValues.V; +import static com.github.technus.tectech.util.CommonValues.VN; +import static com.github.technus.tectech.util.Util.areBitsSet; import static net.minecraft.util.StatCollector.translateToLocal; import static net.minecraft.util.StatCollector.translateToLocalFormatted; @@ -80,11 +81,11 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 0, 0}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{ - this::addClassicToMachineList, - this::addElementalInputToMachineList, - this::addElementalOutputToMachineList, - this::addElementalMufflerToMachineList}; + private static final IHatchAdder[] 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}; 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 7219429d11..e579e68d51 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,17 +1,18 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.mechanics.constructable.IConstructable; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import com.github.technus.tectech.util.CommonValues; 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 net.minecraft.util.StatCollector.translateToLocal; @@ -30,7 +31,9 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc }; 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 final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; + private static final IHatchAdder[] 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}; 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 043b266f62..ced1bceed1 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,15 +1,18 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; -import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; -import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket; import com.github.technus.tectech.mechanics.constructable.IConstructable; +import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket; +import com.github.technus.tectech.mechanics.structure.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.*; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +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.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; +import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.Vec3Impl; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -22,11 +25,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; -import static com.github.technus.tectech.util.CommonValues.V; +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 net.minecraft.util.StatCollector.translateToLocal; /** @@ -41,7 +45,8 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas }; private static final Block[] blockType = new Block[]{sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{3}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList}; + private static final IHatchAdder[] 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}; 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 1d06a3b0d7..65f09c03dc 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,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.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; +import com.github.technus.tectech.util.CommonValues; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -18,6 +18,7 @@ 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; @@ -49,7 +50,9 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB }; 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 final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; + private static final IHatchAdder[] 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}; 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 a320a8b35a..4ab79a6732 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,12 +1,12 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; -import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.mechanics.constructable.IConstructable; +import com.github.technus.tectech.mechanics.structure.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 gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -27,6 +27,7 @@ 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 gregtech.api.GregTech_API.sBlockCasings4; @@ -53,7 +54,8 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock private static final Block[] blockType = new Block[]{sBlockCasings4}; private static final byte[] blockMeta = new byte[]{1}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList}; + private static final IHatchAdder[] 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}; 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 e800037850..4ca2ada866 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java @@ -1,12 +1,12 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.mechanics.constructable.IConstructable; +import com.github.technus.tectech.mechanics.structure.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.IHatchAdder; 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 gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -17,6 +17,7 @@ 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; @@ -45,7 +46,8 @@ public class GT_MetaTileEntity_TM_proccessingStack extends GT_MetaTileEntity_Mul private static final Block[] blockType = new Block[]{sBlockCasings4}; private static final byte[] blockMeta = new byte[]{1}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList}; + private static final IHatchAdder[] addingMethods = adders( + GT_MetaTileEntity_TM_proccessingStack::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}; 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 6a9991451b..16743bd2de 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java @@ -1,22 +1,25 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; -import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.loader.NetworkDispatcher; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.data.RendererMessage; import com.github.technus.tectech.mechanics.data.ThaumSpark; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil; import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil_Ultimate; -import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Capacitor; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Param; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +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.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_TeslaCoil; +import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.Vec3Impl; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -31,13 +34,18 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; -import static com.github.technus.tectech.util.CommonValues.V; -import static com.github.technus.tectech.util.Util.*; +import static com.github.technus.tectech.mechanics.structure.Structure.adders; 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 com.github.technus.tectech.util.Util.entriesSortedByValues; +import static com.github.technus.tectech.util.Util.map; import static gregtech.api.enums.GT_Values.E; import static java.lang.Math.max; import static java.lang.Math.min; @@ -97,7 +105,9 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock 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[][] blockMetas = new byte[][]{blockMetaT0, blockMetaT1, blockMetaT2, blockMetaT3, blockMetaT4, blockMetaT5}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addCapacitorToMachineList, this::addFrameToMachineList}; + private static final IHatchAdder[] 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}; 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 8cf1cee16d..1e5b36ab86 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,21 +2,25 @@ 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.mechanics.alignment.*; +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.structure.IStructureDefinition; -import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.Util; -import com.github.technus.tectech.util.Vec3Impl; -import com.github.technus.tectech.loader.NetworkDispatcher; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; +import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.IStructureDefinition; +import com.github.technus.tectech.mechanics.structure.Structure; 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 cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -42,10 +46,10 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; -import static com.github.technus.tectech.util.CommonValues.*; -import static com.github.technus.tectech.util.Util.getTier; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; +import static com.github.technus.tectech.util.CommonValues.*; +import static com.github.technus.tectech.util.Util.getTier; /** * Created by danie_000 on 27.10.2016. @@ -220,17 +224,18 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } @Deprecated - public final boolean structureCheck_EM( + @SuppressWarnings("unchecked") + public final boolean structureCheck_EM( String[][] structure,//0-9 casing, +- air no air, a-z ignore Block[] blockType,//use numbers 0-9 for casing types byte[] blockMeta,//use numbers 0-9 for casing types - IHatchAdder[] addingMethods, + IHatchAdder[] 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, getBaseMetaTileEntity(), getExtendedFacing(), !mMachine); + horizontalOffset, verticalOffset, depthOffset, (T)this, getExtendedFacing(), !mMachine); } //endregion diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java deleted file mode 100644 index 539fcf4f38..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.multi.base; - - -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; - -@Deprecated -public interface IHatchAdder { - /** - * Callback to add hatch - * @param iGregTechTileEntity hatch - * @param aShort requested texture index, or null if not... - * @return managed to add hatch (structure still valid) - */ - boolean apply(IGregTechTileEntity iGregTechTileEntity, Short aShort); -} 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 5c3296f980..1c76f7be6c 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.thing.metaTileEntity.multi.base.IHatchAdder; -import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.util.Util; +import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; +import com.github.technus.tectech.mechanics.structure.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.mechanics.constructable.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; +import com.github.technus.tectech.util.CommonValues; +import com.github.technus.tectech.util.Util; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -23,6 +23,7 @@ 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.*; @@ -50,7 +51,9 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa {"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 final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; + private static final IHatchAdder[] 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}; -- cgit From eb4333b293eb2046269f5d9347c4d02760d697bd Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 07:57:11 +0200 Subject: Use generics here --- .../multi/base/GT_MetaTileEntity_MultiblockBase_EM.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 1e5b36ab86..83c7066938 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 @@ -1140,12 +1140,12 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } - for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eOutputData) { + for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eOutputData) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_data)) { hatch_data.id = -1; } } - for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eInputData) { + for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eInputData) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_data)) { hatch_data.id = -1; } @@ -1209,13 +1209,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } id = 1; - for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eOutputData) { + for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eOutputData) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_data)) { hatch_data.id = id++; } } id = 1; - for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eInputData) { + for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eInputData) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_data)) { hatch_data.id = id++; } -- cgit From 93bca910f733b60d8151e4e619b27a1e585811ed Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 08:00:35 +0200 Subject: Fix pollutor localization --- .../thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java | 2 +- src/main/resources/assets/tectech/lang/en_US.lang | 2 +- src/main/resources/assets/tectech/lang/zh_CN.lang | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java index 6fef2efbe9..0d5a59a5c1 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java @@ -148,7 +148,7 @@ public class GT_MetaTileEntity_DebugPollutor extends GT_MetaTileEntity_TieredMac CommonValues.TEC_MARK_GENERAL, translateToLocal("gt.blockmachines.debug.tt.pollutor.desc.0"),//Shit genny broke! EnumChatFormatting.BLUE + translateToLocal("gt.blockmachines.debug.tt.pollutor.desc.1"),//Infinite Producer/Consumer - EnumChatFormatting.BLUE + translateToLocal("gt.blockmachines.debug.tt.pollutor.desc.1")//Since i wanted one... + EnumChatFormatting.BLUE + translateToLocal("gt.blockmachines.debug.tt.pollutor.desc.2")//Since i wanted one? }; } diff --git a/src/main/resources/assets/tectech/lang/en_US.lang b/src/main/resources/assets/tectech/lang/en_US.lang index b3ae51a407..5005a90c60 100644 --- a/src/main/resources/assets/tectech/lang/en_US.lang +++ b/src/main/resources/assets/tectech/lang/en_US.lang @@ -762,7 +762,7 @@ gt.blockmachines.machine.tt.tesla.desc.1=Lightning stoves for the rich gt.blockmachines.debug.tt.pollutor.name=Debug Pollution Generator gt.blockmachines.debug.tt.pollutor.desc.0=Shit genny broke! gt.blockmachines.debug.tt.pollutor.desc.1=Infinite Producer/Consumer -gt.blockmachines.debug.tt.pollutor.desc.2=Since i wanted one... +gt.blockmachines.debug.tt.pollutor.desc.2=Since i wanted one? gt.blockmachines.debug.tt.data.name=Debug Data Hatch gt.blockmachines.debug.tt.data.desc.0=Quantum Data Output gt.blockmachines.debug.tt.data.desc.1=High speed fibre optics connector. diff --git a/src/main/resources/assets/tectech/lang/zh_CN.lang b/src/main/resources/assets/tectech/lang/zh_CN.lang index 16d32829f7..a96b13a58f 100644 --- a/src/main/resources/assets/tectech/lang/zh_CN.lang +++ b/src/main/resources/assets/tectech/lang/zh_CN.lang @@ -762,7 +762,7 @@ gt.blockmachines.machine.tt.tesla.desc.1=富人的闪电洪炉 gt.blockmachines.debug.tt.pollutor.name=Debug污染生成机 gt.blockmachines.debug.tt.pollutor.desc.0=该死的genny破产了! gt.blockmachines.debug.tt.pollutor.desc.1=无限的生产者/消费者 -gt.blockmachines.debug.tt.pollutor.desc.2=我只是想要一个... +gt.blockmachines.debug.tt.pollutor.desc.2=我只是想要一个? gt.blockmachines.debug.tt.data.name=Debug数据仓 gt.blockmachines.debug.tt.data.desc.0=量子数据输出 gt.blockmachines.debug.tt.data.desc.1=高速光纤接口 -- cgit From 0c35badc49defc7bd7f76f763aa0a86bd9e7be64 Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 08:25:24 +0200 Subject: Add helper method for on check pass --- .../mechanics/structure/StructureUtility.java | 47 +++++++++++++++++++++- .../multi/GT_MetaTileEntity_EM_transformer.java | 6 ++- 2 files changed, 50 insertions(+), 3 deletions(-) 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 index 3d13ca86e2..e0e94a00eb 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -12,6 +12,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import java.util.*; +import java.util.function.Consumer; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sHintCasingsTT; @@ -76,7 +77,9 @@ public class StructureUtility { @SuppressWarnings("unchecked") public static IStructureElement error(){ return ERROR; - } /** + } + + /** * Does not allow Block duplicates (with different meta) */ public static IStructureElement ofHintFlat(Map blocsMap,Block hintBlock,int hintMeta){ @@ -145,6 +148,24 @@ public class StructureUtility { return ofHint(block, meta,block,meta); } + public static IStructureElement ofHintAdder(IBlockAdder iBlockAdder,Block hintBlock,int hintMeta){ + if(iBlockAdder==null ||hintBlock==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + return iBlockAdder.apply(t,world.getBlock(x, y, z), world.getBlockMetadata(x, y, z)); + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,hintBlock,hintMeta); + return true; + } + }; + } + /** * Does not allow Block duplicates (with different meta) */ @@ -256,6 +277,7 @@ public class StructureUtility { }; } + public static IStructureElement ofTileAdder(ITileAdder iTileAdder,Block hintBlock,int hintMeta){ if(iTileAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); @@ -294,6 +316,29 @@ public class StructureUtility { }; } + public static IStructureElement onCheckPass(Consumer onCheckPass, IStructureElement element){ + return new IStructureElement() { + @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) { + return element.placeBlock(t, world, x, y, z); + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + return element.spawnHint(t, world, x, y, z); + } + }; + } + @SuppressWarnings("unchecked") public static IStructureNavigate step(Vec3Impl step){ if(step==null || step.get0()<0 || step.get1()<0 || step.get2()<0){ 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 1381c1b0f7..b65fcda229 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 @@ -47,9 +47,10 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo .addElement('0', ofBlock(sBlockCasings1,15)) .addElement('1', ofElementChain( ofHatchAdder(GT_MetaTileEntity_EM_transformer::addEnergyIOToMachineList,textureOffset,sHintCasingsTT,0), - ofBlock(sBlockCasingsTT,0) + onCheckPass(t->t.casingCount++,ofBlock(sBlockCasingsTT,0)) )) .build(); + private int casingCount=0; @Override public IStructureDefinition getStructure_EM() { @@ -86,7 +87,8 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return structureCheck_EM("main", 1, 1, 0); + casingCount=0; + return structureCheck_EM("main", 1, 1, 0) && casingCount>=5; } @Override -- cgit From 1522dceb7629b3026e3c4506305d7d1f8708527c Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 08:27:32 +0200 Subject: add some doc --- .../com/github/technus/tectech/mechanics/structure/IBlockAdder.java | 2 +- .../com/github/technus/tectech/mechanics/structure/IHatchAdder.java | 2 +- .../java/com/github/technus/tectech/mechanics/structure/ITileAdder.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java index 85d6f1be3f..21841fc380 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java @@ -5,7 +5,7 @@ import net.minecraft.block.Block; public interface IBlockAdder { /** - * Callback on block added + * 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 diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IHatchAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IHatchAdder.java index 6e5aca5be3..0666e3f214 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IHatchAdder.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IHatchAdder.java @@ -5,7 +5,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; public interface IHatchAdder { /** - * Callback to add hatch + * 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) diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java index bdb619984a..2af878c79e 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java @@ -4,7 +4,7 @@ import net.minecraft.tileentity.TileEntity; public interface ITileAdder { /** - * Callback to add hatch + * 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) */ -- cgit From f40fed706320a4de336bd4e764921daf85262ea1 Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 08:28:07 +0200 Subject: remove unused field --- .../com/github/technus/tectech/mechanics/structure/Structure.java | 4 ---- 1 file changed, 4 deletions(-) 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 index 7eda9b690a..21bf0281bc 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java @@ -12,14 +12,10 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import java.util.regex.Pattern; - import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; @Deprecated public class Structure { - private static final Pattern MATCH_E = Pattern.compile("(E,(E,)+)"); - private Structure(){} @SafeVarargs -- cgit From 65cbb63664bfcad81265b26751f1d53e50b7ea96 Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 09:00:00 +0200 Subject: Make that api chooch --- .../tectech/loader/ConstructableLoader.java | 10 +++---- .../constructable/IMultiblockInfoContainer.java | 19 +++++++++---- .../thing/item/ConstructableTriggerItem.java | 31 +++++++++++----------- 3 files changed, 34 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java b/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java index 665889dc1f..2cd4f04fc8 100644 --- a/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java @@ -6,17 +6,16 @@ import com.github.technus.tectech.mechanics.structure.Structure; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.mechanics.constructable.IMultiblockInfoContainer.*; +import static com.github.technus.tectech.mechanics.constructable.IMultiblockInfoContainer.registerMetaClass; import static gregtech.api.GregTech_API.sBlockCasings1; public class ConstructableLoader implements Runnable { @Override public void run() { - registerMetaClass(GT_MetaTileEntity_ElectricBlastFurnace.class, new IMultiblockInfoContainer() { + registerMetaClass(GT_MetaTileEntity_ElectricBlastFurnace.class, new IMultiblockInfoContainer() { //region Structure private final String[][] shape = new String[][]{ {"000","\"\"\"","\"\"\""," . ",}, @@ -34,8 +33,9 @@ public class ConstructableLoader implements Runnable { //endregion @Override - public void construct(ItemStack stackSize, boolean hintsOnly, TileEntity tileEntity, ExtendedFacing aSide) { - Structure.builder(shape, blockType, blockMeta, 1, 3, 0, tileEntity, aSide, hintsOnly); + public void construct(ItemStack stackSize, boolean hintsOnly, GT_MetaTileEntity_ElectricBlastFurnace tileEntity, ExtendedFacing aSide) { + Structure.builder(shape, blockType, blockMeta, 1, 3, 0, + tileEntity.getBaseMetaTileEntity(), aSide, hintsOnly); } @Override 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 index 2506342f72..173e0d16ec 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/constructable/IMultiblockInfoContainer.java +++ b/src/main/java/com/github/technus/tectech/mechanics/constructable/IMultiblockInfoContainer.java @@ -12,18 +12,27 @@ import java.util.HashMap; /** * To implement IConstructable on not own TileEntities */ -public interface IMultiblockInfoContainer { - HashMap MULTIBLOCK_MAP = new HashMap<>(); +public interface IMultiblockInfoContainer { + HashMap> MULTIBLOCK_MAP = new HashMap<>(); - static void registerTileClass(Class clazz, IMultiblockInfoContainer info){ + static void registerTileClass(Class clazz, IMultiblockInfoContainer info){ MULTIBLOCK_MAP.put(clazz.getCanonicalName(),info); } - static void registerMetaClass(Class clazz, IMultiblockInfoContainer info){ + static void registerMetaClass(Class clazz, IMultiblockInfoContainer info){ MULTIBLOCK_MAP.put(clazz.getCanonicalName(),info); } - void construct(ItemStack stackSize, boolean hintsOnly, TileEntity tileEntity, ExtendedFacing aSide); + @SuppressWarnings("unchecked") + static IMultiblockInfoContainer get(Class tClass){ + return (IMultiblockInfoContainer)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/thing/item/ConstructableTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java index 4160ae2aba..c24b35f8d5 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java @@ -23,7 +23,6 @@ import java.util.List; import static com.github.technus.tectech.Reference.MODID; import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; -import static com.github.technus.tectech.mechanics.constructable.IMultiblockInfoContainer.MULTIBLOCK_MAP; import static net.minecraft.util.StatCollector.translateToLocal; /** @@ -51,20 +50,20 @@ public final class ConstructableTriggerItem extends Item { IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); if (metaTE instanceof IConstructable) { ((IConstructable) metaTE).construct(aStack, false); - } else if (MULTIBLOCK_MAP.containsKey(metaTE.getClass().getCanonicalName())) { - IMultiblockInfoContainer iMultiblockInfoContainer = MULTIBLOCK_MAP.get(metaTE.getClass().getCanonicalName()); + } else if (IMultiblockInfoContainer.contains(metaTE.getClass())) { + IMultiblockInfoContainer iMultiblockInfoContainer =IMultiblockInfoContainer.get(metaTE.getClass()); if(metaTE instanceof IAlignment){ - iMultiblockInfoContainer.construct(aStack, false, tTileEntity, ( + iMultiblockInfoContainer.construct(aStack, false, metaTE, ( (IAlignment) metaTE).getExtendedFacing()); }else { - iMultiblockInfoContainer.construct(aStack, false, tTileEntity, + iMultiblockInfoContainer.construct(aStack, false, metaTE, ExtendedFacing.of(ForgeDirection.getOrientation(((IGregTechTileEntity) tTileEntity).getFrontFacing()))); } } } else if (tTileEntity instanceof IConstructable) { ((IConstructable) tTileEntity).construct(aStack, false); - } else if (MULTIBLOCK_MAP.containsKey(tTileEntity.getClass().getCanonicalName())) { - IMultiblockInfoContainer iMultiblockInfoContainer = MULTIBLOCK_MAP.get(tTileEntity.getClass().getCanonicalName()); + } else if (IMultiblockInfoContainer.contains(tTileEntity.getClass())) { + IMultiblockInfoContainer iMultiblockInfoContainer =IMultiblockInfoContainer.get(tTileEntity.getClass()); if(tTileEntity instanceof IAlignment){ iMultiblockInfoContainer.construct(aStack, false, tTileEntity, ((IAlignment) tTileEntity).getExtendedFacing()); @@ -83,24 +82,24 @@ public final class ConstructableTriggerItem extends Item { ((IConstructable) metaTE).construct(aStack, true); TecTech.proxy.printInchat(((IConstructable) metaTE).getStructureDescription(aStack)); return false; - } else if(MULTIBLOCK_MAP.containsKey(metaTE.getClass().getCanonicalName())){ - IMultiblockInfoContainer iMultiblockInfoContainer = MULTIBLOCK_MAP.get(metaTE.getClass().getCanonicalName()); + } else if(IMultiblockInfoContainer.contains(metaTE.getClass())){ + IMultiblockInfoContainer iMultiblockInfoContainer =IMultiblockInfoContainer.get(metaTE.getClass()); if(metaTE instanceof IAlignment){ - iMultiblockInfoContainer.construct(aStack, true, tTileEntity, ( - (IAlignment) metaTE).getExtendedFacing()); + iMultiblockInfoContainer.construct(aStack, true, metaTE, + ((IAlignment) metaTE).getExtendedFacing()); }else { - iMultiblockInfoContainer.construct(aStack, true, tTileEntity, + iMultiblockInfoContainer.construct(aStack, true, metaTE, ExtendedFacing.of(ForgeDirection.getOrientation(((IGregTechTileEntity) tTileEntity).getFrontFacing()))); } - TecTech.proxy.printInchat(MULTIBLOCK_MAP.get(metaTE.getClass().getCanonicalName()).getDescription(aStack)); + 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(MULTIBLOCK_MAP.containsKey(tTileEntity.getClass().getCanonicalName())){ - IMultiblockInfoContainer iMultiblockInfoContainer = MULTIBLOCK_MAP.get(tTileEntity.getClass().getCanonicalName()); + } else if(IMultiblockInfoContainer.contains(tTileEntity.getClass())){ + IMultiblockInfoContainer iMultiblockInfoContainer = IMultiblockInfoContainer.get(tTileEntity.getClass()); if(tTileEntity instanceof IAlignment){ iMultiblockInfoContainer.construct(aStack, true, tTileEntity, ((IAlignment) tTileEntity).getExtendedFacing()); @@ -108,7 +107,7 @@ public final class ConstructableTriggerItem extends Item { iMultiblockInfoContainer.construct(aStack, true, tTileEntity, ExtendedFacing.of(ForgeDirection.getOrientation(aSide))); } - TecTech.proxy.printInchat(MULTIBLOCK_MAP.get(tTileEntity.getClass().getCanonicalName()).getDescription(aStack)); + TecTech.proxy.printInchat(IMultiblockInfoContainer.get(tTileEntity.getClass()).getDescription(aStack)); return false; } //} else { -- cgit From d0cafa5c88cbbff75321e2d781bca79a9057e473 Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 09:03:21 +0200 Subject: add on element fail --- .../mechanics/structure/StructureUtility.java | 25 +++++++++++++++++++++- .../multi/GT_MetaTileEntity_EM_transformer.java | 2 +- 2 files changed, 25 insertions(+), 2 deletions(-) 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 index e0e94a00eb..f619c7482b 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -316,7 +316,7 @@ public class StructureUtility { }; } - public static IStructureElement onCheckPass(Consumer onCheckPass, IStructureElement element){ + public static IStructureElement onElementPass(Consumer onCheckPass, IStructureElement element){ return new IStructureElement() { @Override public boolean check(T t, World world, int x, int y, int z) { @@ -339,6 +339,29 @@ public class StructureUtility { }; } + public static IStructureElement onElementFail(Consumer onFail, IStructureElement element){ + return new IStructureElement() { + @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) { + return element.placeBlock(t, world, x, y, z); + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + return element.spawnHint(t, world, x, y, z); + } + }; + } + @SuppressWarnings("unchecked") public static IStructureNavigate step(Vec3Impl step){ if(step==null || step.get0()<0 || step.get1()<0 || step.get2()<0){ 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 b65fcda229..2d7fc5b524 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 @@ -47,7 +47,7 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo .addElement('0', ofBlock(sBlockCasings1,15)) .addElement('1', ofElementChain( ofHatchAdder(GT_MetaTileEntity_EM_transformer::addEnergyIOToMachineList,textureOffset,sHintCasingsTT,0), - onCheckPass(t->t.casingCount++,ofBlock(sBlockCasingsTT,0)) + onElementPass(t->t.casingCount++,ofBlock(sBlockCasingsTT,0)) )) .build(); private int casingCount=0; -- cgit From ffcba9cfeada309748e3f2ad206b141fc102cb3e Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 09:10:57 +0200 Subject: Optimize navigation --- .../mechanics/structure/IStructureDefinition.java | 44 ++++++++++++++++------ .../mechanics/structure/IStructureElement.java | 24 ------------ .../mechanics/structure/IStructureNavigate.java | 26 ++++++++++++- .../mechanics/structure/StructureUtility.java | 4 +- 4 files changed, 59 insertions(+), 39 deletions(-) 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 index 1152713d5e..97e4fe2bad 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java @@ -73,9 +73,14 @@ public interface IStructureDefinition { return false; } - abc[0] =(element.resetA()?basePositionA:abc[0])+element.getStepA(); - abc[1] =(element.resetB()?basePositionA:abc[1])+element.getStepB(); - abc[2] =(element.resetC()?basePositionA:abc[2])+element.getStepC(); + if(element instanceof IStructureNavigate) { + IStructureNavigate navigate=(IStructureNavigate)element; + abc[0] = (navigate.resetA() ? basePositionA : abc[0]) + navigate.getStepA(); + abc[1] = (navigate.resetB() ? basePositionA : abc[1]) + navigate.getStepB(); + abc[2] = (navigate.resetC() ? basePositionA : abc[2]) + navigate.getStepC(); + }else { + abc[0]+=1; + } } } else { for (IStructureElement element : elements) { @@ -90,9 +95,14 @@ public interface IStructureDefinition { } } - abc[0] =(element.resetA()?basePositionA:abc[0])+element.getStepA(); - abc[1] =(element.resetB()?basePositionA:abc[1])+element.getStepB(); - abc[2] =(element.resetC()?basePositionA:abc[2])+element.getStepC(); + if(element instanceof IStructureNavigate) { + IStructureNavigate navigate=(IStructureNavigate)element; + abc[0] = (navigate.resetA() ? basePositionA : abc[0]) + navigate.getStepA(); + abc[1] = (navigate.resetB() ? basePositionA : abc[1]) + navigate.getStepB(); + abc[2] = (navigate.resetC() ? basePositionA : abc[2]) + navigate.getStepC(); + }else { + abc[0]+=1; + } } } }else { @@ -107,9 +117,14 @@ public interface IStructureDefinition { element.spawnHint(object, world, xyz[0], xyz[1], xyz[2]); } - abc[0] =(element.resetA()?basePositionA:abc[0])+element.getStepA(); - abc[1] =(element.resetB()?basePositionA:abc[1])+element.getStepB(); - abc[2] =(element.resetC()?basePositionA:abc[2])+element.getStepC(); + if(element instanceof IStructureNavigate) { + IStructureNavigate navigate=(IStructureNavigate)element; + abc[0] = (navigate.resetA() ? basePositionA : abc[0]) + navigate.getStepA(); + abc[1] = (navigate.resetB() ? basePositionA : abc[1]) + navigate.getStepB(); + abc[2] = (navigate.resetC() ? basePositionA : abc[2]) + navigate.getStepC(); + }else { + abc[0]+=1; + } } } else { for (IStructureElement element : elements) { @@ -122,9 +137,14 @@ public interface IStructureDefinition { element.placeBlock(object, world, xyz[0], xyz[1], xyz[2]); } - abc[0] =(element.resetA()?basePositionA:abc[0])+element.getStepA(); - abc[1] =(element.resetB()?basePositionA:abc[1])+element.getStepB(); - abc[2] =(element.resetC()?basePositionA:abc[2])+element.getStepC(); + if(element instanceof IStructureNavigate) { + IStructureNavigate navigate=(IStructureNavigate)element; + abc[0] = (navigate.resetA() ? basePositionA : abc[0]) + navigate.getStepA(); + abc[1] = (navigate.resetB() ? basePositionA : abc[1]) + navigate.getStepB(); + abc[2] = (navigate.resetC() ? basePositionA : abc[2]) + navigate.getStepC(); + }else { + abc[0]+=1; + } } } } 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 index 78997648ab..2ac5c19538 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java @@ -15,28 +15,4 @@ public interface IStructureElement { default boolean placeBlock(T t,World world,int x,int y,int z){ return false; } - - 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; - } } 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 index bba3dc5239..6382f130ee 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java @@ -5,7 +5,7 @@ import net.minecraft.world.World; /** * Use StructureUtility to instantiate */ -public interface IStructureNavigate extends IStructureElement { +interface IStructureNavigate extends IStructureElement { @Override default boolean check(T t, World world, int x, int y, int z){ return true; @@ -20,4 +20,28 @@ public interface IStructureNavigate extends IStructureElement { default boolean placeBlock(T t, World world, int x, int y, int z) { return true; } + + 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; + } } 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 index f619c7482b..703c68221c 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -363,7 +363,7 @@ public class StructureUtility { } @SuppressWarnings("unchecked") - public static IStructureNavigate step(Vec3Impl step){ + static IStructureNavigate step(Vec3Impl step){ if(step==null || step.get0()<0 || step.get1()<0 || step.get2()<0){ throw new IllegalArgumentException(); } @@ -378,7 +378,7 @@ public class StructureUtility { }); } - public static IStructureNavigate step(int a,int b, int c){ + static IStructureNavigate step(int a,int b, int c){ return step(new Vec3Impl(a,b,c)); } -- cgit From 99dcb842b73b8046b92df2bceb517af406a135cc Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 09:13:09 +0200 Subject: move adders to new package --- .../multi/GT_MetaTileEntity_EM_essentiaDequantizer.java | 2 +- .../multi/GT_MetaTileEntity_EM_essentiaQuantizer.java | 2 +- .../technus/tectech/mechanics/structure/IBlockAdder.java | 14 -------------- .../technus/tectech/mechanics/structure/IHatchAdder.java | 14 -------------- .../technus/tectech/mechanics/structure/ITileAdder.java | 12 ------------ .../technus/tectech/mechanics/structure/Structure.java | 1 + .../tectech/mechanics/structure/StructureUtility.java | 7 +++++-- .../tectech/mechanics/structure/adders/IBlockAdder.java | 14 ++++++++++++++ .../tectech/mechanics/structure/adders/IHatchAdder.java | 14 ++++++++++++++ .../tectech/mechanics/structure/adders/ITileAdder.java | 12 ++++++++++++ .../multi/GT_MetaTileEntity_EM_annihilation.java | 2 +- .../metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java | 2 +- .../multi/GT_MetaTileEntity_EM_collider.java | 2 +- .../multi/GT_MetaTileEntity_EM_computer.java | 2 +- .../multi/GT_MetaTileEntity_EM_crafting.java | 2 +- .../multi/GT_MetaTileEntity_EM_dataBank.java | 2 +- .../metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java | 2 +- .../multi/GT_MetaTileEntity_EM_dequantizer.java | 2 +- .../metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java | 2 +- .../multi/GT_MetaTileEntity_EM_junction.java | 2 +- .../multi/GT_MetaTileEntity_EM_quantizer.java | 2 +- .../multi/GT_MetaTileEntity_EM_research.java | 2 +- .../metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java | 2 +- .../multi/GT_MetaTileEntity_EM_stabilizer.java | 2 +- .../metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java | 2 +- .../multi/GT_MetaTileEntity_EM_wormhole.java | 2 +- .../multi/GT_MetaTileEntity_TM_microwave.java | 2 +- .../multi/GT_MetaTileEntity_TM_proccessingStack.java | 2 +- .../multi/GT_MetaTileEntity_TM_teslaCoil.java | 2 +- .../multi/base/GT_MetaTileEntity_MultiblockBase_EM.java | 2 +- .../multi/em_machine/GT_MetaTileEntity_EM_machine.java | 2 +- 31 files changed, 69 insertions(+), 65 deletions(-) delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IHatchAdder.java delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/adders/IBlockAdder.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/adders/IHatchAdder.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/adders/ITileAdder.java 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 0ce33b31b3..87e2660e01 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 @@ -5,7 +5,7 @@ import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.defin import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +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.casing.TT_Container_Casings; 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 98daad91c3..a716420e81 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 @@ -5,7 +5,7 @@ import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.defin import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +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.casing.TT_Container_Casings; diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java deleted file mode 100644 index 21841fc380..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IBlockAdder.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.github.technus.tectech.mechanics.structure; - - -import net.minecraft.block.Block; - -public interface IBlockAdder { - /** - * 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/IHatchAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IHatchAdder.java deleted file mode 100644 index 0666e3f214..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IHatchAdder.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.github.technus.tectech.mechanics.structure; - - -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; - -public interface IHatchAdder { - /** - * 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/ITileAdder.java b/src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java deleted file mode 100644 index 2af878c79e..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/ITileAdder.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.github.technus.tectech.mechanics.structure; - -import net.minecraft.tileentity.TileEntity; - -public interface ITileAdder { - /** - * 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/structure/Structure.java b/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java index 21bf0281bc..4bab18bd28 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java @@ -2,6 +2,7 @@ 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; 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 index 703c68221c..a953cf277f 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -2,6 +2,9 @@ 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; @@ -148,7 +151,7 @@ public class StructureUtility { return ofHint(block, meta,block,meta); } - public static IStructureElement ofHintAdder(IBlockAdder iBlockAdder,Block hintBlock,int hintMeta){ + public static IStructureElement ofHintAdder(IBlockAdder iBlockAdder, Block hintBlock, int hintMeta){ if(iBlockAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); } @@ -278,7 +281,7 @@ public class StructureUtility { } - public static IStructureElement ofTileAdder(ITileAdder iTileAdder,Block hintBlock,int hintMeta){ + public static IStructureElement ofTileAdder(ITileAdder iTileAdder, Block hintBlock, int hintMeta){ if(iTileAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); } 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 new file mode 100644 index 0000000000..908c4c4aca --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/adders/IBlockAdder.java @@ -0,0 +1,14 @@ +package com.github.technus.tectech.mechanics.structure.adders; + + +import net.minecraft.block.Block; + +public interface IBlockAdder { + /** + * 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 new file mode 100644 index 0000000000..a47befc2e8 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/adders/IHatchAdder.java @@ -0,0 +1,14 @@ +package com.github.technus.tectech.mechanics.structure.adders; + + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; + +public interface IHatchAdder { + /** + * 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 new file mode 100644 index 0000000000..cc3c7dbb7a --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/adders/ITileAdder.java @@ -0,0 +1,12 @@ +package com.github.technus.tectech.mechanics.structure.adders; + +import net.minecraft.tileentity.TileEntity; + +public interface ITileAdder { + /** + * 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/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 4eb2028dd8..584e28a607 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,7 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.mechanics.constructable.IConstructable; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +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; 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 0dc949bc2f..63b45500ed 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,6 +1,6 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index 8df3122381..dea65d322f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -11,7 +11,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElem import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition; import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dHadronDefinition; import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eQuarkDefinition; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +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.casing.TT_Container_Casings; 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 c6a6e584df..c845fe361e 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 @@ -3,7 +3,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.IHatchAdder; +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; 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 7e338da853..7d8204c07f 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,7 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.mechanics.constructable.IConstructable; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +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; 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 319141e55c..77647a0e20 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 @@ -3,7 +3,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.IHatchAdder; +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; 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 0d243db7e8..d8ddc2c5b5 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 @@ -3,7 +3,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.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +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; 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 1b17eaa4a6..1ba1389c80 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 @@ -6,7 +6,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElement import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.iHasElementalDefinition; import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aOredictDequantizationInfo; import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.iExchangeInfo; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +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.hatch.GT_MetaTileEntity_Hatch_InputElemental; 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 224e7afc86..152d110c8d 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 @@ -4,7 +4,7 @@ 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.IHatchAdder; +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; 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 c4c0189431..b63079d2dc 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java @@ -1,7 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.mechanics.constructable.IConstructable; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +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; 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 1d2ef85ace..a04a960bf1 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 @@ -10,7 +10,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.transformations import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aItemQuantizationInfo; import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.aOredictQuantizationInfo; import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +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; 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 9ef566a9d3..213c919ec8 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,7 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.mechanics.constructable.IConstructable; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +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; 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 25da9bfe5a..b418ec0fa4 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 @@ -6,7 +6,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInsta import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +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.CustomItemList; 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 e579e68d51..dcd85af99d 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,7 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.mechanics.constructable.IConstructable; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +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; 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 ced1bceed1..5ade4ec965 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 @@ -3,7 +3,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.IHatchAdder; +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; 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 65f09c03dc..fa51447e9f 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,7 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.mechanics.constructable.IConstructable; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +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; 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 4ab79a6732..543c09b72a 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 @@ -2,7 +2,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.structure.IHatchAdder; +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; 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 4ca2ada866..189eae8205 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,7 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.mechanics.constructable.IConstructable; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +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; 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 16743bd2de..15263e2042 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 @@ -5,7 +5,7 @@ import com.github.technus.tectech.loader.NetworkDispatcher; import com.github.technus.tectech.mechanics.constructable.IConstructable; import com.github.technus.tectech.mechanics.data.RendererMessage; import com.github.technus.tectech.mechanics.data.ThaumSpark; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil; import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil_Ultimate; 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 83c7066938..dc9c6d39e5 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 @@ -14,7 +14,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInsta import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder; import com.github.technus.tectech.mechanics.structure.IStructureDefinition; import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.thing.metaTileEntity.hatch.*; 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 1c76f7be6c..6b26132292 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 @@ -3,7 +3,7 @@ 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.cElementalInstanceStackMap; -import com.github.technus.tectech.mechanics.structure.IHatchAdder; +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; -- cgit From 9450b8b91b629095036d783b9b01f5a39508a80a Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 09:16:44 +0200 Subject: Do not all methods on navigation --- .../mechanics/structure/IStructureDefinition.java | 40 ++++++++++------------ 1 file changed, 18 insertions(+), 22 deletions(-) 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 index 97e4fe2bad..f70422fe72 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java @@ -65,20 +65,19 @@ public interface IStructureDefinition { 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])){ - return false; - } - }else { - return false; - } - if(element instanceof IStructureNavigate) { IStructureNavigate navigate=(IStructureNavigate)element; abc[0] = (navigate.resetA() ? basePositionA : abc[0]) + navigate.getStepA(); abc[1] = (navigate.resetB() ? basePositionA : abc[1]) + navigate.getStepB(); abc[2] = (navigate.resetC() ? basePositionA : abc[2]) + navigate.getStepC(); }else { + if (world.blockExists(xyz[0], xyz[1], xyz[2])) { + if(!element.check(object, world, xyz[0], xyz[1], xyz[2])){ + return false; + } + }else { + return false; + } abc[0]+=1; } } @@ -89,18 +88,17 @@ public interface IStructureDefinition { 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])){ - return false; - } - } - if(element instanceof IStructureNavigate) { IStructureNavigate navigate=(IStructureNavigate)element; abc[0] = (navigate.resetA() ? basePositionA : abc[0]) + navigate.getStepA(); abc[1] = (navigate.resetB() ? basePositionA : abc[1]) + navigate.getStepB(); abc[2] = (navigate.resetC() ? basePositionA : abc[2]) + navigate.getStepC(); }else { + if (world.blockExists(xyz[0], xyz[1], xyz[2])) { + if(!element.check(object, world, xyz[0], xyz[1], xyz[2])){ + return false; + } + } abc[0]+=1; } } @@ -113,16 +111,15 @@ public interface IStructureDefinition { xyz[1] += basePositionY; xyz[2] += basePositionZ; - if (world.blockExists(xyz[0], xyz[1], xyz[2])) { - element.spawnHint(object, world, xyz[0], xyz[1], xyz[2]); - } - if(element instanceof IStructureNavigate) { IStructureNavigate navigate=(IStructureNavigate)element; abc[0] = (navigate.resetA() ? basePositionA : abc[0]) + navigate.getStepA(); abc[1] = (navigate.resetB() ? basePositionA : abc[1]) + navigate.getStepB(); abc[2] = (navigate.resetC() ? basePositionA : abc[2]) + navigate.getStepC(); }else { + if (world.blockExists(xyz[0], xyz[1], xyz[2])) { + element.spawnHint(object, world, xyz[0], xyz[1], xyz[2]); + } abc[0]+=1; } } @@ -133,16 +130,15 @@ public interface IStructureDefinition { 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]); - } - if(element instanceof IStructureNavigate) { IStructureNavigate navigate=(IStructureNavigate)element; abc[0] = (navigate.resetA() ? basePositionA : abc[0]) + navigate.getStepA(); abc[1] = (navigate.resetB() ? basePositionA : abc[1]) + navigate.getStepB(); abc[2] = (navigate.resetC() ? basePositionA : abc[2]) + navigate.getStepC(); }else { + if (world.blockExists(xyz[0], xyz[1], xyz[2])) { + element.placeBlock(object, world, xyz[0], xyz[1], xyz[2]); + } abc[0]+=1; } } -- cgit From b8a654436e29505d1ac7bae0742819ff756b5e0f Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 09:25:06 +0200 Subject: Refactor instance of for isNavigating method --- .../mechanics/structure/IStructureDefinition.java | 36 ++++++++++------------ .../mechanics/structure/IStructureElement.java | 28 +++++++++++++++++ .../mechanics/structure/IStructureNavigate.java | 24 ++------------- 3 files changed, 46 insertions(+), 42 deletions(-) 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 index f70422fe72..a32c1f8840 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java @@ -65,11 +65,10 @@ public interface IStructureDefinition { xyz[1] += basePositionY; xyz[2] += basePositionZ; - if(element instanceof IStructureNavigate) { - IStructureNavigate navigate=(IStructureNavigate)element; - abc[0] = (navigate.resetA() ? basePositionA : abc[0]) + navigate.getStepA(); - abc[1] = (navigate.resetB() ? basePositionA : abc[1]) + navigate.getStepB(); - abc[2] = (navigate.resetC() ? basePositionA : abc[2]) + navigate.getStepC(); + if(element.isNavigating()) { + abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA(); + abc[1] = (element.resetB() ? basePositionA : abc[1]) + element.getStepB(); + abc[2] = (element.resetC() ? basePositionA : abc[2]) + element.getStepC(); }else { if (world.blockExists(xyz[0], xyz[1], xyz[2])) { if(!element.check(object, world, xyz[0], xyz[1], xyz[2])){ @@ -88,11 +87,10 @@ public interface IStructureDefinition { xyz[1] += basePositionY; xyz[2] += basePositionZ; - if(element instanceof IStructureNavigate) { - IStructureNavigate navigate=(IStructureNavigate)element; - abc[0] = (navigate.resetA() ? basePositionA : abc[0]) + navigate.getStepA(); - abc[1] = (navigate.resetB() ? basePositionA : abc[1]) + navigate.getStepB(); - abc[2] = (navigate.resetC() ? basePositionA : abc[2]) + navigate.getStepC(); + if(element.isNavigating()) { + abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA(); + abc[1] = (element.resetB() ? basePositionA : abc[1]) + element.getStepB(); + abc[2] = (element.resetC() ? basePositionA : abc[2]) + element.getStepC(); }else { if (world.blockExists(xyz[0], xyz[1], xyz[2])) { if(!element.check(object, world, xyz[0], xyz[1], xyz[2])){ @@ -111,11 +109,10 @@ public interface IStructureDefinition { xyz[1] += basePositionY; xyz[2] += basePositionZ; - if(element instanceof IStructureNavigate) { - IStructureNavigate navigate=(IStructureNavigate)element; - abc[0] = (navigate.resetA() ? basePositionA : abc[0]) + navigate.getStepA(); - abc[1] = (navigate.resetB() ? basePositionA : abc[1]) + navigate.getStepB(); - abc[2] = (navigate.resetC() ? basePositionA : abc[2]) + navigate.getStepC(); + if(element.isNavigating()) { + abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA(); + abc[1] = (element.resetB() ? basePositionA : abc[1]) + element.getStepB(); + abc[2] = (element.resetC() ? basePositionA : abc[2]) + element.getStepC(); }else { if (world.blockExists(xyz[0], xyz[1], xyz[2])) { element.spawnHint(object, world, xyz[0], xyz[1], xyz[2]); @@ -130,11 +127,10 @@ public interface IStructureDefinition { xyz[1] += basePositionY; xyz[2] += basePositionZ; - if(element instanceof IStructureNavigate) { - IStructureNavigate navigate=(IStructureNavigate)element; - abc[0] = (navigate.resetA() ? basePositionA : abc[0]) + navigate.getStepA(); - abc[1] = (navigate.resetB() ? basePositionA : abc[1]) + navigate.getStepB(); - abc[2] = (navigate.resetC() ? basePositionA : abc[2]) + navigate.getStepC(); + if(element.isNavigating()) { + abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA(); + abc[1] = (element.resetB() ? basePositionA : abc[1]) + element.getStepB(); + abc[2] = (element.resetC() ? basePositionA : abc[2]) + element.getStepC(); }else { if (world.blockExists(xyz[0], xyz[1], xyz[2])) { element.placeBlock(object, world, xyz[0], xyz[1], xyz[2]); 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 index 2ac5c19538..f9510910ed 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java @@ -15,4 +15,32 @@ public interface IStructureElement { default boolean placeBlock(T t,World world,int x,int y,int z){ return false; } + + 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/IStructureNavigate.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java index 6382f130ee..4628c710af 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java @@ -21,27 +21,7 @@ interface IStructureNavigate extends IStructureElement { return true; } - 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 true; } } -- cgit From 6e9b51fe3affc60e3969ba50c2090fb82116467a Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 09:25:43 +0200 Subject: Bump version --- build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.properties b/build.properties index c75d05a3da..aa0710220a 100644 --- a/build.properties +++ b/build.properties @@ -1,6 +1,6 @@ minecraft.version=1.7.10 forge.version=10.13.4.1614 -tectech.version=3.8.0 +tectech.version=3.8.1 ic2.version=2.2.790-experimental codechickenlib.version=1.1.3.140 -- cgit From c601ecf8cd72b76f88fe0b020305a79405a484a5 Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 10:04:43 +0200 Subject: Further optimize navigation --- .../mechanics/structure/IStructureDefinition.java | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) 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 index a32c1f8840..ef6ead0eed 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java @@ -60,16 +60,16 @@ public interface IStructureDefinition { if(checkBlocksIfNotNullForceCheckAllIfTrue!=null){ if(checkBlocksIfNotNullForceCheckAllIfTrue){ for (IStructureElement element : elements) { - extendedFacing.getWorldOffset(abc, xyz); - xyz[0] += basePositionX; - xyz[1] += basePositionY; - xyz[2] += basePositionZ; - if(element.isNavigating()) { abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA(); abc[1] = (element.resetB() ? basePositionA : abc[1]) + element.getStepB(); abc[2] = (element.resetC() ? basePositionA : 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])){ return false; @@ -82,16 +82,16 @@ public interface IStructureDefinition { } } else { for (IStructureElement element : elements) { - extendedFacing.getWorldOffset(abc, xyz); - xyz[0] += basePositionX; - xyz[1] += basePositionY; - xyz[2] += basePositionZ; - if(element.isNavigating()) { abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA(); abc[1] = (element.resetB() ? basePositionA : abc[1]) + element.getStepB(); abc[2] = (element.resetC() ? basePositionA : 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])){ return false; @@ -104,16 +104,16 @@ public interface IStructureDefinition { }else { if(hintsOnly) { for (IStructureElement element : elements) { - extendedFacing.getWorldOffset(abc, xyz); - xyz[0] += basePositionX; - xyz[1] += basePositionY; - xyz[2] += basePositionZ; - if(element.isNavigating()) { abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA(); abc[1] = (element.resetB() ? basePositionA : abc[1]) + element.getStepB(); abc[2] = (element.resetC() ? basePositionA : 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.spawnHint(object, world, xyz[0], xyz[1], xyz[2]); } @@ -122,16 +122,16 @@ public interface IStructureDefinition { } } else { for (IStructureElement element : elements) { - extendedFacing.getWorldOffset(abc, xyz); - xyz[0] += basePositionX; - xyz[1] += basePositionY; - xyz[2] += basePositionZ; - if(element.isNavigating()) { abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA(); abc[1] = (element.resetB() ? basePositionA : abc[1]) + element.getStepB(); abc[2] = (element.resetC() ? basePositionA : 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]); } -- cgit From f1d6a097d4bbe66de07e78a9997eb7f2d6ac2cb6 Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 26 Apr 2020 10:54:31 +0200 Subject: Remove more old api, add compat, fix typos,add hint only --- .../tectech/loader/ConstructableLoader.java | 32 +++++--- .../mechanics/structure/IStructureDefinition.java | 16 ++-- .../tectech/mechanics/structure/Structure.java | 25 +----- .../mechanics/structure/StructureDefinition.java | 91 +++++++++++++++++++++- .../mechanics/structure/StructureUtility.java | 16 ++++ 5 files changed, 136 insertions(+), 44 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java b/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java index 2cd4f04fc8..537bbf8cca 100644 --- a/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java @@ -2,13 +2,16 @@ 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.Structure; +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.block.Block; 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.ofHintOnly; import static gregtech.api.GregTech_API.sBlockCasings1; public class ConstructableLoader implements Runnable { @@ -17,13 +20,18 @@ public class ConstructableLoader implements Runnable { public void run() { registerMetaClass(GT_MetaTileEntity_ElectricBlastFurnace.class, new IMultiblockInfoContainer() { //region Structure - private final String[][] shape = new String[][]{ - {"000","\"\"\"","\"\"\""," . ",}, - {"0!0","\"A\"","\"A\""," ",}, - {"000","\"\"\"","\"\"\""," ",}, - }; - private final Block[] blockType = new Block[]{sBlockCasings1}; - private final byte[] blockMeta = new byte[]{11}; + private final IStructureDefinition definition= + StructureDefinition.builder() + .addShapeOldApi("main",new String[][]{ + {"000","\"\"\"","\"\"\""," . ",}, + {"0!0","\"A\"","\"A\""," ",}, + {"000","\"\"\"","\"\"\""," ",}, + }) + .addElement('0', ofBlock(sBlockCasings1,11)) + .addElement('\"', ofHintOnly(3)) + .addElement('!', ofHintOnly(2)) + .addElement(' ', ofHintOnly(1)) + .build(); private final String[] desc=new String[]{ EnumChatFormatting.AQUA+"Hint Details:", "1 - Classic Hatches or Heat Proof Casing", @@ -34,8 +42,10 @@ public class ConstructableLoader implements Runnable { @Override public void construct(ItemStack stackSize, boolean hintsOnly, GT_MetaTileEntity_ElectricBlastFurnace tileEntity, ExtendedFacing aSide) { - Structure.builder(shape, blockType, blockMeta, 1, 3, 0, - tileEntity.getBaseMetaTileEntity(), aSide, hintsOnly); + IGregTechTileEntity base = tileEntity.getBaseMetaTileEntity(); + definition.buildOrHints(tileEntity,"main", base.getWorld(),aSide, + base.getXCoord(),base.getYCoord(),base.getZCoord(), + 1, 3, 0,hintsOnly); } @Override 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 index ef6ead0eed..9319b4954b 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java @@ -62,8 +62,8 @@ public interface IStructureDefinition { for (IStructureElement element : elements) { if(element.isNavigating()) { abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA(); - abc[1] = (element.resetB() ? basePositionA : abc[1]) + element.getStepB(); - abc[2] = (element.resetC() ? basePositionA : abc[2]) + element.getStepC(); + 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; @@ -84,8 +84,8 @@ public interface IStructureDefinition { for (IStructureElement element : elements) { if(element.isNavigating()) { abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA(); - abc[1] = (element.resetB() ? basePositionA : abc[1]) + element.getStepB(); - abc[2] = (element.resetC() ? basePositionA : abc[2]) + element.getStepC(); + 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; @@ -106,8 +106,8 @@ public interface IStructureDefinition { for (IStructureElement element : elements) { if(element.isNavigating()) { abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA(); - abc[1] = (element.resetB() ? basePositionA : abc[1]) + element.getStepB(); - abc[2] = (element.resetC() ? basePositionA : abc[2]) + element.getStepC(); + 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; @@ -124,8 +124,8 @@ public interface IStructureDefinition { for (IStructureElement element : elements) { if(element.isNavigating()) { abc[0] = (element.resetA() ? basePositionA : abc[0]) + element.getStepA(); - abc[1] = (element.resetB() ? basePositionA : abc[1]) + element.getStepB(); - abc[2] = (element.resetC() ? basePositionA : abc[2]) + element.getStepC(); + 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; 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 index 4bab18bd28..e7769b3e04 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java @@ -9,7 +9,6 @@ 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.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -154,26 +153,10 @@ public class Structure { byte[] blockMeta,//use numbers 0-9 for casing types int horizontalOffset, int verticalOffset, int depthOffset, IGregTechTileEntity tileEntity, ExtendedFacing extendedFacing, boolean hintsOnly) { - return builder(structure, blockType, blockMeta, horizontalOffset, verticalOffset, depthOffset, - tileEntity.getWorld(), tileEntity.getXCoord(), tileEntity.getYCoord(), tileEntity.getZCoord(), - extendedFacing, hintsOnly); - } - - 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, - TileEntity tileEntity, ExtendedFacing extendedFacing, boolean hintsOnly) { - return builder(structure, blockType, blockMeta, horizontalOffset, verticalOffset, depthOffset, - tileEntity.getWorldObj(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, - extendedFacing, hintsOnly); - } - - 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, - World world, int baseX, int baseY, int baseZ, 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; } 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 index c8262e8473..5c54d05e60 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java @@ -1,5 +1,7 @@ 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; @@ -28,10 +30,12 @@ public class StructureDefinition implements IStructureDefinition { private static final char B='\uB000'; private static final char C='\uC000'; private static final char D='\uD000'; + private final Map navigates; private final Map> elements; private final Map shapes; private Builder() { + navigates=new HashMap<>(); elements = new HashMap<>(); shapes = new HashMap<>(); } @@ -44,6 +48,79 @@ public class StructureDefinition implements IStructureDefinition { return shapes; } + @Deprecated + public Builder 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 c = 0; c < ch; c++) { + builder.append(B); + } + }else if(ch>'@'){ + for (int c = '@'; c < ch; c++) { + 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; + char d=D; + for (int i = 0; i < builder.length(); i++) { + char ch = builder.charAt(i); + if(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; + } + /** * Adds shape * +- is air/no air checks @@ -92,8 +169,14 @@ public class StructureDefinition implements IStructureDefinition { b=0; c++; }else if(a!=0 || b!=0 || c!=0){ - builder.setCharAt(i-1,d); - addElement(d,step(a,b,c)); + 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; @@ -114,7 +197,7 @@ public class StructureDefinition implements IStructureDefinition { } public Builder addElement(Character name, IStructureElement structurePiece) { - elements.put(name, structurePiece); + elements.putIfAbsent(name, structurePiece); return this; } @@ -128,7 +211,7 @@ public class StructureDefinition implements IStructureDefinition { @SuppressWarnings("unchecked") private Map[]> compileMap() { - List mising = new ArrayList<>(); + Set mising = new HashSet<>(); shapes.values().stream().map(CharSequence::chars).forEach(intStream -> intStream.forEach(c -> { IStructureElement iStructureElement = elements.get((char) c); if (iStructureElement == null) { 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 index a953cf277f..40b1793f93 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -151,6 +151,22 @@ public class StructureUtility { return ofHint(block, meta,block,meta); } + public static IStructureElement ofHintOnly(int dots){ + int meta=dots-1; + return new IStructureElement() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + return false; + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,sHintCasingsTT,meta); + return true; + } + }; + } + public static IStructureElement ofHintAdder(IBlockAdder iBlockAdder, Block hintBlock, int hintMeta){ if(iBlockAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); -- cgit From 0f5cbab6552dfbd514f3183afd4b855f3d1ccb9d Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 27 Apr 2020 18:01:15 +0200 Subject: Addmore util --- .../tectech/loader/ConstructableLoader.java | 8 +- .../mechanics/structure/StructureUtility.java | 98 ++++++++++++++++++---- 2 files changed, 88 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java b/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java index 537bbf8cca..4e1a2eff75 100644 --- a/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java @@ -11,7 +11,7 @@ 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.ofHintOnly; +import static com.github.technus.tectech.mechanics.structure.StructureUtility.ofHint; import static gregtech.api.GregTech_API.sBlockCasings1; public class ConstructableLoader implements Runnable { @@ -28,9 +28,9 @@ public class ConstructableLoader implements Runnable { {"000","\"\"\"","\"\"\""," ",}, }) .addElement('0', ofBlock(sBlockCasings1,11)) - .addElement('\"', ofHintOnly(3)) - .addElement('!', ofHintOnly(2)) - .addElement(' ', ofHintOnly(1)) + .addElement('\"', ofHint(3)) + .addElement('!', ofHint(2)) + .addElement(' ', ofHint(1)) .build(); private final String[] desc=new String[]{ EnumChatFormatting.AQUA+"Hint Details:", 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 index 40b1793f93..b1be2071a7 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -85,7 +85,7 @@ public class StructureUtility { /** * Does not allow Block duplicates (with different meta) */ - public static IStructureElement ofHintFlat(Map blocsMap,Block hintBlock,int hintMeta){ + public static IStructureElement ofBlocksFlatHint(Map blocsMap,Block hintBlock,int hintMeta){ if(blocsMap==null || blocsMap.isEmpty() || hintBlock==null){ throw new IllegalArgumentException(); } @@ -106,7 +106,7 @@ public class StructureUtility { /** * Allows block duplicates (with different meta) */ - public static IStructureElement ofHint(Map> blocsMap,Block hintBlock,int hintMeta){ + public static IStructureElement ofBlocksMapHint(Map> blocsMap,Block hintBlock,int hintMeta){ if(blocsMap==null || blocsMap.isEmpty() || hintBlock==null){ throw new IllegalArgumentException(); } @@ -129,7 +129,7 @@ public class StructureUtility { }; } - public static IStructureElement ofHint(Block block, int meta,Block hintBlock,int hintMeta){ + public static IStructureElement ofBlockHint(Block block, int meta,Block hintBlock,int hintMeta){ if(block==null || hintBlock==null){ throw new IllegalArgumentException(); } @@ -147,11 +147,11 @@ public class StructureUtility { }; } - public static IStructureElement ofHint(Block block, int meta){ - return ofHint(block, meta,block,meta); + public static IStructureElement ofBlockHint(Block block, int meta){ + return ofBlockHint(block, meta,block,meta); } - public static IStructureElement ofHintOnly(int dots){ + public static IStructureElement ofHint(int dots){ int meta=dots-1; return new IStructureElement() { @Override @@ -167,7 +167,7 @@ public class StructureUtility { }; } - public static IStructureElement ofHintAdder(IBlockAdder iBlockAdder, Block hintBlock, int hintMeta){ + public static IStructureElement ofBlockAdderHint(IBlockAdder iBlockAdder, Block hintBlock, int hintMeta){ if(iBlockAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); } @@ -215,7 +215,7 @@ public class StructureUtility { /** * Allows block duplicates (with different meta) */ - public static IStructureElement ofBlocks(Map> blocsMap,Block hintBlock,int hintMeta){ + public static IStructureElement ofBlocskMap(Map> blocsMap,Block hintBlock,int hintMeta){ if(blocsMap==null || blocsMap.isEmpty() || hintBlock==null){ throw new IllegalArgumentException(); } @@ -296,7 +296,6 @@ public class StructureUtility { }; } - public static IStructureElement ofTileAdder(ITileAdder iTileAdder, Block hintBlock, int hintMeta){ if(iTileAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); @@ -316,6 +315,52 @@ public class StructureUtility { }; } + public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, Short textureIndex, int dots){ + int meta=dots-1; + if(iHatchAdder==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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, textureIndex); + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,sHintCasingsTT,meta); + return true; + } + }; + } + + public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, Short textureIndex, int dots, Block placeCasing,int placeCasingMeta){ + int meta=dots-1; + if(iHatchAdder==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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, textureIndex); + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + TecTech.proxy.hint_particle(world,x,y,z,sHintCasingsTT,meta); + return true; + } + + @Override + public boolean placeBlock(T t, World world, int x, int y, int z) { + world.setBlock(x,y,z,placeCasing,placeCasingMeta,2); + return true; + } + }; + } + public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, Short textureIndex, Block hintBlock, int hintMeta){ if(iHatchAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); @@ -335,6 +380,31 @@ public class StructureUtility { }; } + public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, Short textureIndex, Block hintBlock, int hintMeta, Block placeCasing,int placeCasingMeta){ + if(iHatchAdder==null ||hintBlock==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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, textureIndex); + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z) { + 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) { + world.setBlock(x,y,z,placeCasing,placeCasingMeta,2); + return true; + } + }; + } + public static IStructureElement onElementPass(Consumer onCheckPass, IStructureElement element){ return new IStructureElement() { @Override @@ -381,8 +451,12 @@ public class StructureUtility { }; } + public static IStructureNavigate step(int a,int b, int c){ + return step(new Vec3Impl(a,b,c)); + } + @SuppressWarnings("unchecked") - static IStructureNavigate step(Vec3Impl step){ + public static IStructureNavigate step(Vec3Impl step){ if(step==null || step.get0()<0 || step.get1()<0 || step.get2()<0){ throw new IllegalArgumentException(); } @@ -397,10 +471,6 @@ public class StructureUtility { }); } - static IStructureNavigate step(int a,int b, int c){ - return step(new Vec3Impl(a,b,c)); - } - private static IStructureNavigate stepA(int a,int b, int c){ return new IStructureNavigate() { @Override -- cgit From d58f2055aab235a3f3ead64ef86d1dc39396cae5 Mon Sep 17 00:00:00 2001 From: Tec Date: Tue, 28 Apr 2020 19:21:13 +0200 Subject: Implement new api for collider --- .../tectech/loader/ConstructableLoader.java | 6 +- .../mechanics/structure/IStructureDefinition.java | 23 +- .../mechanics/structure/IStructureElement.java | 5 +- .../mechanics/structure/IStructureFallback.java | 9 +- .../mechanics/structure/IStructureNavigate.java | 5 +- .../mechanics/structure/StructureDefinition.java | 59 ++- .../mechanics/structure/StructureUtility.java | 488 ++++++++++++++++++--- .../multi/GT_MetaTileEntity_EM_collider.java | 123 +++--- .../multi/GT_MetaTileEntity_EM_transformer.java | 2 +- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 8 +- 10 files changed, 570 insertions(+), 158 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java b/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java index 4e1a2eff75..dc282ec0b6 100644 --- a/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/ConstructableLoader.java @@ -43,9 +43,9 @@ public class ConstructableLoader implements Runnable { @Override public void construct(ItemStack stackSize, boolean hintsOnly, GT_MetaTileEntity_ElectricBlastFurnace tileEntity, ExtendedFacing aSide) { IGregTechTileEntity base = tileEntity.getBaseMetaTileEntity(); - definition.buildOrHints(tileEntity,"main", base.getWorld(),aSide, - base.getXCoord(),base.getYCoord(),base.getZCoord(), - 1, 3, 0,hintsOnly); + definition.buildOrHints(tileEntity, stackSize, "main", base.getWorld(), + aSide, base.getXCoord(), base.getYCoord(), + base.getZCoord(), 1, 3, 0, hintsOnly); } @Override 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 index 9319b4954b..71305ebd92 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.mechanics.structure; import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing; +import net.minecraft.item.ItemStack; import net.minecraft.world.World; public interface IStructureDefinition { @@ -9,39 +10,39 @@ public interface IStructureDefinition { * @param name same name as for other methods here * @return the array of elements to process */ - IStructureElement[] getElementsFor(String name); + IStructureElement[] 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,getElementsFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ, + return iterate(object, null, getStructureFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ, basePositionA, basePositionB, basePositionC,false,forceCheckAllBlocks); } - default boolean hints(T object,String piece, World world, ExtendedFacing extendedFacing, + 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,getElementsFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ, + return iterate(object, trigger, getStructureFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ, basePositionA, basePositionB, basePositionC,true,null); } - default boolean build(T object,String piece, World world, ExtendedFacing extendedFacing, + 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,getElementsFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ, + return iterate(object, trigger, getStructureFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ, basePositionA, basePositionB, basePositionC,false,null); } - default boolean buildOrHints(T object,String piece, World world, ExtendedFacing extendedFacing, + 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,getElementsFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ, + return iterate(object, trigger, getStructureFor(piece), world, extendedFacing, basePositionX, basePositionY, basePositionZ, basePositionA, basePositionB, basePositionC,hintsOnly,null); } - static boolean iterate(T object, IStructureElement[] elements, World world, ExtendedFacing extendedFacing, + static boolean iterate(T object, ItemStack trigger, IStructureElement[] elements, World world, ExtendedFacing extendedFacing, int basePositionX, int basePositionY, int basePositionZ, int basePositionA, int basePositionB, int basePositionC, boolean hintsOnly, Boolean checkBlocksIfNotNullForceCheckAllIfTrue){ @@ -115,7 +116,7 @@ public interface IStructureDefinition { xyz[2] += basePositionZ; if (world.blockExists(xyz[0], xyz[1], xyz[2])) { - element.spawnHint(object, world, xyz[0], xyz[1], xyz[2]); + element.spawnHint(object, world, xyz[0], xyz[1], xyz[2], trigger); } abc[0]+=1; } @@ -133,7 +134,7 @@ public interface IStructureDefinition { xyz[2] += basePositionZ; if (world.blockExists(xyz[0], xyz[1], xyz[2])) { - element.placeBlock(object, world, xyz[0], xyz[1], xyz[2]); + element.placeBlock(object, world, xyz[0], xyz[1], xyz[2], trigger); } abc[0]+=1; } 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 index f9510910ed..7ed173fbfa 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java @@ -1,5 +1,6 @@ package com.github.technus.tectech.mechanics.structure; +import net.minecraft.item.ItemStack; import net.minecraft.world.World; /** @@ -8,11 +9,11 @@ import net.minecraft.world.World; public interface IStructureElement { boolean check(T t,World world,int x,int y,int z); - default boolean spawnHint(T t,World world,int x,int y,int z){ + default boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger){ return false; } - default boolean placeBlock(T t,World world,int x,int y,int z){ + 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/IStructureFallback.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallback.java index 354aaf60e9..1c55753d19 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallback.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallback.java @@ -1,5 +1,6 @@ package com.github.technus.tectech.mechanics.structure; +import net.minecraft.item.ItemStack; import net.minecraft.world.World; /** @@ -19,9 +20,9 @@ public interface IStructureFallback extends IStructureElement { } @Override - default boolean spawnHint(T t, World world, int x, int y, int z) { + default boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { for (IStructureElement fallback : fallbacks()) { - if (fallback.spawnHint(t, world, x, y, z)) { + if (fallback.spawnHint(t, world, x, y, z, trigger)) { return true; } } @@ -29,9 +30,9 @@ public interface IStructureFallback extends IStructureElement { } @Override - default boolean placeBlock(T t, World world, int x, int y, int z) { + default boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { for (IStructureElement fallback : fallbacks()) { - if (fallback.placeBlock(t, world, x, y, z)) { + if (fallback.placeBlock(t, world, x, y, z, trigger)) { return true; } } 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 index 4628c710af..d3f4134cea 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureNavigate.java @@ -1,5 +1,6 @@ package com.github.technus.tectech.mechanics.structure; +import net.minecraft.item.ItemStack; import net.minecraft.world.World; /** @@ -12,12 +13,12 @@ interface IStructureNavigate extends IStructureElement { } @Override - default boolean spawnHint(T t, World world, int x, int y, int z) { + 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) { + default boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { 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 index 5c54d05e60..9cc82699b9 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java @@ -10,7 +10,7 @@ import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; public class StructureDefinition implements IStructureDefinition { private final Map> elements; private final Map shapes; - private final Map[]> compiled; + private final Map[]> structures; public static Builder builder() { return new Builder<>(); @@ -19,10 +19,10 @@ public class StructureDefinition implements IStructureDefinition { private StructureDefinition( Map> elements, Map shapes, - Map[]> compiled) { + Map[]> structures) { this.elements =elements; this.shapes=shapes; - this.compiled =compiled; + this.structures = structures; } public static class Builder { @@ -48,6 +48,14 @@ public class StructureDefinition implements IStructureDefinition { return shapes; } + /** + * Casings go: 0 1 2 3 4 5 6 7 8 9 : ; < = > ? + *
+ * HatchAdders go: space ! " # $ % & ' ( ) * + * @param name + * @param structurePiece + * @return + */ @Deprecated public Builder addShapeOldApi(String name, String[][] structurePiece) { StringBuilder builder = new StringBuilder(); @@ -202,15 +210,46 @@ public class StructureDefinition implements IStructureDefinition { } public IStructureDefinition build() { + Map[]> structures = compileStructureMap(); if(DEBUG_MODE){ - return new StructureDefinition<>(new HashMap<>(elements), new HashMap<>(shapes), compileMap()); + return new StructureDefinition<>(new HashMap<>(elements), new HashMap<>(shapes), structures); }else { - return compileMap()::get; + return structures::get; + } + } + + @SuppressWarnings("unchecked") + private Map[]> compileElementSetMap() { + Set mising = new HashSet<>(); + shapes.values().stream().map(CharSequence::chars).forEach(intStream -> intStream.forEach(c -> { + IStructureElement iStructureElement = elements.get((char) c); + if (iStructureElement == null) { + mising.add(c); + } + })); + if (mising.isEmpty()) { + Map[]> map = new HashMap<>(); + shapes.forEach((key, value) -> { + Set chars=new HashSet<>(); + for (char c : value.toCharArray()) { + chars.add(c); + } + IStructureElement[] 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(mising.toArray())); } } @SuppressWarnings("unchecked") - private Map[]> compileMap() { + private Map[]> compileStructureMap() { Set mising = new HashSet<>(); shapes.values().stream().map(CharSequence::chars).forEach(intStream -> intStream.forEach(c -> { IStructureElement iStructureElement = elements.get((char) c); @@ -243,12 +282,12 @@ public class StructureDefinition implements IStructureDefinition { return shapes; } - public Map[]> getCompiled() { - return compiled; + public Map[]> getStructures() { + return structures; } @Override - public IStructureElement[] getElementsFor(String name) { - return compiled.get(name); + public IStructureElement[] 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 index b1be2071a7..1658620d2e 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -11,11 +11,15 @@ 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.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; @@ -31,7 +35,7 @@ public class StructureUtility { } @Override - public boolean spawnHint(Object o, World world, int x, int y, int z) { + 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; } @@ -44,7 +48,7 @@ public class StructureUtility { } @Override - public boolean spawnHint(Object o, World world, int x, int y, int z) { + 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; } @@ -57,7 +61,7 @@ public class StructureUtility { } @Override - public boolean spawnHint(Object o, World world, int x, int y, int z) { + 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; } @@ -96,7 +100,7 @@ public class StructureUtility { } @Override - public boolean spawnHint(T t, World world, int x, int y, int z) { + 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; } @@ -122,7 +126,7 @@ public class StructureUtility { } @Override - public boolean spawnHint(T t, World world, int x, int y, int z) { + 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; } @@ -140,7 +144,7 @@ public class StructureUtility { } @Override - public boolean spawnHint(T t, World world, int x, int y, int z) { + 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; } @@ -160,7 +164,7 @@ public class StructureUtility { } @Override - public boolean spawnHint(T t, World world, int x, int y, int z) { + 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 true; } @@ -178,7 +182,7 @@ public class StructureUtility { } @Override - public boolean spawnHint(T t, World world, int x, int y, int z) { + 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; } @@ -199,13 +203,13 @@ public class StructureUtility { } @Override - public boolean placeBlock(T t, World world, int x, int y, int z) { + public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { world.setBlock(x,y,z,hintBlock,hintMeta,2); return true; } @Override - public boolean spawnHint(T t, World world, int x, int y, int z) { + 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; } @@ -231,13 +235,13 @@ public class StructureUtility { } @Override - public boolean placeBlock(T t, World world, int x, int y, int z) { + public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { world.setBlock(x,y,z,hintBlock,hintMeta,2); return true; } @Override - public boolean spawnHint(T t, World world, int x, int y, int z) { + 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; } @@ -255,13 +259,13 @@ public class StructureUtility { } @Override - public boolean placeBlock(T t, World world, int x, int y, int z) { + public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { world.setBlock(x,y,z,hintBlock,hintMeta,2); return true; } @Override - public boolean spawnHint(T t, World world, int x, int y, int z) { + 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; } @@ -283,19 +287,44 @@ public class StructureUtility { } @Override - public boolean placeBlock(T t, World world, int x, int y, int z) { + public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { world.setBlock(x,y,z,hintBlock,hintMeta,2); return true; } @Override - public boolean spawnHint(T t, World world, int x, int y, int z) { + 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 IStructureElement ofBlockAdder(IBlockAdder iBlockAdder,int dots){ + int meta=dots-1; + if(iBlockAdder==null ){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + return iBlockAdder.apply(t,world.getBlock(x, y, z), world.getBlockMetadata(x, y, z)); + } + + @Override + public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { + world.setBlock(x,y,z,sHintCasingsTT,meta,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,sHintCasingsTT,meta); + return true; + } + }; + } + public static IStructureElement ofTileAdder(ITileAdder iTileAdder, Block hintBlock, int hintMeta){ if(iTileAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); @@ -308,14 +337,14 @@ public class StructureUtility { } @Override - public boolean spawnHint(T t, World world, int x, int y, int z) { + 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 IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, Short textureIndex, int dots){ + public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, int dots){ int meta=dots-1; if(iHatchAdder==null){ throw new IllegalArgumentException(); @@ -324,18 +353,18 @@ public class StructureUtility { @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, textureIndex); + 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) { + 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 true; } }; } - public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, Short textureIndex, int dots, Block placeCasing,int placeCasingMeta){ + public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, int dots, Block placeCasing,int placeCasingMeta){ int meta=dots-1; if(iHatchAdder==null){ throw new IllegalArgumentException(); @@ -344,24 +373,24 @@ public class StructureUtility { @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, textureIndex); + 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) { + 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 true; } @Override - public boolean placeBlock(T t, World world, int x, int y, int z) { + 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; } }; } - public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, Short textureIndex, Block hintBlock, int hintMeta){ + public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, Block hintBlock, int hintMeta){ if(iHatchAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); } @@ -369,18 +398,18 @@ public class StructureUtility { @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, textureIndex); + 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) { + 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 IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, Short textureIndex, Block hintBlock, int hintMeta, Block placeCasing,int placeCasingMeta){ + public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, Block hintBlock, int hintMeta, Block placeCasing,int placeCasingMeta){ if(iHatchAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); } @@ -388,17 +417,17 @@ public class StructureUtility { @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, textureIndex); + 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) { + 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) { + 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; } @@ -417,13 +446,13 @@ public class StructureUtility { } @Override - public boolean placeBlock(T t, World world, int x, int y, int z) { - return element.placeBlock(t, world, x, y, z); + 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) { - return element.spawnHint(t, world, x, y, z); + public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + return element.spawnHint(t, world, x, y, z, trigger); } }; } @@ -440,13 +469,381 @@ public class StructureUtility { } @Override - public boolean placeBlock(T t, World world, int x, int y, int z) { - return element.placeBlock(t, world, x, y, z); + 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) { - return element.spawnHint(t, world, x, y, z); + public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + return element.spawnHint(t, world, x, y, z, trigger); + } + }; + } + + @SafeVarargs + public static IStructureFallback ofElementChain(IStructureElement... elementChain){ + if(elementChain==null || elementChain.length==0){ + throw new IllegalArgumentException(); + } + for (IStructureElement iStructureElement : elementChain) { + if(iStructureElement==null){ + throw new IllegalArgumentException(); + } + } + return () -> elementChain; + } + + public static IStructureElement defer(Supplier> to){ + if(to==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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 IStructureElement defer(Function> to){ + if(to==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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 IStructureElement defer(Function keyExtractor,Map> map){ + if(keyExtractor==null||map==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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 IStructureElement defer(Function keyExtractor,Map> map,IStructureElement defaultElem){ + if(keyExtractor==null||map==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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 IStructureElement defer(Function keyExtractor, IStructureElement... array){ + if(keyExtractor==null||array==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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); + } + }; + } + + public static IStructureElement defer(Function keyExtractor,List> array){ + if(keyExtractor==null||array==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + return array.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 array.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 array.get(keyExtractor.apply(t)).spawnHint(t, world, x, y, z, trigger); + } + }; + } + + public static IStructureElement defer(BiFunction> to){ + if(to==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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 IStructureElement defer(BiFunction keyExtractor,Map> map){ + if(keyExtractor==null||map==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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 IStructureElement defer(BiFunction keyExtractor,Map> map,IStructureElement defaultElem){ + if(keyExtractor==null||map==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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 IStructureElement defer(BiFunction keyExtractor, IStructureElement... array){ + if(keyExtractor==null||array==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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); + } + }; + } + + public static IStructureElement defer(BiFunction keyExtractor, List> array){ + if(keyExtractor==null||array==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + return array.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 array.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 array.get(keyExtractor.apply(t,trigger)).spawnHint(t, world, x, y, z, trigger); + } + }; + } + + public static IStructureElement defer(Function> toCheck, BiFunction> to){ + if(to==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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 IStructureElement defer(Function keyExtractorCheck,BiFunction keyExtractor,Map> map){ + if(keyExtractor==null||map==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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 IStructureElement defer(Function keyExtractorCheck,BiFunction keyExtractor,Map> map,IStructureElement defaultElem){ + if(keyExtractor==null||map==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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 IStructureElement defer(Function keyExtractorCheck,BiFunction keyExtractor, IStructureElement... array){ + if(keyExtractor==null||array==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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); + } + }; + } + + public static IStructureElement defer(Function keyExtractorCheck,BiFunction keyExtractor, List> array){ + if(keyExtractor==null||array==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + return array.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 array.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 array.get(keyExtractor.apply(t,trigger)).spawnHint(t, world, x, y, z, trigger); } }; } @@ -543,19 +940,6 @@ public class StructureUtility { }; } - @SafeVarargs - public static IStructureFallback ofElementChain(IStructureElement... elementChain){ - if(elementChain==null || elementChain.length==0){ - throw new IllegalArgumentException(); - } - for (IStructureElement iStructureElement : elementChain) { - if(iStructureElement==null){ - throw new IllegalArgumentException(); - } - } - return () -> elementChain; - } - /** * Use only to get pseudo code... * @param world diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index dea65d322f..924353cd29 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -11,8 +11,8 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElem import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition; import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dHadronDefinition; import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eQuarkDefinition; -import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder; -import com.github.technus.tectech.mechanics.structure.Structure; +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; @@ -28,8 +28,6 @@ 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.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -38,7 +36,7 @@ import net.minecraftforge.common.util.ForgeDirection; import java.util.HashMap; -import static com.github.technus.tectech.mechanics.structure.Structure.adders; +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; @@ -300,47 +298,49 @@ 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 String[][] shape = 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",}, - }; - private static final Block[] blockType = new Block[]{ - sBlockCasingsTT, - sBlockCasingsTT, - sBlockCasingsTT, - QuantumGlassBlock.INSTANCE, - sBlockCasingsTT, - sBlockCasingsTT - }; - private static final byte[] blockMeta1 = new byte[]{4, 7, 4, 0, 4, 8}; - private static final byte[] blockMeta2 = new byte[]{4, 7, 5, 0, 6, 9}; - private static final IHatchAdder[] addingMethods = adders( - GT_MetaTileEntity_EM_collider::addClassicToMachineList, - GT_MetaTileEntity_EM_collider::addElementalInputToMachineList, - GT_MetaTileEntity_EM_collider::addElementalOutputToMachineList, - GT_MetaTileEntity_EM_collider::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 IStructureDefinition STRUCTURE_DEFINITION= StructureDefinition + .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)->(item.stackSize%2)+1, + error(),ofBlock(sBlockCasingsTT,4),ofBlock(sBlockCasingsTT,5))) + .addElement('3', ofBlock(QuantumGlassBlock.INSTANCE,0)) + .addElement('4', defer(t->(int)t.eTier,(t,item)->(item.stackSize%2)+1, + error(),ofBlock(sBlockCasingsTT,4),ofBlock(sBlockCasingsTT,6))) + .addElement('5', defer(t->(int)t.eTier,(t,item)->(item.stackSize%2)+1, + error(),ofBlock(sBlockCasingsTT,8),ofBlock(sBlockCasingsTT,9))) + .addElement('&', ofHatchAdder(GT_MetaTileEntity_EM_collider::addClassicToMachineList, + textureOffset,1,sBlockCasingsTT,0)) + .addElement('!', ofHatchAdder(GT_MetaTileEntity_EM_collider::addElementalInputToMachineList, + textureOffset + 4,2,sBlockCasingsTT,4)) + .addElement('$', ofHatchAdder(GT_MetaTileEntity_EM_collider::addElementalOutputToMachineList, + textureOffset + 4,3,sBlockCasingsTT,4)) + .addElement('#', ofHatchAdder(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 @@ -349,6 +349,12 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB translateToLocal("gt.blockmachines.multimachine.em.collider.hint.3"),//4 - Elemental Overflow Hatches or Molecular Casing translateToLocal("gt.blockmachines.multimachine.em.collider.hint.4"),//General - Another Controller facing opposite direction }; + + @Override + public IStructureDefinition getStructure_EM() { + return STRUCTURE_DEFINITION; + } + //endregion public GT_MetaTileEntity_EM_collider(int aID, String aName, String aNameRegional) { @@ -470,20 +476,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB eTier = 0; return false; } - - boolean test; - switch (eTier) { - case 1: - test = structureCheck_EM(shape, blockType, blockMeta1, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 11, 1, 18); - break; - case 2: - test = structureCheck_EM(shape, blockType, blockMeta2, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 11, 1, 18); - break; - default: - eTier = 0; - return false; - } - if (test) { + if (structureCheck_EM("main",11, 1, 18)) { return true; } eTier = 0; @@ -681,16 +674,8 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12); - } else { - if (iGregTechTileEntity.getBlockOffset(xDir, 0, zDir).getMaterial() == Material.air) { - iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2); - } - } - if ((stackSize.stackSize & 1) == 1) { - Structure.builder(shape, blockType, blockMeta1, 11, 1, 18, iGregTechTileEntity, getExtendedFacing(), hintsOnly); - } else { - Structure.builder(shape, blockType, blockMeta2, 11, 1, 18, iGregTechTileEntity, getExtendedFacing(), hintsOnly); } + structureBuild_EM("main",11, 1, 18,hintsOnly, stackSize); } @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 2d7fc5b524..26a8af04ed 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 @@ -160,7 +160,7 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo @Override public void construct(ItemStack stackSize, boolean hintsOnly) { - structureBuild_EM("main", 1, 1, 0, hintsOnly); + structureBuild_EM("main", 1, 1, 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 dc9c6d39e5..3e53f63736 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 @@ -216,11 +216,11 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt horizontalOffset,verticalOffset,depthOffset,!mMachine); } - public final boolean structureBuild_EM(String piece,int horizontalOffset, int verticalOffset, int depthOffset,boolean hintsOnly) { + public final boolean structureBuild_EM(String piece,int horizontalOffset, int verticalOffset, int depthOffset,boolean hintsOnly,ItemStack trigger) { IGregTechTileEntity baseMetaTileEntity = getBaseMetaTileEntity(); - return getStructure_EM_Internal().buildOrHints(this,piece, baseMetaTileEntity.getWorld(),getExtendedFacing(), - baseMetaTileEntity.getXCoord(),baseMetaTileEntity.getYCoord(),baseMetaTileEntity.getZCoord(), - horizontalOffset,verticalOffset,depthOffset,hintsOnly); + return getStructure_EM_Internal().buildOrHints(this, trigger, piece, baseMetaTileEntity.getWorld(), + getExtendedFacing(), baseMetaTileEntity.getXCoord(), baseMetaTileEntity.getYCoord(), + baseMetaTileEntity.getZCoord(), horizontalOffset, verticalOffset, depthOffset, hintsOnly); } @Deprecated -- cgit From c6615bd442b41170c6ab46d948d832bc063f2b4a Mon Sep 17 00:00:00 2001 From: Tec Date: Tue, 28 Apr 2020 21:47:13 +0200 Subject: Add optional hatch adders --- .../mechanics/structure/StructureUtility.java | 55 ++++++++++++++++++++++ .../multi/GT_MetaTileEntity_EM_collider.java | 14 +++--- 2 files changed, 62 insertions(+), 7 deletions(-) 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 index 1658620d2e..467140cb2c 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -390,6 +390,34 @@ public class StructureUtility { }; } + public static IStructureElement ofHatchAdderOptional(IHatchAdder iHatchAdder, int textureIndex, int dots, Block placeCasing,int placeCasingMeta){ + int meta=dots-1; + if(iHatchAdder==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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) || + (world.getBlock(x,y,z)==placeCasing&&world.getBlockMetadata(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,sHintCasingsTT,meta); + 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; + } + }; + } + public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, Block hintBlock, int hintMeta){ if(iHatchAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); @@ -434,6 +462,33 @@ public class StructureUtility { }; } + public static IStructureElement ofHatchAdderOptional(IHatchAdder iHatchAdder, int textureIndex, Block hintBlock, int hintMeta, Block placeCasing,int placeCasingMeta){ + if(iHatchAdder==null ||hintBlock==null){ + throw new IllegalArgumentException(); + } + return new IStructureElement() { + @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) || + (world.getBlock(x,y,z)==placeCasing&&world.getBlockMetadata(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; + } + }; + } + public static IStructureElement onElementPass(Consumer onCheckPass, IStructureElement element){ return new IStructureElement() { @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index 924353cd29..2782e7924f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -325,20 +325,20 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB }) .addElement('0', ofBlock(sBlockCasingsTT,4)) .addElement('1', ofBlock(sBlockCasingsTT,7)) - .addElement('2', defer(t->(int)t.eTier,(t,item)->(item.stackSize%2)+1, + .addElement('2', defer(t->(int)t.eTier,(t,item)->(item.stackSize&1)+1, error(),ofBlock(sBlockCasingsTT,4),ofBlock(sBlockCasingsTT,5))) .addElement('3', ofBlock(QuantumGlassBlock.INSTANCE,0)) - .addElement('4', defer(t->(int)t.eTier,(t,item)->(item.stackSize%2)+1, + .addElement('4', defer(t->(int)t.eTier,(t,item)->(item.stackSize&1)+1, error(),ofBlock(sBlockCasingsTT,4),ofBlock(sBlockCasingsTT,6))) - .addElement('5', defer(t->(int)t.eTier,(t,item)->(item.stackSize%2)+1, + .addElement('5', defer(t->(int)t.eTier,(t,item)->(item.stackSize&1)+1, error(),ofBlock(sBlockCasingsTT,8),ofBlock(sBlockCasingsTT,9))) - .addElement('&', ofHatchAdder(GT_MetaTileEntity_EM_collider::addClassicToMachineList, + .addElement('&', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addClassicToMachineList, textureOffset,1,sBlockCasingsTT,0)) - .addElement('!', ofHatchAdder(GT_MetaTileEntity_EM_collider::addElementalInputToMachineList, + .addElement('!', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addElementalInputToMachineList, textureOffset + 4,2,sBlockCasingsTT,4)) - .addElement('$', ofHatchAdder(GT_MetaTileEntity_EM_collider::addElementalOutputToMachineList, + .addElement('$', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addElementalOutputToMachineList, textureOffset + 4,3,sBlockCasingsTT,4)) - .addElement('#', ofHatchAdder(GT_MetaTileEntity_EM_collider::addElementalMufflerToMachineList, + .addElement('#', ofHatchAdderOptional(GT_MetaTileEntity_EM_collider::addElementalMufflerToMachineList, textureOffset + 4,4,sBlockCasingsTT,4)) .build(); private static final String[] description = new String[]{ -- cgit From 15dbf1c823e31c437cde0b3e186f791b71ec3506 Mon Sep 17 00:00:00 2001 From: Tec Date: Wed, 29 Apr 2020 20:50:47 +0200 Subject: Cleanup struct util --- .../mechanics/structure/IStructureElement.java | 8 +- .../structure/IStructureElementChain.java | 41 +++ .../structure/IStructureElementCheckOnly.java | 16 + .../structure/IStructureElementDeferred.java | 7 + .../structure/IStructureElementNoPlacement.java | 11 + .../mechanics/structure/IStructureFallback.java | 41 --- .../mechanics/structure/StructureUtility.java | 374 ++++++++------------- .../multi/GT_MetaTileEntity_EM_transformer.java | 2 +- 8 files changed, 223 insertions(+), 277 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementChain.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementCheckOnly.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementDeferred.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementNoPlacement.java delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallback.java 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 index 7ed173fbfa..f946e71f91 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElement.java @@ -9,13 +9,9 @@ import net.minecraft.world.World; public interface IStructureElement { boolean check(T t,World world,int x,int y,int z); - default boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger){ - return false; - } + boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger); - default boolean placeBlock(T t,World world,int x,int y,int z, ItemStack trigger){ - return false; - } + boolean placeBlock(T t,World world,int x,int y,int z, ItemStack trigger); default int getStepA(){ return 1; 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 new file mode 100644 index 0000000000..f9593ee1c5 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementChain.java @@ -0,0 +1,41 @@ +package com.github.technus.tectech.mechanics.structure; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +/** + * Use StructureUtility to instantiate + */ +public interface IStructureElementChain extends IStructureElement { + IStructureElement[] fallbacks(); + + @Override + default boolean check(T t, World world, int x, int y, int z){ + for (IStructureElement 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 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 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 new file mode 100644 index 0000000000..ec15aea53b --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementCheckOnly.java @@ -0,0 +1,16 @@ +package com.github.technus.tectech.mechanics.structure; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public interface IStructureElementCheckOnly extends IStructureElement { + @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 new file mode 100644 index 0000000000..dbb74312a8 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementDeferred.java @@ -0,0 +1,7 @@ +package com.github.technus.tectech.mechanics.structure; + +/** + * Use StructureUtility to instantiate + */ +public interface IStructureElementDeferred extends IStructureElement { +} 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 new file mode 100644 index 0000000000..47e6060878 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureElementNoPlacement.java @@ -0,0 +1,11 @@ +package com.github.technus.tectech.mechanics.structure; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public interface IStructureElementNoPlacement extends IStructureElement { + @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/IStructureFallback.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallback.java deleted file mode 100644 index 1c55753d19..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureFallback.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 IStructureFallback extends IStructureElement { - IStructureElement[] fallbacks(); - - @Override - default boolean check(T t, World world, int x, int y, int z){ - for (IStructureElement 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 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 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/StructureUtility.java b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java index 467140cb2c..68c00cf1ac 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -39,6 +39,12 @@ public class StructureUtility { 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() { @@ -52,6 +58,12 @@ public class StructureUtility { 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() { @@ -65,6 +77,11 @@ public class StructureUtility { 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(){ @@ -81,19 +98,48 @@ public class StructureUtility { 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 + * @return + */ @SuppressWarnings("unchecked") public static IStructureElement error(){ return ERROR; } + /** + * Check always returns: true. + * @param dots + * @param + * @return + */ + public static IStructureElementNoPlacement ofHint(int dots){ + int meta=dots-1; + return new IStructureElementNoPlacement() { + @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; + } + }; + } + /** * Does not allow Block duplicates (with different meta) */ - public static IStructureElement ofBlocksFlatHint(Map blocsMap,Block hintBlock,int hintMeta){ + public static IStructureElementNoPlacement ofBlocksFlatHint(Map blocsMap, Block hintBlock, int hintMeta){ if(blocsMap==null || blocsMap.isEmpty() || hintBlock==null){ throw new IllegalArgumentException(); } - return new IStructureElement() { + return new IStructureElementNoPlacement() { @Override public boolean check(T t, World world, int x, int y, int z) { return blocsMap.getOrDefault(world.getBlock(x, y, z), -1) == world.getBlockMetadata(x, y, z); @@ -110,7 +156,7 @@ public class StructureUtility { /** * Allows block duplicates (with different meta) */ - public static IStructureElement ofBlocksMapHint(Map> blocsMap,Block hintBlock,int hintMeta){ + public static IStructureElementNoPlacement ofBlocksMapHint(Map> blocsMap, Block hintBlock, int hintMeta){ if(blocsMap==null || blocsMap.isEmpty() || hintBlock==null){ throw new IllegalArgumentException(); } @@ -119,7 +165,7 @@ public class StructureUtility { throw new IllegalArgumentException(); } } - return new IStructureElement() { + return new IStructureElementNoPlacement() { @Override public boolean check(T t, World world, int x, int y, int z) { return blocsMap.getOrDefault(world.getBlock(x, y, z), Collections.emptySet()).contains(world.getBlockMetadata(x, y, z)); @@ -133,11 +179,11 @@ public class StructureUtility { }; } - public static IStructureElement ofBlockHint(Block block, int meta,Block hintBlock,int hintMeta){ + public static IStructureElementNoPlacement ofBlockHint(Block block, int meta,Block hintBlock,int hintMeta){ if(block==null || hintBlock==null){ throw new IllegalArgumentException(); } - return new IStructureElement() { + return new IStructureElementNoPlacement() { @Override public boolean check(T t, World world, int x, int y, int z) { return block == world.getBlock(x, y, z) && meta == world.getBlockMetadata(x, y, z); @@ -151,31 +197,15 @@ public class StructureUtility { }; } - public static IStructureElement ofBlockHint(Block block, int meta){ + public static IStructureElementNoPlacement ofBlockHint(Block block, int meta){ return ofBlockHint(block, meta,block,meta); } - public static IStructureElement ofHint(int dots){ - int meta=dots-1; - return new IStructureElement() { - @Override - public boolean check(T t, World world, int x, int y, int z) { - return false; - } - - @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 true; - } - }; - } - - public static IStructureElement ofBlockAdderHint(IBlockAdder iBlockAdder, Block hintBlock, int hintMeta){ + public static IStructureElementNoPlacement ofBlockAdderHint(IBlockAdder iBlockAdder, Block hintBlock, int hintMeta){ if(iBlockAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); } - return new IStructureElement() { + return new IStructureElementNoPlacement() { @Override public boolean check(T t, World world, int x, int y, int z) { return iBlockAdder.apply(t,world.getBlock(x, y, z), world.getBlockMetadata(x, y, z)); @@ -192,8 +222,8 @@ public class StructureUtility { /** * Does not allow Block duplicates (with different meta) */ - public static IStructureElement ofBlocksFlat(Map blocsMap,Block hintBlock,int hintMeta){ - if(blocsMap==null || blocsMap.isEmpty() || hintBlock==null){ + public static IStructureElement ofBlocksFlat(Map blocsMap,Block defaultBlock,int defaultMeta){ + if(blocsMap==null || blocsMap.isEmpty() || defaultBlock==null){ throw new IllegalArgumentException(); } return new IStructureElement() { @@ -204,13 +234,13 @@ public class StructureUtility { @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - world.setBlock(x,y,z,hintBlock,hintMeta,2); + 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,hintBlock,hintMeta); + TecTech.proxy.hint_particle(world,x,y,z,defaultBlock,defaultMeta); return true; } }; @@ -219,8 +249,8 @@ public class StructureUtility { /** * Allows block duplicates (with different meta) */ - public static IStructureElement ofBlocskMap(Map> blocsMap,Block hintBlock,int hintMeta){ - if(blocsMap==null || blocsMap.isEmpty() || hintBlock==null){ + public static IStructureElement ofBlocksMap(Map> blocsMap, Block defaultBlock, int defaultMeta){ + if(blocsMap==null || blocsMap.isEmpty() || defaultBlock==null){ throw new IllegalArgumentException(); } for (Set value : blocsMap.values()) { @@ -236,20 +266,20 @@ public class StructureUtility { @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - world.setBlock(x,y,z,hintBlock,hintMeta,2); + 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,hintBlock,hintMeta); + TecTech.proxy.hint_particle(world,x,y,z,defaultBlock,defaultMeta); return true; } }; } - public static IStructureElement ofBlock(Block block, int meta,Block hintBlock,int hintMeta){ - if(block==null || hintBlock==null){ + public static IStructureElement ofBlock(Block block, int meta,Block defaultBlock,int defaultMeta){ + if(block==null || defaultBlock==null){ throw new IllegalArgumentException(); } return new IStructureElement() { @@ -260,13 +290,13 @@ public class StructureUtility { @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - world.setBlock(x,y,z,hintBlock,hintMeta,2); + 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,hintBlock,hintMeta); + TecTech.proxy.hint_particle(world,x,y,z,defaultBlock,defaultMeta); return true; } }; @@ -276,8 +306,8 @@ public class StructureUtility { return ofBlock(block, meta,block,meta); } - public static IStructureElement ofBlockAdder(IBlockAdder iBlockAdder,Block hintBlock,int hintMeta){ - if(iBlockAdder==null ||hintBlock==null){ + public static IStructureElement ofBlockAdder(IBlockAdder iBlockAdder,Block defaultBlock,int defaultMeta){ + if(iBlockAdder==null ||defaultBlock==null){ throw new IllegalArgumentException(); } return new IStructureElement() { @@ -288,48 +318,27 @@ public class StructureUtility { @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - world.setBlock(x,y,z,hintBlock,hintMeta,2); + 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,hintBlock,hintMeta); + TecTech.proxy.hint_particle(world,x,y,z,defaultBlock,defaultMeta); return true; } }; } public static IStructureElement ofBlockAdder(IBlockAdder iBlockAdder,int dots){ - int meta=dots-1; - if(iBlockAdder==null ){ - throw new IllegalArgumentException(); - } - return new IStructureElement() { - @Override - public boolean check(T t, World world, int x, int y, int z) { - return iBlockAdder.apply(t,world.getBlock(x, y, z), world.getBlockMetadata(x, y, z)); - } - - @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - world.setBlock(x,y,z,sHintCasingsTT,meta,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,sHintCasingsTT,meta); - return true; - } - }; + return ofBlockAdder(iBlockAdder,sHintCasingsTT,dots-1); } - public static IStructureElement ofTileAdder(ITileAdder iTileAdder, Block hintBlock, int hintMeta){ + public static IStructureElementNoPlacement ofTileAdder(ITileAdder iTileAdder, Block hintBlock, int hintMeta){ if(iTileAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); } - return new IStructureElement() { + return new IStructureElementNoPlacement() { @Override public boolean check(T t, World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(x, y, z); @@ -344,85 +353,15 @@ public class StructureUtility { }; } - public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, int dots){ - int meta=dots-1; - if(iHatchAdder==null){ - throw new IllegalArgumentException(); - } - return new IStructureElement() { - @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,sHintCasingsTT,meta); - return true; - } - }; + public static IStructureElementNoPlacement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, int dots){ + return ofHatchAdder(iHatchAdder, textureIndex,sHintCasingsTT, dots-1); } - public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, int dots, Block placeCasing,int placeCasingMeta){ - int meta=dots-1; - if(iHatchAdder==null){ - throw new IllegalArgumentException(); - } - return new IStructureElement() { - @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,sHintCasingsTT,meta); - 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; - } - }; - } - - public static IStructureElement ofHatchAdderOptional(IHatchAdder iHatchAdder, int textureIndex, int dots, Block placeCasing,int placeCasingMeta){ - int meta=dots-1; - if(iHatchAdder==null){ - throw new IllegalArgumentException(); - } - return new IStructureElement() { - @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) || - (world.getBlock(x,y,z)==placeCasing&&world.getBlockMetadata(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,sHintCasingsTT,meta); - 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; - } - }; - } - - public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, Block hintBlock, int hintMeta){ + public static IStructureElementNoPlacement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, Block hintBlock, int hintMeta){ if(iHatchAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); } - return new IStructureElement() { + return new IStructureElementNoPlacement() { @Override public boolean check(T t, World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(x, y, z); @@ -437,6 +376,10 @@ public class StructureUtility { }; } + public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, int dots, Block placeCasing,int placeCasingMeta){ + return ofHatchAdder(iHatchAdder, textureIndex,sHintCasingsTT, dots-1, placeCasing, placeCasingMeta); + } + public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, Block hintBlock, int hintMeta, Block placeCasing,int placeCasingMeta){ if(iHatchAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); @@ -462,6 +405,10 @@ public class StructureUtility { }; } + public static IStructureElement ofHatchAdderOptional(IHatchAdder iHatchAdder, int textureIndex, int dots, Block placeCasing,int placeCasingMeta){ + return ofHatchAdderOptional(iHatchAdder, textureIndex, sHintCasingsTT, dots-1, placeCasing, placeCasingMeta); + } + public static IStructureElement ofHatchAdderOptional(IHatchAdder iHatchAdder, int textureIndex, Block hintBlock, int hintMeta, Block placeCasing,int placeCasingMeta){ if(iHatchAdder==null ||hintBlock==null){ throw new IllegalArgumentException(); @@ -489,7 +436,7 @@ public class StructureUtility { }; } - public static IStructureElement onElementPass(Consumer onCheckPass, IStructureElement element){ + public static ,T> IStructureElement onElementPass(Consumer onCheckPass, B element){ return new IStructureElement() { @Override public boolean check(T t, World world, int x, int y, int z) { @@ -512,7 +459,7 @@ public class StructureUtility { }; } - public static IStructureElement onElementFail(Consumer onFail, IStructureElement element){ + public static ,T> IStructureElement onElementFail(Consumer onFail, B element){ return new IStructureElement() { @Override public boolean check(T t, World world, int x, int y, int z) { @@ -535,8 +482,16 @@ public class StructureUtility { }; } + + /** + * 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 + * @return + */ @SafeVarargs - public static IStructureFallback ofElementChain(IStructureElement... elementChain){ + public static IStructureElementChain ofChain(IStructureElement... elementChain){ if(elementChain==null || elementChain.length==0){ throw new IllegalArgumentException(); } @@ -548,11 +503,23 @@ public class StructureUtility { return () -> elementChain; } - public static IStructureElement defer(Supplier> to){ + /** + * 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 + * @return + */ + @SuppressWarnings("unchecked") + public static IStructureElementChain ofChain(List> elementChain){ + return ofChain(elementChain.toArray(new IStructureElement[0])); + } + + public static IStructureElementDeferred defer(Supplier> to){ if(to==null){ throw new IllegalArgumentException(); } - return new IStructureElement() { + return new IStructureElementDeferred() { @Override public boolean check(T t, World world, int x, int y, int z) { return to.get().check(t, world, x, y, z); @@ -570,11 +537,11 @@ public class StructureUtility { }; } - public static IStructureElement defer(Function> to){ + public static IStructureElementDeferred defer(Function> to){ if(to==null){ throw new IllegalArgumentException(); } - return new IStructureElement() { + return new IStructureElementDeferred() { @Override public boolean check(T t, World world, int x, int y, int z) { return to.apply(t).check(t, world, x, y, z); @@ -592,11 +559,11 @@ public class StructureUtility { }; } - public static IStructureElement defer(Function keyExtractor,Map> map){ + public static IStructureElementDeferred defer(Function keyExtractor,Map> map){ if(keyExtractor==null||map==null){ throw new IllegalArgumentException(); } - return new IStructureElement() { + return new IStructureElementDeferred() { @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); @@ -614,11 +581,11 @@ public class StructureUtility { }; } - public static IStructureElement defer(Function keyExtractor,Map> map,IStructureElement defaultElem){ + public static IStructureElementDeferred defer(Function keyExtractor,Map> map,IStructureElement defaultElem){ if(keyExtractor==null||map==null){ throw new IllegalArgumentException(); } - return new IStructureElement() { + return new IStructureElementDeferred() { @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); @@ -637,11 +604,11 @@ public class StructureUtility { } @SafeVarargs - public static IStructureElement defer(Function keyExtractor, IStructureElement... array){ + public static IStructureElementDeferred defer(Function keyExtractor, IStructureElement... array){ if(keyExtractor==null||array==null){ throw new IllegalArgumentException(); } - return new IStructureElement() { + return new IStructureElementDeferred() { @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); @@ -659,33 +626,16 @@ public class StructureUtility { }; } - public static IStructureElement defer(Function keyExtractor,List> array){ - if(keyExtractor==null||array==null){ - throw new IllegalArgumentException(); - } - return new IStructureElement() { - @Override - public boolean check(T t, World world, int x, int y, int z) { - return array.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 array.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 array.get(keyExtractor.apply(t)).spawnHint(t, world, x, y, z, trigger); - } - }; + @SuppressWarnings("unchecked") + public static IStructureElementDeferred defer(Function keyExtractor,List> array){ + return defer(keyExtractor, array.toArray(new IStructureElement[0])); } - public static IStructureElement defer(BiFunction> to){ + public static IStructureElementDeferred defer(BiFunction> to){ if(to==null){ throw new IllegalArgumentException(); } - return new IStructureElement() { + return new IStructureElementDeferred() { @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); @@ -703,11 +653,11 @@ public class StructureUtility { }; } - public static IStructureElement defer(BiFunction keyExtractor,Map> map){ + public static IStructureElementDeferred defer(BiFunction keyExtractor,Map> map){ if(keyExtractor==null||map==null){ throw new IllegalArgumentException(); } - return new IStructureElement() { + return new IStructureElementDeferred() { @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); @@ -725,11 +675,11 @@ public class StructureUtility { }; } - public static IStructureElement defer(BiFunction keyExtractor,Map> map,IStructureElement defaultElem){ + public static IStructureElementDeferred defer(BiFunction keyExtractor,Map> map,IStructureElement defaultElem){ if(keyExtractor==null||map==null){ throw new IllegalArgumentException(); } - return new IStructureElement() { + return new IStructureElementDeferred() { @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); @@ -748,11 +698,11 @@ public class StructureUtility { } @SafeVarargs - public static IStructureElement defer(BiFunction keyExtractor, IStructureElement... array){ + public static IStructureElementDeferred defer(BiFunction keyExtractor, IStructureElement... array){ if(keyExtractor==null||array==null){ throw new IllegalArgumentException(); } - return new IStructureElement() { + return new IStructureElementDeferred() { @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); @@ -770,33 +720,16 @@ public class StructureUtility { }; } - public static IStructureElement defer(BiFunction keyExtractor, List> array){ - if(keyExtractor==null||array==null){ - throw new IllegalArgumentException(); - } - return new IStructureElement() { - @Override - public boolean check(T t, World world, int x, int y, int z) { - return array.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 array.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 array.get(keyExtractor.apply(t,trigger)).spawnHint(t, world, x, y, z, trigger); - } - }; + @SuppressWarnings("unchecked") + public static IStructureElementDeferred defer(BiFunction keyExtractor, List> array){ + return defer(keyExtractor, array.toArray(new IStructureElement[0])); } - public static IStructureElement defer(Function> toCheck, BiFunction> to){ + public static IStructureElementDeferred defer(Function> toCheck, BiFunction> to){ if(to==null){ throw new IllegalArgumentException(); } - return new IStructureElement() { + return new IStructureElementDeferred() { @Override public boolean check(T t, World world, int x, int y, int z) { return toCheck.apply(t).check(t, world, x, y, z); @@ -814,11 +747,11 @@ public class StructureUtility { }; } - public static IStructureElement defer(Function keyExtractorCheck,BiFunction keyExtractor,Map> map){ + public static IStructureElementDeferred defer(Function keyExtractorCheck,BiFunction keyExtractor,Map> map){ if(keyExtractor==null||map==null){ throw new IllegalArgumentException(); } - return new IStructureElement() { + return new IStructureElementDeferred() { @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); @@ -836,11 +769,11 @@ public class StructureUtility { }; } - public static IStructureElement defer(Function keyExtractorCheck,BiFunction keyExtractor,Map> map,IStructureElement defaultElem){ + public static IStructureElementDeferred defer(Function keyExtractorCheck,BiFunction keyExtractor,Map> map,IStructureElement defaultElem){ if(keyExtractor==null||map==null){ throw new IllegalArgumentException(); } - return new IStructureElement() { + return new IStructureElementDeferred() { @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); @@ -859,11 +792,11 @@ public class StructureUtility { } @SafeVarargs - public static IStructureElement defer(Function keyExtractorCheck,BiFunction keyExtractor, IStructureElement... array){ + public static IStructureElementDeferred defer(Function keyExtractorCheck,BiFunction keyExtractor, IStructureElement... array){ if(keyExtractor==null||array==null){ throw new IllegalArgumentException(); } - return new IStructureElement() { + return new IStructureElementDeferred() { @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); @@ -881,26 +814,9 @@ public class StructureUtility { }; } - public static IStructureElement defer(Function keyExtractorCheck,BiFunction keyExtractor, List> array){ - if(keyExtractor==null||array==null){ - throw new IllegalArgumentException(); - } - return new IStructureElement() { - @Override - public boolean check(T t, World world, int x, int y, int z) { - return array.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 array.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 array.get(keyExtractor.apply(t,trigger)).spawnHint(t, world, x, y, z, trigger); - } - }; + @SuppressWarnings("unchecked") + public static IStructureElementDeferred defer(Function keyExtractorCheck,BiFunction keyExtractor, List> array){ + return defer(keyExtractorCheck, keyExtractor, array.toArray(new IStructureElement[0])); } public static IStructureNavigate step(int a,int b, int c){ @@ -996,7 +912,7 @@ public class StructureUtility { } /** - * Use only to get pseudo code... + * Used only to get pseudo code in structure writer... * @param world * @return */ 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 26a8af04ed..bfd74ab448 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 @@ -45,7 +45,7 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo {"111", "111", "111",}, }) .addElement('0', ofBlock(sBlockCasings1,15)) - .addElement('1', ofElementChain( + .addElement('1', ofChain( ofHatchAdder(GT_MetaTileEntity_EM_transformer::addEnergyIOToMachineList,textureOffset,sHintCasingsTT,0), onElementPass(t->t.casingCount++,ofBlock(sBlockCasingsTT,0)) )) -- cgit From 9099a93e902cd29f5312f4691e00be91c2dbe554 Mon Sep 17 00:00:00 2001 From: Tec Date: Wed, 29 Apr 2020 20:57:41 +0200 Subject: Remove pointless methods --- .../mechanics/structure/StructureUtility.java | 29 ---------------------- 1 file changed, 29 deletions(-) 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 index 68c00cf1ac..1f8beaa240 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -376,35 +376,6 @@ public class StructureUtility { }; } - public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, int dots, Block placeCasing,int placeCasingMeta){ - return ofHatchAdder(iHatchAdder, textureIndex,sHintCasingsTT, dots-1, placeCasing, placeCasingMeta); - } - - public static IStructureElement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, Block hintBlock, int hintMeta, Block placeCasing,int placeCasingMeta){ - if(iHatchAdder==null ||hintBlock==null){ - throw new IllegalArgumentException(); - } - return new IStructureElement() { - @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; - } - - @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; - } - }; - } - public static IStructureElement ofHatchAdderOptional(IHatchAdder iHatchAdder, int textureIndex, int dots, Block placeCasing,int placeCasingMeta){ return ofHatchAdderOptional(iHatchAdder, textureIndex, sHintCasingsTT, dots-1, placeCasing, placeCasingMeta); } -- cgit From 31f7fc89f41e430494bb6e03415f58049f85da51 Mon Sep 17 00:00:00 2001 From: Tec Date: Fri, 1 May 2020 10:47:04 +0200 Subject: Fix navigation, move handles to util --- .../mechanics/alignment/AlignmentUtility.java | 45 ++ .../constructable/ConstructableUtility.java | 114 +++++ .../mechanics/structure/IStructureDefinition.java | 5 +- .../mechanics/structure/StructureDefinition.java | 38 +- .../mechanics/structure/StructureUtility.java | 481 ++++++++++++--------- .../thing/item/ConstructableTriggerItem.java | 104 +---- .../technus/tectech/thing/item/EuMeterGT.java | 2 +- .../thing/item/FrontRotationTriggerItem.java | 36 +- 8 files changed, 468 insertions(+), 357 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentUtility.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/constructable/ConstructableUtility.java 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 new file mode 100644 index 0000000000..68e11b77af --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/alignment/AlignmentUtility.java @@ -0,0 +1,45 @@ +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/constructable/ConstructableUtility.java b/src/main/java/com/github/technus/tectech/mechanics/constructable/ConstructableUtility.java new file mode 100644 index 0000000000..2dc74330f9 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/constructable/ConstructableUtility.java @@ -0,0 +1,114 @@ +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 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 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 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 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/structure/IStructureDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java index 71305ebd92..542d13a7cd 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java @@ -115,9 +115,8 @@ public interface IStructureDefinition { xyz[1] += basePositionY; xyz[2] += basePositionZ; - if (world.blockExists(xyz[0], xyz[1], xyz[2])) { - element.spawnHint(object, world, xyz[0], xyz[1], xyz[2], trigger); - } + element.spawnHint(object, world, xyz[0], xyz[1], xyz[2], trigger); + abc[0]+=1; } } 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 index 9cc82699b9..29114647ac 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java @@ -1,5 +1,6 @@ package com.github.technus.tectech.mechanics.structure; +import com.github.technus.tectech.TecTech; import com.github.technus.tectech.util.Vec3Impl; import java.util.*; @@ -29,7 +30,7 @@ public class StructureDefinition implements IStructureDefinition { private static final char A='\uA000'; private static final char B='\uB000'; private static final char C='\uC000'; - private static final char D='\uD000'; + private char d ='\uD000'; private final Map navigates; private final Map> elements; private final Map shapes; @@ -61,8 +62,12 @@ public class StructureDefinition implements IStructureDefinition { 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<' '){ @@ -77,16 +82,29 @@ public class StructureDefinition implements IStructureDefinition { builder.append(ch); } } + + builder.append(B); } builder.setLength(builder.length() - 1); } + + builder.append(C); } builder.setLength(builder.length() - 1); } + if(DEBUG_MODE){ + Exception exception = new Exception(); + exception.getStackTrace(); + + TecTech.LOGGER.info("Structure shape normal:"); + + + TecTech.LOGGER.info("Structure shape transposed:"); + + } int a=0,b=0,c=0; - char d=D; for (int i = 0; i < builder.length(); i++) { char ch = builder.charAt(i); if(ch =='.'){ @@ -106,7 +124,7 @@ public class StructureDefinition implements IStructureDefinition { Vec3Impl vec3 = new Vec3Impl(a, b, c); Character navigate = navigates.get(vec3); if(navigate==null){ - navigate=d++; + navigate= d++; navigates.put(vec3,navigate); addElement(navigate,step(vec3)); } @@ -137,8 +155,8 @@ public class StructureDefinition implements IStructureDefinition { * rest needs to be defined * * next char is next block(a) - * next string is next line(a,b) - * next string[] is next slice(a,b,c) + * 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 @@ -160,7 +178,6 @@ public class StructureDefinition implements IStructureDefinition { builder.setLength(builder.length() - 1); } int a=0,b=0,c=0; - char d=D; for (int i = 0; i < builder.length(); i++) { char ch = builder.charAt(i); if(ch ==' ' || ch =='.'){ @@ -188,7 +205,6 @@ public class StructureDefinition implements IStructureDefinition { a=0; b=0; c=0; - d++; } } @@ -220,14 +236,14 @@ public class StructureDefinition implements IStructureDefinition { @SuppressWarnings("unchecked") private Map[]> compileElementSetMap() { - Set mising = new HashSet<>(); + Set missing = new HashSet<>(); shapes.values().stream().map(CharSequence::chars).forEach(intStream -> intStream.forEach(c -> { IStructureElement iStructureElement = elements.get((char) c); if (iStructureElement == null) { - mising.add(c); + missing.add(c); } })); - if (mising.isEmpty()) { + if (missing.isEmpty()) { Map[]> map = new HashMap<>(); shapes.forEach((key, value) -> { Set chars=new HashSet<>(); @@ -244,7 +260,7 @@ public class StructureDefinition implements IStructureDefinition { return map; } else { throw new RuntimeException("Missing Structure Element bindings for (chars as integers): " + - Arrays.toString(mising.toArray())); + Arrays.toString(missing.toArray())); } } 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 index 1f8beaa240..868bfec181 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -24,11 +24,11 @@ import java.util.function.Supplier; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sHintCasingsTT; public class StructureUtility { - private static final String NICE_CHARS ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`~!@#$%^&*()_=|[]{};:'<>,./?"; + private static final String NICE_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`~!@#$%^&*()_=|[]{};:'<>,./?"; @SuppressWarnings("rawtypes") - private static final Map STEP = new HashMap<>(); + private static final Map STEP = new HashMap<>(); @SuppressWarnings("rawtypes") - private static final IStructureElement AIR= new IStructureElement() { + 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; @@ -36,18 +36,18 @@ public class StructureUtility { @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); + 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); + world.setBlock(x, y, z, Blocks.air, 0, 2); return false; } }; @SuppressWarnings("rawtypes") - private static final IStructureElement NOT_AIR= new IStructureElement() { + 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; @@ -55,18 +55,18 @@ public class StructureUtility { @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); + 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); + world.setBlock(x, y, z, sHintCasingsTT, 14, 2); return true; } }; @SuppressWarnings("rawtypes") - private static final IStructureElement ERROR= new IStructureElement() { + private static final IStructureElement ERROR = new IStructureElement() { @Override public boolean check(Object t, World world, int x, int y, int z) { return false; @@ -74,7 +74,7 @@ public class StructureUtility { @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); + TecTech.proxy.hint_particle(world, x, y, z, sHintCasingsTT, 15); return true; } @@ -84,17 +84,17 @@ public class StructureUtility { } }; - private StructureUtility(){ + private StructureUtility() { } @SuppressWarnings("unchecked") - public static IStructureElement isAir(){ + public static IStructureElement isAir() { return AIR; } @SuppressWarnings("unchecked") - public static IStructureElement notAir(){ + public static IStructureElement notAir() { return NOT_AIR; } @@ -102,22 +102,24 @@ public class StructureUtility { * Check returns false. * Placement is always handled by this and does nothing. * Makes little to no use it in fallback chain. + * * @param * @return */ @SuppressWarnings("unchecked") - public static IStructureElement error(){ + public static IStructureElement error() { return ERROR; } /** * Check always returns: true. + * * @param dots * @param * @return */ - public static IStructureElementNoPlacement ofHint(int dots){ - int meta=dots-1; + public static IStructureElementNoPlacement ofHint(int dots) { + int meta = dots - 1; return new IStructureElementNoPlacement() { @Override public boolean check(T t, World world, int x, int y, int z) { @@ -135,8 +137,8 @@ public class StructureUtility { /** * Does not allow Block duplicates (with different meta) */ - public static IStructureElementNoPlacement ofBlocksFlatHint(Map blocsMap, Block hintBlock, int hintMeta){ - if(blocsMap==null || blocsMap.isEmpty() || hintBlock==null){ + public static IStructureElementNoPlacement ofBlocksFlatHint(Map blocsMap, Block hintBlock, int hintMeta) { + if (blocsMap == null || blocsMap.isEmpty() || hintBlock == null) { throw new IllegalArgumentException(); } return new IStructureElementNoPlacement() { @@ -147,7 +149,7 @@ public class StructureUtility { @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); + TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta); return true; } }; @@ -156,12 +158,12 @@ public class StructureUtility { /** * Allows block duplicates (with different meta) */ - public static IStructureElementNoPlacement ofBlocksMapHint(Map> blocsMap, Block hintBlock, int hintMeta){ - if(blocsMap==null || blocsMap.isEmpty() || hintBlock==null){ + public static IStructureElementNoPlacement ofBlocksMapHint(Map> blocsMap, Block hintBlock, int hintMeta) { + if (blocsMap == null || blocsMap.isEmpty() || hintBlock == null) { throw new IllegalArgumentException(); } for (Set value : blocsMap.values()) { - if(value.isEmpty()){ + if (value.isEmpty()) { throw new IllegalArgumentException(); } } @@ -173,14 +175,14 @@ public class StructureUtility { @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); + TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta); return true; } }; } - public static IStructureElementNoPlacement ofBlockHint(Block block, int meta,Block hintBlock,int hintMeta){ - if(block==null || hintBlock==null){ + public static IStructureElementNoPlacement ofBlockHint(Block block, int meta, Block hintBlock, int hintMeta) { + if (block == null || hintBlock == null) { throw new IllegalArgumentException(); } return new IStructureElementNoPlacement() { @@ -191,29 +193,29 @@ public class StructureUtility { @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); + TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta); return true; } }; } - public static IStructureElementNoPlacement ofBlockHint(Block block, int meta){ - return ofBlockHint(block, meta,block,meta); + public static IStructureElementNoPlacement ofBlockHint(Block block, int meta) { + return ofBlockHint(block, meta, block, meta); } - public static IStructureElementNoPlacement ofBlockAdderHint(IBlockAdder iBlockAdder, Block hintBlock, int hintMeta){ - if(iBlockAdder==null ||hintBlock==null){ + public static IStructureElementNoPlacement ofBlockAdderHint(IBlockAdder iBlockAdder, Block hintBlock, int hintMeta) { + if (iBlockAdder == null || hintBlock == null) { throw new IllegalArgumentException(); } return new IStructureElementNoPlacement() { @Override public boolean check(T t, World world, int x, int y, int z) { - return iBlockAdder.apply(t,world.getBlock(x, y, z), world.getBlockMetadata(x, y, z)); + return iBlockAdder.apply(t, world.getBlock(x, y, z), world.getBlockMetadata(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); + TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta); return true; } }; @@ -222,8 +224,8 @@ public class StructureUtility { /** * Does not allow Block duplicates (with different meta) */ - public static IStructureElement ofBlocksFlat(Map blocsMap,Block defaultBlock,int defaultMeta){ - if(blocsMap==null || blocsMap.isEmpty() || defaultBlock==null){ + public static IStructureElement ofBlocksFlat(Map blocsMap, Block defaultBlock, int defaultMeta) { + if (blocsMap == null || blocsMap.isEmpty() || defaultBlock == null) { throw new IllegalArgumentException(); } return new IStructureElement() { @@ -234,13 +236,13 @@ public class StructureUtility { @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - world.setBlock(x,y,z,defaultBlock,defaultMeta,2); + 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); + TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta); return true; } }; @@ -249,12 +251,12 @@ public class StructureUtility { /** * Allows block duplicates (with different meta) */ - public static IStructureElement ofBlocksMap(Map> blocsMap, Block defaultBlock, int defaultMeta){ - if(blocsMap==null || blocsMap.isEmpty() || defaultBlock==null){ + public static IStructureElement ofBlocksMap(Map> blocsMap, Block defaultBlock, int defaultMeta) { + if (blocsMap == null || blocsMap.isEmpty() || defaultBlock == null) { throw new IllegalArgumentException(); } for (Set value : blocsMap.values()) { - if(value.isEmpty()){ + if (value.isEmpty()) { throw new IllegalArgumentException(); } } @@ -266,20 +268,20 @@ public class StructureUtility { @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - world.setBlock(x,y,z,defaultBlock,defaultMeta,2); + 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); + TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta); return true; } }; } - public static IStructureElement ofBlock(Block block, int meta,Block defaultBlock,int defaultMeta){ - if(block==null || defaultBlock==null){ + public static IStructureElement ofBlock(Block block, int meta, Block defaultBlock, int defaultMeta) { + if (block == null || defaultBlock == null) { throw new IllegalArgumentException(); } return new IStructureElement() { @@ -290,98 +292,98 @@ public class StructureUtility { @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - world.setBlock(x,y,z,defaultBlock,defaultMeta,2); + 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); + TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta); return true; } }; } - public static IStructureElement ofBlock(Block block, int meta){ - return ofBlock(block, meta,block,meta); + public static IStructureElement ofBlock(Block block, int meta) { + return ofBlock(block, meta, block, meta); } - public static IStructureElement ofBlockAdder(IBlockAdder iBlockAdder,Block defaultBlock,int defaultMeta){ - if(iBlockAdder==null ||defaultBlock==null){ + public static IStructureElement ofBlockAdder(IBlockAdder iBlockAdder, Block defaultBlock, int defaultMeta) { + if (iBlockAdder == null || defaultBlock == null) { throw new IllegalArgumentException(); } return new IStructureElement() { @Override public boolean check(T t, World world, int x, int y, int z) { - return iBlockAdder.apply(t,world.getBlock(x, y, z), world.getBlockMetadata(x, y, z)); + return iBlockAdder.apply(t, world.getBlock(x, y, z), world.getBlockMetadata(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); + 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); + TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta); return true; } }; } - public static IStructureElement ofBlockAdder(IBlockAdder iBlockAdder,int dots){ - return ofBlockAdder(iBlockAdder,sHintCasingsTT,dots-1); + public static IStructureElement ofBlockAdder(IBlockAdder iBlockAdder, int dots) { + return ofBlockAdder(iBlockAdder, sHintCasingsTT, dots - 1); } - public static IStructureElementNoPlacement ofTileAdder(ITileAdder iTileAdder, Block hintBlock, int hintMeta){ - if(iTileAdder==null ||hintBlock==null){ + public static IStructureElementNoPlacement ofTileAdder(ITileAdder iTileAdder, Block hintBlock, int hintMeta) { + if (iTileAdder == null || hintBlock == null) { throw new IllegalArgumentException(); } return new IStructureElementNoPlacement() { @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); + 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); + TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta); return true; } }; } - public static IStructureElementNoPlacement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, int dots){ - return ofHatchAdder(iHatchAdder, textureIndex,sHintCasingsTT, dots-1); + public static IStructureElementNoPlacement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, int dots) { + return ofHatchAdder(iHatchAdder, textureIndex, sHintCasingsTT, dots - 1); } - public static IStructureElementNoPlacement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, Block hintBlock, int hintMeta){ - if(iHatchAdder==null ||hintBlock==null){ + public static IStructureElementNoPlacement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, Block hintBlock, int hintMeta) { + if (iHatchAdder == null || hintBlock == null) { throw new IllegalArgumentException(); } return new IStructureElementNoPlacement() { @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); + 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); + TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta); return true; } }; } - public static IStructureElement ofHatchAdderOptional(IHatchAdder iHatchAdder, int textureIndex, int dots, Block placeCasing,int placeCasingMeta){ - return ofHatchAdderOptional(iHatchAdder, textureIndex, sHintCasingsTT, dots-1, placeCasing, placeCasingMeta); + public static IStructureElement ofHatchAdderOptional(IHatchAdder iHatchAdder, int textureIndex, int dots, Block placeCasing, int placeCasingMeta) { + return ofHatchAdderOptional(iHatchAdder, textureIndex, sHintCasingsTT, dots - 1, placeCasing, placeCasingMeta); } - public static IStructureElement ofHatchAdderOptional(IHatchAdder iHatchAdder, int textureIndex, Block hintBlock, int hintMeta, Block placeCasing,int placeCasingMeta){ - if(iHatchAdder==null ||hintBlock==null){ + public static IStructureElement ofHatchAdderOptional(IHatchAdder iHatchAdder, int textureIndex, Block hintBlock, int hintMeta, Block placeCasing, int placeCasingMeta) { + if (iHatchAdder == null || hintBlock == null) { throw new IllegalArgumentException(); } return new IStructureElement() { @@ -389,30 +391,30 @@ public class StructureUtility { 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) || - (world.getBlock(x,y,z)==placeCasing&&world.getBlockMetadata(x,y,z)==placeCasingMeta)); + (iHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) textureIndex) || + (world.getBlock(x, y, z) == placeCasing && world.getBlockMetadata(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); + 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); + world.setBlock(x, y, z, placeCasing, placeCasingMeta, 2); return true; } }; } - public static ,T> IStructureElement onElementPass(Consumer onCheckPass, B element){ + public static , T> IStructureElement onElementPass(Consumer onCheckPass, B element) { return new IStructureElement() { @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){ + if (check) { onCheckPass.accept(t); } return check; @@ -430,12 +432,12 @@ public class StructureUtility { }; } - public static ,T> IStructureElement onElementFail(Consumer onFail, B element){ + public static , T> IStructureElement onElementFail(Consumer onFail, B element) { return new IStructureElement() { @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){ + if (!check) { onFail.accept(t); } return check; @@ -457,17 +459,18 @@ public class StructureUtility { /** * 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 * @return */ @SafeVarargs - public static IStructureElementChain ofChain(IStructureElement... elementChain){ - if(elementChain==null || elementChain.length==0){ + public static IStructureElementChain ofChain(IStructureElement... elementChain) { + if (elementChain == null || elementChain.length == 0) { throw new IllegalArgumentException(); } for (IStructureElement iStructureElement : elementChain) { - if(iStructureElement==null){ + if (iStructureElement == null) { throw new IllegalArgumentException(); } } @@ -477,17 +480,18 @@ public class StructureUtility { /** * 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 * @return */ @SuppressWarnings("unchecked") - public static IStructureElementChain ofChain(List> elementChain){ + public static IStructureElementChain ofChain(List> elementChain) { return ofChain(elementChain.toArray(new IStructureElement[0])); } - public static IStructureElementDeferred defer(Supplier> to){ - if(to==null){ + public static IStructureElementDeferred defer(Supplier> to) { + if (to == null) { throw new IllegalArgumentException(); } return new IStructureElementDeferred() { @@ -508,8 +512,8 @@ public class StructureUtility { }; } - public static IStructureElementDeferred defer(Function> to){ - if(to==null){ + public static IStructureElementDeferred defer(Function> to) { + if (to == null) { throw new IllegalArgumentException(); } return new IStructureElementDeferred() { @@ -530,8 +534,8 @@ public class StructureUtility { }; } - public static IStructureElementDeferred defer(Function keyExtractor,Map> map){ - if(keyExtractor==null||map==null){ + public static IStructureElementDeferred defer(Function keyExtractor, Map> map) { + if (keyExtractor == null || map == null) { throw new IllegalArgumentException(); } return new IStructureElementDeferred() { @@ -552,31 +556,31 @@ public class StructureUtility { }; } - public static IStructureElementDeferred defer(Function keyExtractor,Map> map,IStructureElement defaultElem){ - if(keyExtractor==null||map==null){ + public static IStructureElementDeferred defer(Function keyExtractor, Map> map, IStructureElement defaultElem) { + if (keyExtractor == null || map == null) { throw new IllegalArgumentException(); } return new IStructureElementDeferred() { @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); + 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); + 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); + return map.getOrDefault(keyExtractor.apply(t), defaultElem).spawnHint(t, world, x, y, z, trigger); } }; } @SafeVarargs - public static IStructureElementDeferred defer(Function keyExtractor, IStructureElement... array){ - if(keyExtractor==null||array==null){ + public static IStructureElementDeferred defer(Function keyExtractor, IStructureElement... array) { + if (keyExtractor == null || array == null) { throw new IllegalArgumentException(); } return new IStructureElementDeferred() { @@ -598,106 +602,106 @@ public class StructureUtility { } @SuppressWarnings("unchecked") - public static IStructureElementDeferred defer(Function keyExtractor,List> array){ + public static IStructureElementDeferred defer(Function keyExtractor, List> array) { return defer(keyExtractor, array.toArray(new IStructureElement[0])); } - public static IStructureElementDeferred defer(BiFunction> to){ - if(to==null){ + public static IStructureElementDeferred defer(BiFunction> to) { + if (to == null) { throw new IllegalArgumentException(); } return new IStructureElementDeferred() { @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); + 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); + 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); + return to.apply(t, trigger).spawnHint(t, world, x, y, z, trigger); } }; } - public static IStructureElementDeferred defer(BiFunction keyExtractor,Map> map){ - if(keyExtractor==null||map==null){ + public static IStructureElementDeferred defer(BiFunction keyExtractor, Map> map) { + if (keyExtractor == null || map == null) { throw new IllegalArgumentException(); } return new IStructureElementDeferred() { @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); + 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); + 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); + return map.get(keyExtractor.apply(t, trigger)).spawnHint(t, world, x, y, z, trigger); } }; } - public static IStructureElementDeferred defer(BiFunction keyExtractor,Map> map,IStructureElement defaultElem){ - if(keyExtractor==null||map==null){ + public static IStructureElementDeferred defer(BiFunction keyExtractor, Map> map, IStructureElement defaultElem) { + if (keyExtractor == null || map == null) { throw new IllegalArgumentException(); } return new IStructureElementDeferred() { @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); + 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); + 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); + return map.getOrDefault(keyExtractor.apply(t, trigger), defaultElem).spawnHint(t, world, x, y, z, trigger); } }; } @SafeVarargs - public static IStructureElementDeferred defer(BiFunction keyExtractor, IStructureElement... array){ - if(keyExtractor==null||array==null){ + public static IStructureElementDeferred defer(BiFunction keyExtractor, IStructureElement... array) { + if (keyExtractor == null || array == null) { throw new IllegalArgumentException(); } return new IStructureElementDeferred() { @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); + 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); + 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); + return array[keyExtractor.apply(t, trigger)].spawnHint(t, world, x, y, z, trigger); } }; } @SuppressWarnings("unchecked") - public static IStructureElementDeferred defer(BiFunction keyExtractor, List> array){ + public static IStructureElementDeferred defer(BiFunction keyExtractor, List> array) { return defer(keyExtractor, array.toArray(new IStructureElement[0])); } - public static IStructureElementDeferred defer(Function> toCheck, BiFunction> to){ - if(to==null){ + public static IStructureElementDeferred defer(Function> toCheck, BiFunction> to) { + if (to == null) { throw new IllegalArgumentException(); } return new IStructureElementDeferred() { @@ -708,18 +712,18 @@ public class StructureUtility { @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); + 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); + return to.apply(t, trigger).spawnHint(t, world, x, y, z, trigger); } }; } - public static IStructureElementDeferred defer(Function keyExtractorCheck,BiFunction keyExtractor,Map> map){ - if(keyExtractor==null||map==null){ + public static IStructureElementDeferred defer(Function keyExtractorCheck, BiFunction keyExtractor, Map> map) { + if (keyExtractor == null || map == null) { throw new IllegalArgumentException(); } return new IStructureElementDeferred() { @@ -730,41 +734,41 @@ public class StructureUtility { @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); + 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); + return map.get(keyExtractor.apply(t, trigger)).spawnHint(t, world, x, y, z, trigger); } }; } - public static IStructureElementDeferred defer(Function keyExtractorCheck,BiFunction keyExtractor,Map> map,IStructureElement defaultElem){ - if(keyExtractor==null||map==null){ + public static IStructureElementDeferred defer(Function keyExtractorCheck, BiFunction keyExtractor, Map> map, IStructureElement defaultElem) { + if (keyExtractor == null || map == null) { throw new IllegalArgumentException(); } return new IStructureElementDeferred() { @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); + 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); + 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); + return map.getOrDefault(keyExtractor.apply(t, trigger), defaultElem).spawnHint(t, world, x, y, z, trigger); } }; } @SafeVarargs - public static IStructureElementDeferred defer(Function keyExtractorCheck,BiFunction keyExtractor, IStructureElement... array){ - if(keyExtractor==null||array==null){ + public static IStructureElementDeferred defer(Function keyExtractorCheck, BiFunction keyExtractor, IStructureElement... array) { + if (keyExtractor == null || array == null) { throw new IllegalArgumentException(); } return new IStructureElementDeferred() { @@ -775,42 +779,42 @@ public class StructureUtility { @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); + 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); + return array[keyExtractor.apply(t, trigger)].spawnHint(t, world, x, y, z, trigger); } }; } @SuppressWarnings("unchecked") - public static IStructureElementDeferred defer(Function keyExtractorCheck,BiFunction keyExtractor, List> array){ + public static IStructureElementDeferred defer(Function keyExtractorCheck, BiFunction keyExtractor, List> array) { return defer(keyExtractorCheck, keyExtractor, array.toArray(new IStructureElement[0])); } - public static IStructureNavigate step(int a,int b, int c){ - return step(new Vec3Impl(a,b,c)); + public static IStructureNavigate step(int a, int b, int c) { + return step(new Vec3Impl(a, b, c)); } @SuppressWarnings("unchecked") - public static IStructureNavigate step(Vec3Impl step){ - if(step==null || step.get0()<0 || step.get1()<0 || step.get2()<0){ + public static IStructureNavigate 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){ + if (vec3.get2() > 0) { return stepC(vec3.get0(), vec3.get1(), vec3.get2()); - }else if(vec3.get1()>0){ + } else if (vec3.get1() > 0) { return stepB(vec3.get0(), vec3.get1(), vec3.get2()); - }else { + } else { return stepA(vec3.get0(), vec3.get1(), vec3.get2()); } }); } - private static IStructureNavigate stepA(int a,int b, int c){ + private static IStructureNavigate stepA(int a, int b, int c) { return new IStructureNavigate() { @Override public int getStepA() { @@ -829,7 +833,7 @@ public class StructureUtility { }; } - private static IStructureNavigate stepB(int a,int b, int c){ + private static IStructureNavigate stepB(int a, int b, int c) { return new IStructureNavigate() { @Override public int getStepA() { @@ -853,7 +857,7 @@ public class StructureUtility { }; } - private static IStructureNavigate stepC(int a,int b, int c){ + private static IStructureNavigate stepC(int a, int b, int c) { return new IStructureNavigate() { @Override public int getStepA() { @@ -884,13 +888,14 @@ public class StructureUtility { /** * 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) { + int sizeA, int sizeB, int sizeC, boolean transpose) { Map> blocks = new TreeMap<>(Comparator.comparing(Block::getUnlocalizedName)); Set> tiles = new TreeSet<>(Comparator.comparing(Class::getCanonicalName)); Set> gtTiles = new TreeSet<>(Comparator.comparing(Class::getCanonicalName)); @@ -934,7 +939,7 @@ public class StructureUtility { Set set = entry.getValue(); for (Integer meta : set) { c = NICE_CHARS.charAt(i++); - if(i>NICE_CHARS.length()){ + if (i > NICE_CHARS.length()) { return "Too complicated for nice chars"; } map.put(block.getUnlocalizedName() + '\0' + meta, c); @@ -945,7 +950,7 @@ public class StructureUtility { builder.append("\nTiles:\n"); for (Class tile : tiles) { c = NICE_CHARS.charAt(i++); - if(i>NICE_CHARS.length()){ + if (i > NICE_CHARS.length()) { return "Too complicated for nice chars"; } map.put(tile.getCanonicalName(), c); @@ -955,7 +960,7 @@ public class StructureUtility { builder.append("\nMeta:\n"); for (Class gtTile : gtTiles) { c = NICE_CHARS.charAt(i++); - if(i>NICE_CHARS.length()){ + if (i > NICE_CHARS.length()) { return "Too complicated for nice chars"; } map.put(gtTile.getCanonicalName(), c); @@ -965,61 +970,97 @@ public class StructureUtility { } builder.append("\nOffsets:\n") .append(basePositionA).append(' ').append(basePositionB).append(' ').append(basePositionC).append('\n'); - builder.append("\nScan:\n") - .append("new String[][]{{\n") - .append(" \""); - - 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) { - builder.append(map.get(block.getUnlocalizedName() + '\0' + world.getBlockMetadata(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())); + 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' + world.getBlockMetadata(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' + world.getBlockMetadata(x, y, z))); + } else { + builder.append(' '); + } } else { - builder.append(map.get(tileEntity.getClass().getCanonicalName())); + 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")); + }), + () -> 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 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]++) { + 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); + iBlockPosConsumer.consume(world, xyz[0] + basePositionX, xyz[1] + basePositionY, xyz[2] + basePositionZ); } } @@ -1027,28 +1068,56 @@ public class StructureUtility { } 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, - Runnable nextB, - Runnable nextC){ - sizeA-=basePositionA; - sizeB-=basePositionB; - sizeC-=basePositionC; + 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]; - - 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); + 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(); } - 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]; } - nextC.run(); } + return shape; } } diff --git a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java index c24b35f8d5..752f2d1bcc 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java @@ -1,23 +1,13 @@ package com.github.technus.tectech.thing.item; -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.mechanics.alignment.IAlignment; -import com.github.technus.tectech.mechanics.alignment.enumerable.ExtendedFacing; -import com.github.technus.tectech.mechanics.constructable.IConstructable; -import com.github.technus.tectech.mechanics.constructable.IMultiblockInfoContainer; +import com.github.technus.tectech.mechanics.constructable.ConstructableUtility; import com.github.technus.tectech.util.CommonValues; import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; -import net.minecraftforge.common.util.FakePlayer; -import net.minecraftforge.common.util.ForgeDirection; import java.util.List; @@ -39,97 +29,7 @@ public final class ConstructableTriggerItem extends Item { @Override public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { - 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 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 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 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 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; + return ConstructableUtility.handle(aStack, aPlayer, aWorld, aX, aY, aZ, aSide); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/item/EuMeterGT.java b/src/main/java/com/github/technus/tectech/thing/item/EuMeterGT.java index 8e3d770da1..f4531a248b 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/EuMeterGT.java +++ b/src/main/java/com/github/technus/tectech/thing/item/EuMeterGT.java @@ -73,7 +73,7 @@ public class EuMeterGT extends Item { } } if (!(aPlayer instanceof EntityPlayerMP)) { - GT_Utility.doSoundAtClient(Reference.MODID + ":fx_scan", 1, 1.0F, (double) aX, (double) aY, (double) aZ); + GT_Utility.doSoundAtClient(Reference.MODID + ":fx_scan", 1, 1.0F, aX, aY, aZ); } return false; } diff --git a/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java index 5edc238a91..d71abb34b7 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java @@ -1,19 +1,13 @@ package com.github.technus.tectech.thing.item; -import com.github.technus.tectech.mechanics.alignment.IAlignment; -import com.github.technus.tectech.mechanics.alignment.IAlignmentProvider; +import com.github.technus.tectech.mechanics.alignment.AlignmentUtility; import com.github.technus.tectech.util.CommonValues; import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; -import net.minecraftforge.common.util.FakePlayer; import java.util.List; @@ -36,33 +30,7 @@ public final class FrontRotationTriggerItem extends Item { @Override public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { - 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; + return AlignmentUtility.handle(aPlayer,aWorld,aX,aY,aZ); } @Override -- cgit From ec623a00822141f002149f5f9453295288967119 Mon Sep 17 00:00:00 2001 From: Tec Date: Fri, 1 May 2020 10:47:43 +0200 Subject: Update struct writer --- .../single/GT_MetaTileEntity_DebugStructureWriter.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 42f25ddfde..3b194c516b 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 @@ -119,13 +119,26 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti ExtendedFacing.of(ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing())), aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), numbers[0], numbers[1], numbers[2], - numbers[3], numbers[4], numbers[5]); + numbers[3], numbers[4], numbers[5],false); TecTech.LOGGER.info(pseudoJavaCode); result = pseudoJavaCode.split("\\n"); aBaseMetaTileEntity.disableWorking(); } } + @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())), + aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), + numbers[0], numbers[1], numbers[2], + numbers[3], numbers[4], numbers[5],true); + TecTech.LOGGER.info(pseudoJavaCode); + result = pseudoJavaCode.split("\\n"); + aBaseMetaTileEntity.disableWorking(); + } + @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) { -- cgit From ed992c9ce5077a4ccf56d554eaba73e038258d9e Mon Sep 17 00:00:00 2001 From: Tec Date: Fri, 1 May 2020 12:15:47 +0200 Subject: Tweak the api some more, fix bugs --- .../mechanics/structure/StructureDefinition.java | 33 +--- .../mechanics/structure/StructureUtility.java | 2 +- .../multi/GT_MetaTileEntity_EM_bhg.java | 194 +++++++++++---------- .../multi/GT_MetaTileEntity_EM_collider.java | 6 +- .../multi/GT_MetaTileEntity_EM_transformer.java | 2 +- 5 files changed, 109 insertions(+), 128 deletions(-) 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 index 29114647ac..9a1e94d98a 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureDefinition.java @@ -1,6 +1,5 @@ package com.github.technus.tectech.mechanics.structure; -import com.github.technus.tectech.TecTech; import com.github.technus.tectech.util.Vec3Impl; import java.util.*; @@ -62,55 +61,35 @@ public class StructureDefinition implements IStructureDefinition { 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 c = 0; c < ch; c++) { + for (int b = 0; b < ch; b++) { builder.append(B); } }else if(ch>'@'){ - for (int c = '@'; c < ch; c++) { + 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); } - if(DEBUG_MODE){ - Exception exception = new Exception(); - exception.getStackTrace(); - - TecTech.LOGGER.info("Structure shape normal:"); - - - TecTech.LOGGER.info("Structure shape transposed:"); - - } int a=0,b=0,c=0; for (int i = 0; i < builder.length(); i++) { char ch = builder.charAt(i); - if(ch =='.'){ - builder.setCharAt(i,A); - ch=A; - } if(ch==A){ a++; }else if(ch==B){ @@ -151,7 +130,7 @@ public class StructureDefinition implements IStructureDefinition { * 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...) + * ~ 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) @@ -180,7 +159,7 @@ public class StructureDefinition implements IStructureDefinition { int a=0,b=0,c=0; for (int i = 0; i < builder.length(); i++) { char ch = builder.charAt(i); - if(ch ==' ' || ch =='.'){ + if(ch ==' ' || ch =='~'){ builder.setCharAt(i,A); ch=A; } 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 index 868bfec181..8e2cedd6e2 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -24,7 +24,7 @@ import java.util.function.Supplier; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sHintCasingsTT; public class StructureUtility { - private static final String NICE_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`~!@#$%^&*()_=|[]{};:'<>,./?"; + private static final String NICE_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz=|!@#$%&()[]{};:<>/?_,.*^'`"; @SuppressWarnings("rawtypes") private static final Map STEP = new HashMap<>(); @SuppressWarnings("rawtypes") 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 63b45500ed..24fbb9e423 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,24 +1,24 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder; -import com.github.technus.tectech.mechanics.structure.Structure; -import com.github.technus.tectech.util.CommonValues; -import com.github.technus.tectech.thing.block.QuantumGlassBlock; 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 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.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; @@ -48,49 +48,95 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E //per dim disable thingies //region structure actual - private static final String[][] shape = 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",}, - }; - private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; - private static final byte[] blockMeta = new byte[]{12, 13, 14, 10, 11}; - private static final IHatchAdder[] addingMethods = adders( - GT_MetaTileEntity_EM_bhg::addClassicToMachineList, - GT_MetaTileEntity_EM_bhg::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 IStructureDefinition STRUCTURE_DEFINITION= StructureDefinition + .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)) + .build(); + + @Override + public IStructureDefinition getStructure_EM() { + return STRUCTURE_DEFINITION; + } + private static final String[] description = new String[]{ EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", translateToLocal("gt.blockmachines.multimachine.em.blackholegenerator.hint.0"),//1 - Classic Hatches or High Power Casing @@ -98,46 +144,6 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E }; //endregion - //region structure dank - glass sphere for the looks - private static final String[][] shape2 = new String[][]{ - {"\u000B", "M0000000", "L00 00", "L0 0", "L0 !!! 0", "L0 !.! 0", "L0 !!! 0", "L0 0", "L00 00", "M0000000",}, - {"\u0008", "O0A0", "M110A011", "L1110A0111", "K11110A01111", "J1111222221111", "J1112202022111", "I000020020020000", "M2222222", "I000020020020000", "J1112202022111", "J1111222221111", "K11110A01111", "L1110A0111", "M110A011", "O0A0",}, - {"\u0006", "O0A0", "M110A011", "K11110A01111", "J111C2C111", "I111D2D111", "I11B2222222B11", "H11B22E22B11", "H11B2B333B2B11", "G000B2A34443A2B000", "J222A34443A222", "G000B2A34443A2B000", "H11B2B333B2B11", "H11B22E22B11", "I11B2222222B11", "I111D2D111", "J111C2C111", "K11110A01111", "M110A011", "O0A0",}, - {"\u0005", "O0A0", "L1110A0111", "J111C2C111", "I11E2E11", "H11M11", "H1O1", "G11O11", "G1Q1", "G1Q1", "F00Q00", "H22M22", "F00Q00", "G1Q1", "G1Q1", "G11O11", "H1O1", "H11M11", "I11E2E11", "J111C2C111", "L1110A0111", "O0A0",}, - {"\u0004", "O0A0", "K11100000111", "I111D2D111", "H11F5F11", "G11G5G11", "G1Q1", "F11Q11", "F1S1", "F1S1", "F0S0", "E00S00", "F0255M5520", "E00S00", "F0S0", "F1S1", "F1S1", "F11Q11", "G1Q1", "G11G5G11", "H11F5F11", "I111D2D111", "K11100000111", "O0A0",}, - {"\u0003", "O0A0", "J111110A011111", "H111E2E111", "G11D3335333D11", "F11Q11", "F1S1", "E11S11", "E1U1", "E1U1", "E1A3Q3A1", "E1A3Q3A1", "D00A3Q3A00", "F25Q52", "D00A3Q3A00", "E1A3Q3A1", "E1A3Q3A1", "E1U1", "E1U1", "E11S11", "F1S1", "F11Q11", "G11D3335333D11", "H111E2E111", "J111110A011111", "O0A0",}, - {"\u0002", "O0A0", "K11100000111", "H111E2E111", "G11G5G11", "F1S1", "E11S11", "E1U1", "E1U1", "D1W1", "D1W1", "D1W1", "D0W0", "C00W00", "D025S520", "C00W00", "D0W0", "D1W1", "D1W1", "D1W1", "E1U1", "E1U1", "E11S11", "F1S1", "G11G5G11", "H111E2E111", "K11100000111", "O0A0",}, - {"\u0001", "O0A0", "L1110A0111", "I111D2D111", "G11D3335333D11", "F1S1", "E1U1", "E1U1", "D1W1", "D1W1", "D1W1", "C1Y1", "C1A3U3A1", "C1A3U3A1", "B00A3U3A00", "D25U52", "B00A3U3A00", "C1A3U3A1", "C1A3U3A1", "C1Y1", "D1W1", "D1W1", "D1W1", "E1U1", "E1U1", "F1S1", "G11D3335333D11", "I111D2D111", "L1110A0111", "O0A0",}, - {"\u0001", "M110A011", "J111C2C111", "H11F5F11", "F11Q11", "E11S11", "E1U1", "D1W1", "D1W1", "C1Y1", "C1Y1", "C1Y1", "B1[1", "B1[1", "B0[0", "C25W52", "B0[0", "B1[1", "B1[1", "C1Y1", "C1Y1", "C1Y1", "D1W1", "D1W1", "E1U1", "E11S11", "F11Q11", "H11F5F11", "J111C2C111", "M110A011",}, - {E, "O0A0", "K11110A01111", "I11E2E11", "G11G5G11", "F1S1", "E1U1", "D1W1", "D1W1", "C1Y1", "C1Y1", "B1[1", "B1[1", "B1[1", "B1[1", "A00[00", "C25W52", "A00[00", "B1[1", "B1[1", "B1[1", "B1[1", "C1Y1", "C1Y1", "D1W1", "D1W1", "E1U1", "F1S1", "G11G5G11", "I11E2E11", "K11110A01111", "O0A0",}, - {E, "M110A011", "J111C2C111", "H11M11", "G1Q1", "E11S11", "E1U1", "D1W1", "C1Y1", "C1Y1", "B1[1", "B1[1", "B1[1", "A1]1", "A1]1", "A0]0", "B2[2", "A0]0", "A1]1", "A1]1", "B1[1", "B1[1", "B1[1", "C1Y1", "C1Y1", "D1W1", "E1U1", "E11S11", "G1Q1", "H11M11", "J111C2C111", "M110A011",}, - {E, "L1110A0111", "I111D2D111", "H1O1", "F11Q11", "E1U1", "D1W1", "D1W1", "C1Y1", "B1[1", "B1[1", "B1[1", "A1]1", "A1]1", "A1]1", "A0]0", "B2[2", "A0]0", "A1]1", "A1]1", "A1]1", "B1[1", "B1[1", "B1[1", "C1Y1", "D1W1", "D1W1", "E1U1", "F11Q11", "H1O1", "I111D2D111", "L1110A0111",}, - {"O0A0", "K11110A01111", "I11B2222222B11", "G11O11", "F1S1", "E1U1", "D1W1", "C1Y1", "C1Y1", "B1[1", "B1[1", "A1]1", "A1]1", "A12[21", "A12[21", "002[200", "B2[2", "002[200", "A12[21", "A12[21", "A1]1", "A1]1", "B1[1", "B1[1", "C1Y1", "C1Y1", "D1W1", "E1U1", "F1S1", "G11O11", "I11B2222222B11", "K11110A01111", "O0A0",}, - {"O0A0", "J1111222221111", "H11B22E22B11", "G1Q1", "F1S1", "E1A3Q3A1", "D1W1", "C1A3U3A1", "B1[1", "B1[1", "A1]1", "A1]1", "A12[21", "A12[21", "A2]2", "02]20", "A2]2", "02]20", "A2]2", "A12[21", "A12[21", "A1]1", "A1]1", "B1[1", "B1[1", "C1A3U3A1", "D1W1", "E1A3Q3A1", "F1S1", "G1Q1", "H11B22E22B11", "J1111222221111", "O0A0",}, - {"O0A0", "J1112202022111", "H11B2B333B2B11", "G1Q1", "F0S0", "E1A3Q3A1", "D0W0", "C1A3U3A1", "B1[1", "B1[1", "A1]1", "A1]1", "A12[21", "A2]2", "A2]2", "003[300", "A23[32", "003[300", "A2]2", "A2]2", "A12[21", "A1]1", "A1]1", "B1[1", "B1[1", "C1A3U3A1", "D0W0", "E1A3Q3A1", "F0S0", "G1Q1", "H11B2B333B2B11", "J1112202022111", "O0A0",}, - {"L000000000", "I000020020020000", "G000B2A34443A2B000", "F00Q00", "E00S00", "D00A3Q3A00", "C00W00", "B00A3U3A00", "B0[0", "A00[00", "A0]0", "A0]0", "002[200", "02]20", "003[300", "004[400", "024[420", "004[400", "003[300", "02]20", "002[200", "A0]0", "A0]0", "A00[00", "B0[0", "B00A3U3A00", "C00W00", "D00A3Q3A00", "E00S00", "F00Q00", "G000B2A34443A2B000", "I000020020020000", "L000000000",}, - {"O0A0", "M2222222", "J222A34443A222", "H22M22", "F0255M5520", "F25Q52", "D025S520", "D25U52", "C25W52", "C25W52", "B2[2", "B2[2", "B2[2", "A2]2", "A23[32", "024[420", "A24[42", "024[420", "A23[32", "A2]2", "B2[2", "B2[2", "B2[2", "C25W52", "C25W52", "D25U52", "D025S520", "F25Q52", "F0255M5520", "H22M22", "J222A34443A222", "M2222222", "O0A0",}, - {"L000000000", "I000020020020000", "G000B2A34443A2B000", "F00Q00", "E00S00", "D00A3Q3A00", "C00W00", "B00A3U3A00", "B0[0", "A00[00", "A0]0", "A0]0", "002[200", "02]20", "003[300", "004[400", "024[420", "004[400", "003[300", "02]20", "002[200", "A0]0", "A0]0", "A00[00", "B0[0", "B00A3U3A00", "C00W00", "D00A3Q3A00", "E00S00", "F00Q00", "G000B2A34443A2B000", "I000020020020000", "L000000000",}, - {"O0A0", "J1112202022111", "H11B2B333B2B11", "G1Q1", "F0S0", "E1A3Q3A1", "D0W0", "C1A3U3A1", "B1[1", "B1[1", "A1]1", "A1]1", "A12[21", "A2]2", "A2]2", "003[300", "A23[32", "003[300", "A2]2", "A2]2", "A12[21", "A1]1", "A1]1", "B1[1", "B1[1", "C1A3U3A1", "D0W0", "E1A3Q3A1", "F0S0", "G1Q1", "H11B2B333B2B11", "J1112202022111", "O0A0",}, - {"O0A0", "J1111222221111", "H11B22E22B11", "G1Q1", "F1S1", "E1A3Q3A1", "D1W1", "C1A3U3A1", "B1[1", "B1[1", "A1]1", "A1]1", "A12[21", "A12[21", "A2]2", "02]20", "A2]2", "02]20", "A2]2", "A12[21", "A12[21", "A1]1", "A1]1", "B1[1", "B1[1", "C1A3U3A1", "D1W1", "E1A3Q3A1", "F1S1", "G1Q1", "H11B22E22B11", "J1111222221111", "O0A0",}, - {"O0A0", "K11110A01111", "I11B2222222B11", "G11O11", "F1S1", "E1U1", "D1W1", "C1Y1", "C1Y1", "B1[1", "B1[1", "A1]1", "A1]1", "A12[21", "A12[21", "002[200", "B2[2", "002[200", "A12[21", "A12[21", "A1]1", "A1]1", "B1[1", "B1[1", "C1Y1", "C1Y1", "D1W1", "E1U1", "F1S1", "G11O11", "I11B2222222B11", "K11110A01111", "O0A0",}, - {E, "L1110A0111", "I111D2D111", "H1O1", "F11Q11", "E1U1", "D1W1", "D1W1", "C1Y1", "B1[1", "B1[1", "B1[1", "A1]1", "A1]1", "A1]1", "A0]0", "B2[2", "A0]0", "A1]1", "A1]1", "A1]1", "B1[1", "B1[1", "B1[1", "C1Y1", "D1W1", "D1W1", "E1U1", "F11Q11", "H1O1", "I111D2D111", "L1110A0111",}, - {E, "M110A011", "J111C2C111", "H11M11", "G1Q1", "E11S11", "E1U1", "D1W1", "C1Y1", "C1Y1", "B1[1", "B1[1", "B1[1", "A1]1", "A1]1", "A0]0", "B2[2", "A0]0", "A1]1", "A1]1", "B1[1", "B1[1", "B1[1", "C1Y1", "C1Y1", "D1W1", "E1U1", "E11S11", "G1Q1", "H11M11", "J111C2C111", "M110A011",}, - {E, "O0A0", "K11110A01111", "I11E2E11", "G11G5G11", "F1S1", "E1U1", "D1W1", "D1W1", "C1Y1", "C1Y1", "B1[1", "B1[1", "B1[1", "B1[1", "A00[00", "C25W52", "A00[00", "B1[1", "B1[1", "B1[1", "B1[1", "C1Y1", "C1Y1", "D1W1", "D1W1", "E1U1", "F1S1", "G11G5G11", "I11E2E11", "K11110A01111", "O0A0",}, - {"\u0001", "M110A011", "J111C2C111", "H11F5F11", "F11Q11", "E11S11", "E1U1", "D1W1", "D1W1", "C1Y1", "C1Y1", "C1Y1", "B1[1", "B1[1", "B0[0", "C25W52", "B0[0", "B1[1", "B1[1", "C1Y1", "C1Y1", "C1Y1", "D1W1", "D1W1", "E1U1", "E11S11", "F11Q11", "H11F5F11", "J111C2C111", "M110A011",}, - {"\u0001", "O0A0", "L1110A0111", "I111D2D111", "G11D3335333D11", "F1S1", "E1U1", "E1U1", "D1W1", "D1W1", "D1W1", "C1Y1", "C1A3U3A1", "C1A3U3A1", "B00A3U3A00", "D25U52", "B00A3U3A00", "C1A3U3A1", "C1A3U3A1", "C1Y1", "D1W1", "D1W1", "D1W1", "E1U1", "E1U1", "F1S1", "G11D3335333D11", "I111D2D111", "L1110A0111", "O0A0",}, - {"\u0002", "O0A0", "K11100000111", "H111E2E111", "G11G5G11", "F1S1", "E11S11", "E1U1", "E1U1", "D1W1", "D1W1", "D1W1", "D0W0", "C00W00", "D025S520", "C00W00", "D0W0", "D1W1", "D1W1", "D1W1", "E1U1", "E1U1", "E11S11", "F1S1", "G11G5G11", "H111E2E111", "K11100000111", "O0A0",}, - {"\u0003", "O0A0", "J111110A011111", "H111E2E111", "G11D3335333D11", "F11Q11", "F1S1", "E11S11", "E1U1", "E1U1", "E1A3Q3A1", "E1A3Q3A1", "D00A3Q3A00", "F25Q52", "D00A3Q3A00", "E1A3Q3A1", "E1A3Q3A1", "E1U1", "E1U1", "E11S11", "F1S1", "F11Q11", "G11D3335333D11", "H111E2E111", "J111110A011111", "O0A0",}, - {"\u0004", "O0A0", "K11100000111", "I111D2D111", "H11F5F11", "G11G5G11", "G1Q1", "F11Q11", "F1S1", "F1S1", "F0S0", "E00S00", "F0255M5520", "E00S00", "F0S0", "F1S1", "F1S1", "F11Q11", "G1Q1", "G11G5G11", "H11F5F11", "I111D2D111", "K11100000111", "O0A0",}, - {"\u0005", "O0A0", "L1110A0111", "J111C2C111", "I11E2E11", "H11M11", "H1O1", "G11O11", "G1Q1", "G1Q1", "F00Q00", "H22M22", "F00Q00", "G1Q1", "G1Q1", "G11O11", "H1O1", "H11M11", "I11E2E11", "J111C2C111", "L1110A0111", "O0A0",}, - {"\u0006", "O0A0", "M110A011", "K11110A01111", "J111C2C111", "I111D2D111", "I11B2222222B11", "H11B22E22B11", "H11B2B333B2B11", "G000B2A34443A2B000", "J222A34443A222", "G000B2A34443A2B000", "H11B2B333B2B11", "H11B22E22B11", "I11B2222222B11", "I111D2D111", "J111C2C111", "K11110A01111", "M110A011", "O0A0",}, - {"\u0008", "O0A0", "M110A011", "L1110A0111", "K11110A01111", "J1111222221111", "J1112202022111", "I000020020020000", "M2222222", "I000020020020000", "J1112202022111", "J1111222221111", "K11110A01111", "L1110A0111", "M110A011", "O0A0",}, - {"\u000B", "O0A0", "O0A0", "O0A0", "L000000000", "O0A0", "L000000000", "O0A0", "O0A0", "O0A0",}, - }; - private static final Block[] blockType2 = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; - private static final byte[] blockMeta2 = new byte[]{12, 0, 13, 14, 10, 11}; - //endregion - public GT_MetaTileEntity_EM_bhg(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -262,11 +268,11 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - if (structureCheck_EM(shape2, blockType2, blockMeta2, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 16, 16, 0)) { + if (structureCheck_EM("t2", 16, 16, 0)) { glassDome = true; return true; } - if (structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 16, 16, 0)) { + if (structureCheck_EM("t1", 16, 16, 0)) { glassDome = false; return true; } @@ -301,11 +307,7 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E @Override public void construct(ItemStack stackSize, boolean hintsOnly) { - if ((stackSize.stackSize & 1) == 1) { - Structure.builder(shape, blockType, blockMeta, 16, 16, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); - } else { - Structure.builder(shape2, blockType2, blockMeta2, 16, 16, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); - } + structureBuild_EM((stackSize.stackSize&1)==1?"t1":"t2", 16, 16, 0, hintsOnly,stackSize); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index 2782e7924f..8f4e7969ee 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -325,12 +325,12 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB }) .addElement('0', ofBlock(sBlockCasingsTT,4)) .addElement('1', ofBlock(sBlockCasingsTT,7)) - .addElement('2', defer(t->(int)t.eTier,(t,item)->(item.stackSize&1)+1, + .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)->(item.stackSize&1)+1, + .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)->(item.stackSize&1)+1, + .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)) 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 bfd74ab448..cdac772541 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 @@ -40,7 +40,7 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition.builder() .addShape("main",new String[][]{ - {"111", "1.1", "111",}, + {"111", "1~1", "111",}, {"111", "101", "111",}, {"111", "111", "111",}, }) -- cgit From 145e443d70af83109b3b9c4cb92097b4964d4402 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 2 May 2020 16:04:17 +0200 Subject: Add IIcon hint particle --- .../technus/tectech/entity/fx/BlockHint.java | 19 ++++++++++++++++++ .../mechanics/structure/StructureUtility.java | 23 ++++++++++++++++++++++ .../github/technus/tectech/proxy/ClientProxy.java | 10 ++++++++++ .../github/technus/tectech/proxy/CommonProxy.java | 2 ++ 4 files changed, 54 insertions(+) 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 index ab075f7ffd..24459a89b8 100644 --- a/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java +++ b/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java @@ -19,6 +19,25 @@ public class BlockHint extends EntityFX { 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; 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 index 8e2cedd6e2..d544efc48e 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -13,6 +13,7 @@ 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.*; @@ -134,6 +135,28 @@ public class StructureUtility { }; } + /** + * Check always returns: true. + * + * @param icons + * @param + * @return + */ + public static IStructureElementNoPlacement ofHint(IIcon[] icons) { + return new IStructureElementNoPlacement() { + @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); + return false; + } + }; + } + /** * Does not allow Block duplicates (with different meta) */ 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 720460d56b..43f4989638 100644 --- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java @@ -24,6 +24,7 @@ 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; @@ -45,6 +46,15 @@ public class ClientProxy extends CommonProxy { } } + @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 + TecTech.RANDOM.nextFloat() * 0.5F, y + TecTech.RANDOM.nextFloat() * 0.5F, z + TecTech.RANDOM.nextFloat() * 0.5F, 0, 0, 0); + particle.setRBGColorF(0, 0.6F * TecTech.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)); 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 955b664bd1..5891c21d5d 100644 --- a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java @@ -7,12 +7,14 @@ 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(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! -- cgit From 132765721d820021e594fe417ee7bbb6180df970 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 2 May 2020 17:03:12 +0200 Subject: Expose tinting --- .../technus/tectech/entity/fx/BlockHint.java | 9 ++++++++- .../mechanics/structure/StructureUtility.java | 23 ++++++++++++++++++++++ .../github/technus/tectech/proxy/ClientProxy.java | 18 +++++++++++++++++ .../github/technus/tectech/proxy/CommonProxy.java | 2 ++ 4 files changed, 51 insertions(+), 1 deletion(-) 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 index 24459a89b8..dd5cd59ac7 100644 --- a/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java +++ b/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java @@ -3,6 +3,7 @@ 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; @@ -14,6 +15,7 @@ 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); @@ -51,6 +53,11 @@ public class BlockHint extends EntityFX { } } + 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; @@ -59,7 +66,7 @@ public class BlockHint extends EntityFX { float Z = (float) (prevPosZ + (posZ - prevPosZ) * (double) subTickTime - EntityFX.interpPosZ); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDepthMask(false); - tes.setColorRGBA_F(.9F, .95F, 1F, .75f); + 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 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 index d544efc48e..2177d1a00e 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -157,6 +157,29 @@ public class StructureUtility { }; } + /** + * Check always returns: true. + * + * @param icons + * @param RGBa + * @param + * @return + */ + public static IStructureElementNoPlacement ofHint(IIcon[] icons,short[] RGBa) { + return new IStructureElementNoPlacement() { + @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,RGBa); + return false; + } + }; + } + /** * Does not allow Block duplicates (with different meta) */ 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 43f4989638..9e693b7664 100644 --- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java @@ -46,6 +46,24 @@ 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 + TecTech.RANDOM.nextFloat() * 0.5F, y + TecTech.RANDOM.nextFloat() * 0.5F, z + TecTech.RANDOM.nextFloat() * 0.5F, 0, 0, 0); + particle.setRBGColorF(0, 0.6F * TecTech.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 + TecTech.RANDOM.nextFloat() * 0.5F, y + TecTech.RANDOM.nextFloat() * 0.5F, z + TecTech.RANDOM.nextFloat() * 0.5F, 0, 0, 0); + particle.setRBGColorF(0, 0.6F * TecTech.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)); 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 5891c21d5d..490cdf1092 100644 --- a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java @@ -14,6 +14,8 @@ 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! -- cgit From f072d69ee5dbbef49e46e4c2357b985f86d202a3 Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 3 May 2020 11:02:55 +0200 Subject: Defer get icons --- src/main/java/com/github/technus/tectech/loader/MainLoader.java | 2 +- .../technus/tectech/mechanics/structure/StructureUtility.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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 f8fbcda2da..bab6c6d092 100644 --- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java @@ -157,7 +157,7 @@ public final class MainLoader { fixBlocks(); TecTech.LOGGER.info("Blocks nerf done"); - progressBarPostLoad.step("Initialize more constructable stuff"); + progressBarPostLoad.step("Constructable stuff"); new ConstructableLoader().run(); TecTech.LOGGER.info("Constructable initialized"); 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 index 2177d1a00e..00bdcdb1ad 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -142,7 +142,7 @@ public class StructureUtility { * @param * @return */ - public static IStructureElementNoPlacement ofHint(IIcon[] icons) { + public static IStructureElementNoPlacement ofHintDeferred(Supplier icons) { return new IStructureElementNoPlacement() { @Override public boolean check(T t, World world, int x, int y, int z) { @@ -151,7 +151,7 @@ public class StructureUtility { @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); + TecTech.proxy.hint_particle(world, x, y, z, icons.get()); return false; } }; @@ -165,7 +165,7 @@ public class StructureUtility { * @param * @return */ - public static IStructureElementNoPlacement ofHint(IIcon[] icons,short[] RGBa) { + public static IStructureElementNoPlacement ofHintDeferred(Supplier icons,short[] RGBa) { return new IStructureElementNoPlacement() { @Override public boolean check(T t, World world, int x, int y, int z) { @@ -174,7 +174,7 @@ public class StructureUtility { @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,RGBa); + TecTech.proxy.hint_particle_tinted(world, x, y, z, icons.get(),RGBa); return false; } }; -- cgit From 87d6601b4890b3a69c0d0fdcd3e7cbf0092377b7 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 4 May 2020 20:15:05 +0200 Subject: Fix loss, to be max instead of min... --- .../multi/base/GT_MetaTileEntity_MultiblockBase_EM.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 3e53f63736..cf37fb0689 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 @@ -1435,7 +1435,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { euVar = tHatch.maxEUOutput(); if (tHatch.getBaseMetaTileEntity().getStoredEU() <= tHatch.maxEUStore() - euVar && - aBaseMetaTileEntity.decreaseStoredEnergyUnits(euVar + Math.min(euVar >> 7, 1), false)) { + aBaseMetaTileEntity.decreaseStoredEnergyUnits(euVar + Math.max(euVar >> 7, 1), false)) { tHatch.setEUVar(tHatch.getBaseMetaTileEntity().getStoredEU() + euVar); } } @@ -1444,7 +1444,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { euVar = tHatch.maxEUOutput() * tHatch.Amperes; if (tHatch.getBaseMetaTileEntity().getStoredEU() <= tHatch.maxEUStore() - euVar && - aBaseMetaTileEntity.decreaseStoredEnergyUnits(euVar + Math.min(euVar >> 7, tHatch.Amperes), false)) { + aBaseMetaTileEntity.decreaseStoredEnergyUnits(euVar + Math.max(euVar >> 7, tHatch.Amperes), false)) { tHatch.setEUVar(tHatch.getBaseMetaTileEntity().getStoredEU() + euVar); } } -- cgit From f1dff1a236a32284d733464e220995aca79aea6b Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 9 May 2020 09:16:53 +0200 Subject: Refactor thaum spark --- .../technus/tectech/loader/NetworkDispatcher.java | 2 +- .../tectech/mechanics/data/RendererMessage.java | 82 ---------------------- .../technus/tectech/mechanics/data/ThaumSpark.java | 54 -------------- .../tectech/mechanics/spark/RendererMessage.java | 82 ++++++++++++++++++++++ .../tectech/mechanics/spark/ThaumSpark.java | 54 ++++++++++++++ .../multi/GT_MetaTileEntity_TM_teslaCoil.java | 4 +- .../single/GT_MetaTileEntity_TeslaCoil.java | 4 +- 7 files changed, 141 insertions(+), 141 deletions(-) delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/data/RendererMessage.java delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/data/ThaumSpark.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/spark/RendererMessage.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/spark/ThaumSpark.java 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 7d35a216f0..581c81d15f 100644 --- a/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java +++ b/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.loader; import com.github.technus.tectech.mechanics.data.ChunkDataMessage; import com.github.technus.tectech.mechanics.data.PlayerDataMessage; -import com.github.technus.tectech.mechanics.data.RendererMessage; +import com.github.technus.tectech.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; diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/RendererMessage.java b/src/main/java/com/github/technus/tectech/mechanics/data/RendererMessage.java deleted file mode 100644 index 514b8b88ad..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/data/RendererMessage.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.github.technus.tectech.mechanics.data; - -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; -import io.netty.buffer.ByteBuf; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import net.minecraftforge.common.DimensionManager; -import thaumcraft.client.fx.bolt.FXLightningBolt; - -import java.io.*; -import java.util.Arrays; -import java.util.HashSet; - -public class RendererMessage implements IMessage { - HashSet sparkList = new HashSet(); - - public RendererMessage() { - } - - @Override - public void fromBytes(ByteBuf pBuffer) { - try { - //I'd love to know why I need to offset by one byte for this to work - byte[] boop = pBuffer.array(); - boop = Arrays.copyOfRange(boop, 1, boop.length); - InputStream is = new ByteArrayInputStream(boop); - ObjectInputStream ois = new ObjectInputStream(is); - Object data = ois.readObject(); - sparkList = (HashSet) data; - } catch (IOException | ClassNotFoundException ex) { - } - } - - @Override - public void toBytes(ByteBuf pBuffer) { - try { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(sparkList); - oos.flush(); - InputStream is = new ByteArrayInputStream(baos.toByteArray()); - pBuffer.writeBytes(is, baos.toByteArray().length); - } catch (IOException ex) { - } - } - - public static class RendererData extends RendererMessage { - public RendererData() { - } - - public RendererData(HashSet eSparkList) { - sparkList = eSparkList; - } - } - - - public static class ClientHandler extends AbstractClientMessageHandler { - @Override - public IMessage handleClientMessage(EntityPlayer pPlayer, RendererData pMessage, MessageContext pCtx) { - for (ThaumSpark sp : pMessage.sparkList) { - thaumLightning(sp.x, sp.y, sp.z, sp.xR, sp.yR, sp.zR, sp.wID); - } - pMessage.sparkList.clear(); - return null; - } - } - - private static void thaumLightning(int tX, int tY, int tZ, int tXN, int tYN, int tZN, int wID) { - //This is enough to check for thaum, since it only ever matters for client side effects (Tested not to crash) - if (Loader.isModLoaded("Thaumcraft")) { - World world = DimensionManager.getWorld(wID); - FXLightningBolt bolt = new FXLightningBolt(world, tX + 0.5F, tY + 0.5F, tZ + 0.5F, tX + tXN + 0.5F, tY + tYN + 0.5F, tZ + tZN + 0.5F, world.rand.nextLong(), 6, 0.5F, 8); - bolt.defaultFractal(); - bolt.setType(2); - bolt.setWidth(0.125F); - bolt.finalizeBolt(); - } - } -} \ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/ThaumSpark.java b/src/main/java/com/github/technus/tectech/mechanics/data/ThaumSpark.java deleted file mode 100644 index 99f3696aa9..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/data/ThaumSpark.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.github.technus.tectech.mechanics.data; - -import java.io.Serializable; -import java.util.Objects; - -public class ThaumSpark implements Serializable { - //This works regardless of if TC is loaded - private static final long serialVersionUID = -7037856938316679566L; - public int x, y, z, wID; - public byte xR, yR, zR; - - public ThaumSpark(){ - this.x = 0; - this.z = 0; - this.y = 0; - - this.xR = 0; - this.yR = 0; - this.zR = 0; - - this.wID = 0; - } - - public ThaumSpark(int x, int y, int z, byte xR, byte yR, byte zR, int wID) { - this.x = x; - this.z = z; - this.y = y; - - this.xR = xR; - this.yR = yR; - this.zR = zR; - - this.wID = wID; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - ThaumSpark that = (ThaumSpark) o; - return x == that.x && - y == that.y && - z == that.z && - wID == that.wID && - xR == that.xR && - yR == that.yR && - zR == that.zR; - } - - @Override - public int hashCode() { - return Objects.hash(x, y, z, wID, xR, yR, zR); - } -} diff --git a/src/main/java/com/github/technus/tectech/mechanics/spark/RendererMessage.java b/src/main/java/com/github/technus/tectech/mechanics/spark/RendererMessage.java new file mode 100644 index 0000000000..f2fd17817d --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/spark/RendererMessage.java @@ -0,0 +1,82 @@ +package com.github.technus.tectech.mechanics.spark; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; +import io.netty.buffer.ByteBuf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; +import thaumcraft.client.fx.bolt.FXLightningBolt; + +import java.io.*; +import java.util.Arrays; +import java.util.HashSet; + +public class RendererMessage implements IMessage { + HashSet sparkList = new HashSet(); + + public RendererMessage() { + } + + @Override + public void fromBytes(ByteBuf pBuffer) { + try { + //I'd love to know why I need to offset by one byte for this to work + byte[] boop = pBuffer.array(); + boop = Arrays.copyOfRange(boop, 1, boop.length); + InputStream is = new ByteArrayInputStream(boop); + ObjectInputStream ois = new ObjectInputStream(is); + Object data = ois.readObject(); + sparkList = (HashSet) data; + } catch (IOException | ClassNotFoundException ex) { + } + } + + @Override + public void toBytes(ByteBuf pBuffer) { + try { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos); + oos.writeObject(sparkList); + oos.flush(); + InputStream is = new ByteArrayInputStream(baos.toByteArray()); + pBuffer.writeBytes(is, baos.toByteArray().length); + } catch (IOException ex) { + } + } + + public static class RendererData extends RendererMessage { + public RendererData() { + } + + public RendererData(HashSet eSparkList) { + sparkList = eSparkList; + } + } + + + public static class ClientHandler extends AbstractClientMessageHandler { + @Override + public IMessage handleClientMessage(EntityPlayer pPlayer, RendererData pMessage, MessageContext pCtx) { + for (ThaumSpark sp : pMessage.sparkList) { + thaumLightning(sp.x, sp.y, sp.z, sp.xR, sp.yR, sp.zR, sp.wID); + } + pMessage.sparkList.clear(); + return null; + } + } + + private static void thaumLightning(int tX, int tY, int tZ, int tXN, int tYN, int tZN, int wID) { + //This is enough to check for thaum, since it only ever matters for client side effects (Tested not to crash) + if (Loader.isModLoaded("Thaumcraft")) { + World world = DimensionManager.getWorld(wID); + FXLightningBolt bolt = new FXLightningBolt(world, tX + 0.5F, tY + 0.5F, tZ + 0.5F, tX + tXN + 0.5F, tY + tYN + 0.5F, tZ + tZN + 0.5F, world.rand.nextLong(), 6, 0.5F, 8); + bolt.defaultFractal(); + bolt.setType(2); + bolt.setWidth(0.125F); + bolt.finalizeBolt(); + } + } +} \ No newline at end of file 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 new file mode 100644 index 0000000000..604624828c --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/spark/ThaumSpark.java @@ -0,0 +1,54 @@ +package com.github.technus.tectech.mechanics.spark; + +import java.io.Serializable; +import java.util.Objects; + +public class ThaumSpark implements Serializable { + //This works regardless of if TC is loaded + private static final long serialVersionUID = -7037856938316679566L; + public int x, y, z, wID; + public byte xR, yR, zR; + + public ThaumSpark(){ + this.x = 0; + this.z = 0; + this.y = 0; + + this.xR = 0; + this.yR = 0; + this.zR = 0; + + this.wID = 0; + } + + public ThaumSpark(int x, int y, int z, byte xR, byte yR, byte zR, int wID) { + this.x = x; + this.z = z; + this.y = y; + + this.xR = xR; + this.yR = yR; + this.zR = zR; + + this.wID = wID; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ThaumSpark that = (ThaumSpark) o; + return x == that.x && + y == that.y && + z == that.z && + wID == that.wID && + xR == that.xR && + yR == that.yR && + zR == that.zR; + } + + @Override + public int hashCode() { + return Objects.hash(x, y, z, wID, xR, yR, zR); + } +} 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 15263e2042..89093bdba7 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 @@ -3,8 +3,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.data.RendererMessage; -import com.github.technus.tectech.mechanics.data.ThaumSpark; +import com.github.technus.tectech.mechanics.spark.RendererMessage; +import com.github.technus.tectech.mechanics.spark.ThaumSpark; import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil; 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 0c282ac94f..ed36dec7cb 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 @@ -4,8 +4,8 @@ import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.util.Util; import com.github.technus.tectech.loader.NetworkDispatcher; -import com.github.technus.tectech.mechanics.data.RendererMessage; -import com.github.technus.tectech.mechanics.data.ThaumSpark; +import com.github.technus.tectech.mechanics.spark.RendererMessage; +import com.github.technus.tectech.mechanics.spark.ThaumSpark; import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil; import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil_Ultimate; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_TM_teslaCoil; -- cgit From 50ef86f655d1a6f4e44305e3cea962dc52534736 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Sun, 10 May 2020 09:42:24 +0200 Subject: update gt version for jenkins build --- build.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.properties b/build.properties index aa0710220a..2aaa4ac7ce 100644 --- a/build.properties +++ b/build.properties @@ -6,8 +6,8 @@ ic2.version=2.2.790-experimental codechickenlib.version=1.1.3.140 codechickencore.version=1.0.7.47 nei.version=1.0.5.120 -gregtech.jenkinsbuild=520 -gregtech.version=5.09.33.42-Test +gregtech.jenkinsbuild=545 +gregtech.version=5.09.33.44 cofhcore.version=[1.7.10]3.1.4-329-dev yamcore.version=0.5.79 baubles.version=1.0.1.10 -- cgit From 7d64270920ef2f095ae9923fdb9f0e685f940220 Mon Sep 17 00:00:00 2001 From: Tec Date: Tue, 12 May 2020 20:11:23 +0200 Subject: Update descriptions --- .../tectech/loader/thing/MachineLoader.java | 252 ++++++++++----------- src/main/resources/assets/tectech/lang/en_US.lang | 252 ++++++++++----------- src/main/resources/assets/tectech/lang/zh_CN.lang | 252 ++++++++++----------- 3 files changed, 378 insertions(+), 378 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index 9dd71df9eb..7b1e85591d 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -198,139 +198,139 @@ public class MachineLoader implements Runnable { // =================================================================================================== eM_energyTunnel1_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15130, "hatch.energytunnel1.tier.05", "IV 256/t Laser Target Hatch", 5, 256).getStackForm(1L)); + 15130, "hatch.energytunnel1.tier.05", "IV 256A/s Laser Target Hatch", 5, 256).getStackForm(1L)); eM_energyTunnel2_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15140, "hatch.energytunnel2.tier.05", "IV 1024/t Laser Target Hatch", 5, 1024).getStackForm(1L)); + 15140, "hatch.energytunnel2.tier.05", "IV 1024A/s Laser Target Hatch", 5, 1024).getStackForm(1L)); eM_energyTunnel3_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15150, "hatch.energytunnel3.tier.05", "IV 4096/t Laser Target Hatch", 5, 4096).getStackForm(1L)); + 15150, "hatch.energytunnel3.tier.05", "IV 4096A/s Laser Target Hatch", 5, 4096).getStackForm(1L)); eM_energyTunnel4_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15160, "hatch.energytunnel4.tier.05", "IV 16384/t Laser Target Hatch", 5, 16384).getStackForm(1L)); + 15160, "hatch.energytunnel4.tier.05", "IV 16384A/s Laser Target Hatch", 5, 16384).getStackForm(1L)); eM_energyTunnel5_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15170, "hatch.energytunnel5.tier.05", "IV 65536/t Laser Target Hatch", 5, 65536).getStackForm(1L)); + 15170, "hatch.energytunnel5.tier.05", "IV 65536A/s Laser Target Hatch", 5, 65536).getStackForm(1L)); eM_energyTunnel6_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15180, "hatch.energytunnel6.tier.05", "IV 262144/t Laser Target Hatch", 5, 262144).getStackForm(1L)); + 15180, "hatch.energytunnel6.tier.05", "IV 262144A/s Laser Target Hatch", 5, 262144).getStackForm(1L)); eM_energyTunnel7_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15190, "hatch.energytunnel7.tier.05", "IV 1048576/t Laser Target Hatch", 5, 1048576).getStackForm(1L)); + 15190, "hatch.energytunnel7.tier.05", "IV 1048576A/s Laser Target Hatch", 5, 1048576).getStackForm(1L)); eM_energyTunnel1_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15131, "hatch.energytunnel1.tier.06", "LuV 256/t Laser Target Hatch", 6, 256).getStackForm(1L)); + 15131, "hatch.energytunnel1.tier.06", "LuV 256A/s Laser Target Hatch", 6, 256).getStackForm(1L)); eM_energyTunnel2_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15141, "hatch.energytunnel2.tier.06", "LuV 1024/t Laser Target Hatch", 6, 1024).getStackForm(1L)); + 15141, "hatch.energytunnel2.tier.06", "LuV 1024A/s Laser Target Hatch", 6, 1024).getStackForm(1L)); eM_energyTunnel3_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15151, "hatch.energytunnel3.tier.06", "LuV 4096/t Laser Target Hatch", 6, 4096).getStackForm(1L)); + 15151, "hatch.energytunnel3.tier.06", "LuV 4096A/s Laser Target Hatch", 6, 4096).getStackForm(1L)); eM_energyTunnel4_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15161, "hatch.energytunnel4.tier.06", "LuV 16384/t Laser Target Hatch", 6, 16384).getStackForm(1L)); + 15161, "hatch.energytunnel4.tier.06", "LuV 16384A/s Laser Target Hatch", 6, 16384).getStackForm(1L)); eM_energyTunnel5_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15171, "hatch.energytunnel5.tier.06", "LuV 65536/t Laser Target Hatch", 6, 65536).getStackForm(1L)); + 15171, "hatch.energytunnel5.tier.06", "LuV 65536A/s Laser Target Hatch", 6, 65536).getStackForm(1L)); eM_energyTunnel6_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15181, "hatch.energytunnel6.tier.06", "LuV 262144/t Laser Target Hatch", 6, 262144).getStackForm(1L)); + 15181, "hatch.energytunnel6.tier.06", "LuV 262144A/s Laser Target Hatch", 6, 262144).getStackForm(1L)); eM_energyTunnel7_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15191, "hatch.energytunnel7.tier.06", "LuV 1048576/t Laser Target Hatch", 6, 1048576).getStackForm(1L)); + 15191, "hatch.energytunnel7.tier.06", "LuV 1048576A/s Laser Target Hatch", 6, 1048576).getStackForm(1L)); eM_energyTunnel1_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15132, "hatch.energytunnel1.tier.07", "ZPM 256/t Laser Target Hatch", 7, 256).getStackForm(1L)); + 15132, "hatch.energytunnel1.tier.07", "ZPM 256A/s Laser Target Hatch", 7, 256).getStackForm(1L)); eM_energyTunnel2_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15142, "hatch.energytunnel2.tier.07", "ZPM 1024/t Laser Target Hatch", 7, 1024).getStackForm(1L)); + 15142, "hatch.energytunnel2.tier.07", "ZPM 1024A/s Laser Target Hatch", 7, 1024).getStackForm(1L)); eM_energyTunnel3_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15152, "hatch.energytunnel3.tier.07", "ZPM 4096/t Laser Target Hatch", 7, 4096).getStackForm(1L)); + 15152, "hatch.energytunnel3.tier.07", "ZPM 4096A/s Laser Target Hatch", 7, 4096).getStackForm(1L)); eM_energyTunnel4_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15162, "hatch.energytunnel4.tier.07", "ZPM 16384/t Laser Target Hatch", 7, 16384).getStackForm(1L)); + 15162, "hatch.energytunnel4.tier.07", "ZPM 16384A/s Laser Target Hatch", 7, 16384).getStackForm(1L)); eM_energyTunnel5_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15172, "hatch.energytunnel5.tier.07", "ZPM 65536/t Laser Target Hatch", 7, 65536).getStackForm(1L)); + 15172, "hatch.energytunnel5.tier.07", "ZPM 65536A/s Laser Target Hatch", 7, 65536).getStackForm(1L)); eM_energyTunnel6_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15182, "hatch.energytunnel6.tier.07", "ZPM 262144/t Laser Target Hatch", 7, 262144).getStackForm(1L)); + 15182, "hatch.energytunnel6.tier.07", "ZPM 262144A/s Laser Target Hatch", 7, 262144).getStackForm(1L)); eM_energyTunnel7_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15192, "hatch.energytunnel7.tier.07", "ZPM 1048576/t Laser Target Hatch", 7, 1048576).getStackForm(1L)); + 15192, "hatch.energytunnel7.tier.07", "ZPM 1048576A/s Laser Target Hatch", 7, 1048576).getStackForm(1L)); eM_energyTunnel1_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15133, "hatch.energytunnel1.tier.08", "UV 256/t Laser Target Hatch", 8, 256).getStackForm(1L)); + 15133, "hatch.energytunnel1.tier.08", "UV 256A/s Laser Target Hatch", 8, 256).getStackForm(1L)); eM_energyTunnel2_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15143, "hatch.energytunnel2.tier.08", "UV 1024/t Laser Target Hatch", 8, 1024).getStackForm(1L)); + 15143, "hatch.energytunnel2.tier.08", "UV 1024A/s Laser Target Hatch", 8, 1024).getStackForm(1L)); eM_energyTunnel3_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15153, "hatch.energytunnel3.tier.08", "UV 4096/t Laser Target Hatch", 8, 4096).getStackForm(1L)); + 15153, "hatch.energytunnel3.tier.08", "UV 4096A/s Laser Target Hatch", 8, 4096).getStackForm(1L)); eM_energyTunnel4_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15163, "hatch.energytunnel4.tier.08", "UV 16384/t Laser Target Hatch", 8, 16384).getStackForm(1L)); + 15163, "hatch.energytunnel4.tier.08", "UV 16384A/s Laser Target Hatch", 8, 16384).getStackForm(1L)); eM_energyTunnel5_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15173, "hatch.energytunnel5.tier.08", "UV 65536/t Laser Target Hatch", 8, 65536).getStackForm(1L)); + 15173, "hatch.energytunnel5.tier.08", "UV 65536A/s Laser Target Hatch", 8, 65536).getStackForm(1L)); eM_energyTunnel6_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15183, "hatch.energytunnel6.tier.08", "UV 262144/t Laser Target Hatch", 8, 262144).getStackForm(1L)); + 15183, "hatch.energytunnel6.tier.08", "UV 262144A/s Laser Target Hatch", 8, 262144).getStackForm(1L)); eM_energyTunnel7_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15193, "hatch.energytunnel7.tier.08", "UV 1048576/t Laser Target Hatch", 8, 1048576).getStackForm(1L)); + 15193, "hatch.energytunnel7.tier.08", "UV 1048576A/s Laser Target Hatch", 8, 1048576).getStackForm(1L)); eM_energyTunnel1_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15134, "hatch.energytunnel1.tier.09", "UHV 256/t Laser Target Hatch", 9, 256).getStackForm(1L)); + 15134, "hatch.energytunnel1.tier.09", "UHV 256A/s Laser Target Hatch", 9, 256).getStackForm(1L)); eM_energyTunnel2_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15144, "hatch.energytunnel2.tier.09", "UHV 1024/t Laser Target Hatch", 9, 1024).getStackForm(1L)); + 15144, "hatch.energytunnel2.tier.09", "UHV 1024A/s Laser Target Hatch", 9, 1024).getStackForm(1L)); eM_energyTunnel3_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15154, "hatch.energytunnel3.tier.09", "UHV 4096/t Laser Target Hatch", 9, 4096).getStackForm(1L)); + 15154, "hatch.energytunnel3.tier.09", "UHV 4096A/s Laser Target Hatch", 9, 4096).getStackForm(1L)); eM_energyTunnel4_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15164, "hatch.energytunnel4.tier.09", "UHV 16384/t Laser Target Hatch", 9, 16384).getStackForm(1L)); + 15164, "hatch.energytunnel4.tier.09", "UHV 16384A/s Laser Target Hatch", 9, 16384).getStackForm(1L)); eM_energyTunnel5_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15174, "hatch.energytunnel5.tier.09", "UHV 65536/t Laser Target Hatch", 9, 65536).getStackForm(1L)); + 15174, "hatch.energytunnel5.tier.09", "UHV 65536A/s Laser Target Hatch", 9, 65536).getStackForm(1L)); eM_energyTunnel6_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15184, "hatch.energytunnel6.tier.09", "UHV 262144/t Laser Target Hatch", 9, 262144).getStackForm(1L)); + 15184, "hatch.energytunnel6.tier.09", "UHV 262144A/s Laser Target Hatch", 9, 262144).getStackForm(1L)); eM_energyTunnel7_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15194, "hatch.energytunnel7.tier.09", "UHV 1048576/t Laser Target Hatch", 9, 1048576).getStackForm(1L)); + 15194, "hatch.energytunnel7.tier.09", "UHV 1048576A/s Laser Target Hatch", 9, 1048576).getStackForm(1L)); eM_energyTunnel1_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15135, "hatch.energytunnel1.tier.10", "UEV 256/t Laser Target Hatch", 10, 256).getStackForm(1L)); + 15135, "hatch.energytunnel1.tier.10", "UEV 256A/s Laser Target Hatch", 10, 256).getStackForm(1L)); eM_energyTunnel2_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15145, "hatch.energytunnel2.tier.10", "UEV 1024/t Laser Target Hatch", 10, 1024).getStackForm(1L)); + 15145, "hatch.energytunnel2.tier.10", "UEV 1024A/s Laser Target Hatch", 10, 1024).getStackForm(1L)); eM_energyTunnel3_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15155, "hatch.energytunnel3.tier.10", "UEV 4096/t Laser Target Hatch", 10, 4096).getStackForm(1L)); + 15155, "hatch.energytunnel3.tier.10", "UEV 4096A/s Laser Target Hatch", 10, 4096).getStackForm(1L)); eM_energyTunnel4_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15165, "hatch.energytunnel4.tier.10", "UEV 16384/t Laser Target Hatch", 10, 16384).getStackForm(1L)); + 15165, "hatch.energytunnel4.tier.10", "UEV 16384A/s Laser Target Hatch", 10, 16384).getStackForm(1L)); eM_energyTunnel5_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15175, "hatch.energytunnel5.tier.10", "UEV 65536/t Laser Target Hatch", 10, 65536).getStackForm(1L)); + 15175, "hatch.energytunnel5.tier.10", "UEV 65536A/s Laser Target Hatch", 10, 65536).getStackForm(1L)); eM_energyTunnel6_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15185, "hatch.energytunnel6.tier.10", "UEV 262144/t Laser Target Hatch", 10, 262144).getStackForm(1L)); + 15185, "hatch.energytunnel6.tier.10", "UEV 262144A/s Laser Target Hatch", 10, 262144).getStackForm(1L)); eM_energyTunnel7_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15195, "hatch.energytunnel7.tier.10", "UEV 1048576/t Laser Target Hatch", 10, 1048576).getStackForm(1L)); + 15195, "hatch.energytunnel7.tier.10", "UEV 1048576A/s Laser Target Hatch", 10, 1048576).getStackForm(1L)); eM_energyTunnel1_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15136, "hatch.energytunnel1.tier.11", "UIV 256/t Laser Target Hatch", 11, 256).getStackForm(1L)); + 15136, "hatch.energytunnel1.tier.11", "UIV 256A/s Laser Target Hatch", 11, 256).getStackForm(1L)); eM_energyTunnel2_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15146, "hatch.energytunnel2.tier.11", "UIV 1024/t Laser Target Hatch", 11, 1024).getStackForm(1L)); + 15146, "hatch.energytunnel2.tier.11", "UIV 1024A/s Laser Target Hatch", 11, 1024).getStackForm(1L)); eM_energyTunnel3_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15156, "hatch.energytunnel3.tier.11", "UIV 4096/t Laser Target Hatch", 11, 4096).getStackForm(1L)); + 15156, "hatch.energytunnel3.tier.11", "UIV 4096A/s Laser Target Hatch", 11, 4096).getStackForm(1L)); eM_energyTunnel4_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15166, "hatch.energytunnel4.tier.11", "UIV 16384/t Laser Target Hatch", 11, 16384).getStackForm(1L)); + 15166, "hatch.energytunnel4.tier.11", "UIV 16384A/s Laser Target Hatch", 11, 16384).getStackForm(1L)); eM_energyTunnel5_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15176, "hatch.energytunnel5.tier.11", "UIV 65536/t Laser Target Hatch", 11, 65536).getStackForm(1L)); + 15176, "hatch.energytunnel5.tier.11", "UIV 65536A/s Laser Target Hatch", 11, 65536).getStackForm(1L)); eM_energyTunnel6_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15186, "hatch.energytunnel6.tier.11", "UIV 262144/t Laser Target Hatch", 11, 262144).getStackForm(1L)); + 15186, "hatch.energytunnel6.tier.11", "UIV 262144A/s Laser Target Hatch", 11, 262144).getStackForm(1L)); eM_energyTunnel7_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15196, "hatch.energytunnel7.tier.11", "UIV 1048576/t Laser Target Hatch", 11, 1048576).getStackForm(1L)); + 15196, "hatch.energytunnel7.tier.11", "UIV 1048576A/s Laser Target Hatch", 11, 1048576).getStackForm(1L)); eM_energyTunnel1_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15137, "hatch.energytunnel1.tier.12", "UMV 256/t Laser Target Hatch", 12, 256).getStackForm(1L)); + 15137, "hatch.energytunnel1.tier.12", "UMV 256A/s Laser Target Hatch", 12, 256).getStackForm(1L)); eM_energyTunnel2_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15147, "hatch.energytunnel2.tier.12", "UMV 1024/t Laser Target Hatch", 12, 1024).getStackForm(1L)); + 15147, "hatch.energytunnel2.tier.12", "UMV 1024A/s Laser Target Hatch", 12, 1024).getStackForm(1L)); eM_energyTunnel3_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15157, "hatch.energytunnel3.tier.12", "UMV 4096/t Laser Target Hatch", 12, 4096).getStackForm(1L)); + 15157, "hatch.energytunnel3.tier.12", "UMV 4096A/s Laser Target Hatch", 12, 4096).getStackForm(1L)); eM_energyTunnel4_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15167, "hatch.energytunnel4.tier.12", "UMV 16384/t Laser Target Hatch", 12, 16384).getStackForm(1L)); + 15167, "hatch.energytunnel4.tier.12", "UMV 16384A/s Laser Target Hatch", 12, 16384).getStackForm(1L)); eM_energyTunnel5_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15177, "hatch.energytunnel5.tier.12", "UMV 65536/t Laser Target Hatch", 12, 65536).getStackForm(1L)); + 15177, "hatch.energytunnel5.tier.12", "UMV 65536A/s Laser Target Hatch", 12, 65536).getStackForm(1L)); eM_energyTunnel6_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15187, "hatch.energytunnel6.tier.12", "UMV 262144/t Laser Target Hatch", 12, 262144).getStackForm(1L)); + 15187, "hatch.energytunnel6.tier.12", "UMV 262144A/s Laser Target Hatch", 12, 262144).getStackForm(1L)); eM_energyTunnel7_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15197, "hatch.energytunnel7.tier.12", "UMV 1048576/t Laser Target Hatch", 12, 1048576).getStackForm(1L)); + 15197, "hatch.energytunnel7.tier.12", "UMV 1048576A/s Laser Target Hatch", 12, 1048576).getStackForm(1L)); eM_energyTunnel1_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15138, "hatch.energytunnel1.tier.13", "UXV 256/t Laser Target Hatch", 13, 256).getStackForm(1L)); + 15138, "hatch.energytunnel1.tier.13", "UXV 256A/s Laser Target Hatch", 13, 256).getStackForm(1L)); eM_energyTunnel2_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15148, "hatch.energytunnel2.tier.13", "UXV 1024/t Laser Target Hatch", 13, 1024).getStackForm(1L)); + 15148, "hatch.energytunnel2.tier.13", "UXV 1024A/s Laser Target Hatch", 13, 1024).getStackForm(1L)); eM_energyTunnel3_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15158, "hatch.energytunnel3.tier.13", "UXV 4096/t Laser Target Hatch", 13, 4096).getStackForm(1L)); + 15158, "hatch.energytunnel3.tier.13", "UXV 4096A/s Laser Target Hatch", 13, 4096).getStackForm(1L)); eM_energyTunnel4_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15168, "hatch.energytunnel4.tier.13", "UXV 16384/t Laser Target Hatch", 13, 16384).getStackForm(1L)); + 15168, "hatch.energytunnel4.tier.13", "UXV 16384A/s Laser Target Hatch", 13, 16384).getStackForm(1L)); eM_energyTunnel5_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15178, "hatch.energytunnel5.tier.13", "UXV 65536/t Laser Target Hatch", 13, 65536).getStackForm(1L)); + 15178, "hatch.energytunnel5.tier.13", "UXV 65536A/s Laser Target Hatch", 13, 65536).getStackForm(1L)); eM_energyTunnel6_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15188, "hatch.energytunnel6.tier.13", "UXV 262144/t Laser Target Hatch", 13, 262144).getStackForm(1L)); + 15188, "hatch.energytunnel6.tier.13", "UXV 262144A/s Laser Target Hatch", 13, 262144).getStackForm(1L)); eM_energyTunnel7_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15198, "hatch.energytunnel7.tier.13", "UXV 1048576/t Laser Target Hatch", 13, 1048576).getStackForm(1L)); + 15198, "hatch.energytunnel7.tier.13", "UXV 1048576A/s Laser Target Hatch", 13, 1048576).getStackForm(1L)); eM_energyTunnel9001.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( 15199, "hatch.energytunnel.tier.14", "Legendary Laser Target Hatch", 14, (int) V[14]).getStackForm(1L)); @@ -406,139 +406,139 @@ public class MachineLoader implements Runnable { // =================================================================================================== eM_dynamoTunnel1_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15230, "hatch.dynamotunnel1.tier.05", "IV 256/t Laser Source Hatch", 5, 256).getStackForm(1L)); + 15230, "hatch.dynamotunnel1.tier.05", "IV 256A/s Laser Source Hatch", 5, 256).getStackForm(1L)); eM_dynamoTunnel2_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15240, "hatch.dynamotunnel2.tier.05", "IV 1024/t Laser Source Hatch", 5, 1024).getStackForm(1L)); + 15240, "hatch.dynamotunnel2.tier.05", "IV 1024A/s Laser Source Hatch", 5, 1024).getStackForm(1L)); eM_dynamoTunnel3_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15250, "hatch.dynamotunnel3.tier.05", "IV 4096/t Laser Source Hatch", 5, 4096).getStackForm(1L)); + 15250, "hatch.dynamotunnel3.tier.05", "IV 4096A/s Laser Source Hatch", 5, 4096).getStackForm(1L)); eM_dynamoTunnel4_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15260, "hatch.dynamotunnel4.tier.05", "IV 16384/t Laser Source Hatch", 5, 16384).getStackForm(1L)); + 15260, "hatch.dynamotunnel4.tier.05", "IV 16384A/s Laser Source Hatch", 5, 16384).getStackForm(1L)); eM_dynamoTunnel5_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15270, "hatch.dynamotunnel5.tier.05", "IV 65536/t Laser Source Hatch", 5, 65536).getStackForm(1L)); + 15270, "hatch.dynamotunnel5.tier.05", "IV 65536A/s Laser Source Hatch", 5, 65536).getStackForm(1L)); eM_dynamoTunnel6_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15280, "hatch.dynamotunnel6.tier.05", "IV 262144/t Laser Source Hatch", 5, 262144).getStackForm(1L)); + 15280, "hatch.dynamotunnel6.tier.05", "IV 262144A/s Laser Source Hatch", 5, 262144).getStackForm(1L)); eM_dynamoTunnel7_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15290, "hatch.dynamotunnel7.tier.05", "IV 1048576/t Laser Source Hatch", 5, 1048576).getStackForm(1L)); + 15290, "hatch.dynamotunnel7.tier.05", "IV 1048576A/s Laser Source Hatch", 5, 1048576).getStackForm(1L)); eM_dynamoTunnel1_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15231, "hatch.dynamotunnel1.tier.06", "LuV 256/t Laser Source Hatch", 6, 256).getStackForm(1L)); + 15231, "hatch.dynamotunnel1.tier.06", "LuV 256A/s Laser Source Hatch", 6, 256).getStackForm(1L)); eM_dynamoTunnel2_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15241, "hatch.dynamotunnel2.tier.06", "LuV 1024/t Laser Source Hatch", 6, 1024).getStackForm(1L)); + 15241, "hatch.dynamotunnel2.tier.06", "LuV 1024A/s Laser Source Hatch", 6, 1024).getStackForm(1L)); eM_dynamoTunnel3_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15251, "hatch.dynamotunnel3.tier.06", "LuV 4096/t Laser Source Hatch", 6, 4096).getStackForm(1L)); + 15251, "hatch.dynamotunnel3.tier.06", "LuV 4096A/s Laser Source Hatch", 6, 4096).getStackForm(1L)); eM_dynamoTunnel4_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15261, "hatch.dynamotunnel4.tier.06", "LuV 16384/t Laser Source Hatch", 6, 16384).getStackForm(1L)); + 15261, "hatch.dynamotunnel4.tier.06", "LuV 16384A/s Laser Source Hatch", 6, 16384).getStackForm(1L)); eM_dynamoTunnel5_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15271, "hatch.dynamotunnel5.tier.06", "LuV 65536/t Laser Source Hatch", 6, 65536).getStackForm(1L)); + 15271, "hatch.dynamotunnel5.tier.06", "LuV 65536A/s Laser Source Hatch", 6, 65536).getStackForm(1L)); eM_dynamoTunnel6_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15281, "hatch.dynamotunnel6.tier.06", "LuV 262144/t Laser Source Hatch", 6, 262144).getStackForm(1L)); + 15281, "hatch.dynamotunnel6.tier.06", "LuV 262144A/s Laser Source Hatch", 6, 262144).getStackForm(1L)); eM_dynamoTunnel7_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15291, "hatch.dynamotunnel7.tier.06", "LuV 1048576/t Laser Source Hatch", 6, 1048576).getStackForm(1L)); + 15291, "hatch.dynamotunnel7.tier.06", "LuV 1048576A/s Laser Source Hatch", 6, 1048576).getStackForm(1L)); eM_dynamoTunnel1_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15232, "hatch.dynamotunnel1.tier.07", "ZPM 256/t Laser Source Hatch", 7, 256).getStackForm(1L)); + 15232, "hatch.dynamotunnel1.tier.07", "ZPM 256A/s Laser Source Hatch", 7, 256).getStackForm(1L)); eM_dynamoTunnel2_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15242, "hatch.dynamotunnel2.tier.07", "ZPM 1024/t Laser Source Hatch", 7, 1024).getStackForm(1L)); + 15242, "hatch.dynamotunnel2.tier.07", "ZPM 1024A/s Laser Source Hatch", 7, 1024).getStackForm(1L)); eM_dynamoTunnel3_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15252, "hatch.dynamotunnel3.tier.07", "ZPM 4096/t Laser Source Hatch", 7, 4096).getStackForm(1L)); + 15252, "hatch.dynamotunnel3.tier.07", "ZPM 4096A/s Laser Source Hatch", 7, 4096).getStackForm(1L)); eM_dynamoTunnel4_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15262, "hatch.dynamotunnel4.tier.07", "ZPM 16384/t Laser Source Hatch", 7, 16384).getStackForm(1L)); + 15262, "hatch.dynamotunnel4.tier.07", "ZPM 16384A/s Laser Source Hatch", 7, 16384).getStackForm(1L)); eM_dynamoTunnel5_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15272, "hatch.dynamotunnel5.tier.07", "ZPM 65536/t Laser Source Hatch", 7, 65536).getStackForm(1L)); + 15272, "hatch.dynamotunnel5.tier.07", "ZPM 65536A/s Laser Source Hatch", 7, 65536).getStackForm(1L)); eM_dynamoTunnel6_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15282, "hatch.dynamotunnel6.tier.07", "ZPM 262144/t Laser Source Hatch", 7, 262144).getStackForm(1L)); + 15282, "hatch.dynamotunnel6.tier.07", "ZPM 262144A/s Laser Source Hatch", 7, 262144).getStackForm(1L)); eM_dynamoTunnel7_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15292, "hatch.dynamotunnel7.tier.07", "ZPM 1048576/t Laser Source Hatch", 7, 1048576).getStackForm(1L)); + 15292, "hatch.dynamotunnel7.tier.07", "ZPM 1048576A/s Laser Source Hatch", 7, 1048576).getStackForm(1L)); eM_dynamoTunnel1_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15233, "hatch.dynamotunnel1.tier.08", "UV 256/t Laser Source Hatch", 8, 256).getStackForm(1L)); + 15233, "hatch.dynamotunnel1.tier.08", "UV 256A/s Laser Source Hatch", 8, 256).getStackForm(1L)); eM_dynamoTunnel2_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15243, "hatch.dynamotunnel2.tier.08", "UV 1024/t Laser Source Hatch", 8, 1024).getStackForm(1L)); + 15243, "hatch.dynamotunnel2.tier.08", "UV 1024A/s Laser Source Hatch", 8, 1024).getStackForm(1L)); eM_dynamoTunnel3_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15253, "hatch.dynamotunnel3.tier.08", "UV 4096/t Laser Source Hatch", 8, 4096).getStackForm(1L)); + 15253, "hatch.dynamotunnel3.tier.08", "UV 4096A/s Laser Source Hatch", 8, 4096).getStackForm(1L)); eM_dynamoTunnel4_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15263, "hatch.dynamotunnel4.tier.08", "UV 16384/t Laser Source Hatch", 8, 16384).getStackForm(1L)); + 15263, "hatch.dynamotunnel4.tier.08", "UV 16384A/s Laser Source Hatch", 8, 16384).getStackForm(1L)); eM_dynamoTunnel5_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15273, "hatch.dynamotunnel5.tier.08", "UV 65536/t Laser Source Hatch", 8, 65536).getStackForm(1L)); + 15273, "hatch.dynamotunnel5.tier.08", "UV 65536A/s Laser Source Hatch", 8, 65536).getStackForm(1L)); eM_dynamoTunnel6_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15283, "hatch.dynamotunnel6.tier.08", "UV 262144/t Laser Source Hatch", 8, 262144).getStackForm(1L)); + 15283, "hatch.dynamotunnel6.tier.08", "UV 262144A/s Laser Source Hatch", 8, 262144).getStackForm(1L)); eM_dynamoTunnel7_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15293, "hatch.dynamotunnel7.tier.08", "UV 1048576/t Laser Source Hatch", 8, 1048576).getStackForm(1L)); + 15293, "hatch.dynamotunnel7.tier.08", "UV 1048576A/s Laser Source Hatch", 8, 1048576).getStackForm(1L)); eM_dynamoTunnel1_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15234, "hatch.dynamotunnel1.tier.09", "UHV 256/t Laser Source Hatch", 9, 256).getStackForm(1L)); + 15234, "hatch.dynamotunnel1.tier.09", "UHV 256A/s Laser Source Hatch", 9, 256).getStackForm(1L)); eM_dynamoTunnel2_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15244, "hatch.dynamotunnel2.tier.09", "UHV 1024/t Laser Source Hatch", 9, 1024).getStackForm(1L)); + 15244, "hatch.dynamotunnel2.tier.09", "UHV 1024A/s Laser Source Hatch", 9, 1024).getStackForm(1L)); eM_dynamoTunnel3_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15254, "hatch.dynamotunnel3.tier.09", "UHV 4096/t Laser Source Hatch", 9, 4096).getStackForm(1L)); + 15254, "hatch.dynamotunnel3.tier.09", "UHV 4096A/s Laser Source Hatch", 9, 4096).getStackForm(1L)); eM_dynamoTunnel4_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15264, "hatch.dynamotunnel4.tier.09", "UHV 16384/t Laser Source Hatch", 9, 16384).getStackForm(1L)); + 15264, "hatch.dynamotunnel4.tier.09", "UHV 16384A/s Laser Source Hatch", 9, 16384).getStackForm(1L)); eM_dynamoTunnel5_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15274, "hatch.dynamotunnel5.tier.09", "UHV 65536/t Laser Source Hatch", 9, 65536).getStackForm(1L)); + 15274, "hatch.dynamotunnel5.tier.09", "UHV 65536A/s Laser Source Hatch", 9, 65536).getStackForm(1L)); eM_dynamoTunnel6_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15284, "hatch.dynamotunnel6.tier.09", "UHV 262144/t Laser Source Hatch", 9, 262144).getStackForm(1L)); + 15284, "hatch.dynamotunnel6.tier.09", "UHV 262144A/s Laser Source Hatch", 9, 262144).getStackForm(1L)); eM_dynamoTunnel7_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15294, "hatch.dynamotunnel7.tier.09", "UHV 1048576/t Laser Source Hatch", 9, 1048576).getStackForm(1L)); + 15294, "hatch.dynamotunnel7.tier.09", "UHV 1048576A/s Laser Source Hatch", 9, 1048576).getStackForm(1L)); eM_dynamoTunnel1_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15235, "hatch.dynamotunnel1.tier.10", "UEV 256/t Laser Source Hatch", 10, 256).getStackForm(1L)); + 15235, "hatch.dynamotunnel1.tier.10", "UEV 256A/s Laser Source Hatch", 10, 256).getStackForm(1L)); eM_dynamoTunnel2_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15245, "hatch.dynamotunnel2.tier.10", "UEV 1024/t Laser Source Hatch", 10, 1024).getStackForm(1L)); + 15245, "hatch.dynamotunnel2.tier.10", "UEV 1024A/s Laser Source Hatch", 10, 1024).getStackForm(1L)); eM_dynamoTunnel3_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15255, "hatch.dynamotunnel3.tier.10", "UEV 4096/t Laser Source Hatch", 10, 4096).getStackForm(1L)); + 15255, "hatch.dynamotunnel3.tier.10", "UEV 4096A/s Laser Source Hatch", 10, 4096).getStackForm(1L)); eM_dynamoTunnel4_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15265, "hatch.dynamotunnel4.tier.10", "UEV 16384/t Laser Source Hatch", 10, 16384).getStackForm(1L)); + 15265, "hatch.dynamotunnel4.tier.10", "UEV 16384A/s Laser Source Hatch", 10, 16384).getStackForm(1L)); eM_dynamoTunnel5_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15275, "hatch.dynamotunnel5.tier.10", "UEV 65536/t Laser Source Hatch", 10, 65536).getStackForm(1L)); + 15275, "hatch.dynamotunnel5.tier.10", "UEV 65536A/s Laser Source Hatch", 10, 65536).getStackForm(1L)); eM_dynamoTunnel6_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15285, "hatch.dynamotunnel6.tier.10", "UEV 262144/t Laser Source Hatch", 10, 262144).getStackForm(1L)); + 15285, "hatch.dynamotunnel6.tier.10", "UEV 262144A/s Laser Source Hatch", 10, 262144).getStackForm(1L)); eM_dynamoTunnel7_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15295, "hatch.dynamotunnel7.tier.10", "UEV 1048576/t Laser Source Hatch", 10, 1048576).getStackForm(1L)); + 15295, "hatch.dynamotunnel7.tier.10", "UEV 1048576A/s Laser Source Hatch", 10, 1048576).getStackForm(1L)); eM_dynamoTunnel1_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15236, "hatch.dynamotunnel1.tier.11", "UIV 256/t Laser Source Hatch", 11, 256).getStackForm(1L)); + 15236, "hatch.dynamotunnel1.tier.11", "UIV 256A/s Laser Source Hatch", 11, 256).getStackForm(1L)); eM_dynamoTunnel2_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15246, "hatch.dynamotunnel2.tier.11", "UIV 1024/t Laser Source Hatch", 11, 1024).getStackForm(1L)); + 15246, "hatch.dynamotunnel2.tier.11", "UIV 1024A/s Laser Source Hatch", 11, 1024).getStackForm(1L)); eM_dynamoTunnel3_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15256, "hatch.dynamotunnel3.tier.11", "UIV 4096/t Laser Source Hatch", 11, 4096).getStackForm(1L)); + 15256, "hatch.dynamotunnel3.tier.11", "UIV 4096A/s Laser Source Hatch", 11, 4096).getStackForm(1L)); eM_dynamoTunnel4_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15266, "hatch.dynamotunnel4.tier.11", "UIV 16384/t Laser Source Hatch", 11, 16384).getStackForm(1L)); + 15266, "hatch.dynamotunnel4.tier.11", "UIV 16384A/s Laser Source Hatch", 11, 16384).getStackForm(1L)); eM_dynamoTunnel5_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15276, "hatch.dynamotunnel5.tier.11", "UIV 65536/t Laser Source Hatch", 11, 65536).getStackForm(1L)); + 15276, "hatch.dynamotunnel5.tier.11", "UIV 65536A/s Laser Source Hatch", 11, 65536).getStackForm(1L)); eM_dynamoTunnel6_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15286, "hatch.dynamotunnel6.tier.11", "UIV 262144/t Laser Source Hatch", 11, 262144).getStackForm(1L)); + 15286, "hatch.dynamotunnel6.tier.11", "UIV 262144A/s Laser Source Hatch", 11, 262144).getStackForm(1L)); eM_dynamoTunnel7_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15296, "hatch.dynamotunnel7.tier.11", "UIV 1048576/t Laser Source Hatch", 11, 1048576).getStackForm(1L)); + 15296, "hatch.dynamotunnel7.tier.11", "UIV 1048576A/s Laser Source Hatch", 11, 1048576).getStackForm(1L)); eM_dynamoTunnel1_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15237, "hatch.dynamotunnel1.tier.12", "UMV 256/t Laser Source Hatch", 12, 256).getStackForm(1L)); + 15237, "hatch.dynamotunnel1.tier.12", "UMV 256A/s Laser Source Hatch", 12, 256).getStackForm(1L)); eM_dynamoTunnel2_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15247, "hatch.dynamotunnel2.tier.12", "UMV 1024/t Laser Source Hatch", 12, 1024).getStackForm(1L)); + 15247, "hatch.dynamotunnel2.tier.12", "UMV 1024A/s Laser Source Hatch", 12, 1024).getStackForm(1L)); eM_dynamoTunnel3_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15257, "hatch.dynamotunnel3.tier.12", "UMV 4096/t Laser Source Hatch", 12, 4096).getStackForm(1L)); + 15257, "hatch.dynamotunnel3.tier.12", "UMV 4096A/s Laser Source Hatch", 12, 4096).getStackForm(1L)); eM_dynamoTunnel4_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15267, "hatch.dynamotunnel4.tier.12", "UMV 16384/t Laser Source Hatch", 12, 16384).getStackForm(1L)); + 15267, "hatch.dynamotunnel4.tier.12", "UMV 16384A/s Laser Source Hatch", 12, 16384).getStackForm(1L)); eM_dynamoTunnel5_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15277, "hatch.dynamotunnel5.tier.12", "UMV 65536/t Laser Source Hatch", 12, 65536).getStackForm(1L)); + 15277, "hatch.dynamotunnel5.tier.12", "UMV 65536A/s Laser Source Hatch", 12, 65536).getStackForm(1L)); eM_dynamoTunnel6_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15287, "hatch.dynamotunnel6.tier.12", "UMV 262144/t Laser Source Hatch", 12, 262144).getStackForm(1L)); + 15287, "hatch.dynamotunnel6.tier.12", "UMV 262144A/s Laser Source Hatch", 12, 262144).getStackForm(1L)); eM_dynamoTunnel7_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15297, "hatch.dynamotunnel7.tier.12", "UMV 1048576/t Laser Source Hatch", 12, 1048576).getStackForm(1L)); + 15297, "hatch.dynamotunnel7.tier.12", "UMV 1048576A/s Laser Source Hatch", 12, 1048576).getStackForm(1L)); eM_dynamoTunnel1_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15238, "hatch.dynamotunnel1.tier.13", "UXV 256/t Laser Source Hatch", 13, 256).getStackForm(1L)); + 15238, "hatch.dynamotunnel1.tier.13", "UXV 256A/s Laser Source Hatch", 13, 256).getStackForm(1L)); eM_dynamoTunnel2_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15248, "hatch.dynamotunnel2.tier.13", "UXV 1024/t Laser Source Hatch", 13, 1024).getStackForm(1L)); + 15248, "hatch.dynamotunnel2.tier.13", "UXV 1024A/s Laser Source Hatch", 13, 1024).getStackForm(1L)); eM_dynamoTunnel3_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15258, "hatch.dynamotunnel3.tier.13", "UXV 4096/t Laser Source Hatch", 13, 4096).getStackForm(1L)); + 15258, "hatch.dynamotunnel3.tier.13", "UXV 4096A/s Laser Source Hatch", 13, 4096).getStackForm(1L)); eM_dynamoTunnel4_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15268, "hatch.dynamotunnel4.tier.13", "UXV 16384/t Laser Source Hatch", 13, 16384).getStackForm(1L)); + 15268, "hatch.dynamotunnel4.tier.13", "UXV 16384A/s Laser Source Hatch", 13, 16384).getStackForm(1L)); eM_dynamoTunnel5_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15278, "hatch.dynamotunnel5.tier.13", "UXV 65536/t Laser Source Hatch", 13, 65536).getStackForm(1L)); + 15278, "hatch.dynamotunnel5.tier.13", "UXV 65536A/s Laser Source Hatch", 13, 65536).getStackForm(1L)); eM_dynamoTunnel6_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15288, "hatch.dynamotunnel6.tier.13", "UXV 262144/t Laser Source Hatch", 13, 262144).getStackForm(1L)); + 15288, "hatch.dynamotunnel6.tier.13", "UXV 262144A/s Laser Source Hatch", 13, 262144).getStackForm(1L)); eM_dynamoTunnel7_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15298, "hatch.dynamotunnel7.tier.13", "UXV 1048576/t Laser Source Hatch", 13, 1048576).getStackForm(1L)); + 15298, "hatch.dynamotunnel7.tier.13", "UXV 1048576A/s Laser Source Hatch", 13, 1048576).getStackForm(1L)); eM_dynamoTunnel9001.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( 15299, "hatch.dynamotunnel.tier.14", "Legendary Laser Source Hatch", 14, (int) V[14]).getStackForm(1L)); diff --git a/src/main/resources/assets/tectech/lang/en_US.lang b/src/main/resources/assets/tectech/lang/en_US.lang index 5005a90c60..70f7d5ab8f 100644 --- a/src/main/resources/assets/tectech/lang/en_US.lang +++ b/src/main/resources/assets/tectech/lang/en_US.lang @@ -210,69 +210,69 @@ gt.blockmachines.hatch.energymulti64.tier.13.name=UXV 64A Energy Hatch gt.blockmachines.hatch.energymulti.desc.0=Multiple Ampere Energy Injector for Multiblocks gt.blockmachines.hatch.energymulti.desc.1=Amperes In -gt.blockmachines.hatch.energytunnel1.tier.05.name=IV 256/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel2.tier.05.name=IV 1024/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel3.tier.05.name=IV 4096/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel4.tier.05.name=IV 16384/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel5.tier.05.name=IV 65536/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel6.tier.05.name=IV 262144/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel7.tier.05.name=IV 1048576/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel1.tier.06.name=LuV 256/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel2.tier.06.name=LuV 1024/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel3.tier.06.name=LuV 4096/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel4.tier.06.name=LuV 16384/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel5.tier.06.name=LuV 65536/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel6.tier.06.name=LuV 262144/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel7.tier.06.name=LuV 1048576/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel1.tier.07.name=ZPM 256/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel2.tier.07.name=ZPM 1024/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel3.tier.07.name=ZPM 4096/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel4.tier.07.name=ZPM 16384/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel5.tier.07.name=ZPM 65536/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel6.tier.07.name=ZPM 262144/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel7.tier.07.name=ZPM 1048576/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel1.tier.08.name=UV 256/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel2.tier.08.name=UV 1024/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel3.tier.08.name=UV 4096/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel4.tier.08.name=UV 16384/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel5.tier.08.name=UV 65536/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel6.tier.08.name=UV 262144/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel7.tier.08.name=UV 1048576/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel1.tier.09.name=UHV 256/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel2.tier.09.name=UHV 1024/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel3.tier.09.name=UHV 4096/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel4.tier.09.name=UHV 16384/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel5.tier.09.name=UHV 65536/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel6.tier.09.name=UHV 262144/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel7.tier.09.name=UHV 1048576/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel1.tier.10.name=UEV 256/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel2.tier.10.name=UEV 1024/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel3.tier.10.name=UEV 4096/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel4.tier.10.name=UEV 16384/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel5.tier.10.name=UEV 65536/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel6.tier.10.name=UEV 262144/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel7.tier.10.name=UEV 1048576/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel1.tier.11.name=UIV 256/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel2.tier.11.name=UIV 1024/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel3.tier.11.name=UIV 4096/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel4.tier.11.name=UIV 16384/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel5.tier.11.name=UIV 65536/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel6.tier.11.name=UIV 262144/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel7.tier.11.name=UIV 1048576/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel1.tier.12.name=UMV 256/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel2.tier.12.name=UMV 1024/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel3.tier.12.name=UMV 4096/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel4.tier.12.name=UMV 16384/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel5.tier.12.name=UMV 65536/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel6.tier.12.name=UMV 262144/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel7.tier.12.name=UMV 1048576/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel1.tier.13.name=UXV 256/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel2.tier.13.name=UXV 1024/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel3.tier.13.name=UXV 4096/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel4.tier.13.name=UXV 16384/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel5.tier.13.name=UXV 65536/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel6.tier.13.name=UXV 262144/t Laser Target Hatch -gt.blockmachines.hatch.energytunnel7.tier.13.name=UXV 1048576/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel1.tier.05.name=IV 256A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel2.tier.05.name=IV 1024A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel3.tier.05.name=IV 4096A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel4.tier.05.name=IV 16384A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel5.tier.05.name=IV 65536A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel6.tier.05.name=IV 262144A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel7.tier.05.name=IV 1048576A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel1.tier.06.name=LuV 256A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel2.tier.06.name=LuV 1024A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel3.tier.06.name=LuV 4096A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel4.tier.06.name=LuV 16384A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel5.tier.06.name=LuV 65536A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel6.tier.06.name=LuV 262144A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel7.tier.06.name=LuV 1048576A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel1.tier.07.name=ZPM 256A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel2.tier.07.name=ZPM 1024A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel3.tier.07.name=ZPM 4096A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel4.tier.07.name=ZPM 16384A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel5.tier.07.name=ZPM 65536A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel6.tier.07.name=ZPM 262144A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel7.tier.07.name=ZPM 1048576A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel1.tier.08.name=UV 256A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel2.tier.08.name=UV 1024A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel3.tier.08.name=UV 4096A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel4.tier.08.name=UV 16384A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel5.tier.08.name=UV 65536A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel6.tier.08.name=UV 262144A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel7.tier.08.name=UV 1048576A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel1.tier.09.name=UHV 256A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel2.tier.09.name=UHV 1024A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel3.tier.09.name=UHV 4096A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel4.tier.09.name=UHV 16384A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel5.tier.09.name=UHV 65536A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel6.tier.09.name=UHV 262144A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel7.tier.09.name=UHV 1048576A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel1.tier.10.name=UEV 256A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel2.tier.10.name=UEV 1024A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel3.tier.10.name=UEV 4096A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel4.tier.10.name=UEV 16384A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel5.tier.10.name=UEV 65536A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel6.tier.10.name=UEV 262144A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel7.tier.10.name=UEV 1048576A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel1.tier.11.name=UIV 256A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel2.tier.11.name=UIV 1024A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel3.tier.11.name=UIV 4096A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel4.tier.11.name=UIV 16384A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel5.tier.11.name=UIV 65536A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel6.tier.11.name=UIV 262144A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel7.tier.11.name=UIV 1048576A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel1.tier.12.name=UMV 256A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel2.tier.12.name=UMV 1024A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel3.tier.12.name=UMV 4096A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel4.tier.12.name=UMV 16384A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel5.tier.12.name=UMV 65536A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel6.tier.12.name=UMV 262144A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel7.tier.12.name=UMV 1048576A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel1.tier.13.name=UXV 256A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel2.tier.13.name=UXV 1024A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel3.tier.13.name=UXV 4096A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel4.tier.13.name=UXV 16384A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel5.tier.13.name=UXV 65536A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel6.tier.13.name=UXV 262144A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel7.tier.13.name=UXV 1048576A/s Laser Target Hatch gt.blockmachines.hatch.energytunnel.tier.14.name=Legendary Laser Target Hatch gt.blockmachines.hatch.energytunnel.desc.0=Energy injecting terminal for Multiblocks gt.blockmachines.hatch.energytunnel.desc.1=Throughput @@ -307,69 +307,69 @@ gt.blockmachines.hatch.dynamomulti64.tier.13.name=IV 64A Dynamo Hatch gt.blockmachines.hatch.dynamomulti.desc.0=Multiple Ampere Energy Extractor for Multiblocks gt.blockmachines.hatch.dynamomulti.desc.1=Amperes Out -gt.blockmachines.hatch.dynamotunnel1.tier.05.name=IV 256/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel2.tier.05.name=IV 1024/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel3.tier.05.name=IV 4096/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel4.tier.05.name=IV 16384/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel5.tier.05.name=IV 65536/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel6.tier.05.name=IV 262144/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel7.tier.05.name=IV 1048576/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel1.tier.06.name=LuV 256/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel2.tier.06.name=LuV 1024/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel3.tier.06.name=LuV 4096/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel4.tier.06.name=LuV 16384/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel5.tier.06.name=LuV 65536/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel6.tier.06.name=LuV 262144/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel7.tier.06.name=LuV 1048576/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel1.tier.07.name=ZPM 256/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel2.tier.07.name=ZPM 1024/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel3.tier.07.name=ZPM 4096/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel4.tier.07.name=ZPM 16384/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel5.tier.07.name=ZPM 65536/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel6.tier.07.name=ZPM 262144/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel7.tier.07.name=ZPM 1048576/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel1.tier.08.name=UV 256/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel2.tier.08.name=UV 1024/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel3.tier.08.name=UV 4096/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel4.tier.08.name=UV 16384/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel5.tier.08.name=UV 65536/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel6.tier.08.name=UV 262144/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel7.tier.08.name=UV 1048576/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel1.tier.09.name=UHV 256/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel2.tier.09.name=UHV 1024/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel3.tier.09.name=UHV 4096/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel4.tier.09.name=UHV 16384/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel5.tier.09.name=UHV 65536/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel6.tier.09.name=UHV 262144/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel7.tier.09.name=UHV 1048576/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel1.tier.10.name=UEV 256/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel2.tier.10.name=UEV 1024/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel3.tier.10.name=UEV 4096/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel4.tier.10.name=UEV 16384/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel5.tier.10.name=UEV 65536/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel6.tier.10.name=UEV 262144/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel7.tier.10.name=UEV 1048576/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel1.tier.11.name=UIV 256/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel2.tier.11.name=UIV 1024/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel3.tier.11.name=UIV 4096/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel4.tier.11.name=UIV 16384/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel5.tier.11.name=UIV 65536/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel6.tier.11.name=UIV 262144/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel7.tier.11.name=UIV 1048576/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel1.tier.12.name=UMV 256/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel2.tier.12.name=UMV 1024/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel3.tier.12.name=UMV 4096/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel4.tier.12.name=UMV 16384/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel5.tier.12.name=UMV 65536/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel6.tier.12.name=UMV 262144/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel7.tier.12.name=UMV 1048576/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel1.tier.13.name=UXV 256/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel2.tier.13.name=UXV 1024/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel3.tier.13.name=UXV 4096/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel4.tier.13.name=UXV 16384/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel5.tier.13.name=UXV 65536/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel6.tier.13.name=UXV 262144/t Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel7.tier.13.name=UXV 1048576/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel1.tier.05.name=IV 256A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel2.tier.05.name=IV 1024A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel3.tier.05.name=IV 4096A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel4.tier.05.name=IV 16384A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel5.tier.05.name=IV 65536A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel6.tier.05.name=IV 262144A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel7.tier.05.name=IV 1048576A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel1.tier.06.name=LuV 256A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel2.tier.06.name=LuV 1024A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel3.tier.06.name=LuV 4096A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel4.tier.06.name=LuV 16384A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel5.tier.06.name=LuV 65536A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel6.tier.06.name=LuV 262144A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel7.tier.06.name=LuV 1048576A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel1.tier.07.name=ZPM 256A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel2.tier.07.name=ZPM 1024A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel3.tier.07.name=ZPM 4096A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel4.tier.07.name=ZPM 16384A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel5.tier.07.name=ZPM 65536A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel6.tier.07.name=ZPM 262144A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel7.tier.07.name=ZPM 1048576A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel1.tier.08.name=UV 256A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel2.tier.08.name=UV 1024A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel3.tier.08.name=UV 4096A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel4.tier.08.name=UV 16384A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel5.tier.08.name=UV 65536A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel6.tier.08.name=UV 262144A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel7.tier.08.name=UV 1048576A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel1.tier.09.name=UHV 256A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel2.tier.09.name=UHV 1024A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel3.tier.09.name=UHV 4096A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel4.tier.09.name=UHV 16384A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel5.tier.09.name=UHV 65536A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel6.tier.09.name=UHV 262144A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel7.tier.09.name=UHV 1048576A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel1.tier.10.name=UEV 256A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel2.tier.10.name=UEV 1024A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel3.tier.10.name=UEV 4096A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel4.tier.10.name=UEV 16384A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel5.tier.10.name=UEV 65536A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel6.tier.10.name=UEV 262144A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel7.tier.10.name=UEV 1048576A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel1.tier.11.name=UIV 256A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel2.tier.11.name=UIV 1024A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel3.tier.11.name=UIV 4096A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel4.tier.11.name=UIV 16384A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel5.tier.11.name=UIV 65536A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel6.tier.11.name=UIV 262144A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel7.tier.11.name=UIV 1048576A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel1.tier.12.name=UMV 256A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel2.tier.12.name=UMV 1024A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel3.tier.12.name=UMV 4096A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel4.tier.12.name=UMV 16384A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel5.tier.12.name=UMV 65536A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel6.tier.12.name=UMV 262144A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel7.tier.12.name=UMV 1048576A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel1.tier.13.name=UXV 256A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel2.tier.13.name=UXV 1024A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel3.tier.13.name=UXV 4096A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel4.tier.13.name=UXV 16384A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel5.tier.13.name=UXV 65536A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel6.tier.13.name=UXV 262144A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel7.tier.13.name=UXV 1048576A/s Laser Source Hatch gt.blockmachines.hatch.dynamotunnel.tier.14.name=Legendary Laser Source Hatch gt.blockmachines.hatch.dynamotunnel.desc.0=Energy extracting terminal for Multiblocks gt.blockmachines.hatch.dynamotunnel.desc.1=Throughput diff --git a/src/main/resources/assets/tectech/lang/zh_CN.lang b/src/main/resources/assets/tectech/lang/zh_CN.lang index a96b13a58f..3484eb3579 100644 --- a/src/main/resources/assets/tectech/lang/zh_CN.lang +++ b/src/main/resources/assets/tectech/lang/zh_CN.lang @@ -210,69 +210,69 @@ gt.blockmachines.hatch.energymulti64.tier.13.name=64安UXV能源仓 gt.blockmachines.hatch.energymulti.desc.0=为多方块机器以高电流输入能源 gt.blockmachines.hatch.energymulti.desc.1=输入电流 -gt.blockmachines.hatch.energytunnel1.tier.05.name=IV 256/t 激光靶仓 -gt.blockmachines.hatch.energytunnel2.tier.05.name=IV 1024/t 激光靶仓 -gt.blockmachines.hatch.energytunnel3.tier.05.name=IV 4096/t 激光靶仓 -gt.blockmachines.hatch.energytunnel4.tier.05.name=IV 16384/t 激光靶仓 -gt.blockmachines.hatch.energytunnel5.tier.05.name=IV 65536/t 激光靶仓 -gt.blockmachines.hatch.energytunnel6.tier.05.name=IV 262144/t 激光靶仓 -gt.blockmachines.hatch.energytunnel7.tier.05.name=IV 1048576/t 激光靶仓 -gt.blockmachines.hatch.energytunnel1.tier.06.name=LuV 256/t 激光靶仓 -gt.blockmachines.hatch.energytunnel2.tier.06.name=LuV 1024/t 激光靶仓 -gt.blockmachines.hatch.energytunnel3.tier.06.name=LuV 4096/t 激光靶仓 -gt.blockmachines.hatch.energytunnel4.tier.06.name=LuV 16384/t 激光靶仓 -gt.blockmachines.hatch.energytunnel5.tier.06.name=LuV 65536/t 激光靶仓 -gt.blockmachines.hatch.energytunnel6.tier.06.name=LuV 262144/t 激光靶仓 -gt.blockmachines.hatch.energytunnel7.tier.06.name=LuV 1048576/t 激光靶仓 -gt.blockmachines.hatch.energytunnel1.tier.07.name=ZPM 256/t 激光靶仓 -gt.blockmachines.hatch.energytunnel2.tier.07.name=ZPM 1024/t 激光靶仓 -gt.blockmachines.hatch.energytunnel3.tier.07.name=ZPM 4096/t 激光靶仓 -gt.blockmachines.hatch.energytunnel4.tier.07.name=ZPM 16384/t 激光靶仓 -gt.blockmachines.hatch.energytunnel5.tier.07.name=ZPM 65536/t 激光靶仓 -gt.blockmachines.hatch.energytunnel6.tier.07.name=ZPM 262144/t 激光靶仓 -gt.blockmachines.hatch.energytunnel7.tier.07.name=ZPM 1048576/t 激光靶仓 -gt.blockmachines.hatch.energytunnel1.tier.08.name=UV 256/t 激光靶仓 -gt.blockmachines.hatch.energytunnel2.tier.08.name=UV 1024/t 激光靶仓 -gt.blockmachines.hatch.energytunnel3.tier.08.name=UV 4096/t 激光靶仓 -gt.blockmachines.hatch.energytunnel4.tier.08.name=UV 16384/t 激光靶仓 -gt.blockmachines.hatch.energytunnel5.tier.08.name=UV 65536/t 激光靶仓 -gt.blockmachines.hatch.energytunnel6.tier.08.name=UV 262144/t 激光靶仓 -gt.blockmachines.hatch.energytunnel7.tier.08.name=UV 1048576/t 激光靶仓 -gt.blockmachines.hatch.energytunnel1.tier.09.name=UHV 256/t 激光靶仓 -gt.blockmachines.hatch.energytunnel2.tier.09.name=UHV 1024/t 激光靶仓 -gt.blockmachines.hatch.energytunnel3.tier.09.name=UHV 4096/t 激光靶仓 -gt.blockmachines.hatch.energytunnel4.tier.09.name=UHV 16384/t 激光靶仓 -gt.blockmachines.hatch.energytunnel5.tier.09.name=UHV 65536/t 激光靶仓 -gt.blockmachines.hatch.energytunnel6.tier.09.name=UHV 262144/t 激光靶仓 -gt.blockmachines.hatch.energytunnel7.tier.09.name=UHV 1048576/t 激光靶仓 -gt.blockmachines.hatch.energytunnel1.tier.10.name=UEV 256/t 激光靶仓 -gt.blockmachines.hatch.energytunnel2.tier.10.name=UEV 1024/t 激光靶仓 -gt.blockmachines.hatch.energytunnel3.tier.10.name=UEV 4096/t 激光靶仓 -gt.blockmachines.hatch.energytunnel4.tier.10.name=UEV 16384/t 激光靶仓 -gt.blockmachines.hatch.energytunnel5.tier.10.name=UEV 65536/t 激光靶仓 -gt.blockmachines.hatch.energytunnel6.tier.10.name=UEV 262144/t 激光靶仓 -gt.blockmachines.hatch.energytunnel7.tier.10.name=UEV 1048576/t 激光靶仓 -gt.blockmachines.hatch.energytunnel1.tier.11.name=UIV 256/t 激光靶仓 -gt.blockmachines.hatch.energytunnel2.tier.11.name=UIV 1024/t 激光靶仓 -gt.blockmachines.hatch.energytunnel3.tier.11.name=UIV 4096/t 激光靶仓 -gt.blockmachines.hatch.energytunnel4.tier.11.name=UIV 16384/t 激光靶仓 -gt.blockmachines.hatch.energytunnel5.tier.11.name=UIV 65536/t 激光靶仓 -gt.blockmachines.hatch.energytunnel6.tier.11.name=UIV 262144/t 激光靶仓 -gt.blockmachines.hatch.energytunnel7.tier.11.name=UIV 1048576/t 激光靶仓 -gt.blockmachines.hatch.energytunnel1.tier.12.name=UMV 256/t 激光靶仓 -gt.blockmachines.hatch.energytunnel2.tier.12.name=UMV 1024/t 激光靶仓 -gt.blockmachines.hatch.energytunnel3.tier.12.name=UMV 4096/t 激光靶仓 -gt.blockmachines.hatch.energytunnel4.tier.12.name=UMV 16384/t 激光靶仓 -gt.blockmachines.hatch.energytunnel5.tier.12.name=UMV 65536/t 激光靶仓 -gt.blockmachines.hatch.energytunnel6.tier.12.name=UMV 262144/t 激光靶仓 -gt.blockmachines.hatch.energytunnel7.tier.12.name=UMV 1048576/t 激光靶仓 -gt.blockmachines.hatch.energytunnel1.tier.13.name=UXV 256/t 激光靶仓 -gt.blockmachines.hatch.energytunnel2.tier.13.name=UXV 1024/t 激光靶仓 -gt.blockmachines.hatch.energytunnel3.tier.13.name=UXV 4096/t 激光靶仓 -gt.blockmachines.hatch.energytunnel4.tier.13.name=UXV 16384/t 激光靶仓 -gt.blockmachines.hatch.energytunnel5.tier.13.name=UXV 65536/t 激光靶仓 -gt.blockmachines.hatch.energytunnel6.tier.13.name=UXV 262144/t 激光靶仓 -gt.blockmachines.hatch.energytunnel7.tier.13.name=UXV 1048576/t 激光靶仓 +gt.blockmachines.hatch.energytunnel1.tier.05.name=IV 256A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel2.tier.05.name=IV 1024A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel3.tier.05.name=IV 4096A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel4.tier.05.name=IV 16384A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel5.tier.05.name=IV 65536A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel6.tier.05.name=IV 262144A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel7.tier.05.name=IV 1048576A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel1.tier.06.name=LuV 256A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel2.tier.06.name=LuV 1024A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel3.tier.06.name=LuV 4096A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel4.tier.06.name=LuV 16384A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel5.tier.06.name=LuV 65536A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel6.tier.06.name=LuV 262144A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel7.tier.06.name=LuV 1048576A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel1.tier.07.name=ZPM 256A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel2.tier.07.name=ZPM 1024A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel3.tier.07.name=ZPM 4096A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel4.tier.07.name=ZPM 16384A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel5.tier.07.name=ZPM 65536A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel6.tier.07.name=ZPM 262144A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel7.tier.07.name=ZPM 1048576A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel1.tier.08.name=UV 256A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel2.tier.08.name=UV 1024A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel3.tier.08.name=UV 4096A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel4.tier.08.name=UV 16384A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel5.tier.08.name=UV 65536A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel6.tier.08.name=UV 262144A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel7.tier.08.name=UV 1048576A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel1.tier.09.name=UHV 256A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel2.tier.09.name=UHV 1024A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel3.tier.09.name=UHV 4096A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel4.tier.09.name=UHV 16384A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel5.tier.09.name=UHV 65536A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel6.tier.09.name=UHV 262144A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel7.tier.09.name=UHV 1048576A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel1.tier.10.name=UEV 256A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel2.tier.10.name=UEV 1024A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel3.tier.10.name=UEV 4096A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel4.tier.10.name=UEV 16384A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel5.tier.10.name=UEV 65536A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel6.tier.10.name=UEV 262144A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel7.tier.10.name=UEV 1048576A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel1.tier.11.name=UIV 256A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel2.tier.11.name=UIV 1024A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel3.tier.11.name=UIV 4096A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel4.tier.11.name=UIV 16384A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel5.tier.11.name=UIV 65536A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel6.tier.11.name=UIV 262144A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel7.tier.11.name=UIV 1048576A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel1.tier.12.name=UMV 256A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel2.tier.12.name=UMV 1024A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel3.tier.12.name=UMV 4096A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel4.tier.12.name=UMV 16384A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel5.tier.12.name=UMV 65536A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel6.tier.12.name=UMV 262144A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel7.tier.12.name=UMV 1048576A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel1.tier.13.name=UXV 256A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel2.tier.13.name=UXV 1024A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel3.tier.13.name=UXV 4096A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel4.tier.13.name=UXV 16384A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel5.tier.13.name=UXV 65536A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel6.tier.13.name=UXV 262144A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel7.tier.13.name=UXV 1048576A/s 激光靶仓 gt.blockmachines.hatch.energytunnel.tier.14.name=传奇激光靶仓 gt.blockmachines.hatch.energytunnel.desc.0=多方块机器的能量输入端 gt.blockmachines.hatch.energytunnel.desc.1=通量 @@ -307,69 +307,69 @@ gt.blockmachines.hatch.dynamomulti64.tier.13.name=64安IV动力仓 gt.blockmachines.hatch.dynamomulti.desc.0=从多方块机器以高电流输出能源 gt.blockmachines.hatch.dynamomulti.desc.1=输出电流 -gt.blockmachines.hatch.dynamotunnel1.tier.05.name=IV 256/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel2.tier.05.name=IV 1024/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel3.tier.05.name=IV 4096/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel4.tier.05.name=IV 16384/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel5.tier.05.name=IV 65536/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel6.tier.05.name=IV 262144/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel7.tier.05.name=IV 1048576/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel1.tier.06.name=LuV 256/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel2.tier.06.name=LuV 1024/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel3.tier.06.name=LuV 4096/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel4.tier.06.name=LuV 16384/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel5.tier.06.name=LuV 65536/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel6.tier.06.name=LuV 262144/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel7.tier.06.name=LuV 1048576/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel1.tier.07.name=ZPM 256/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel2.tier.07.name=ZPM 1024/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel3.tier.07.name=ZPM 4096/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel4.tier.07.name=ZPM 16384/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel5.tier.07.name=ZPM 65536/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel6.tier.07.name=ZPM 262144/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel7.tier.07.name=ZPM 1048576/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel1.tier.08.name=UV 256/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel2.tier.08.name=UV 1024/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel3.tier.08.name=UV 4096/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel4.tier.08.name=UV 16384/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel5.tier.08.name=UV 65536/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel6.tier.08.name=UV 262144/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel7.tier.08.name=UV 1048576/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel1.tier.09.name=UHV 256/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel2.tier.09.name=UHV 1024/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel3.tier.09.name=UHV 4096/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel4.tier.09.name=UHV 16384/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel5.tier.09.name=UHV 65536/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel6.tier.09.name=UHV 262144/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel7.tier.09.name=UHV 1048576/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel1.tier.10.name=UEV 256/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel2.tier.10.name=UEV 1024/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel3.tier.10.name=UEV 4096/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel4.tier.10.name=UEV 16384/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel5.tier.10.name=UEV 65536/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel6.tier.10.name=UEV 262144/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel7.tier.10.name=UEV 1048576/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel1.tier.11.name=UIV 256/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel2.tier.11.name=UIV 1024/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel3.tier.11.name=UIV 4096/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel4.tier.11.name=UIV 16384/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel5.tier.11.name=UIV 65536/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel6.tier.11.name=UIV 262144/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel7.tier.11.name=UIV 1048576/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel1.tier.12.name=UMV 256/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel2.tier.12.name=UMV 1024/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel3.tier.12.name=UMV 4096/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel4.tier.12.name=UMV 16384/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel5.tier.12.name=UMV 65536/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel6.tier.12.name=UMV 262144/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel7.tier.12.name=UMV 1048576/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel1.tier.13.name=UXV 256/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel2.tier.13.name=UXV 1024/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel3.tier.13.name=UXV 4096/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel4.tier.13.name=UXV 16384/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel5.tier.13.name=UXV 65536/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel6.tier.13.name=UXV 262144/t 激光源仓 -gt.blockmachines.hatch.dynamotunnel7.tier.13.name=UXV 1048576/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel1.tier.05.name=IV 256A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel2.tier.05.name=IV 1024A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel3.tier.05.name=IV 4096A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel4.tier.05.name=IV 16384A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel5.tier.05.name=IV 65536A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel6.tier.05.name=IV 262144A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel7.tier.05.name=IV 1048576A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel1.tier.06.name=LuV 256A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel2.tier.06.name=LuV 1024A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel3.tier.06.name=LuV 4096A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel4.tier.06.name=LuV 16384A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel5.tier.06.name=LuV 65536A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel6.tier.06.name=LuV 262144A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel7.tier.06.name=LuV 1048576A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel1.tier.07.name=ZPM 256A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel2.tier.07.name=ZPM 1024A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel3.tier.07.name=ZPM 4096A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel4.tier.07.name=ZPM 16384A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel5.tier.07.name=ZPM 65536A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel6.tier.07.name=ZPM 262144A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel7.tier.07.name=ZPM 1048576A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel1.tier.08.name=UV 256A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel2.tier.08.name=UV 1024A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel3.tier.08.name=UV 4096A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel4.tier.08.name=UV 16384A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel5.tier.08.name=UV 65536A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel6.tier.08.name=UV 262144A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel7.tier.08.name=UV 1048576A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel1.tier.09.name=UHV 256A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel2.tier.09.name=UHV 1024A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel3.tier.09.name=UHV 4096A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel4.tier.09.name=UHV 16384A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel5.tier.09.name=UHV 65536A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel6.tier.09.name=UHV 262144A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel7.tier.09.name=UHV 1048576A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel1.tier.10.name=UEV 256A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel2.tier.10.name=UEV 1024A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel3.tier.10.name=UEV 4096A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel4.tier.10.name=UEV 16384A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel5.tier.10.name=UEV 65536A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel6.tier.10.name=UEV 262144A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel7.tier.10.name=UEV 1048576A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel1.tier.11.name=UIV 256A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel2.tier.11.name=UIV 1024A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel3.tier.11.name=UIV 4096A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel4.tier.11.name=UIV 16384A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel5.tier.11.name=UIV 65536A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel6.tier.11.name=UIV 262144A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel7.tier.11.name=UIV 1048576A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel1.tier.12.name=UMV 256A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel2.tier.12.name=UMV 1024A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel3.tier.12.name=UMV 4096A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel4.tier.12.name=UMV 16384A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel5.tier.12.name=UMV 65536A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel6.tier.12.name=UMV 262144A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel7.tier.12.name=UMV 1048576A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel1.tier.13.name=UXV 256A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel2.tier.13.name=UXV 1024A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel3.tier.13.name=UXV 4096A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel4.tier.13.name=UXV 16384A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel5.tier.13.name=UXV 65536A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel6.tier.13.name=UXV 262144A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel7.tier.13.name=UXV 1048576A/s 激光源仓 gt.blockmachines.hatch.dynamotunnel.tier.14.name=传奇激光源仓 gt.blockmachines.hatch.dynamotunnel.desc.0=多方块机器的能量输出端 gt.blockmachines.hatch.dynamotunnel.desc.1=通量 -- cgit From 92b50677c155e8781efc26a5e9ddb660c48ffec5 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 12 May 2020 21:35:29 +0200 Subject: Added config Option for Block Nerf (#28) --- .../github/technus/tectech/loader/MainLoader.java | 11 ++++++++--- .../github/technus/tectech/loader/TecTechConfig.java | 20 ++++++++++++-------- 2 files changed, 20 insertions(+), 11 deletions(-) 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 bab6c6d092..d473da6b07 100644 --- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java @@ -153,9 +153,14 @@ public final class MainLoader { registerExtraHazmats(); TecTech.LOGGER.info("Hazmat additions done"); - progressBarPostLoad.step("Nerf blocks blast resistance"); - fixBlocks(); - TecTech.LOGGER.info("Blocks nerf done"); + if (!configTecTech.DISABLE_BLOCK_HARDNESS_NERF) { + progressBarPostLoad.step("Nerf blocks blast resistance"); + fixBlocks(); + TecTech.LOGGER.info("Blocks nerf done"); + } else { + progressBarPostLoad.step("Do not nerf blocks blast resistance"); + TecTech.LOGGER.info("Blocks were not nerfed"); + } progressBarPostLoad.step("Constructable stuff"); new ConstructableLoader().run(); diff --git a/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java b/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java index e16580befe..0c2920e585 100644 --- a/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java +++ b/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java @@ -18,6 +18,7 @@ public class TecTechConfig extends ConfigManager { public boolean NERF_FUSION; public boolean ENABLE_TURRET_EXPLOSIONS; public boolean DISABLE_MATERIAL_LOADING_FFS; + public boolean DISABLE_BLOCK_HARDNESS_NERF; public float TURRET_DAMAGE_FACTOR; public float TURRET_EXPLOSION_FACTOR; public float TESLA_MULTI_MIN_EFFICIENCY; @@ -38,8 +39,9 @@ public class TecTechConfig extends ConfigManager { EASY_SCAN = false; BOOM_ENABLE = true; NERF_FUSION = false; + DISABLE_BLOCK_HARDNESS_NERF = false; ENABLE_TURRET_EXPLOSIONS = true; - DISABLE_MATERIAL_LOADING_FFS=false; + DISABLE_MATERIAL_LOADING_FFS = false; TURRET_DAMAGE_FACTOR = 10; TURRET_EXPLOSION_FACTOR = 1; TESLA_MULTI_MIN_EFFICIENCY = 0.955F; @@ -72,19 +74,21 @@ public class TecTechConfig extends ConfigManager { "Damage is multiplied by this number"); TURRET_EXPLOSION_FACTOR = _mainConfig.getFloat("TurretExplosionFactor", "Features", TURRET_EXPLOSION_FACTOR, 0, Short.MAX_VALUE, "Explosion strength is multiplied by this number"); - DISABLE_MATERIAL_LOADING_FFS = _mainConfig.getBoolean("DisableMaterialLoading", "Debug", DISABLE_MATERIAL_LOADING_FFS, + DISABLE_BLOCK_HARDNESS_NERF = _mainConfig.getBoolean("DisableBlockHardnessNerf", "Features", DISABLE_BLOCK_HARDNESS_NERF, + "Set to true to disable the block hardness nerf"); + DISABLE_MATERIAL_LOADING_FFS = _mainConfig.getBoolean("DisableMaterialLoading", "Debug", DISABLE_MATERIAL_LOADING_FFS, "Set to true to disable gregtech material processing"); - TESLA_MULTI_MIN_EFFICIENCY = _mainConfig.getFloat("teslaMultiMinEfficency", "Features", TESLA_MULTI_MIN_EFFICIENCY, 0, 1, + TESLA_MULTI_MIN_EFFICIENCY = _mainConfig.getFloat("teslaMultiMinEfficency", "Features", TESLA_MULTI_MIN_EFFICIENCY, 0, 1, "Worst possible power loss per block for the multi block tesla"); - TESLA_MULTI_MAX_EFFICIENCY = _mainConfig.getFloat("teslaMultiMaxEfficency", "Features", TESLA_MULTI_MAX_EFFICIENCY, 0, 1, + TESLA_MULTI_MAX_EFFICIENCY = _mainConfig.getFloat("teslaMultiMaxEfficency", "Features", TESLA_MULTI_MAX_EFFICIENCY, 0, 1, "Best possible power loss per block for the multi block tesla"); - TESLA_MULTI_OVERDRIVE_LOSS = _mainConfig.getFloat("teslaMultiOverdriveLoss", "Features", TESLA_MULTI_OVERDRIVE_LOSS, 0, 1, + TESLA_MULTI_OVERDRIVE_LOSS = _mainConfig.getFloat("teslaMultiOverdriveLoss", "Features", TESLA_MULTI_OVERDRIVE_LOSS, 0, 1, "Additional losses for overdrive use on the multi block tesla"); - TESLA_SINGLE_MIN_EFFICIENCY = _mainConfig.getFloat("teslaSingleMinEfficency", "Features", TESLA_SINGLE_MIN_EFFICIENCY, 0, 1, + TESLA_SINGLE_MIN_EFFICIENCY = _mainConfig.getFloat("teslaSingleMinEfficency", "Features", TESLA_SINGLE_MIN_EFFICIENCY, 0, 1, "Worst possible power loss per block for the single block tesla"); - TESLA_SINGLE_MAX_EFFICIENCY = _mainConfig.getFloat("teslaSingleMaxEfficency", "Features", TESLA_SINGLE_MAX_EFFICIENCY, 0, 1, + TESLA_SINGLE_MAX_EFFICIENCY = _mainConfig.getFloat("teslaSingleMaxEfficency", "Features", TESLA_SINGLE_MAX_EFFICIENCY, 0, 1, "Best possible power loss per block for the single block tesla"); - TESLA_SINGLE_OVERDRIVE_LOSS = _mainConfig.getFloat("teslaSingleOverdriveLoss", "Features", TESLA_SINGLE_OVERDRIVE_LOSS, 0, 1, + TESLA_SINGLE_OVERDRIVE_LOSS = _mainConfig.getFloat("teslaSingleOverdriveLoss", "Features", TESLA_SINGLE_OVERDRIVE_LOSS, 0, 1, "Additional losses for overdrive use on the single block tesla"); } -- cgit From 20212d1d6950dadd1fa705f144d8f62abe59fbfc Mon Sep 17 00:00:00 2001 From: Tec Date: Tue, 12 May 2020 22:14:22 +0200 Subject: Fix laser logic --- .../tectech/loader/thing/MachineLoader.java | 252 ++++++++++----------- .../GT_MetaTileEntity_Hatch_DynamoTunnel.java | 7 +- src/main/resources/assets/tectech/lang/en_US.lang | 252 ++++++++++----------- src/main/resources/assets/tectech/lang/zh_CN.lang | 252 ++++++++++----------- 4 files changed, 381 insertions(+), 382 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index 7b1e85591d..3891d28845 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -198,139 +198,139 @@ public class MachineLoader implements Runnable { // =================================================================================================== eM_energyTunnel1_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15130, "hatch.energytunnel1.tier.05", "IV 256A/s Laser Target Hatch", 5, 256).getStackForm(1L)); + 15130, "hatch.energytunnel1.tier.05", "IV 256A/t Laser Target Hatch", 5, 256).getStackForm(1L)); eM_energyTunnel2_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15140, "hatch.energytunnel2.tier.05", "IV 1024A/s Laser Target Hatch", 5, 1024).getStackForm(1L)); + 15140, "hatch.energytunnel2.tier.05", "IV 1024A/t Laser Target Hatch", 5, 1024).getStackForm(1L)); eM_energyTunnel3_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15150, "hatch.energytunnel3.tier.05", "IV 4096A/s Laser Target Hatch", 5, 4096).getStackForm(1L)); + 15150, "hatch.energytunnel3.tier.05", "IV 4096A/t Laser Target Hatch", 5, 4096).getStackForm(1L)); eM_energyTunnel4_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15160, "hatch.energytunnel4.tier.05", "IV 16384A/s Laser Target Hatch", 5, 16384).getStackForm(1L)); + 15160, "hatch.energytunnel4.tier.05", "IV 16384A/t Laser Target Hatch", 5, 16384).getStackForm(1L)); eM_energyTunnel5_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15170, "hatch.energytunnel5.tier.05", "IV 65536A/s Laser Target Hatch", 5, 65536).getStackForm(1L)); + 15170, "hatch.energytunnel5.tier.05", "IV 65536A/t Laser Target Hatch", 5, 65536).getStackForm(1L)); eM_energyTunnel6_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15180, "hatch.energytunnel6.tier.05", "IV 262144A/s Laser Target Hatch", 5, 262144).getStackForm(1L)); + 15180, "hatch.energytunnel6.tier.05", "IV 262144A/t Laser Target Hatch", 5, 262144).getStackForm(1L)); eM_energyTunnel7_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15190, "hatch.energytunnel7.tier.05", "IV 1048576A/s Laser Target Hatch", 5, 1048576).getStackForm(1L)); + 15190, "hatch.energytunnel7.tier.05", "IV 1048576A/t Laser Target Hatch", 5, 1048576).getStackForm(1L)); eM_energyTunnel1_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15131, "hatch.energytunnel1.tier.06", "LuV 256A/s Laser Target Hatch", 6, 256).getStackForm(1L)); + 15131, "hatch.energytunnel1.tier.06", "LuV 256A/t Laser Target Hatch", 6, 256).getStackForm(1L)); eM_energyTunnel2_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15141, "hatch.energytunnel2.tier.06", "LuV 1024A/s Laser Target Hatch", 6, 1024).getStackForm(1L)); + 15141, "hatch.energytunnel2.tier.06", "LuV 1024A/t Laser Target Hatch", 6, 1024).getStackForm(1L)); eM_energyTunnel3_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15151, "hatch.energytunnel3.tier.06", "LuV 4096A/s Laser Target Hatch", 6, 4096).getStackForm(1L)); + 15151, "hatch.energytunnel3.tier.06", "LuV 4096A/t Laser Target Hatch", 6, 4096).getStackForm(1L)); eM_energyTunnel4_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15161, "hatch.energytunnel4.tier.06", "LuV 16384A/s Laser Target Hatch", 6, 16384).getStackForm(1L)); + 15161, "hatch.energytunnel4.tier.06", "LuV 16384A/t Laser Target Hatch", 6, 16384).getStackForm(1L)); eM_energyTunnel5_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15171, "hatch.energytunnel5.tier.06", "LuV 65536A/s Laser Target Hatch", 6, 65536).getStackForm(1L)); + 15171, "hatch.energytunnel5.tier.06", "LuV 65536A/t Laser Target Hatch", 6, 65536).getStackForm(1L)); eM_energyTunnel6_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15181, "hatch.energytunnel6.tier.06", "LuV 262144A/s Laser Target Hatch", 6, 262144).getStackForm(1L)); + 15181, "hatch.energytunnel6.tier.06", "LuV 262144A/t Laser Target Hatch", 6, 262144).getStackForm(1L)); eM_energyTunnel7_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15191, "hatch.energytunnel7.tier.06", "LuV 1048576A/s Laser Target Hatch", 6, 1048576).getStackForm(1L)); + 15191, "hatch.energytunnel7.tier.06", "LuV 1048576A/t Laser Target Hatch", 6, 1048576).getStackForm(1L)); eM_energyTunnel1_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15132, "hatch.energytunnel1.tier.07", "ZPM 256A/s Laser Target Hatch", 7, 256).getStackForm(1L)); + 15132, "hatch.energytunnel1.tier.07", "ZPM 256A/t Laser Target Hatch", 7, 256).getStackForm(1L)); eM_energyTunnel2_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15142, "hatch.energytunnel2.tier.07", "ZPM 1024A/s Laser Target Hatch", 7, 1024).getStackForm(1L)); + 15142, "hatch.energytunnel2.tier.07", "ZPM 1024A/t Laser Target Hatch", 7, 1024).getStackForm(1L)); eM_energyTunnel3_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15152, "hatch.energytunnel3.tier.07", "ZPM 4096A/s Laser Target Hatch", 7, 4096).getStackForm(1L)); + 15152, "hatch.energytunnel3.tier.07", "ZPM 4096A/t Laser Target Hatch", 7, 4096).getStackForm(1L)); eM_energyTunnel4_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15162, "hatch.energytunnel4.tier.07", "ZPM 16384A/s Laser Target Hatch", 7, 16384).getStackForm(1L)); + 15162, "hatch.energytunnel4.tier.07", "ZPM 16384A/t Laser Target Hatch", 7, 16384).getStackForm(1L)); eM_energyTunnel5_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15172, "hatch.energytunnel5.tier.07", "ZPM 65536A/s Laser Target Hatch", 7, 65536).getStackForm(1L)); + 15172, "hatch.energytunnel5.tier.07", "ZPM 65536A/t Laser Target Hatch", 7, 65536).getStackForm(1L)); eM_energyTunnel6_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15182, "hatch.energytunnel6.tier.07", "ZPM 262144A/s Laser Target Hatch", 7, 262144).getStackForm(1L)); + 15182, "hatch.energytunnel6.tier.07", "ZPM 262144A/t Laser Target Hatch", 7, 262144).getStackForm(1L)); eM_energyTunnel7_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15192, "hatch.energytunnel7.tier.07", "ZPM 1048576A/s Laser Target Hatch", 7, 1048576).getStackForm(1L)); + 15192, "hatch.energytunnel7.tier.07", "ZPM 1048576A/t Laser Target Hatch", 7, 1048576).getStackForm(1L)); eM_energyTunnel1_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15133, "hatch.energytunnel1.tier.08", "UV 256A/s Laser Target Hatch", 8, 256).getStackForm(1L)); + 15133, "hatch.energytunnel1.tier.08", "UV 256A/t Laser Target Hatch", 8, 256).getStackForm(1L)); eM_energyTunnel2_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15143, "hatch.energytunnel2.tier.08", "UV 1024A/s Laser Target Hatch", 8, 1024).getStackForm(1L)); + 15143, "hatch.energytunnel2.tier.08", "UV 1024A/t Laser Target Hatch", 8, 1024).getStackForm(1L)); eM_energyTunnel3_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15153, "hatch.energytunnel3.tier.08", "UV 4096A/s Laser Target Hatch", 8, 4096).getStackForm(1L)); + 15153, "hatch.energytunnel3.tier.08", "UV 4096A/t Laser Target Hatch", 8, 4096).getStackForm(1L)); eM_energyTunnel4_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15163, "hatch.energytunnel4.tier.08", "UV 16384A/s Laser Target Hatch", 8, 16384).getStackForm(1L)); + 15163, "hatch.energytunnel4.tier.08", "UV 16384A/t Laser Target Hatch", 8, 16384).getStackForm(1L)); eM_energyTunnel5_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15173, "hatch.energytunnel5.tier.08", "UV 65536A/s Laser Target Hatch", 8, 65536).getStackForm(1L)); + 15173, "hatch.energytunnel5.tier.08", "UV 65536A/t Laser Target Hatch", 8, 65536).getStackForm(1L)); eM_energyTunnel6_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15183, "hatch.energytunnel6.tier.08", "UV 262144A/s Laser Target Hatch", 8, 262144).getStackForm(1L)); + 15183, "hatch.energytunnel6.tier.08", "UV 262144A/t Laser Target Hatch", 8, 262144).getStackForm(1L)); eM_energyTunnel7_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15193, "hatch.energytunnel7.tier.08", "UV 1048576A/s Laser Target Hatch", 8, 1048576).getStackForm(1L)); + 15193, "hatch.energytunnel7.tier.08", "UV 1048576A/t Laser Target Hatch", 8, 1048576).getStackForm(1L)); eM_energyTunnel1_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15134, "hatch.energytunnel1.tier.09", "UHV 256A/s Laser Target Hatch", 9, 256).getStackForm(1L)); + 15134, "hatch.energytunnel1.tier.09", "UHV 256A/t Laser Target Hatch", 9, 256).getStackForm(1L)); eM_energyTunnel2_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15144, "hatch.energytunnel2.tier.09", "UHV 1024A/s Laser Target Hatch", 9, 1024).getStackForm(1L)); + 15144, "hatch.energytunnel2.tier.09", "UHV 1024A/t Laser Target Hatch", 9, 1024).getStackForm(1L)); eM_energyTunnel3_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15154, "hatch.energytunnel3.tier.09", "UHV 4096A/s Laser Target Hatch", 9, 4096).getStackForm(1L)); + 15154, "hatch.energytunnel3.tier.09", "UHV 4096A/t Laser Target Hatch", 9, 4096).getStackForm(1L)); eM_energyTunnel4_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15164, "hatch.energytunnel4.tier.09", "UHV 16384A/s Laser Target Hatch", 9, 16384).getStackForm(1L)); + 15164, "hatch.energytunnel4.tier.09", "UHV 16384A/t Laser Target Hatch", 9, 16384).getStackForm(1L)); eM_energyTunnel5_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15174, "hatch.energytunnel5.tier.09", "UHV 65536A/s Laser Target Hatch", 9, 65536).getStackForm(1L)); + 15174, "hatch.energytunnel5.tier.09", "UHV 65536A/t Laser Target Hatch", 9, 65536).getStackForm(1L)); eM_energyTunnel6_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15184, "hatch.energytunnel6.tier.09", "UHV 262144A/s Laser Target Hatch", 9, 262144).getStackForm(1L)); + 15184, "hatch.energytunnel6.tier.09", "UHV 262144A/t Laser Target Hatch", 9, 262144).getStackForm(1L)); eM_energyTunnel7_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15194, "hatch.energytunnel7.tier.09", "UHV 1048576A/s Laser Target Hatch", 9, 1048576).getStackForm(1L)); + 15194, "hatch.energytunnel7.tier.09", "UHV 1048576A/t Laser Target Hatch", 9, 1048576).getStackForm(1L)); eM_energyTunnel1_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15135, "hatch.energytunnel1.tier.10", "UEV 256A/s Laser Target Hatch", 10, 256).getStackForm(1L)); + 15135, "hatch.energytunnel1.tier.10", "UEV 256A/t Laser Target Hatch", 10, 256).getStackForm(1L)); eM_energyTunnel2_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15145, "hatch.energytunnel2.tier.10", "UEV 1024A/s Laser Target Hatch", 10, 1024).getStackForm(1L)); + 15145, "hatch.energytunnel2.tier.10", "UEV 1024A/t Laser Target Hatch", 10, 1024).getStackForm(1L)); eM_energyTunnel3_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15155, "hatch.energytunnel3.tier.10", "UEV 4096A/s Laser Target Hatch", 10, 4096).getStackForm(1L)); + 15155, "hatch.energytunnel3.tier.10", "UEV 4096A/t Laser Target Hatch", 10, 4096).getStackForm(1L)); eM_energyTunnel4_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15165, "hatch.energytunnel4.tier.10", "UEV 16384A/s Laser Target Hatch", 10, 16384).getStackForm(1L)); + 15165, "hatch.energytunnel4.tier.10", "UEV 16384A/t Laser Target Hatch", 10, 16384).getStackForm(1L)); eM_energyTunnel5_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15175, "hatch.energytunnel5.tier.10", "UEV 65536A/s Laser Target Hatch", 10, 65536).getStackForm(1L)); + 15175, "hatch.energytunnel5.tier.10", "UEV 65536A/t Laser Target Hatch", 10, 65536).getStackForm(1L)); eM_energyTunnel6_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15185, "hatch.energytunnel6.tier.10", "UEV 262144A/s Laser Target Hatch", 10, 262144).getStackForm(1L)); + 15185, "hatch.energytunnel6.tier.10", "UEV 262144A/t Laser Target Hatch", 10, 262144).getStackForm(1L)); eM_energyTunnel7_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15195, "hatch.energytunnel7.tier.10", "UEV 1048576A/s Laser Target Hatch", 10, 1048576).getStackForm(1L)); + 15195, "hatch.energytunnel7.tier.10", "UEV 1048576A/t Laser Target Hatch", 10, 1048576).getStackForm(1L)); eM_energyTunnel1_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15136, "hatch.energytunnel1.tier.11", "UIV 256A/s Laser Target Hatch", 11, 256).getStackForm(1L)); + 15136, "hatch.energytunnel1.tier.11", "UIV 256A/t Laser Target Hatch", 11, 256).getStackForm(1L)); eM_energyTunnel2_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15146, "hatch.energytunnel2.tier.11", "UIV 1024A/s Laser Target Hatch", 11, 1024).getStackForm(1L)); + 15146, "hatch.energytunnel2.tier.11", "UIV 1024A/t Laser Target Hatch", 11, 1024).getStackForm(1L)); eM_energyTunnel3_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15156, "hatch.energytunnel3.tier.11", "UIV 4096A/s Laser Target Hatch", 11, 4096).getStackForm(1L)); + 15156, "hatch.energytunnel3.tier.11", "UIV 4096A/t Laser Target Hatch", 11, 4096).getStackForm(1L)); eM_energyTunnel4_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15166, "hatch.energytunnel4.tier.11", "UIV 16384A/s Laser Target Hatch", 11, 16384).getStackForm(1L)); + 15166, "hatch.energytunnel4.tier.11", "UIV 16384A/t Laser Target Hatch", 11, 16384).getStackForm(1L)); eM_energyTunnel5_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15176, "hatch.energytunnel5.tier.11", "UIV 65536A/s Laser Target Hatch", 11, 65536).getStackForm(1L)); + 15176, "hatch.energytunnel5.tier.11", "UIV 65536A/t Laser Target Hatch", 11, 65536).getStackForm(1L)); eM_energyTunnel6_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15186, "hatch.energytunnel6.tier.11", "UIV 262144A/s Laser Target Hatch", 11, 262144).getStackForm(1L)); + 15186, "hatch.energytunnel6.tier.11", "UIV 262144A/t Laser Target Hatch", 11, 262144).getStackForm(1L)); eM_energyTunnel7_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15196, "hatch.energytunnel7.tier.11", "UIV 1048576A/s Laser Target Hatch", 11, 1048576).getStackForm(1L)); + 15196, "hatch.energytunnel7.tier.11", "UIV 1048576A/t Laser Target Hatch", 11, 1048576).getStackForm(1L)); eM_energyTunnel1_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15137, "hatch.energytunnel1.tier.12", "UMV 256A/s Laser Target Hatch", 12, 256).getStackForm(1L)); + 15137, "hatch.energytunnel1.tier.12", "UMV 256A/t Laser Target Hatch", 12, 256).getStackForm(1L)); eM_energyTunnel2_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15147, "hatch.energytunnel2.tier.12", "UMV 1024A/s Laser Target Hatch", 12, 1024).getStackForm(1L)); + 15147, "hatch.energytunnel2.tier.12", "UMV 1024A/t Laser Target Hatch", 12, 1024).getStackForm(1L)); eM_energyTunnel3_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15157, "hatch.energytunnel3.tier.12", "UMV 4096A/s Laser Target Hatch", 12, 4096).getStackForm(1L)); + 15157, "hatch.energytunnel3.tier.12", "UMV 4096A/t Laser Target Hatch", 12, 4096).getStackForm(1L)); eM_energyTunnel4_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15167, "hatch.energytunnel4.tier.12", "UMV 16384A/s Laser Target Hatch", 12, 16384).getStackForm(1L)); + 15167, "hatch.energytunnel4.tier.12", "UMV 16384A/t Laser Target Hatch", 12, 16384).getStackForm(1L)); eM_energyTunnel5_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15177, "hatch.energytunnel5.tier.12", "UMV 65536A/s Laser Target Hatch", 12, 65536).getStackForm(1L)); + 15177, "hatch.energytunnel5.tier.12", "UMV 65536A/t Laser Target Hatch", 12, 65536).getStackForm(1L)); eM_energyTunnel6_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15187, "hatch.energytunnel6.tier.12", "UMV 262144A/s Laser Target Hatch", 12, 262144).getStackForm(1L)); + 15187, "hatch.energytunnel6.tier.12", "UMV 262144A/t Laser Target Hatch", 12, 262144).getStackForm(1L)); eM_energyTunnel7_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15197, "hatch.energytunnel7.tier.12", "UMV 1048576A/s Laser Target Hatch", 12, 1048576).getStackForm(1L)); + 15197, "hatch.energytunnel7.tier.12", "UMV 1048576A/t Laser Target Hatch", 12, 1048576).getStackForm(1L)); eM_energyTunnel1_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15138, "hatch.energytunnel1.tier.13", "UXV 256A/s Laser Target Hatch", 13, 256).getStackForm(1L)); + 15138, "hatch.energytunnel1.tier.13", "UXV 256A/t Laser Target Hatch", 13, 256).getStackForm(1L)); eM_energyTunnel2_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15148, "hatch.energytunnel2.tier.13", "UXV 1024A/s Laser Target Hatch", 13, 1024).getStackForm(1L)); + 15148, "hatch.energytunnel2.tier.13", "UXV 1024A/t Laser Target Hatch", 13, 1024).getStackForm(1L)); eM_energyTunnel3_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15158, "hatch.energytunnel3.tier.13", "UXV 4096A/s Laser Target Hatch", 13, 4096).getStackForm(1L)); + 15158, "hatch.energytunnel3.tier.13", "UXV 4096A/t Laser Target Hatch", 13, 4096).getStackForm(1L)); eM_energyTunnel4_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15168, "hatch.energytunnel4.tier.13", "UXV 16384A/s Laser Target Hatch", 13, 16384).getStackForm(1L)); + 15168, "hatch.energytunnel4.tier.13", "UXV 16384A/t Laser Target Hatch", 13, 16384).getStackForm(1L)); eM_energyTunnel5_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15178, "hatch.energytunnel5.tier.13", "UXV 65536A/s Laser Target Hatch", 13, 65536).getStackForm(1L)); + 15178, "hatch.energytunnel5.tier.13", "UXV 65536A/t Laser Target Hatch", 13, 65536).getStackForm(1L)); eM_energyTunnel6_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15188, "hatch.energytunnel6.tier.13", "UXV 262144A/s Laser Target Hatch", 13, 262144).getStackForm(1L)); + 15188, "hatch.energytunnel6.tier.13", "UXV 262144A/t Laser Target Hatch", 13, 262144).getStackForm(1L)); eM_energyTunnel7_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15198, "hatch.energytunnel7.tier.13", "UXV 1048576A/s Laser Target Hatch", 13, 1048576).getStackForm(1L)); + 15198, "hatch.energytunnel7.tier.13", "UXV 1048576A/t Laser Target Hatch", 13, 1048576).getStackForm(1L)); eM_energyTunnel9001.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( 15199, "hatch.energytunnel.tier.14", "Legendary Laser Target Hatch", 14, (int) V[14]).getStackForm(1L)); @@ -406,139 +406,139 @@ public class MachineLoader implements Runnable { // =================================================================================================== eM_dynamoTunnel1_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15230, "hatch.dynamotunnel1.tier.05", "IV 256A/s Laser Source Hatch", 5, 256).getStackForm(1L)); + 15230, "hatch.dynamotunnel1.tier.05", "IV 256A/t Laser Source Hatch", 5, 256).getStackForm(1L)); eM_dynamoTunnel2_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15240, "hatch.dynamotunnel2.tier.05", "IV 1024A/s Laser Source Hatch", 5, 1024).getStackForm(1L)); + 15240, "hatch.dynamotunnel2.tier.05", "IV 1024A/t Laser Source Hatch", 5, 1024).getStackForm(1L)); eM_dynamoTunnel3_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15250, "hatch.dynamotunnel3.tier.05", "IV 4096A/s Laser Source Hatch", 5, 4096).getStackForm(1L)); + 15250, "hatch.dynamotunnel3.tier.05", "IV 4096A/t Laser Source Hatch", 5, 4096).getStackForm(1L)); eM_dynamoTunnel4_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15260, "hatch.dynamotunnel4.tier.05", "IV 16384A/s Laser Source Hatch", 5, 16384).getStackForm(1L)); + 15260, "hatch.dynamotunnel4.tier.05", "IV 16384A/t Laser Source Hatch", 5, 16384).getStackForm(1L)); eM_dynamoTunnel5_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15270, "hatch.dynamotunnel5.tier.05", "IV 65536A/s Laser Source Hatch", 5, 65536).getStackForm(1L)); + 15270, "hatch.dynamotunnel5.tier.05", "IV 65536A/t Laser Source Hatch", 5, 65536).getStackForm(1L)); eM_dynamoTunnel6_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15280, "hatch.dynamotunnel6.tier.05", "IV 262144A/s Laser Source Hatch", 5, 262144).getStackForm(1L)); + 15280, "hatch.dynamotunnel6.tier.05", "IV 262144A/t Laser Source Hatch", 5, 262144).getStackForm(1L)); eM_dynamoTunnel7_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15290, "hatch.dynamotunnel7.tier.05", "IV 1048576A/s Laser Source Hatch", 5, 1048576).getStackForm(1L)); + 15290, "hatch.dynamotunnel7.tier.05", "IV 1048576A/t Laser Source Hatch", 5, 1048576).getStackForm(1L)); eM_dynamoTunnel1_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15231, "hatch.dynamotunnel1.tier.06", "LuV 256A/s Laser Source Hatch", 6, 256).getStackForm(1L)); + 15231, "hatch.dynamotunnel1.tier.06", "LuV 256A/t Laser Source Hatch", 6, 256).getStackForm(1L)); eM_dynamoTunnel2_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15241, "hatch.dynamotunnel2.tier.06", "LuV 1024A/s Laser Source Hatch", 6, 1024).getStackForm(1L)); + 15241, "hatch.dynamotunnel2.tier.06", "LuV 1024A/t Laser Source Hatch", 6, 1024).getStackForm(1L)); eM_dynamoTunnel3_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15251, "hatch.dynamotunnel3.tier.06", "LuV 4096A/s Laser Source Hatch", 6, 4096).getStackForm(1L)); + 15251, "hatch.dynamotunnel3.tier.06", "LuV 4096A/t Laser Source Hatch", 6, 4096).getStackForm(1L)); eM_dynamoTunnel4_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15261, "hatch.dynamotunnel4.tier.06", "LuV 16384A/s Laser Source Hatch", 6, 16384).getStackForm(1L)); + 15261, "hatch.dynamotunnel4.tier.06", "LuV 16384A/t Laser Source Hatch", 6, 16384).getStackForm(1L)); eM_dynamoTunnel5_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15271, "hatch.dynamotunnel5.tier.06", "LuV 65536A/s Laser Source Hatch", 6, 65536).getStackForm(1L)); + 15271, "hatch.dynamotunnel5.tier.06", "LuV 65536A/t Laser Source Hatch", 6, 65536).getStackForm(1L)); eM_dynamoTunnel6_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15281, "hatch.dynamotunnel6.tier.06", "LuV 262144A/s Laser Source Hatch", 6, 262144).getStackForm(1L)); + 15281, "hatch.dynamotunnel6.tier.06", "LuV 262144A/t Laser Source Hatch", 6, 262144).getStackForm(1L)); eM_dynamoTunnel7_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15291, "hatch.dynamotunnel7.tier.06", "LuV 1048576A/s Laser Source Hatch", 6, 1048576).getStackForm(1L)); + 15291, "hatch.dynamotunnel7.tier.06", "LuV 1048576A/t Laser Source Hatch", 6, 1048576).getStackForm(1L)); eM_dynamoTunnel1_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15232, "hatch.dynamotunnel1.tier.07", "ZPM 256A/s Laser Source Hatch", 7, 256).getStackForm(1L)); + 15232, "hatch.dynamotunnel1.tier.07", "ZPM 256A/t Laser Source Hatch", 7, 256).getStackForm(1L)); eM_dynamoTunnel2_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15242, "hatch.dynamotunnel2.tier.07", "ZPM 1024A/s Laser Source Hatch", 7, 1024).getStackForm(1L)); + 15242, "hatch.dynamotunnel2.tier.07", "ZPM 1024A/t Laser Source Hatch", 7, 1024).getStackForm(1L)); eM_dynamoTunnel3_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15252, "hatch.dynamotunnel3.tier.07", "ZPM 4096A/s Laser Source Hatch", 7, 4096).getStackForm(1L)); + 15252, "hatch.dynamotunnel3.tier.07", "ZPM 4096A/t Laser Source Hatch", 7, 4096).getStackForm(1L)); eM_dynamoTunnel4_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15262, "hatch.dynamotunnel4.tier.07", "ZPM 16384A/s Laser Source Hatch", 7, 16384).getStackForm(1L)); + 15262, "hatch.dynamotunnel4.tier.07", "ZPM 16384A/t Laser Source Hatch", 7, 16384).getStackForm(1L)); eM_dynamoTunnel5_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15272, "hatch.dynamotunnel5.tier.07", "ZPM 65536A/s Laser Source Hatch", 7, 65536).getStackForm(1L)); + 15272, "hatch.dynamotunnel5.tier.07", "ZPM 65536A/t Laser Source Hatch", 7, 65536).getStackForm(1L)); eM_dynamoTunnel6_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15282, "hatch.dynamotunnel6.tier.07", "ZPM 262144A/s Laser Source Hatch", 7, 262144).getStackForm(1L)); + 15282, "hatch.dynamotunnel6.tier.07", "ZPM 262144A/t Laser Source Hatch", 7, 262144).getStackForm(1L)); eM_dynamoTunnel7_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15292, "hatch.dynamotunnel7.tier.07", "ZPM 1048576A/s Laser Source Hatch", 7, 1048576).getStackForm(1L)); + 15292, "hatch.dynamotunnel7.tier.07", "ZPM 1048576A/t Laser Source Hatch", 7, 1048576).getStackForm(1L)); eM_dynamoTunnel1_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15233, "hatch.dynamotunnel1.tier.08", "UV 256A/s Laser Source Hatch", 8, 256).getStackForm(1L)); + 15233, "hatch.dynamotunnel1.tier.08", "UV 256A/t Laser Source Hatch", 8, 256).getStackForm(1L)); eM_dynamoTunnel2_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15243, "hatch.dynamotunnel2.tier.08", "UV 1024A/s Laser Source Hatch", 8, 1024).getStackForm(1L)); + 15243, "hatch.dynamotunnel2.tier.08", "UV 1024A/t Laser Source Hatch", 8, 1024).getStackForm(1L)); eM_dynamoTunnel3_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15253, "hatch.dynamotunnel3.tier.08", "UV 4096A/s Laser Source Hatch", 8, 4096).getStackForm(1L)); + 15253, "hatch.dynamotunnel3.tier.08", "UV 4096A/t Laser Source Hatch", 8, 4096).getStackForm(1L)); eM_dynamoTunnel4_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15263, "hatch.dynamotunnel4.tier.08", "UV 16384A/s Laser Source Hatch", 8, 16384).getStackForm(1L)); + 15263, "hatch.dynamotunnel4.tier.08", "UV 16384A/t Laser Source Hatch", 8, 16384).getStackForm(1L)); eM_dynamoTunnel5_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15273, "hatch.dynamotunnel5.tier.08", "UV 65536A/s Laser Source Hatch", 8, 65536).getStackForm(1L)); + 15273, "hatch.dynamotunnel5.tier.08", "UV 65536A/t Laser Source Hatch", 8, 65536).getStackForm(1L)); eM_dynamoTunnel6_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15283, "hatch.dynamotunnel6.tier.08", "UV 262144A/s Laser Source Hatch", 8, 262144).getStackForm(1L)); + 15283, "hatch.dynamotunnel6.tier.08", "UV 262144A/t Laser Source Hatch", 8, 262144).getStackForm(1L)); eM_dynamoTunnel7_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15293, "hatch.dynamotunnel7.tier.08", "UV 1048576A/s Laser Source Hatch", 8, 1048576).getStackForm(1L)); + 15293, "hatch.dynamotunnel7.tier.08", "UV 1048576A/t Laser Source Hatch", 8, 1048576).getStackForm(1L)); eM_dynamoTunnel1_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15234, "hatch.dynamotunnel1.tier.09", "UHV 256A/s Laser Source Hatch", 9, 256).getStackForm(1L)); + 15234, "hatch.dynamotunnel1.tier.09", "UHV 256A/t Laser Source Hatch", 9, 256).getStackForm(1L)); eM_dynamoTunnel2_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15244, "hatch.dynamotunnel2.tier.09", "UHV 1024A/s Laser Source Hatch", 9, 1024).getStackForm(1L)); + 15244, "hatch.dynamotunnel2.tier.09", "UHV 1024A/t Laser Source Hatch", 9, 1024).getStackForm(1L)); eM_dynamoTunnel3_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15254, "hatch.dynamotunnel3.tier.09", "UHV 4096A/s Laser Source Hatch", 9, 4096).getStackForm(1L)); + 15254, "hatch.dynamotunnel3.tier.09", "UHV 4096A/t Laser Source Hatch", 9, 4096).getStackForm(1L)); eM_dynamoTunnel4_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15264, "hatch.dynamotunnel4.tier.09", "UHV 16384A/s Laser Source Hatch", 9, 16384).getStackForm(1L)); + 15264, "hatch.dynamotunnel4.tier.09", "UHV 16384A/t Laser Source Hatch", 9, 16384).getStackForm(1L)); eM_dynamoTunnel5_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15274, "hatch.dynamotunnel5.tier.09", "UHV 65536A/s Laser Source Hatch", 9, 65536).getStackForm(1L)); + 15274, "hatch.dynamotunnel5.tier.09", "UHV 65536A/t Laser Source Hatch", 9, 65536).getStackForm(1L)); eM_dynamoTunnel6_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15284, "hatch.dynamotunnel6.tier.09", "UHV 262144A/s Laser Source Hatch", 9, 262144).getStackForm(1L)); + 15284, "hatch.dynamotunnel6.tier.09", "UHV 262144A/t Laser Source Hatch", 9, 262144).getStackForm(1L)); eM_dynamoTunnel7_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15294, "hatch.dynamotunnel7.tier.09", "UHV 1048576A/s Laser Source Hatch", 9, 1048576).getStackForm(1L)); + 15294, "hatch.dynamotunnel7.tier.09", "UHV 1048576A/t Laser Source Hatch", 9, 1048576).getStackForm(1L)); eM_dynamoTunnel1_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15235, "hatch.dynamotunnel1.tier.10", "UEV 256A/s Laser Source Hatch", 10, 256).getStackForm(1L)); + 15235, "hatch.dynamotunnel1.tier.10", "UEV 256A/t Laser Source Hatch", 10, 256).getStackForm(1L)); eM_dynamoTunnel2_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15245, "hatch.dynamotunnel2.tier.10", "UEV 1024A/s Laser Source Hatch", 10, 1024).getStackForm(1L)); + 15245, "hatch.dynamotunnel2.tier.10", "UEV 1024A/t Laser Source Hatch", 10, 1024).getStackForm(1L)); eM_dynamoTunnel3_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15255, "hatch.dynamotunnel3.tier.10", "UEV 4096A/s Laser Source Hatch", 10, 4096).getStackForm(1L)); + 15255, "hatch.dynamotunnel3.tier.10", "UEV 4096A/t Laser Source Hatch", 10, 4096).getStackForm(1L)); eM_dynamoTunnel4_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15265, "hatch.dynamotunnel4.tier.10", "UEV 16384A/s Laser Source Hatch", 10, 16384).getStackForm(1L)); + 15265, "hatch.dynamotunnel4.tier.10", "UEV 16384A/t Laser Source Hatch", 10, 16384).getStackForm(1L)); eM_dynamoTunnel5_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15275, "hatch.dynamotunnel5.tier.10", "UEV 65536A/s Laser Source Hatch", 10, 65536).getStackForm(1L)); + 15275, "hatch.dynamotunnel5.tier.10", "UEV 65536A/t Laser Source Hatch", 10, 65536).getStackForm(1L)); eM_dynamoTunnel6_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15285, "hatch.dynamotunnel6.tier.10", "UEV 262144A/s Laser Source Hatch", 10, 262144).getStackForm(1L)); + 15285, "hatch.dynamotunnel6.tier.10", "UEV 262144A/t Laser Source Hatch", 10, 262144).getStackForm(1L)); eM_dynamoTunnel7_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15295, "hatch.dynamotunnel7.tier.10", "UEV 1048576A/s Laser Source Hatch", 10, 1048576).getStackForm(1L)); + 15295, "hatch.dynamotunnel7.tier.10", "UEV 1048576A/t Laser Source Hatch", 10, 1048576).getStackForm(1L)); eM_dynamoTunnel1_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15236, "hatch.dynamotunnel1.tier.11", "UIV 256A/s Laser Source Hatch", 11, 256).getStackForm(1L)); + 15236, "hatch.dynamotunnel1.tier.11", "UIV 256A/t Laser Source Hatch", 11, 256).getStackForm(1L)); eM_dynamoTunnel2_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15246, "hatch.dynamotunnel2.tier.11", "UIV 1024A/s Laser Source Hatch", 11, 1024).getStackForm(1L)); + 15246, "hatch.dynamotunnel2.tier.11", "UIV 1024A/t Laser Source Hatch", 11, 1024).getStackForm(1L)); eM_dynamoTunnel3_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15256, "hatch.dynamotunnel3.tier.11", "UIV 4096A/s Laser Source Hatch", 11, 4096).getStackForm(1L)); + 15256, "hatch.dynamotunnel3.tier.11", "UIV 4096A/t Laser Source Hatch", 11, 4096).getStackForm(1L)); eM_dynamoTunnel4_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15266, "hatch.dynamotunnel4.tier.11", "UIV 16384A/s Laser Source Hatch", 11, 16384).getStackForm(1L)); + 15266, "hatch.dynamotunnel4.tier.11", "UIV 16384A/t Laser Source Hatch", 11, 16384).getStackForm(1L)); eM_dynamoTunnel5_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15276, "hatch.dynamotunnel5.tier.11", "UIV 65536A/s Laser Source Hatch", 11, 65536).getStackForm(1L)); + 15276, "hatch.dynamotunnel5.tier.11", "UIV 65536A/t Laser Source Hatch", 11, 65536).getStackForm(1L)); eM_dynamoTunnel6_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15286, "hatch.dynamotunnel6.tier.11", "UIV 262144A/s Laser Source Hatch", 11, 262144).getStackForm(1L)); + 15286, "hatch.dynamotunnel6.tier.11", "UIV 262144A/t Laser Source Hatch", 11, 262144).getStackForm(1L)); eM_dynamoTunnel7_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15296, "hatch.dynamotunnel7.tier.11", "UIV 1048576A/s Laser Source Hatch", 11, 1048576).getStackForm(1L)); + 15296, "hatch.dynamotunnel7.tier.11", "UIV 1048576A/t Laser Source Hatch", 11, 1048576).getStackForm(1L)); eM_dynamoTunnel1_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15237, "hatch.dynamotunnel1.tier.12", "UMV 256A/s Laser Source Hatch", 12, 256).getStackForm(1L)); + 15237, "hatch.dynamotunnel1.tier.12", "UMV 256A/t Laser Source Hatch", 12, 256).getStackForm(1L)); eM_dynamoTunnel2_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15247, "hatch.dynamotunnel2.tier.12", "UMV 1024A/s Laser Source Hatch", 12, 1024).getStackForm(1L)); + 15247, "hatch.dynamotunnel2.tier.12", "UMV 1024A/t Laser Source Hatch", 12, 1024).getStackForm(1L)); eM_dynamoTunnel3_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15257, "hatch.dynamotunnel3.tier.12", "UMV 4096A/s Laser Source Hatch", 12, 4096).getStackForm(1L)); + 15257, "hatch.dynamotunnel3.tier.12", "UMV 4096A/t Laser Source Hatch", 12, 4096).getStackForm(1L)); eM_dynamoTunnel4_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15267, "hatch.dynamotunnel4.tier.12", "UMV 16384A/s Laser Source Hatch", 12, 16384).getStackForm(1L)); + 15267, "hatch.dynamotunnel4.tier.12", "UMV 16384A/t Laser Source Hatch", 12, 16384).getStackForm(1L)); eM_dynamoTunnel5_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15277, "hatch.dynamotunnel5.tier.12", "UMV 65536A/s Laser Source Hatch", 12, 65536).getStackForm(1L)); + 15277, "hatch.dynamotunnel5.tier.12", "UMV 65536A/t Laser Source Hatch", 12, 65536).getStackForm(1L)); eM_dynamoTunnel6_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15287, "hatch.dynamotunnel6.tier.12", "UMV 262144A/s Laser Source Hatch", 12, 262144).getStackForm(1L)); + 15287, "hatch.dynamotunnel6.tier.12", "UMV 262144A/t Laser Source Hatch", 12, 262144).getStackForm(1L)); eM_dynamoTunnel7_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15297, "hatch.dynamotunnel7.tier.12", "UMV 1048576A/s Laser Source Hatch", 12, 1048576).getStackForm(1L)); + 15297, "hatch.dynamotunnel7.tier.12", "UMV 1048576A/t Laser Source Hatch", 12, 1048576).getStackForm(1L)); eM_dynamoTunnel1_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15238, "hatch.dynamotunnel1.tier.13", "UXV 256A/s Laser Source Hatch", 13, 256).getStackForm(1L)); + 15238, "hatch.dynamotunnel1.tier.13", "UXV 256A/t Laser Source Hatch", 13, 256).getStackForm(1L)); eM_dynamoTunnel2_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15248, "hatch.dynamotunnel2.tier.13", "UXV 1024A/s Laser Source Hatch", 13, 1024).getStackForm(1L)); + 15248, "hatch.dynamotunnel2.tier.13", "UXV 1024A/t Laser Source Hatch", 13, 1024).getStackForm(1L)); eM_dynamoTunnel3_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15258, "hatch.dynamotunnel3.tier.13", "UXV 4096A/s Laser Source Hatch", 13, 4096).getStackForm(1L)); + 15258, "hatch.dynamotunnel3.tier.13", "UXV 4096A/t Laser Source Hatch", 13, 4096).getStackForm(1L)); eM_dynamoTunnel4_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15268, "hatch.dynamotunnel4.tier.13", "UXV 16384A/s Laser Source Hatch", 13, 16384).getStackForm(1L)); + 15268, "hatch.dynamotunnel4.tier.13", "UXV 16384A/t Laser Source Hatch", 13, 16384).getStackForm(1L)); eM_dynamoTunnel5_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15278, "hatch.dynamotunnel5.tier.13", "UXV 65536A/s Laser Source Hatch", 13, 65536).getStackForm(1L)); + 15278, "hatch.dynamotunnel5.tier.13", "UXV 65536A/t Laser Source Hatch", 13, 65536).getStackForm(1L)); eM_dynamoTunnel6_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15288, "hatch.dynamotunnel6.tier.13", "UXV 262144A/s Laser Source Hatch", 13, 262144).getStackForm(1L)); + 15288, "hatch.dynamotunnel6.tier.13", "UXV 262144A/t Laser Source Hatch", 13, 262144).getStackForm(1L)); eM_dynamoTunnel7_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15298, "hatch.dynamotunnel7.tier.13", "UXV 1048576A/s Laser Source Hatch", 13, 1048576).getStackForm(1L)); + 15298, "hatch.dynamotunnel7.tier.13", "UXV 1048576A/t Laser Source Hatch", 13, 1048576).getStackForm(1L)); eM_dynamoTunnel9001.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( 15299, "hatch.dynamotunnel.tier.14", "Legendary Laser Source Hatch", 14, (int) V[14]).getStackForm(1L)); 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 fb3487bc09..841d2ec1a8 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 @@ -148,13 +148,12 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc return; } else if (maxEUOutput() == ((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).maxEUInput()) { long diff = Math.min( - Amperes * 20, + Amperes * 20L * maxEUOutput(), Math.min( ((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).maxEUStore() - aMetaTileEntity.getBaseMetaTileEntity().getStoredEU(), - maxEUStore() - aBaseMetaTileEntity.getStoredEU() - ) / maxEUOutput() - ) * maxEUOutput(); + aBaseMetaTileEntity.getStoredEU() + )); setEUVar(aBaseMetaTileEntity.getStoredEU() - diff); diff --git a/src/main/resources/assets/tectech/lang/en_US.lang b/src/main/resources/assets/tectech/lang/en_US.lang index 70f7d5ab8f..3b8bc433ed 100644 --- a/src/main/resources/assets/tectech/lang/en_US.lang +++ b/src/main/resources/assets/tectech/lang/en_US.lang @@ -210,69 +210,69 @@ gt.blockmachines.hatch.energymulti64.tier.13.name=UXV 64A Energy Hatch gt.blockmachines.hatch.energymulti.desc.0=Multiple Ampere Energy Injector for Multiblocks gt.blockmachines.hatch.energymulti.desc.1=Amperes In -gt.blockmachines.hatch.energytunnel1.tier.05.name=IV 256A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel2.tier.05.name=IV 1024A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel3.tier.05.name=IV 4096A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel4.tier.05.name=IV 16384A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel5.tier.05.name=IV 65536A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel6.tier.05.name=IV 262144A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel7.tier.05.name=IV 1048576A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel1.tier.06.name=LuV 256A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel2.tier.06.name=LuV 1024A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel3.tier.06.name=LuV 4096A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel4.tier.06.name=LuV 16384A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel5.tier.06.name=LuV 65536A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel6.tier.06.name=LuV 262144A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel7.tier.06.name=LuV 1048576A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel1.tier.07.name=ZPM 256A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel2.tier.07.name=ZPM 1024A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel3.tier.07.name=ZPM 4096A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel4.tier.07.name=ZPM 16384A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel5.tier.07.name=ZPM 65536A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel6.tier.07.name=ZPM 262144A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel7.tier.07.name=ZPM 1048576A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel1.tier.08.name=UV 256A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel2.tier.08.name=UV 1024A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel3.tier.08.name=UV 4096A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel4.tier.08.name=UV 16384A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel5.tier.08.name=UV 65536A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel6.tier.08.name=UV 262144A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel7.tier.08.name=UV 1048576A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel1.tier.09.name=UHV 256A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel2.tier.09.name=UHV 1024A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel3.tier.09.name=UHV 4096A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel4.tier.09.name=UHV 16384A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel5.tier.09.name=UHV 65536A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel6.tier.09.name=UHV 262144A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel7.tier.09.name=UHV 1048576A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel1.tier.10.name=UEV 256A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel2.tier.10.name=UEV 1024A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel3.tier.10.name=UEV 4096A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel4.tier.10.name=UEV 16384A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel5.tier.10.name=UEV 65536A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel6.tier.10.name=UEV 262144A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel7.tier.10.name=UEV 1048576A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel1.tier.11.name=UIV 256A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel2.tier.11.name=UIV 1024A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel3.tier.11.name=UIV 4096A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel4.tier.11.name=UIV 16384A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel5.tier.11.name=UIV 65536A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel6.tier.11.name=UIV 262144A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel7.tier.11.name=UIV 1048576A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel1.tier.12.name=UMV 256A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel2.tier.12.name=UMV 1024A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel3.tier.12.name=UMV 4096A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel4.tier.12.name=UMV 16384A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel5.tier.12.name=UMV 65536A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel6.tier.12.name=UMV 262144A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel7.tier.12.name=UMV 1048576A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel1.tier.13.name=UXV 256A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel2.tier.13.name=UXV 1024A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel3.tier.13.name=UXV 4096A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel4.tier.13.name=UXV 16384A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel5.tier.13.name=UXV 65536A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel6.tier.13.name=UXV 262144A/s Laser Target Hatch -gt.blockmachines.hatch.energytunnel7.tier.13.name=UXV 1048576A/s Laser Target Hatch +gt.blockmachines.hatch.energytunnel1.tier.05.name=IV 256A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel2.tier.05.name=IV 1024A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel3.tier.05.name=IV 4096A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel4.tier.05.name=IV 16384A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel5.tier.05.name=IV 65536A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel6.tier.05.name=IV 262144A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel7.tier.05.name=IV 1048576A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel1.tier.06.name=LuV 256A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel2.tier.06.name=LuV 1024A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel3.tier.06.name=LuV 4096A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel4.tier.06.name=LuV 16384A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel5.tier.06.name=LuV 65536A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel6.tier.06.name=LuV 262144A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel7.tier.06.name=LuV 1048576A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel1.tier.07.name=ZPM 256A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel2.tier.07.name=ZPM 1024A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel3.tier.07.name=ZPM 4096A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel4.tier.07.name=ZPM 16384A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel5.tier.07.name=ZPM 65536A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel6.tier.07.name=ZPM 262144A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel7.tier.07.name=ZPM 1048576A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel1.tier.08.name=UV 256A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel2.tier.08.name=UV 1024A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel3.tier.08.name=UV 4096A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel4.tier.08.name=UV 16384A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel5.tier.08.name=UV 65536A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel6.tier.08.name=UV 262144A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel7.tier.08.name=UV 1048576A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel1.tier.09.name=UHV 256A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel2.tier.09.name=UHV 1024A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel3.tier.09.name=UHV 4096A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel4.tier.09.name=UHV 16384A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel5.tier.09.name=UHV 65536A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel6.tier.09.name=UHV 262144A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel7.tier.09.name=UHV 1048576A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel1.tier.10.name=UEV 256A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel2.tier.10.name=UEV 1024A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel3.tier.10.name=UEV 4096A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel4.tier.10.name=UEV 16384A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel5.tier.10.name=UEV 65536A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel6.tier.10.name=UEV 262144A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel7.tier.10.name=UEV 1048576A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel1.tier.11.name=UIV 256A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel2.tier.11.name=UIV 1024A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel3.tier.11.name=UIV 4096A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel4.tier.11.name=UIV 16384A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel5.tier.11.name=UIV 65536A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel6.tier.11.name=UIV 262144A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel7.tier.11.name=UIV 1048576A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel1.tier.12.name=UMV 256A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel2.tier.12.name=UMV 1024A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel3.tier.12.name=UMV 4096A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel4.tier.12.name=UMV 16384A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel5.tier.12.name=UMV 65536A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel6.tier.12.name=UMV 262144A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel7.tier.12.name=UMV 1048576A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel1.tier.13.name=UXV 256A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel2.tier.13.name=UXV 1024A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel3.tier.13.name=UXV 4096A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel4.tier.13.name=UXV 16384A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel5.tier.13.name=UXV 65536A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel6.tier.13.name=UXV 262144A/t Laser Target Hatch +gt.blockmachines.hatch.energytunnel7.tier.13.name=UXV 1048576A/t Laser Target Hatch gt.blockmachines.hatch.energytunnel.tier.14.name=Legendary Laser Target Hatch gt.blockmachines.hatch.energytunnel.desc.0=Energy injecting terminal for Multiblocks gt.blockmachines.hatch.energytunnel.desc.1=Throughput @@ -307,69 +307,69 @@ gt.blockmachines.hatch.dynamomulti64.tier.13.name=IV 64A Dynamo Hatch gt.blockmachines.hatch.dynamomulti.desc.0=Multiple Ampere Energy Extractor for Multiblocks gt.blockmachines.hatch.dynamomulti.desc.1=Amperes Out -gt.blockmachines.hatch.dynamotunnel1.tier.05.name=IV 256A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel2.tier.05.name=IV 1024A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel3.tier.05.name=IV 4096A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel4.tier.05.name=IV 16384A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel5.tier.05.name=IV 65536A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel6.tier.05.name=IV 262144A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel7.tier.05.name=IV 1048576A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel1.tier.06.name=LuV 256A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel2.tier.06.name=LuV 1024A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel3.tier.06.name=LuV 4096A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel4.tier.06.name=LuV 16384A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel5.tier.06.name=LuV 65536A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel6.tier.06.name=LuV 262144A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel7.tier.06.name=LuV 1048576A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel1.tier.07.name=ZPM 256A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel2.tier.07.name=ZPM 1024A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel3.tier.07.name=ZPM 4096A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel4.tier.07.name=ZPM 16384A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel5.tier.07.name=ZPM 65536A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel6.tier.07.name=ZPM 262144A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel7.tier.07.name=ZPM 1048576A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel1.tier.08.name=UV 256A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel2.tier.08.name=UV 1024A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel3.tier.08.name=UV 4096A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel4.tier.08.name=UV 16384A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel5.tier.08.name=UV 65536A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel6.tier.08.name=UV 262144A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel7.tier.08.name=UV 1048576A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel1.tier.09.name=UHV 256A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel2.tier.09.name=UHV 1024A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel3.tier.09.name=UHV 4096A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel4.tier.09.name=UHV 16384A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel5.tier.09.name=UHV 65536A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel6.tier.09.name=UHV 262144A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel7.tier.09.name=UHV 1048576A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel1.tier.10.name=UEV 256A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel2.tier.10.name=UEV 1024A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel3.tier.10.name=UEV 4096A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel4.tier.10.name=UEV 16384A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel5.tier.10.name=UEV 65536A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel6.tier.10.name=UEV 262144A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel7.tier.10.name=UEV 1048576A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel1.tier.11.name=UIV 256A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel2.tier.11.name=UIV 1024A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel3.tier.11.name=UIV 4096A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel4.tier.11.name=UIV 16384A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel5.tier.11.name=UIV 65536A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel6.tier.11.name=UIV 262144A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel7.tier.11.name=UIV 1048576A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel1.tier.12.name=UMV 256A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel2.tier.12.name=UMV 1024A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel3.tier.12.name=UMV 4096A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel4.tier.12.name=UMV 16384A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel5.tier.12.name=UMV 65536A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel6.tier.12.name=UMV 262144A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel7.tier.12.name=UMV 1048576A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel1.tier.13.name=UXV 256A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel2.tier.13.name=UXV 1024A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel3.tier.13.name=UXV 4096A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel4.tier.13.name=UXV 16384A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel5.tier.13.name=UXV 65536A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel6.tier.13.name=UXV 262144A/s Laser Source Hatch -gt.blockmachines.hatch.dynamotunnel7.tier.13.name=UXV 1048576A/s Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel1.tier.05.name=IV 256A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel2.tier.05.name=IV 1024A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel3.tier.05.name=IV 4096A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel4.tier.05.name=IV 16384A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel5.tier.05.name=IV 65536A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel6.tier.05.name=IV 262144A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel7.tier.05.name=IV 1048576A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel1.tier.06.name=LuV 256A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel2.tier.06.name=LuV 1024A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel3.tier.06.name=LuV 4096A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel4.tier.06.name=LuV 16384A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel5.tier.06.name=LuV 65536A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel6.tier.06.name=LuV 262144A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel7.tier.06.name=LuV 1048576A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel1.tier.07.name=ZPM 256A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel2.tier.07.name=ZPM 1024A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel3.tier.07.name=ZPM 4096A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel4.tier.07.name=ZPM 16384A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel5.tier.07.name=ZPM 65536A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel6.tier.07.name=ZPM 262144A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel7.tier.07.name=ZPM 1048576A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel1.tier.08.name=UV 256A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel2.tier.08.name=UV 1024A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel3.tier.08.name=UV 4096A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel4.tier.08.name=UV 16384A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel5.tier.08.name=UV 65536A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel6.tier.08.name=UV 262144A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel7.tier.08.name=UV 1048576A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel1.tier.09.name=UHV 256A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel2.tier.09.name=UHV 1024A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel3.tier.09.name=UHV 4096A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel4.tier.09.name=UHV 16384A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel5.tier.09.name=UHV 65536A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel6.tier.09.name=UHV 262144A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel7.tier.09.name=UHV 1048576A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel1.tier.10.name=UEV 256A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel2.tier.10.name=UEV 1024A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel3.tier.10.name=UEV 4096A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel4.tier.10.name=UEV 16384A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel5.tier.10.name=UEV 65536A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel6.tier.10.name=UEV 262144A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel7.tier.10.name=UEV 1048576A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel1.tier.11.name=UIV 256A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel2.tier.11.name=UIV 1024A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel3.tier.11.name=UIV 4096A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel4.tier.11.name=UIV 16384A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel5.tier.11.name=UIV 65536A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel6.tier.11.name=UIV 262144A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel7.tier.11.name=UIV 1048576A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel1.tier.12.name=UMV 256A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel2.tier.12.name=UMV 1024A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel3.tier.12.name=UMV 4096A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel4.tier.12.name=UMV 16384A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel5.tier.12.name=UMV 65536A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel6.tier.12.name=UMV 262144A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel7.tier.12.name=UMV 1048576A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel1.tier.13.name=UXV 256A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel2.tier.13.name=UXV 1024A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel3.tier.13.name=UXV 4096A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel4.tier.13.name=UXV 16384A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel5.tier.13.name=UXV 65536A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel6.tier.13.name=UXV 262144A/t Laser Source Hatch +gt.blockmachines.hatch.dynamotunnel7.tier.13.name=UXV 1048576A/t Laser Source Hatch gt.blockmachines.hatch.dynamotunnel.tier.14.name=Legendary Laser Source Hatch gt.blockmachines.hatch.dynamotunnel.desc.0=Energy extracting terminal for Multiblocks gt.blockmachines.hatch.dynamotunnel.desc.1=Throughput diff --git a/src/main/resources/assets/tectech/lang/zh_CN.lang b/src/main/resources/assets/tectech/lang/zh_CN.lang index 3484eb3579..6aae89bb1b 100644 --- a/src/main/resources/assets/tectech/lang/zh_CN.lang +++ b/src/main/resources/assets/tectech/lang/zh_CN.lang @@ -210,69 +210,69 @@ gt.blockmachines.hatch.energymulti64.tier.13.name=64安UXV能源仓 gt.blockmachines.hatch.energymulti.desc.0=为多方块机器以高电流输入能源 gt.blockmachines.hatch.energymulti.desc.1=输入电流 -gt.blockmachines.hatch.energytunnel1.tier.05.name=IV 256A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel2.tier.05.name=IV 1024A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel3.tier.05.name=IV 4096A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel4.tier.05.name=IV 16384A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel5.tier.05.name=IV 65536A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel6.tier.05.name=IV 262144A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel7.tier.05.name=IV 1048576A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel1.tier.06.name=LuV 256A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel2.tier.06.name=LuV 1024A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel3.tier.06.name=LuV 4096A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel4.tier.06.name=LuV 16384A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel5.tier.06.name=LuV 65536A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel6.tier.06.name=LuV 262144A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel7.tier.06.name=LuV 1048576A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel1.tier.07.name=ZPM 256A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel2.tier.07.name=ZPM 1024A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel3.tier.07.name=ZPM 4096A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel4.tier.07.name=ZPM 16384A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel5.tier.07.name=ZPM 65536A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel6.tier.07.name=ZPM 262144A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel7.tier.07.name=ZPM 1048576A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel1.tier.08.name=UV 256A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel2.tier.08.name=UV 1024A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel3.tier.08.name=UV 4096A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel4.tier.08.name=UV 16384A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel5.tier.08.name=UV 65536A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel6.tier.08.name=UV 262144A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel7.tier.08.name=UV 1048576A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel1.tier.09.name=UHV 256A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel2.tier.09.name=UHV 1024A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel3.tier.09.name=UHV 4096A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel4.tier.09.name=UHV 16384A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel5.tier.09.name=UHV 65536A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel6.tier.09.name=UHV 262144A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel7.tier.09.name=UHV 1048576A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel1.tier.10.name=UEV 256A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel2.tier.10.name=UEV 1024A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel3.tier.10.name=UEV 4096A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel4.tier.10.name=UEV 16384A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel5.tier.10.name=UEV 65536A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel6.tier.10.name=UEV 262144A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel7.tier.10.name=UEV 1048576A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel1.tier.11.name=UIV 256A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel2.tier.11.name=UIV 1024A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel3.tier.11.name=UIV 4096A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel4.tier.11.name=UIV 16384A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel5.tier.11.name=UIV 65536A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel6.tier.11.name=UIV 262144A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel7.tier.11.name=UIV 1048576A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel1.tier.12.name=UMV 256A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel2.tier.12.name=UMV 1024A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel3.tier.12.name=UMV 4096A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel4.tier.12.name=UMV 16384A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel5.tier.12.name=UMV 65536A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel6.tier.12.name=UMV 262144A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel7.tier.12.name=UMV 1048576A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel1.tier.13.name=UXV 256A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel2.tier.13.name=UXV 1024A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel3.tier.13.name=UXV 4096A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel4.tier.13.name=UXV 16384A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel5.tier.13.name=UXV 65536A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel6.tier.13.name=UXV 262144A/s 激光靶仓 -gt.blockmachines.hatch.energytunnel7.tier.13.name=UXV 1048576A/s 激光靶仓 +gt.blockmachines.hatch.energytunnel1.tier.05.name=IV 256A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel2.tier.05.name=IV 1024A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel3.tier.05.name=IV 4096A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel4.tier.05.name=IV 16384A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel5.tier.05.name=IV 65536A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel6.tier.05.name=IV 262144A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel7.tier.05.name=IV 1048576A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel1.tier.06.name=LuV 256A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel2.tier.06.name=LuV 1024A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel3.tier.06.name=LuV 4096A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel4.tier.06.name=LuV 16384A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel5.tier.06.name=LuV 65536A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel6.tier.06.name=LuV 262144A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel7.tier.06.name=LuV 1048576A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel1.tier.07.name=ZPM 256A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel2.tier.07.name=ZPM 1024A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel3.tier.07.name=ZPM 4096A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel4.tier.07.name=ZPM 16384A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel5.tier.07.name=ZPM 65536A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel6.tier.07.name=ZPM 262144A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel7.tier.07.name=ZPM 1048576A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel1.tier.08.name=UV 256A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel2.tier.08.name=UV 1024A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel3.tier.08.name=UV 4096A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel4.tier.08.name=UV 16384A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel5.tier.08.name=UV 65536A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel6.tier.08.name=UV 262144A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel7.tier.08.name=UV 1048576A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel1.tier.09.name=UHV 256A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel2.tier.09.name=UHV 1024A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel3.tier.09.name=UHV 4096A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel4.tier.09.name=UHV 16384A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel5.tier.09.name=UHV 65536A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel6.tier.09.name=UHV 262144A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel7.tier.09.name=UHV 1048576A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel1.tier.10.name=UEV 256A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel2.tier.10.name=UEV 1024A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel3.tier.10.name=UEV 4096A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel4.tier.10.name=UEV 16384A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel5.tier.10.name=UEV 65536A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel6.tier.10.name=UEV 262144A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel7.tier.10.name=UEV 1048576A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel1.tier.11.name=UIV 256A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel2.tier.11.name=UIV 1024A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel3.tier.11.name=UIV 4096A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel4.tier.11.name=UIV 16384A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel5.tier.11.name=UIV 65536A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel6.tier.11.name=UIV 262144A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel7.tier.11.name=UIV 1048576A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel1.tier.12.name=UMV 256A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel2.tier.12.name=UMV 1024A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel3.tier.12.name=UMV 4096A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel4.tier.12.name=UMV 16384A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel5.tier.12.name=UMV 65536A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel6.tier.12.name=UMV 262144A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel7.tier.12.name=UMV 1048576A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel1.tier.13.name=UXV 256A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel2.tier.13.name=UXV 1024A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel3.tier.13.name=UXV 4096A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel4.tier.13.name=UXV 16384A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel5.tier.13.name=UXV 65536A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel6.tier.13.name=UXV 262144A/t 激光靶仓 +gt.blockmachines.hatch.energytunnel7.tier.13.name=UXV 1048576A/t 激光靶仓 gt.blockmachines.hatch.energytunnel.tier.14.name=传奇激光靶仓 gt.blockmachines.hatch.energytunnel.desc.0=多方块机器的能量输入端 gt.blockmachines.hatch.energytunnel.desc.1=通量 @@ -307,69 +307,69 @@ gt.blockmachines.hatch.dynamomulti64.tier.13.name=64安IV动力仓 gt.blockmachines.hatch.dynamomulti.desc.0=从多方块机器以高电流输出能源 gt.blockmachines.hatch.dynamomulti.desc.1=输出电流 -gt.blockmachines.hatch.dynamotunnel1.tier.05.name=IV 256A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel2.tier.05.name=IV 1024A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel3.tier.05.name=IV 4096A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel4.tier.05.name=IV 16384A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel5.tier.05.name=IV 65536A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel6.tier.05.name=IV 262144A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel7.tier.05.name=IV 1048576A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel1.tier.06.name=LuV 256A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel2.tier.06.name=LuV 1024A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel3.tier.06.name=LuV 4096A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel4.tier.06.name=LuV 16384A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel5.tier.06.name=LuV 65536A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel6.tier.06.name=LuV 262144A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel7.tier.06.name=LuV 1048576A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel1.tier.07.name=ZPM 256A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel2.tier.07.name=ZPM 1024A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel3.tier.07.name=ZPM 4096A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel4.tier.07.name=ZPM 16384A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel5.tier.07.name=ZPM 65536A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel6.tier.07.name=ZPM 262144A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel7.tier.07.name=ZPM 1048576A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel1.tier.08.name=UV 256A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel2.tier.08.name=UV 1024A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel3.tier.08.name=UV 4096A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel4.tier.08.name=UV 16384A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel5.tier.08.name=UV 65536A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel6.tier.08.name=UV 262144A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel7.tier.08.name=UV 1048576A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel1.tier.09.name=UHV 256A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel2.tier.09.name=UHV 1024A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel3.tier.09.name=UHV 4096A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel4.tier.09.name=UHV 16384A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel5.tier.09.name=UHV 65536A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel6.tier.09.name=UHV 262144A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel7.tier.09.name=UHV 1048576A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel1.tier.10.name=UEV 256A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel2.tier.10.name=UEV 1024A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel3.tier.10.name=UEV 4096A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel4.tier.10.name=UEV 16384A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel5.tier.10.name=UEV 65536A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel6.tier.10.name=UEV 262144A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel7.tier.10.name=UEV 1048576A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel1.tier.11.name=UIV 256A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel2.tier.11.name=UIV 1024A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel3.tier.11.name=UIV 4096A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel4.tier.11.name=UIV 16384A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel5.tier.11.name=UIV 65536A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel6.tier.11.name=UIV 262144A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel7.tier.11.name=UIV 1048576A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel1.tier.12.name=UMV 256A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel2.tier.12.name=UMV 1024A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel3.tier.12.name=UMV 4096A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel4.tier.12.name=UMV 16384A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel5.tier.12.name=UMV 65536A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel6.tier.12.name=UMV 262144A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel7.tier.12.name=UMV 1048576A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel1.tier.13.name=UXV 256A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel2.tier.13.name=UXV 1024A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel3.tier.13.name=UXV 4096A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel4.tier.13.name=UXV 16384A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel5.tier.13.name=UXV 65536A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel6.tier.13.name=UXV 262144A/s 激光源仓 -gt.blockmachines.hatch.dynamotunnel7.tier.13.name=UXV 1048576A/s 激光源仓 +gt.blockmachines.hatch.dynamotunnel1.tier.05.name=IV 256A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel2.tier.05.name=IV 1024A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel3.tier.05.name=IV 4096A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel4.tier.05.name=IV 16384A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel5.tier.05.name=IV 65536A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel6.tier.05.name=IV 262144A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel7.tier.05.name=IV 1048576A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel1.tier.06.name=LuV 256A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel2.tier.06.name=LuV 1024A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel3.tier.06.name=LuV 4096A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel4.tier.06.name=LuV 16384A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel5.tier.06.name=LuV 65536A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel6.tier.06.name=LuV 262144A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel7.tier.06.name=LuV 1048576A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel1.tier.07.name=ZPM 256A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel2.tier.07.name=ZPM 1024A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel3.tier.07.name=ZPM 4096A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel4.tier.07.name=ZPM 16384A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel5.tier.07.name=ZPM 65536A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel6.tier.07.name=ZPM 262144A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel7.tier.07.name=ZPM 1048576A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel1.tier.08.name=UV 256A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel2.tier.08.name=UV 1024A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel3.tier.08.name=UV 4096A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel4.tier.08.name=UV 16384A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel5.tier.08.name=UV 65536A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel6.tier.08.name=UV 262144A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel7.tier.08.name=UV 1048576A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel1.tier.09.name=UHV 256A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel2.tier.09.name=UHV 1024A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel3.tier.09.name=UHV 4096A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel4.tier.09.name=UHV 16384A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel5.tier.09.name=UHV 65536A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel6.tier.09.name=UHV 262144A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel7.tier.09.name=UHV 1048576A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel1.tier.10.name=UEV 256A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel2.tier.10.name=UEV 1024A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel3.tier.10.name=UEV 4096A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel4.tier.10.name=UEV 16384A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel5.tier.10.name=UEV 65536A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel6.tier.10.name=UEV 262144A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel7.tier.10.name=UEV 1048576A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel1.tier.11.name=UIV 256A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel2.tier.11.name=UIV 1024A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel3.tier.11.name=UIV 4096A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel4.tier.11.name=UIV 16384A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel5.tier.11.name=UIV 65536A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel6.tier.11.name=UIV 262144A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel7.tier.11.name=UIV 1048576A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel1.tier.12.name=UMV 256A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel2.tier.12.name=UMV 1024A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel3.tier.12.name=UMV 4096A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel4.tier.12.name=UMV 16384A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel5.tier.12.name=UMV 65536A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel6.tier.12.name=UMV 262144A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel7.tier.12.name=UMV 1048576A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel1.tier.13.name=UXV 256A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel2.tier.13.name=UXV 1024A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel3.tier.13.name=UXV 4096A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel4.tier.13.name=UXV 16384A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel5.tier.13.name=UXV 65536A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel6.tier.13.name=UXV 262144A/t 激光源仓 +gt.blockmachines.hatch.dynamotunnel7.tier.13.name=UXV 1048576A/t 激光源仓 gt.blockmachines.hatch.dynamotunnel.tier.14.name=传奇激光源仓 gt.blockmachines.hatch.dynamotunnel.desc.0=多方块机器的能量输出端 gt.blockmachines.hatch.dynamotunnel.desc.1=通量 -- cgit From b63dcaf7b782d033742b28bf88f9587f6a7ab611 Mon Sep 17 00:00:00 2001 From: Tec Date: Tue, 12 May 2020 22:22:37 +0200 Subject: Adjust for comfort --- .../java/com/github/technus/tectech/loader/thing/MachineLoader.java | 4 ++-- .../metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java | 2 +- .../metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index 3891d28845..8a46732e66 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -332,7 +332,7 @@ public class MachineLoader implements Runnable { eM_energyTunnel7_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( 15198, "hatch.energytunnel7.tier.13", "UXV 1048576A/t Laser Target Hatch", 13, 1048576).getStackForm(1L)); eM_energyTunnel9001.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15199, "hatch.energytunnel.tier.14", "Legendary Laser Target Hatch", 14, (int) V[14]).getStackForm(1L)); + 15199, "hatch.energytunnel.tier.14", "Legendary Laser Target Hatch", 13, (int) V[13]).getStackForm(1L)); // =================================================================================================== // Multi AMP Power OUTPUTS @@ -540,7 +540,7 @@ public class MachineLoader implements Runnable { eM_dynamoTunnel7_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( 15298, "hatch.dynamotunnel7.tier.13", "UXV 1048576A/t Laser Source Hatch", 13, 1048576).getStackForm(1L)); eM_dynamoTunnel9001.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15299, "hatch.dynamotunnel.tier.14", "Legendary Laser Source Hatch", 14, (int) V[14]).getStackForm(1L)); + 15299, "hatch.dynamotunnel.tier.14", "Legendary Laser Source Hatch", 13, (int) V[13]).getStackForm(1L)); // =================================================================================================== // MULTIBLOCKS 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 841d2ec1a8..beacf26122 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 @@ -78,7 +78,7 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc @Override public long maxEUStore() { - return 512L + V[mTier] * 4L * Amperes; + return V[mTier] * 24L * Amperes; } @Override 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 2407f2ab0a..2393f4f702 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 @@ -75,7 +75,7 @@ public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatc @Override public long maxEUStore() { - return 512L + V[mTier] * 4L * Amperes; + return V[mTier] * 24L * Amperes; } @Override -- cgit From 80f297676089d2b4507d9f996f52ba35edff2ef5 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Wed, 13 May 2020 10:16:49 +0200 Subject: bump version --- build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.properties b/build.properties index 2aaa4ac7ce..5eafc26e8e 100644 --- a/build.properties +++ b/build.properties @@ -1,6 +1,6 @@ minecraft.version=1.7.10 forge.version=10.13.4.1614 -tectech.version=3.8.1 +tectech.version=3.8.2 ic2.version=2.2.790-experimental codechickenlib.version=1.1.3.140 -- cgit From 3ccc193c26828c3e4ad2016a1b8a08e6793164ff Mon Sep 17 00:00:00 2001 From: Tec Date: Thu, 14 May 2020 09:27:22 +0200 Subject: Cleanup, add debug print, fix hatch adder optional --- .../mechanics/structure/IStructureDefinition.java | 24 ++++++++++++- .../mechanics/structure/StructureUtility.java | 39 ++++++++++++++++++++-- 2 files changed, 59 insertions(+), 4 deletions(-) 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 index 542d13a7cd..c8488d5cea 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/IStructureDefinition.java @@ -1,9 +1,14 @@ 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 { /** * Used internally @@ -73,9 +78,17 @@ public interface IStructureDefinition { 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 { + } else { + if(DEBUG_MODE){ + TecTech.LOGGER.info("Multi ["+basePositionX+", "+basePositionY+", "+basePositionZ+"] !blockExists @ "+ + Arrays.toString(xyz)+" "+Arrays.toString(abc)); + } return false; } abc[0]+=1; @@ -95,8 +108,17 @@ public interface IStructureDefinition { 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; } 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 index 00bdcdb1ad..1c2fd18326 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -112,6 +112,8 @@ public class StructureUtility { return ERROR; } + //region hint only + /** * Check always returns: true. * @@ -180,6 +182,10 @@ public class StructureUtility { }; } + //endregion + + //region block + /** * Does not allow Block duplicates (with different meta) */ @@ -354,6 +360,10 @@ public class StructureUtility { return ofBlock(block, meta, block, meta); } + //endregion + + //region adders + public static IStructureElement ofBlockAdder(IBlockAdder iBlockAdder, Block defaultBlock, int defaultMeta) { if (iBlockAdder == null || defaultBlock == null) { throw new IllegalArgumentException(); @@ -436,9 +446,9 @@ public class StructureUtility { @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) || - (world.getBlock(x, y, z) == placeCasing && world.getBlockMetadata(x, y, z) == placeCasingMeta)); + return (tileEntity instanceof IGregTechTileEntity && + iHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) textureIndex)) || + (world.getBlock(x, y, z) == placeCasing && world.getBlockMetadata(x, y, z) == placeCasingMeta); } @Override @@ -455,6 +465,10 @@ public class StructureUtility { }; } + //endregion + + //region side effects + public static , T> IStructureElement onElementPass(Consumer onCheckPass, B element) { return new IStructureElement() { @Override @@ -501,6 +515,7 @@ public class StructureUtility { }; } + //endregion /** * Take care while chaining, as it will try to call every structure element until it returns true. @@ -536,6 +551,8 @@ public class StructureUtility { return ofChain(elementChain.toArray(new IStructureElement[0])); } + //region defer + public static IStructureElementDeferred defer(Supplier> to) { if (to == null) { throw new IllegalArgumentException(); @@ -840,10 +857,26 @@ public class StructureUtility { 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 + * @return + */ public static IStructureNavigate 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 + * @return + */ @SuppressWarnings("unchecked") public static IStructureNavigate step(Vec3Impl step) { if (step == null || step.get0() < 0 || step.get1() < 0 || step.get2() < 0) { -- cgit From f840c335e5a15ff244f2e8cd5583e8c5d3a26de6 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Mon, 1 Jun 2020 17:00:55 +0200 Subject: Buck Converter from TecTech #6179 https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/6179 --- .../dreamcraft/DreamCraftRecipeLoader.java | 24 +++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) 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 b863e35901..6fff07cbc5 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 @@ -253,9 +253,9 @@ public class DreamCraftRecipeLoader implements Runnable { 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.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Dynamo_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 2)}, Materials.Silver.getMolten(8000), CustomItemList.eM_dynamoMulti4_UIV.get(1), 100, 8000000); - //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UMV_UIV.get(1), CustomItemList.eM_dynamoMulti4_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 4)}, Materials.Electrum.getMolten(8000), CustomItemList.eM_dynamoMulti16_UIV.get(1), 200, 8000000); - //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UMV_UIV.get(1), CustomItemList.eM_dynamoMulti16_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 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(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); //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); @@ -282,10 +282,20 @@ public class DreamCraftRecipeLoader implements Runnable { 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.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Energy_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 2)}, Materials.Silver.getMolten(8000), CustomItemList.eM_energyMulti4_UIV.get(1), 100, 8000000); - //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UMV_UIV.get(1), CustomItemList.eM_energyMulti4_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 4)}, Materials.Electrum.getMolten(8000), CustomItemList.eM_energyMulti16_UIV.get(1), 200, 8000000); - //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UMV_UIV.get(1), CustomItemList.eM_energyMulti16_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 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(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); + + //Buck Converter IV-UIV + if(Loader.isModLoaded("bartworks")) { + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_IV.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Elite, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 2)}, Materials.TungstenSteel.getMolten(144), CustomItemList.Machine_BuckConverter_IV.get(1), 100, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_LuV.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Rhodium-PlatedPalladium", Materials.Chrome), 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 3)}, new FluidStack(FluidRegistry.getFluid("molten.rhodium-plated palladium"), 288), CustomItemList.Machine_BuckConverter_LuV.get(1), 100, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_ZPM.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 4)}, Materials.Iridium.getMolten(144), CustomItemList.Machine_BuckConverter_ZPM.get(1), 100, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UV.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 5)}, Materials.Osmium.getMolten(144), CustomItemList.Machine_BuckConverter_UV.get(1), 100, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UHV.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Infinite, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 4L, 5)}, Materials.Neutronium.getMolten(144), CustomItemList.Machine_BuckConverter_UHV.get(1), 100, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UEV.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Bio, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 8L, 5)}, Materials.Bedrockium.getMolten(144), CustomItemList.Machine_BuckConverter_UEV.get(1), 100, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UIV.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Nano, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 16L, 5)}, Materials.BlackPlutonium.getMolten(144), CustomItemList.Machine_BuckConverter_UIV.get(1), 200, 8000000); + } //Laser Dynamo IV-UEV 256/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_IV.get(1), ItemList.Electric_Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamoTunnel1_IV.get(1), 1000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_LuV.get(1), ItemList.Electric_Pump_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.VanadiumGallium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamoTunnel1_LuV.get(1), 1000, 30720); -- cgit From a98c065b4f266979be1ac23fbd1e163964a868cf Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Mon, 1 Jun 2020 17:09:05 +0200 Subject: Buck Converter from TecTech #6179 https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/6179 add neutronium fluid if Bedrockium and Black Plutonium not available --- .../tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 6fff07cbc5..8621c83216 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 @@ -293,8 +293,8 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_ZPM.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 4)}, Materials.Iridium.getMolten(144), CustomItemList.Machine_BuckConverter_ZPM.get(1), 100, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UV.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 5)}, Materials.Osmium.getMolten(144), CustomItemList.Machine_BuckConverter_UV.get(1), 100, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UHV.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Infinite, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 4L, 5)}, Materials.Neutronium.getMolten(144), CustomItemList.Machine_BuckConverter_UHV.get(1), 100, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UEV.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Bio, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 8L, 5)}, Materials.Bedrockium.getMolten(144), CustomItemList.Machine_BuckConverter_UEV.get(1), 100, 8000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UIV.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Nano, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 16L, 5)}, Materials.BlackPlutonium.getMolten(144), CustomItemList.Machine_BuckConverter_UIV.get(1), 200, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UEV.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Bio, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 8L, 5)}, getOrDefault("Bedrockium", Materials.Neutronium).getMolten(144), CustomItemList.Machine_BuckConverter_UEV.get(1), 100, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UIV.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Nano, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 16L, 5)}, getOrDefault("BlackPlutonium", Materials.Neutronium).getMolten(144), CustomItemList.Machine_BuckConverter_UIV.get(1), 200, 8000000); } //Laser Dynamo IV-UEV 256/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_IV.get(1), ItemList.Electric_Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamoTunnel1_IV.get(1), 1000, 7680); -- cgit From 8c2c74b4b4f808d37a6b47450c5474ab63fbd361 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Mon, 1 Jun 2020 17:18:32 +0200 Subject: bump version and gt dependencie for Jenkins --- build.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.properties b/build.properties index 5eafc26e8e..3b282b43c2 100644 --- a/build.properties +++ b/build.properties @@ -1,13 +1,13 @@ minecraft.version=1.7.10 forge.version=10.13.4.1614 -tectech.version=3.8.2 +tectech.version=3.8.3 ic2.version=2.2.790-experimental codechickenlib.version=1.1.3.140 codechickencore.version=1.0.7.47 nei.version=1.0.5.120 -gregtech.jenkinsbuild=545 -gregtech.version=5.09.33.44 +gregtech.jenkinsbuild=620 +gregtech.version=5.09.33.50 cofhcore.version=[1.7.10]3.1.4-329-dev yamcore.version=0.5.79 baubles.version=1.0.1.10 -- cgit From 11bf30cbff2e200f9bb6400aad1c81a209365d14 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Mon, 1 Jun 2020 17:40:54 +0200 Subject: Buck Converter from TecTech #6179 https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/6179 fix Display naming --- .../compatibility/dreamcraft/DreamCraftRecipeLoader.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 8621c83216..3fa004f7d4 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 @@ -288,13 +288,13 @@ public class DreamCraftRecipeLoader implements Runnable { //Buck Converter IV-UIV if(Loader.isModLoaded("bartworks")) { - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_IV.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Elite, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 2)}, Materials.TungstenSteel.getMolten(144), CustomItemList.Machine_BuckConverter_IV.get(1), 100, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_LuV.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Rhodium-PlatedPalladium", Materials.Chrome), 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 3)}, new FluidStack(FluidRegistry.getFluid("molten.rhodium-plated palladium"), 288), CustomItemList.Machine_BuckConverter_LuV.get(1), 100, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_ZPM.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 4)}, Materials.Iridium.getMolten(144), CustomItemList.Machine_BuckConverter_ZPM.get(1), 100, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UV.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 5)}, Materials.Osmium.getMolten(144), CustomItemList.Machine_BuckConverter_UV.get(1), 100, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UHV.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Infinite, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 4L, 5)}, Materials.Neutronium.getMolten(144), CustomItemList.Machine_BuckConverter_UHV.get(1), 100, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UEV.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Bio, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 8L, 5)}, getOrDefault("Bedrockium", Materials.Neutronium).getMolten(144), CustomItemList.Machine_BuckConverter_UEV.get(1), 100, 8000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UIV.get(1), getItemContainer("display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Nano, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 16L, 5)}, getOrDefault("BlackPlutonium", Materials.Neutronium).getMolten(144), CustomItemList.Machine_BuckConverter_UIV.get(1), 200, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_IV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Elite, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 2)}, Materials.TungstenSteel.getMolten(144), CustomItemList.Machine_BuckConverter_IV.get(1), 100, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_LuV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Rhodium-PlatedPalladium", Materials.Chrome), 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 3)}, new FluidStack(FluidRegistry.getFluid("molten.rhodium-plated palladium"), 288), CustomItemList.Machine_BuckConverter_LuV.get(1), 100, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_ZPM.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 4)}, Materials.Iridium.getMolten(144), CustomItemList.Machine_BuckConverter_ZPM.get(1), 100, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 5)}, Materials.Osmium.getMolten(144), CustomItemList.Machine_BuckConverter_UV.get(1), 100, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UHV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Infinite, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 4L, 5)}, Materials.Neutronium.getMolten(144), CustomItemList.Machine_BuckConverter_UHV.get(1), 100, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UEV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Bio, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 8L, 5)}, getOrDefault("Bedrockium", Materials.Neutronium).getMolten(144), CustomItemList.Machine_BuckConverter_UEV.get(1), 100, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UIV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Nano, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 16L, 5)}, getOrDefault("BlackPlutonium", Materials.Neutronium).getMolten(144), CustomItemList.Machine_BuckConverter_UIV.get(1), 200, 8000000); } //Laser Dynamo IV-UEV 256/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_IV.get(1), ItemList.Electric_Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamoTunnel1_IV.get(1), 1000, 7680); -- cgit From 66546d6b566772394523e0bca7848707da609bd9 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Mon, 1 Jun 2020 18:28:20 +0200 Subject: Buck Converter from TecTech #6179 https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/6179 change BAse block be a GT Transformator add Wires --- .../compatibility/dreamcraft/DreamCraftRecipeLoader.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 3fa004f7d4..de1c69f118 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 @@ -288,13 +288,13 @@ public class DreamCraftRecipeLoader implements Runnable { //Buck Converter IV-UIV if(Loader.isModLoaded("bartworks")) { - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_IV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Elite, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 2)}, Materials.TungstenSteel.getMolten(144), CustomItemList.Machine_BuckConverter_IV.get(1), 100, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_LuV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Rhodium-PlatedPalladium", Materials.Chrome), 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 3)}, new FluidStack(FluidRegistry.getFluid("molten.rhodium-plated palladium"), 288), CustomItemList.Machine_BuckConverter_LuV.get(1), 100, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_ZPM.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 4)}, Materials.Iridium.getMolten(144), CustomItemList.Machine_BuckConverter_ZPM.get(1), 100, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 5)}, Materials.Osmium.getMolten(144), CustomItemList.Machine_BuckConverter_UV.get(1), 100, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UHV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Infinite, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 4L, 5)}, Materials.Neutronium.getMolten(144), CustomItemList.Machine_BuckConverter_UHV.get(1), 100, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UEV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Bio, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 8L, 5)}, getOrDefault("Bedrockium", Materials.Neutronium).getMolten(144), CustomItemList.Machine_BuckConverter_UEV.get(1), 100, 8000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.eM_energyMulti64_UIV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Nano, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 2), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 16L, 5)}, getOrDefault("BlackPlutonium", Materials.Neutronium).getMolten(144), CustomItemList.Machine_BuckConverter_UIV.get(1), 200, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_LuV_IV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.TungstenSteel, 4), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 2)}, Materials.TungstenSteel.getMolten(288), CustomItemList.Machine_BuckConverter_IV.get(1), 100, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_ZPM_LuV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 2), GT_OreDictUnificator.get(OrePrefixes.plateDouble, getOrDefault("Rhodium-PlatedPalladium", Materials.Chrome), 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NiobiumTitanium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 3)}, new FluidStack(FluidRegistry.getFluid("molten.rhodium-plated palladium"), 288), CustomItemList.Machine_BuckConverter_LuV.get(1), 100, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_UV_ZPM.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Iridium, 4), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 4)}, Materials.Iridium.getMolten(288), CustomItemList.Machine_BuckConverter_ZPM.get(1), 100, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_MAX_UV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Infinite, 2), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Osmium, 4), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 5)}, Materials.Osmium.getMolten(288), CustomItemList.Machine_BuckConverter_UV.get(1), 100, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.Transformer_UEV_UHV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Bio, 2), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 4), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.ElectrumFlux, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 4L, 5)}, Materials.Neutronium.getMolten(288), CustomItemList.Machine_BuckConverter_UHV.get(1), 100, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.Transformer_UIV_UEV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Nano, 2), GT_OreDictUnificator.get(OrePrefixes.plateDouble, getOrDefault("Bedrockium", Materials.Neutronium), 4), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Bedrockium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 8L, 5)}, getOrDefault("Bedrockium", Materials.Neutronium).getMolten(288), CustomItemList.Machine_BuckConverter_UEV.get(1), 100, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.Transformer_UMV_UIV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Piko, 2), GT_OreDictUnificator.get(OrePrefixes.plateDouble, getOrDefault("BlackPlutonium", Materials.Neutronium), 4), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Draconium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 16L, 5)}, getOrDefault("BlackPlutonium", Materials.Neutronium).getMolten(288), CustomItemList.Machine_BuckConverter_UIV.get(1), 200, 8000000); } //Laser Dynamo IV-UEV 256/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_IV.get(1), ItemList.Electric_Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamoTunnel1_IV.get(1), 1000, 7680); -- cgit From 4de2332482ba078b1b987f098c3b92d7e4884c3c Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Mon, 1 Jun 2020 18:33:03 +0200 Subject: Buck Converter from TecTech #6179 https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/6179 make recipes a bit cheaper use lower circuits and normal plates 2x --- .../compatibility/dreamcraft/DreamCraftRecipeLoader.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 de1c69f118..b45d1b7d10 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 @@ -288,13 +288,13 @@ public class DreamCraftRecipeLoader implements Runnable { //Buck Converter IV-UIV if(Loader.isModLoaded("bartworks")) { - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_LuV_IV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.TungstenSteel, 4), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 2)}, Materials.TungstenSteel.getMolten(288), CustomItemList.Machine_BuckConverter_IV.get(1), 100, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_ZPM_LuV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 2), GT_OreDictUnificator.get(OrePrefixes.plateDouble, getOrDefault("Rhodium-PlatedPalladium", Materials.Chrome), 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NiobiumTitanium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 3)}, new FluidStack(FluidRegistry.getFluid("molten.rhodium-plated palladium"), 288), CustomItemList.Machine_BuckConverter_LuV.get(1), 100, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_UV_ZPM.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Iridium, 4), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 4)}, Materials.Iridium.getMolten(288), CustomItemList.Machine_BuckConverter_ZPM.get(1), 100, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_MAX_UV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Infinite, 2), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Osmium, 4), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 5)}, Materials.Osmium.getMolten(288), CustomItemList.Machine_BuckConverter_UV.get(1), 100, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.Transformer_UEV_UHV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Bio, 2), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 4), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.ElectrumFlux, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 4L, 5)}, Materials.Neutronium.getMolten(288), CustomItemList.Machine_BuckConverter_UHV.get(1), 100, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.Transformer_UIV_UEV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Nano, 2), GT_OreDictUnificator.get(OrePrefixes.plateDouble, getOrDefault("Bedrockium", Materials.Neutronium), 4), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Bedrockium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 8L, 5)}, getOrDefault("Bedrockium", Materials.Neutronium).getMolten(288), CustomItemList.Machine_BuckConverter_UEV.get(1), 100, 8000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.Transformer_UMV_UIV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Piko, 2), GT_OreDictUnificator.get(OrePrefixes.plateDouble, getOrDefault("BlackPlutonium", Materials.Neutronium), 4), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Draconium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 16L, 5)}, getOrDefault("BlackPlutonium", Materials.Neutronium).getMolten(288), CustomItemList.Machine_BuckConverter_UIV.get(1), 200, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_LuV_IV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Elite, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 2)}, Materials.TungstenSteel.getMolten(288), CustomItemList.Machine_BuckConverter_IV.get(1), 100, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_ZPM_LuV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Rhodium-PlatedPalladium", Materials.Chrome), 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NiobiumTitanium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 3)}, new FluidStack(FluidRegistry.getFluid("molten.rhodium-plated palladium"), 288), CustomItemList.Machine_BuckConverter_LuV.get(1), 100, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_UV_ZPM.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 4)}, Materials.Iridium.getMolten(288), CustomItemList.Machine_BuckConverter_ZPM.get(1), 100, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_MAX_UV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 5)}, Materials.Osmium.getMolten(288), CustomItemList.Machine_BuckConverter_UV.get(1), 100, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.Transformer_UEV_UHV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Infinite, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.ElectrumFlux, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 4L, 5)}, Materials.Neutronium.getMolten(288), CustomItemList.Machine_BuckConverter_UHV.get(1), 100, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.Transformer_UIV_UEV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Bio, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Bedrockium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 8L, 5)}, getOrDefault("Bedrockium", Materials.Neutronium).getMolten(288), CustomItemList.Machine_BuckConverter_UEV.get(1), 100, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.Transformer_UMV_UIV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Nano, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Draconium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 16L, 5)}, getOrDefault("BlackPlutonium", Materials.Neutronium).getMolten(288), CustomItemList.Machine_BuckConverter_UIV.get(1), 200, 8000000); } //Laser Dynamo IV-UEV 256/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_IV.get(1), ItemList.Electric_Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamoTunnel1_IV.get(1), 1000, 7680); -- cgit From 93907bac715fb04d206aaff9480974c709e8389c Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Mon, 1 Jun 2020 18:33:32 +0200 Subject: Buck Converter from TecTech #6179 (#29) * Buck Converter from TecTech #6179 https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/6179 * Buck Converter from TecTech #6179 https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/6179 add neutronium fluid if Bedrockium and Black Plutonium not available * bump version and gt dependencie for Jenkins * Buck Converter from TecTech #6179 https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/6179 fix Display naming * Buck Converter from TecTech #6179 https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/6179 change BAse block be a GT Transformator add Wires * Buck Converter from TecTech #6179 https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/6179 make recipes a bit cheaper use lower circuits and normal plates 2x --- build.properties | 6 +++--- .../dreamcraft/DreamCraftRecipeLoader.java | 24 +++++++++++++++------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/build.properties b/build.properties index 5eafc26e8e..3b282b43c2 100644 --- a/build.properties +++ b/build.properties @@ -1,13 +1,13 @@ minecraft.version=1.7.10 forge.version=10.13.4.1614 -tectech.version=3.8.2 +tectech.version=3.8.3 ic2.version=2.2.790-experimental codechickenlib.version=1.1.3.140 codechickencore.version=1.0.7.47 nei.version=1.0.5.120 -gregtech.jenkinsbuild=545 -gregtech.version=5.09.33.44 +gregtech.jenkinsbuild=620 +gregtech.version=5.09.33.50 cofhcore.version=[1.7.10]3.1.4-329-dev yamcore.version=0.5.79 baubles.version=1.0.1.10 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 b863e35901..b45d1b7d10 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 @@ -253,9 +253,9 @@ public class DreamCraftRecipeLoader implements Runnable { 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.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Dynamo_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 2)}, Materials.Silver.getMolten(8000), CustomItemList.eM_dynamoMulti4_UIV.get(1), 100, 8000000); - //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UMV_UIV.get(1), CustomItemList.eM_dynamoMulti4_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 4)}, Materials.Electrum.getMolten(8000), CustomItemList.eM_dynamoMulti16_UIV.get(1), 200, 8000000); - //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UMV_UIV.get(1), CustomItemList.eM_dynamoMulti16_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 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(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); //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); @@ -282,10 +282,20 @@ public class DreamCraftRecipeLoader implements Runnable { 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.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Energy_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 2)}, Materials.Silver.getMolten(8000), CustomItemList.eM_energyMulti4_UIV.get(1), 100, 8000000); - //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UMV_UIV.get(1), CustomItemList.eM_energyMulti4_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 4)}, Materials.Electrum.getMolten(8000), CustomItemList.eM_energyMulti16_UIV.get(1), 200, 8000000); - //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UMV_UIV.get(1), CustomItemList.eM_energyMulti16_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 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(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); + + //Buck Converter IV-UIV + if(Loader.isModLoaded("bartworks")) { + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_LuV_IV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Elite, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 2)}, Materials.TungstenSteel.getMolten(288), CustomItemList.Machine_BuckConverter_IV.get(1), 100, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_ZPM_LuV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Rhodium-PlatedPalladium", Materials.Chrome), 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NiobiumTitanium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 3)}, new FluidStack(FluidRegistry.getFluid("molten.rhodium-plated palladium"), 288), CustomItemList.Machine_BuckConverter_LuV.get(1), 100, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_UV_ZPM.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 4)}, Materials.Iridium.getMolten(288), CustomItemList.Machine_BuckConverter_ZPM.get(1), 100, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_MAX_UV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 5)}, Materials.Osmium.getMolten(288), CustomItemList.Machine_BuckConverter_UV.get(1), 100, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.Transformer_UEV_UHV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Infinite, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.ElectrumFlux, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 4L, 5)}, Materials.Neutronium.getMolten(288), CustomItemList.Machine_BuckConverter_UHV.get(1), 100, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.Transformer_UIV_UEV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Bio, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Bedrockium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 8L, 5)}, getOrDefault("Bedrockium", Materials.Neutronium).getMolten(288), CustomItemList.Machine_BuckConverter_UEV.get(1), 100, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.Transformer_UMV_UIV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Nano, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Draconium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 16L, 5)}, getOrDefault("BlackPlutonium", Materials.Neutronium).getMolten(288), CustomItemList.Machine_BuckConverter_UIV.get(1), 200, 8000000); + } //Laser Dynamo IV-UEV 256/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_IV.get(1), ItemList.Electric_Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamoTunnel1_IV.get(1), 1000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_LuV.get(1), ItemList.Electric_Pump_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.VanadiumGallium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamoTunnel1_LuV.get(1), 1000, 30720); -- cgit From 1393d73fea85784d8abf9c81fa2234cf879309a9 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Mon, 1 Jun 2020 18:57:15 +0200 Subject: Buck Converter from TecTech #6179 https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/6179 fix derp --- .../tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 b45d1b7d10..bbbed0a70a 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 @@ -292,9 +292,9 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_ZPM_LuV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Rhodium-PlatedPalladium", Materials.Chrome), 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NiobiumTitanium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 3)}, new FluidStack(FluidRegistry.getFluid("molten.rhodium-plated palladium"), 288), CustomItemList.Machine_BuckConverter_LuV.get(1), 100, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_UV_ZPM.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 4)}, Materials.Iridium.getMolten(288), CustomItemList.Machine_BuckConverter_ZPM.get(1), 100, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_MAX_UV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 5)}, Materials.Osmium.getMolten(288), CustomItemList.Machine_BuckConverter_UV.get(1), 100, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.Transformer_UEV_UHV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Infinite, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.ElectrumFlux, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 4L, 5)}, Materials.Neutronium.getMolten(288), CustomItemList.Machine_BuckConverter_UHV.get(1), 100, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.Transformer_UIV_UEV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Bio, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Bedrockium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 8L, 5)}, getOrDefault("Bedrockium", Materials.Neutronium).getMolten(288), CustomItemList.Machine_BuckConverter_UEV.get(1), 100, 8000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{CustomItemList.Transformer_UMV_UIV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Nano, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Draconium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 16L, 5)}, getOrDefault("BlackPlutonium", Materials.Neutronium).getMolten(288), CustomItemList.Machine_BuckConverter_UIV.get(1), 200, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UEV_UHV").get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Infinite, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.ElectrumFlux, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 4L, 5)}, Materials.Neutronium.getMolten(288), CustomItemList.Machine_BuckConverter_UHV.get(1), 100, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UIV_UEV").get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Bio, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Bedrockium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 8L, 5)}, getOrDefault("Bedrockium", Materials.Neutronium).getMolten(288), CustomItemList.Machine_BuckConverter_UEV.get(1), 100, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UMV_UIV").get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Nano, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Draconium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 16L, 5)}, getOrDefault("BlackPlutonium", Materials.Neutronium).getMolten(288), CustomItemList.Machine_BuckConverter_UIV.get(1), 200, 8000000); } //Laser Dynamo IV-UEV 256/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_IV.get(1), ItemList.Electric_Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamoTunnel1_IV.get(1), 1000, 7680); -- cgit From b3fa98eebb71c25e3a59ed965ca217f40bd68470 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 1 Jun 2020 19:12:09 +0200 Subject: Add recipes for some hatches --- .../dreamcraft/DreamCraftRecipeLoader.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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 b863e35901..fcf89dc1c6 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 @@ -446,6 +446,20 @@ public class DreamCraftRecipeLoader implements Runnable { ItemList.Cover_Screen.get(1), new ItemStack(Blocks.stone_button, 16), }, Materials.Iridium.getMolten(2592), CustomItemList.Parametrizer_Hatch.get(1), 800, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_Computer_Casing.get(1), + ItemList.Circuit_Ultimatecrystalcomputer.get(1), + CustomItemList.DATApipe.get(6), + ItemList.Cover_Screen.get(1), + new ItemStack(Blocks.stone_button, 32), + }, Materials.Iridium.getMolten(2592), CustomItemList.ParametrizerX_Hatch.get(1), 800, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.eM_Computer_Casing.get(1), + ItemList.Circuit_Biomainframe.get(1), + CustomItemList.DATApipe.get(8), + ItemList.Cover_Screen.get(2), + new ItemStack(Blocks.stone_button, 64), + }, Materials.Iridium.getMolten(2592), CustomItemList.ParametrizerTXT_Hatch.get(1), 800, 122880); //Uncertainty addAssemblerRecipeWithCleanroom(new ItemStack[]{ CustomItemList.eM_Computer_Casing.get(1), @@ -454,6 +468,13 @@ public class DreamCraftRecipeLoader implements Runnable { ItemList.Cover_Screen.get(1), new ItemStack(Blocks.stone_button, 16), }, Materials.Iridium.getMolten(2592), CustomItemList.Uncertainty_Hatch.get(1), 1200, 122880); + addAssemblerRecipeWithCleanroom(new ItemStack[]{ + CustomItemList.eM_Computer_Casing.get(1), + ItemList.Circuit_Biomainframe.get(1), + CustomItemList.DATApipe.get(32), + ItemList.Cover_Screen.get(1), + new ItemStack(Blocks.stone_button, 16), + }, Materials.Iridium.getMolten(2592), CustomItemList.UncertaintyX_Hatch.get(1), 1200, 122880); //Elemental Input addAssemblerRecipeWithCleanroom(new ItemStack[]{ -- cgit From eb479dd05217d6313e3b8cc0b294e1b526663cc5 Mon Sep 17 00:00:00 2001 From: DreamMasterXXL Date: Thu, 11 Jun 2020 12:27:07 +0200 Subject: Uncertainty Resolver has no recipe #6217 https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/6217 add control circuits to the recipes --- .../tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java | 7 +++++++ 1 file changed, 7 insertions(+) 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 57eb0179ed..696dc2a1df 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 @@ -455,6 +455,7 @@ public class DreamCraftRecipeLoader implements Runnable { CustomItemList.DATApipe.get(4), ItemList.Cover_Screen.get(1), new ItemStack(Blocks.stone_button, 16), + GT_Utility.getIntegratedCircuit(1), }, Materials.Iridium.getMolten(2592), CustomItemList.Parametrizer_Hatch.get(1), 800, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.eM_Computer_Casing.get(1), @@ -462,13 +463,16 @@ public class DreamCraftRecipeLoader implements Runnable { CustomItemList.DATApipe.get(6), ItemList.Cover_Screen.get(1), new ItemStack(Blocks.stone_button, 32), + GT_Utility.getIntegratedCircuit(2), }, Materials.Iridium.getMolten(2592), CustomItemList.ParametrizerX_Hatch.get(1), 800, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.eM_Computer_Casing.get(1), ItemList.Circuit_Biomainframe.get(1), CustomItemList.DATApipe.get(8), ItemList.Cover_Screen.get(2), new ItemStack(Blocks.stone_button, 64), + GT_Utility.getIntegratedCircuit(3), }, Materials.Iridium.getMolten(2592), CustomItemList.ParametrizerTXT_Hatch.get(1), 800, 122880); //Uncertainty addAssemblerRecipeWithCleanroom(new ItemStack[]{ @@ -477,13 +481,16 @@ public class DreamCraftRecipeLoader implements Runnable { CustomItemList.DATApipe.get(16), ItemList.Cover_Screen.get(1), new ItemStack(Blocks.stone_button, 16), + GT_Utility.getIntegratedCircuit(4), }, Materials.Iridium.getMolten(2592), CustomItemList.Uncertainty_Hatch.get(1), 1200, 122880); + addAssemblerRecipeWithCleanroom(new ItemStack[]{ CustomItemList.eM_Computer_Casing.get(1), ItemList.Circuit_Biomainframe.get(1), CustomItemList.DATApipe.get(32), ItemList.Cover_Screen.get(1), new ItemStack(Blocks.stone_button, 16), + GT_Utility.getIntegratedCircuit(5), }, Materials.Iridium.getMolten(2592), CustomItemList.UncertaintyX_Hatch.get(1), 1200, 122880); //Elemental Input -- cgit From 55d58b9812096f09a41a5298e74791d82509595b Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 14 Jun 2020 07:35:34 +0200 Subject: REsolve some bugs --- .../tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java | 4 +++- .../thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java | 2 +- .../multi/base/GT_MetaTileEntity_MultiblockBase_EM.java | 2 ++ .../thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) 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 57eb0179ed..c26125fe69 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 @@ -30,9 +30,11 @@ import static com.github.technus.tectech.loader.recipe.RecipeLoader.getOrDefault */ public class DreamCraftRecipeLoader implements Runnable { //region reflect a bit + @SuppressWarnings("rawtypes") private Class CUSTOM_ITEM_LIST; private Method ADD_ASSEMBLER_RECIPE; + @SuppressWarnings("unchecked") private IItemContainer getItemContainer(String name) { return (IItemContainer) Enum.valueOf(CUSTOM_ITEM_LIST, name); } @@ -41,7 +43,7 @@ public class DreamCraftRecipeLoader implements Runnable { try { ADD_ASSEMBLER_RECIPE.invoke(GT_Values.RA, items, fluid, output, time, eut, true); } catch (Exception e) { - throw new Error(e); + throw new RuntimeException("Failed to add clean room assembler recipe! " +output.getDisplayName(),e); } } //endregion 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 213c919ec8..8838286071 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 @@ -239,7 +239,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB mEfficiencyIncrease = 10000; eRequiredData = (short) (ttRecipe.mSpecialValue >>> 16); eAmpereFlow = (short) (ttRecipe.mSpecialValue & 0xFFFF); - mEUt = ttRecipe.mEUt; + mEUt = Math.min(ttRecipe.mEUt,-ttRecipe.mEUt); eHolders.get(0).getBaseMetaTileEntity().setActive(true); return true; } 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 cf37fb0689..24fd51c7d4 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 @@ -87,6 +87,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt protected ArrayList eInputData = new ArrayList<>(); protected ArrayList eOutputData = new ArrayList<>(); + //endregion + //region parameters public final Parameters parametrization; //endregion diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java index 7aabff1af4..ee6f469d59 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java @@ -194,6 +194,7 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn if (meta instanceof IConnectsToDataPipe && meta != source) { if (meta instanceof GT_MetaTileEntity_Pipe_Data && ((GT_MetaTileEntity_Pipe_Data) meta).connectionCount == 2) { + ((GT_MetaTileEntity_Pipe_Data) meta).markUsed(); return (IConnectsToDataPipe) meta; } if (((IConnectsToDataPipe) meta).isDataInputFacing(GT_Utility.getOppositeSide(b))) { -- cgit From 2ad9e1927127ee115741ebed7c24de617e0df1b9 Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 14 Jun 2020 08:11:32 +0200 Subject: Add offline temp reading --- .../multi/GT_MetaTileEntity_EM_computer.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 c845fe361e..5d88fdfc50 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 @@ -35,6 +35,7 @@ import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texture 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 net.minecraft.util.StatCollector.translateToLocal; @@ -160,6 +161,23 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB return eUncertainHatches.size() == 1; } + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if(aBaseMetaTileEntity.isServerSide() && mMachine && !aBaseMetaTileEntity.isActive() && aTick % 20 == MULTI_CHECK_AT){ + double maxTemp = 0; + for (GT_MetaTileEntity_Hatch_Rack rack : eRacks) { + if (!GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { + continue; + } + if (rack.heat > maxTemp) { + maxTemp = rack.heat; + } + } + maxCurrentTemp.set(maxTemp); + } + } + @Override public boolean checkRecipe_EM(ItemStack itemStack) { parametrization.setToDefaults(false, true); -- cgit From 12d5080675762c4ce760f371673a2af37d6476ac Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 14 Jun 2020 08:25:51 +0200 Subject: Add missing machine type --- .../thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java | 3 +++ 1 file changed, 3 insertions(+) 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 8838286071..889b4cfec3 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 @@ -58,6 +58,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB private GT_Recipe.GT_Recipe_AssemblyLine tRecipe; private TT_recipe.TT_assLineRecipe aRecipe; private String machineType; + private static final String assembly="Assembly line"; private ItemStack holdItem; private long computationRemaining, computationRequired; @@ -282,6 +283,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB if (ItemList.Tool_DataStick.isStackEqual(itemStack, false, true)) { for (GT_Recipe.GT_Recipe_AssemblyLine assRecipe : TT_recipe.GT_Recipe_MapTT.sAssemblylineRecipes) { if (GT_Utility.areStacksEqual(assRecipe.mResearchItem, holdItem, true)) { + machineType = assembly; tRecipe = assRecipe; //if found if (iterateRecipes()) return true; @@ -469,6 +471,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB for (GT_Recipe.GT_Recipe_AssemblyLine tRecipe : TT_recipe.GT_Recipe_MapTT.sAssemblylineRecipes) { if (GT_Utility.areStacksEqual(tRecipe.mResearchItem, holdItem, true)) { this.tRecipe = tRecipe; + machineType = assembly; break; } } -- cgit From 028dd5ee21c8b1d4766ccc6f35dedcb81ca2408a Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 14 Jun 2020 09:12:55 +0200 Subject: Fix sound loops --- .../thing/metaTileEntity/multi/base/SoundLoop.java | 9 ++++----- .../resources/assets/tectech/sounds/fx_lo_freq.ogg | Bin 14802 -> 29373 bytes .../resources/assets/tectech/sounds/fx_mid_freq.ogg | Bin 15252 -> 26378 bytes 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/SoundLoop.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/SoundLoop.java index 338af1626e..e8e1a7eb27 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/SoundLoop.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/SoundLoop.java @@ -25,7 +25,7 @@ public class SoundLoop extends MovingSound{ zPosF=base.getZCoord(); worldID=base.getWorld().provider.dimensionId; repeat=true; - volume=0f; + volume= 0.0625f; } @Override @@ -34,14 +34,13 @@ public class SoundLoop extends MovingSound{ return; } if(fadeMe) { - volume-=0.05f; - if(volume<0){ + volume-=0.0625f; + if(volume<=0){ volume=0; - }else if(volume==0){ donePlaying=true; } }else if(volume<1) { - volume += 0.05f; + volume += 0.0625f; } World world=Minecraft.getMinecraft().thePlayer.worldObj; donePlaying=world.provider.dimensionId!=worldID || diff --git a/src/main/resources/assets/tectech/sounds/fx_lo_freq.ogg b/src/main/resources/assets/tectech/sounds/fx_lo_freq.ogg index 8eab2d92e2..f02581ae56 100644 Binary files a/src/main/resources/assets/tectech/sounds/fx_lo_freq.ogg and b/src/main/resources/assets/tectech/sounds/fx_lo_freq.ogg differ diff --git a/src/main/resources/assets/tectech/sounds/fx_mid_freq.ogg b/src/main/resources/assets/tectech/sounds/fx_mid_freq.ogg index b16d1297f4..10ac371e19 100644 Binary files a/src/main/resources/assets/tectech/sounds/fx_mid_freq.ogg and b/src/main/resources/assets/tectech/sounds/fx_mid_freq.ogg differ -- cgit From 2c0bbbb109aa0cc00193ad294e0aa794137bf9e1 Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 14 Jun 2020 09:31:50 +0200 Subject: Fix divide by zero lol --- .../metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java | 3 +++ 1 file changed, 3 insertions(+) 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 24fd51c7d4..28c90b58d0 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 @@ -1708,6 +1708,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } private boolean drainEnergyInput_EM(long EUtTierVoltage, long EUtEffective, long Amperes) { + if(maxEUinputMin==0){ + return false; + } if (EUtTierVoltage < 0) { EUtTierVoltage = -EUtTierVoltage; } -- cgit From 1959a09715b671073379f63e34c2df391635278d Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 23 Jun 2020 12:36:11 +0200 Subject: Added Support for MetaBlocks --- .../tectech/mechanics/structure/Structure.java | 20 +++++++------ .../mechanics/structure/StructureUtility.java | 33 ++++++++++++++-------- 2 files changed, 32 insertions(+), 21 deletions(-) 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 index e7769b3e04..7195563d19 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java @@ -103,32 +103,34 @@ public class Structure { } 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 (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockType[pointer]) { + 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] + " / " + world.getBlock(xyz[0], xyz[1], xyz[2]).getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName()); + 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 (world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != blockMeta[pointer]) { + 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] + " / " + world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) + ' ' + blockMeta[pointer]); + 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 (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockTypeFallback[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] + " / " + world.getBlock(xyz[0], xyz[1], xyz[2]).getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName())); + TecTech.LOGGER.info("Fallback-struct-block-error " + xyz[0] + ' ' + xyz[1] + ' ' + xyz[2] + " / " + abc[0] + ' ' + abc[1] + ' ' + abc[2] + " / " + worldblock.getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName())); } return false; } - if (world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != blockMetaFallback[pointer]) { + 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] + " / " + world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) + ' ' + blockMetaFallback[pointer]); + 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; } @@ -212,7 +214,7 @@ public class Structure { break; default: //check for block if ((pointer = block - '0') >= 0) { - if (world.getBlock(xyz[0], xyz[1], xyz[2]) != blockType[pointer] || world.getBlockMetadata(xyz[0], xyz[1], xyz[2]) != blockMeta[pointer]) { + 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) { 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 index 1c2fd18326..04e79ea33b 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -196,7 +196,8 @@ public class StructureUtility { return new IStructureElementNoPlacement() { @Override public boolean check(T t, World world, int x, int y, int z) { - return blocsMap.getOrDefault(world.getBlock(x, y, z), -1) == world.getBlockMetadata(x, y, z); + Block worldBlock = world.getBlock(x, y, z); + return blocsMap.getOrDefault(worldBlock, -1) == worldBlock.getDamageValue(world, x, y, z); } @Override @@ -222,7 +223,8 @@ public class StructureUtility { return new IStructureElementNoPlacement() { @Override public boolean check(T t, World world, int x, int y, int z) { - return blocsMap.getOrDefault(world.getBlock(x, y, z), Collections.emptySet()).contains(world.getBlockMetadata(x, y, z)); + Block worldBlock = world.getBlock(x, y, z); + return blocsMap.getOrDefault(worldBlock, Collections.emptySet()).contains(worldBlock.getDamageValue(world, x, y, z)); } @Override @@ -240,7 +242,8 @@ public class StructureUtility { return new IStructureElementNoPlacement() { @Override public boolean check(T t, World world, int x, int y, int z) { - return block == world.getBlock(x, y, z) && meta == world.getBlockMetadata(x, y, z); + Block worldBlock = world.getBlock(x, y, z); + return block == worldBlock && meta == worldBlock.getDamageValue(world, x, y, z); } @Override @@ -262,7 +265,8 @@ public class StructureUtility { return new IStructureElementNoPlacement() { @Override public boolean check(T t, World world, int x, int y, int z) { - return iBlockAdder.apply(t, world.getBlock(x, y, z), world.getBlockMetadata(x, y, z)); + Block worldBlock = world.getBlock(x, y, z); + return iBlockAdder.apply(t, worldBlock, worldBlock.getDamageValue(world,x,y,z)); } @Override @@ -283,7 +287,8 @@ public class StructureUtility { return new IStructureElement() { @Override public boolean check(T t, World world, int x, int y, int z) { - return blocsMap.getOrDefault(world.getBlock(x, y, z), -1) == world.getBlockMetadata(x, y, z); + Block worldBlock = world.getBlock(x, y, z); + return blocsMap.getOrDefault(worldBlock, -1) == worldBlock.getDamageValue(world,x,y,z); } @Override @@ -315,7 +320,8 @@ public class StructureUtility { return new IStructureElement() { @Override public boolean check(T t, World world, int x, int y, int z) { - return blocsMap.getOrDefault(world.getBlock(x, y, z), Collections.emptySet()).contains(world.getBlockMetadata(x, y, z)); + Block worldBlock = world.getBlock(x, y, z); + return blocsMap.getOrDefault(worldBlock, Collections.emptySet()).contains(worldBlock.getDamageValue(world, x, y, z)); } @Override @@ -339,7 +345,8 @@ public class StructureUtility { return new IStructureElement() { @Override public boolean check(T t, World world, int x, int y, int z) { - return block == world.getBlock(x, y, z) && meta == world.getBlockMetadata(x, y, z); + Block worldBlock = world.getBlock(x, y, z); + return block == worldBlock && meta == worldBlock.getDamageValue(world, x, y, z); } @Override @@ -371,7 +378,8 @@ public class StructureUtility { return new IStructureElement() { @Override public boolean check(T t, World world, int x, int y, int z) { - return iBlockAdder.apply(t, world.getBlock(x, y, z), world.getBlockMetadata(x, y, z)); + Block worldBlock = world.getBlock(x, y, z); + return iBlockAdder.apply(t, worldBlock, worldBlock.getDamageValue(world, x, y, z)); } @Override @@ -446,9 +454,10 @@ public class StructureUtility { @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)) || - (world.getBlock(x, y, z) == placeCasing && world.getBlockMetadata(x, y, z) == placeCasingMeta); + (worldBlock == placeCasing && worldBlock.getDamageValue(world, x, y, z) == placeCasingMeta); } @Override @@ -989,7 +998,7 @@ public class StructureUtility { if (set == null) { set = new TreeSet<>(); } - set.add(world.getBlockMetadata(x, y, z)); + set.add(block.getDamageValue(world, x, y, z)); return set; }); } @@ -1060,7 +1069,7 @@ public class StructureUtility { if (tileEntity == null) { Block block = w.getBlock(x, y, z); if (block != null && block != Blocks.air) { - builder.append(map.get(block.getUnlocalizedName() + '\0' + world.getBlockMetadata(x, y, z))); + builder.append(map.get(block.getUnlocalizedName() + '\0' + block.getDamageValue(world, x, y, z))); } else { builder.append(' '); } @@ -1095,7 +1104,7 @@ public class StructureUtility { if (tileEntity == null) { Block block = w.getBlock(x, y, z); if (block != null && block != Blocks.air) { - builder.append(map.get(block.getUnlocalizedName() + '\0' + world.getBlockMetadata(x, y, z))); + builder.append(map.get(block.getUnlocalizedName() + '\0' + block.getDamageValue(world,x, y, z))); } else { builder.append(' '); } -- cgit From 0afcd6ff4c62200307c409dd62b768c3015ead1d Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 23 Jun 2020 17:08:28 +0200 Subject: Added Build Support for MetaBlocks --- .../mechanics/structure/ICustomMetaBlock.java | 10 +++++++++ .../tectech/mechanics/structure/Structure.java | 5 ++++- .../mechanics/structure/StructureUtility.java | 25 +++++++++++++++++----- 3 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/ICustomMetaBlock.java diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/ICustomMetaBlock.java b/src/main/java/com/github/technus/tectech/mechanics/structure/ICustomMetaBlock.java new file mode 100644 index 0000000000..2c783ef268 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/ICustomMetaBlock.java @@ -0,0 +1,10 @@ +package com.github.technus.tectech.mechanics.structure; + +import net.minecraft.block.Block; +import net.minecraft.world.World; + +public interface ICustomMetaBlock { + default void setBlock(World world, int x, int y, int z, int meta){ + world.setBlock(x, y, z, (Block)this, meta, 2); + } +} 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 index 7195563d19..9e680b877e 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java @@ -237,7 +237,10 @@ public class Structure { break; default: //check for block if ((pointer = block - '0') >= 0) { - world.setBlock(xyz[0], xyz[1], xyz[2], blockType[pointer], blockMeta[pointer], 2); + if (blockType[pointer] instanceof ICustomMetaBlock) + ((ICustomMetaBlock)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); } } } 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 index 04e79ea33b..10779659dc 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -293,7 +293,10 @@ public class StructureUtility { @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - world.setBlock(x, y, z, defaultBlock, defaultMeta, 2); + if (defaultBlock instanceof ICustomMetaBlock) + ((ICustomMetaBlock)defaultBlock).setBlock(world, x, y, z, defaultMeta); + else + world.setBlock(x, y, z, defaultBlock, defaultMeta, 2); return true; } @@ -326,7 +329,10 @@ public class StructureUtility { @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - world.setBlock(x, y, z, defaultBlock, defaultMeta, 2); + if (defaultBlock instanceof ICustomMetaBlock) + ((ICustomMetaBlock)defaultBlock).setBlock(world, x, y, z, defaultMeta); + else + world.setBlock(x, y, z, defaultBlock, defaultMeta, 2); return true; } @@ -351,7 +357,10 @@ public class StructureUtility { @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - world.setBlock(x, y, z, defaultBlock, defaultMeta, 2); + if (defaultBlock instanceof ICustomMetaBlock) + ((ICustomMetaBlock)defaultBlock).setBlock(world, x, y, z, defaultMeta); + else + world.setBlock(x, y, z, defaultBlock, defaultMeta, 2); return true; } @@ -384,7 +393,10 @@ public class StructureUtility { @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - world.setBlock(x, y, z, defaultBlock, defaultMeta, 2); + if (defaultBlock instanceof ICustomMetaBlock) + ((ICustomMetaBlock)defaultBlock).setBlock(world, x, y, z, defaultMeta); + else + world.setBlock(x, y, z, defaultBlock, defaultMeta, 2); return true; } @@ -468,7 +480,10 @@ public class StructureUtility { @Override public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - world.setBlock(x, y, z, placeCasing, placeCasingMeta, 2); + if (placeCasing instanceof ICustomMetaBlock) + ((ICustomMetaBlock)placeCasing).setBlock(world, x, y, z, placeCasingMeta); + else + world.setBlock(x, y, z, placeCasing, placeCasingMeta, 2); return true; } }; -- cgit From 3707610dd388d8cdcb9f3a1f30de6249c65ad782 Mon Sep 17 00:00:00 2001 From: Tec Date: Tue, 23 Jun 2020 21:07:50 +0200 Subject: Cleanup code style, rename interface, unimplement default method to force user to implement it. rework to eager evaluation of instanceof check --- .../mechanics/structure/ICustomBlockSetting.java | 17 ++ .../mechanics/structure/ICustomMetaBlock.java | 10 - .../tectech/mechanics/structure/Structure.java | 24 +- .../mechanics/structure/StructureUtility.java | 311 ++++++++++++++------- 4 files changed, 236 insertions(+), 126 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/ICustomBlockSetting.java delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/structure/ICustomMetaBlock.java 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 new file mode 100644 index 0000000000..b70e76fbac --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/ICustomBlockSetting.java @@ -0,0 +1,17 @@ +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/ICustomMetaBlock.java b/src/main/java/com/github/technus/tectech/mechanics/structure/ICustomMetaBlock.java deleted file mode 100644 index 2c783ef268..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/ICustomMetaBlock.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.github.technus.tectech.mechanics.structure; - -import net.minecraft.block.Block; -import net.minecraft.world.World; - -public interface ICustomMetaBlock { - default void setBlock(World world, int x, int y, int z, int meta){ - world.setBlock(x, y, z, (Block)this, meta, 2); - } -} 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 index 9e680b877e..4282a9e13c 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java @@ -16,10 +16,11 @@ import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; @Deprecated public class Structure { - private Structure(){} + private Structure() { + } @SafeVarargs - public static IHatchAdder[] adders(IHatchAdder... iHatchAdder){ + public static IHatchAdder[] adders(IHatchAdder... iHatchAdder) { return iHatchAdder; } @@ -121,7 +122,7 @@ public class Structure { } } 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 (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())); @@ -155,10 +156,10 @@ public class Structure { 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(); + World world = tileEntity.getWorld(); + int baseX = tileEntity.getXCoord(); + int baseY = tileEntity.getYCoord(); + int baseZ = tileEntity.getZCoord(); if (world == null || (!world.isRemote && hintsOnly)) { return false; } @@ -214,7 +215,7 @@ public class Structure { 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]) { + 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) { @@ -237,10 +238,11 @@ public class Structure { break; default: //check for block if ((pointer = block - '0') >= 0) { - if (blockType[pointer] instanceof ICustomMetaBlock) - ((ICustomMetaBlock)blockType[pointer]).setBlock(world,xyz[0], xyz[1], xyz[2], blockMeta[pointer]); - else + 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); + } } } } 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 index 10779659dc..a9b88af2f3 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -167,7 +167,7 @@ public class StructureUtility { * @param * @return */ - public static IStructureElementNoPlacement ofHintDeferred(Supplier icons,short[] RGBa) { + public static IStructureElementNoPlacement ofHintDeferred(Supplier icons, short[] RGBa) { return new IStructureElementNoPlacement() { @Override public boolean check(T t, World world, int x, int y, int z) { @@ -176,7 +176,7 @@ public class StructureUtility { @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); + TecTech.proxy.hint_particle_tinted(world, x, y, z, icons.get(), RGBa); return false; } }; @@ -266,7 +266,7 @@ public class StructureUtility { @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)); + return iBlockAdder.apply(t, worldBlock, worldBlock.getDamageValue(world, x, y, z)); } @Override @@ -284,28 +284,47 @@ public class StructureUtility { if (blocsMap == null || blocsMap.isEmpty() || defaultBlock == null) { throw new IllegalArgumentException(); } - return new IStructureElement() { - @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, -1) == worldBlock.getDamageValue(world,x,y,z); - } + if(defaultBlock instanceof ICustomBlockSetting){ + return new IStructureElement() { + @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, -1) == worldBlock.getDamageValue(world, x, y, z); + } - @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - if (defaultBlock instanceof ICustomMetaBlock) - ((ICustomMetaBlock)defaultBlock).setBlock(world, x, y, z, defaultMeta); - else + @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() { + @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, -1) == 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; - } + 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; - } - }; + @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; + } + }; + } } /** @@ -320,56 +339,94 @@ public class StructureUtility { throw new IllegalArgumentException(); } } - return new IStructureElement() { - @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)); - } + if(defaultBlock instanceof ICustomBlockSetting){ + return new IStructureElement() { + @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) { - if (defaultBlock instanceof ICustomMetaBlock) - ((ICustomMetaBlock)defaultBlock).setBlock(world, x, y, z, defaultMeta); - else + @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() { + @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; - } + 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; - } - }; + @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 IStructureElement ofBlock(Block block, int meta, Block defaultBlock, int defaultMeta) { if (block == null || defaultBlock == null) { throw new IllegalArgumentException(); } - return new IStructureElement() { - @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); - } + if(block instanceof ICustomBlockSetting){ + return new IStructureElement() { + @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) { - if (defaultBlock instanceof ICustomMetaBlock) - ((ICustomMetaBlock)defaultBlock).setBlock(world, x, y, z, defaultMeta); - else + @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() { + @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; - } + 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; - } - }; + @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 IStructureElement ofBlock(Block block, int meta) { @@ -384,28 +441,47 @@ public class StructureUtility { if (iBlockAdder == null || defaultBlock == null) { throw new IllegalArgumentException(); } - return new IStructureElement() { - @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)); - } + if(defaultBlock instanceof ICustomBlockSetting){ + return new IStructureElement() { + @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) { - if (defaultBlock instanceof ICustomMetaBlock) - ((ICustomMetaBlock)defaultBlock).setBlock(world, x, y, z, defaultMeta); - else + @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() { + @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; - } + 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; - } - }; + @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 IStructureElement ofBlockAdder(IBlockAdder iBlockAdder, int dots) { @@ -462,31 +538,53 @@ public class StructureUtility { if (iHatchAdder == null || hintBlock == null) { throw new IllegalArgumentException(); } - return new IStructureElement() { - @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); - } + if(placeCasing instanceof ICustomBlockSetting){ + return new IStructureElement() { + @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 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) { - if (placeCasing instanceof ICustomMetaBlock) - ((ICustomMetaBlock)placeCasing).setBlock(world, x, y, z, placeCasingMeta); - else + @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() { + @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; - } - }; + return true; + } + }; + } } //endregion @@ -885,6 +983,7 @@ public class StructureUtility { /** * Used internally, to generate skips for structure definitions + * * @param a * @param b * @param c @@ -897,6 +996,7 @@ public class StructureUtility { /** * Used internally, to generate skips for structure definitions + * * @param step * @param * @return @@ -1119,7 +1219,7 @@ public class StructureUtility { 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))); + builder.append(map.get(block.getUnlocalizedName() + '\0' + block.getDamageValue(world, x, y, z))); } else { builder.append(' '); } @@ -1211,14 +1311,15 @@ public class StructureUtility { /** * 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]; + 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]; + shape[j][i] = structurePiece[i][j]; } } return shape; -- cgit From 7e55f6a68a7b7b307034c994f2fac95a83f3753b Mon Sep 17 00:00:00 2001 From: Tec Date: Tue, 23 Jun 2020 21:09:39 +0200 Subject: Fully mark old api for deprecation --- .../java/com/github/technus/tectech/mechanics/structure/Structure.java | 3 +++ 1 file changed, 3 insertions(+) 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 index 4282a9e13c..83951372a2 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/Structure.java @@ -19,6 +19,7 @@ public class Structure { private Structure() { } + @Deprecated @SafeVarargs public static IHatchAdder[] adders(IHatchAdder... iHatchAdder) { return iHatchAdder; @@ -26,6 +27,7 @@ public class Structure { //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller //This only checks for REGULAR BLOCKS! + @Deprecated public static 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 @@ -151,6 +153,7 @@ public class Structure { 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 -- cgit