From b82fb691d0ee54463a6a48bcd4c8bfb81eb0af8b Mon Sep 17 00:00:00 2001 From: Technus Date: Fri, 23 Feb 2018 17:56:16 +0100 Subject: Stuff and bugfixes. --- .../java/com/github/technus/tectech/TecTech.java | 13 +- src/main/java/com/github/technus/tectech/Util.java | 231 +++++++++++---------- .../GT_MetaTileEntity_EM_essentiaDequantizer.java | 4 +- .../GT_MetaTileEntity_EM_essentiaQuantizer.java | 4 +- .../technus/tectech/entity/fx/BlockHint.java | 5 + .../github/technus/tectech/proxy/ClientProxy.java | 25 +++ .../github/technus/tectech/proxy/CommonProxy.java | 5 + .../thing/item/ConstructableTriggerItem.java | 25 ++- .../multi/GT_MetaTileEntity_EM_annihilation.java | 4 +- .../multi/GT_MetaTileEntity_EM_bhg.java | 6 +- .../multi/GT_MetaTileEntity_EM_collider.java | 11 +- .../multi/GT_MetaTileEntity_EM_computer.java | 17 +- .../multi/GT_MetaTileEntity_EM_crafting.java | 4 +- .../multi/GT_MetaTileEntity_EM_decay.java | 13 +- .../multi/GT_MetaTileEntity_EM_dequantizer.java | 8 +- .../multi/GT_MetaTileEntity_EM_infuser.java | 9 +- .../multi/GT_MetaTileEntity_EM_junction.java | 4 +- .../multi/GT_MetaTileEntity_EM_quantizer.java | 2 +- .../multi/GT_MetaTileEntity_EM_scanner.java | 2 +- .../multi/GT_MetaTileEntity_EM_stabilizer.java | 4 +- .../multi/GT_MetaTileEntity_EM_switch.java | 4 +- .../multi/GT_MetaTileEntity_EM_transformer.java | 4 +- .../multi/GT_MetaTileEntity_EM_wormhole.java | 4 +- .../multi/GT_MetaTileEntity_TM_microwave.java | 86 ++------ .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 173 +++++++++++++++ .../em_machine/GT_MetaTileEntity_EM_machine.java | 4 +- .../gui/GT_GUIContainer_DebugStructureWriter.java | 2 +- 27 files changed, 421 insertions(+), 252 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index 4616bf8671..84f2ddf58b 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -184,12 +184,15 @@ public class TecTech { )); String modId; for(Block block : GameData.getBlockRegistry().typeSafeIterable()) { - modId = GameRegistry.findUniqueIdentifierFor(block).modId; - if (modIDs.contains(modId)) {//Full Whitelisted Mods - continue; - } else if ("OpenBlocks".equals(modId)) { - if ("grave".equals(GameRegistry.findUniqueIdentifierFor(block).name)) { + GameRegistry.UniqueIdentifier uniqueIdentifier=GameRegistry.findUniqueIdentifierFor(block); + if (uniqueIdentifier != null) { + modId = uniqueIdentifier.modId; + if (modIDs.contains(modId)) {//Full Whitelisted Mods continue; + } else if ("OpenBlocks".equals(modId)) { + if ("grave".equals(GameRegistry.findUniqueIdentifierFor(block).name)) { + continue; + } } } block.setResistance(6); diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index 87f3a2bebb..9d53689517 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -34,7 +34,8 @@ import static gregtech.api.enums.GT_Values.E; * Created by Tec on 21.03.2017. */ public final class Util { - private Util() {} + private Util() { + } public static String intBitsToString(int number) { StringBuilder result = new StringBuilder(16); @@ -375,15 +376,15 @@ public final class Util { return false; } //TE Rotation - int facingAndRotation = aBaseMetaTileEntity.getFrontFacing() + (frontRotation==null?0:(frontRotation.getFrontRotation()<<3)); + int facingAndRotation = aBaseMetaTileEntity.getFrontFacing() + (frontRotation == null ? 0 : (frontRotation.getFrontRotation() << 3)); IGregTechTileEntity igt; IMetaTileEntity imt = aBaseMetaTileEntity.getMetaTileEntity(); int x, y, z, a, b, c, pointer; - int baseX=aBaseMetaTileEntity.getXCoord(), - baseZ=aBaseMetaTileEntity.getZCoord(), - baseY=aBaseMetaTileEntity.getYCoord(); + 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 @@ -403,7 +404,7 @@ public final class Util { a += block - '@'; }//else if (block < '+')//used to mark THINGS // a++; - else if (block=='.') { + else if (block == '.') { a++; } else { //get x y z from rotation @@ -534,7 +535,7 @@ public final class Util { y = baseY + c; break; default: - if(DEBUG_MODE) { + if (DEBUG_MODE) { TecTech.Logger.info("facing = " + facingAndRotation); } return false; @@ -617,38 +618,38 @@ public final class Util { 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); + 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, IFrontRotation frontRotation, boolean hintsOnly) { + Block[] blockType,//use numbers 0-9 for casing types + byte[] blockMeta,//use numbers 0-9 for casing types + int horizontalOffset, int verticalOffset, int depthOffset, + IGregTechTileEntity aBaseMetaTileEntity, IFrontRotation frontRotation, boolean hintsOnly) { byte facing = aBaseMetaTileEntity.getFrontFacing(); - return StructureBuilderExtreme(structure,blockType,blockMeta, - horizontalOffset,verticalOffset,depthOffset, - aBaseMetaTileEntity.getWorld().getTileEntity(aBaseMetaTileEntity.getXCoord(),aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord()),frontRotation, - facing,hintsOnly); + return StructureBuilderExtreme(structure, blockType, blockMeta, + horizontalOffset, verticalOffset, depthOffset, + aBaseMetaTileEntity.getWorld().getTileEntity(aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()), frontRotation, + 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, IFrontRotation frontRotation, int facing, boolean hintsOnly) { - if(!tileEntity.hasWorldObj()) { + 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, IFrontRotation frontRotation, int facing, boolean hintsOnly) { + if (!tileEntity.hasWorldObj()) { return false; } World world = tileEntity.getWorldObj(); @@ -660,12 +661,12 @@ public final class Util { int x, y, z, a, b, c, pointer; int - baseX=tileEntity.xCoord, - baseZ=tileEntity.zCoord, - baseY=tileEntity.yCoord; + baseX = tileEntity.xCoord, + baseZ = tileEntity.zCoord, + baseY = tileEntity.yCoord; //a,b,c - relative to block face! //x,y,z - relative to block position on map! - if(frontRotation!=null) { + if (frontRotation != null) { facing += frontRotation.getFrontRotation() << 3; } @@ -679,12 +680,13 @@ public final class Util { if (block < ' ') {//Control chars allow skipping b -= block; break; - } if (block > '@')//characters allow to skip check a-1 skip, b-2 skips etc. + } + if (block > '@')//characters allow to skip check a-1 skip, b-2 skips etc. { a += block - '@'; }//else if (block < '+')//used to mark THINGS - // a++; - else if (block=='.')// this TE + // a++; + else if (block == '.')// this TE { a++; } else { @@ -816,7 +818,7 @@ public final class Util { y = baseY + c; break; default: - if(DEBUG_MODE) { + if (DEBUG_MODE) { TecTech.Logger.info("facing = " + facing); } return false; @@ -829,49 +831,49 @@ public final class Util { //Check block if (world.blockExists(x, y, z)) {//this actually checks if the chunk is loaded - if(hintsOnly){ + if (hintsOnly) { switch (block) { - case '-'://must be air - TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 13); - break; - case '+'://must not be air - TecTech.proxy.hint_particle(world,x, y, z, TT_Container_Casings.sHintCasingsTT, 14); - break; - default: //check for block - if ((pointer = block - '0') >= 0) { - if(world.getBlock(x,y,z)!=blockType[pointer] || world.getBlockMetadata(x,y,z)!=blockMeta[pointer]) { - TecTech.proxy.hint_particle(world, x, y, z, blockType[pointer], blockMeta[pointer]); - } - } else if ((pointer = block - ' ') >= 0) { - if(pointer>=0 && pointer<12) { - TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, pointer); + case '-'://must be air + TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, 13); + break; + case '+'://must not be air + TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, 14); + break; + default: //check for block + if ((pointer = block - '0') >= 0) { + if (world.getBlock(x, y, z) != blockType[pointer] || world.getBlockMetadata(x, y, z) != blockMeta[pointer]) { + TecTech.proxy.hint_particle(world, x, y, z, blockType[pointer], blockMeta[pointer]); + } + } else if ((pointer = block - ' ') >= 0) { + if (pointer >= 0 && pointer < 12) { + TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, pointer); + } else { + TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, 12); + } } else { - TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, 12); + TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, 15); } - } else { - TecTech.proxy.hint_particle(world, x, y, z, TT_Container_Casings.sHintCasingsTT, 15); - } } - }else{ + } else { switch (block) { - case '-'://must be air - world.setBlock(x, y, z, Blocks.air, 0, 2); - break; - case '+'://must not be air - world.setBlock(x, y, z, TT_Container_Casings.sBlockCasingsTT, 14, 2); - break; - default: //check for block - if ((pointer = block - '0') >= 0) { - world.setBlock(x, y, z, blockType[pointer], blockMeta[pointer], 2); - } else if (block - ' ' < 0) { - world.setBlock(x, y, z, TT_Container_Casings.sHintCasingsTT, 15, 2); - } //else { + case '-'://must be air + world.setBlock(x, y, z, Blocks.air, 0, 2); + break; + case '+'://must not be air + world.setBlock(x, y, z, TT_Container_Casings.sBlockCasingsTT, 14, 2); + break; + default: //check for block + if ((pointer = block - '0') >= 0) { + world.setBlock(x, y, z, blockType[pointer], blockMeta[pointer], 2); + } else if (block - ' ' < 0) { + world.setBlock(x, y, z, 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); //} - //} + //} } } } @@ -900,9 +902,9 @@ public final class Util { int x, y, z, a, b, c; int - baseX=aBaseMetaTileEntity.getXCoord(), - baseZ=aBaseMetaTileEntity.getZCoord(), - baseY=aBaseMetaTileEntity.getYCoord(); + 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 @@ -1081,7 +1083,7 @@ public final class Util { if (ignoreAir) { StringBuilder builder = new StringBuilder(); char temp = '@'; - for (char ch : line.toString().toCharArray()){ + for (char ch : line.toString().toCharArray()) { if (ch == '-') { temp += 1; if (temp == '~') { @@ -1096,21 +1098,21 @@ public final class Util { builder.append(ch); } } - while (builder.length()>0 && builder.charAt(builder.length() - 1) == '~') { + while (builder.length() > 0 && builder.charAt(builder.length() - 1) == '~') { builder.deleteCharAt(builder.length() - 1); } - if (builder.length()==0) { + if (builder.length() == 0) { builder.append("E,"); } else { - builder.insert(0,'"'); + builder.insert(0, '"'); builder.append('"').append(','); } addMe.append(builder); } else { - if (line.length()==0) { + if (line.length() == 0) { line.append("E,"); } else { - line.insert(0,'"'); + line.insert(0, '"'); line.append('"').append(','); } addMe.append(line); @@ -1119,11 +1121,11 @@ public final class Util { } //region less verbose addMe.append('}').append(','); - String builtStr=addMe.toString().replaceAll("(E,)+(?=})",E/*Remove Empty strings at end*/); + 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)+"\","); + 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 @@ -1250,7 +1252,7 @@ public final class Util { public static final String[] VN = new String[]{"ULV", "LV", "MV", "HV", "EV", "IV", "LuV", "ZPM", "UV", "UHV", "UEV", "UIV", "UMV", "UXV", "OpV", "MAX"}; - public static final long[] V = new long[]{8L, 32L, 128L, 512L, 2048L, 8192L, 32768L, 131072L, 524288L, 2097152L, 8388608L, 33554432L, 134217728L, 536870912L, 1073741824L, Integer.MAX_VALUE-7}; + public static final long[] V = new long[]{8L, 32L, 128L, 512L, 2048L, 8192L, 32768L, 131072L, 524288L, 2097152L, 8388608L, 33554432L, 134217728L, 536870912L, 1073741824L, Integer.MAX_VALUE - 7}; public static byte getTier(long l) { byte b = -1; @@ -1260,20 +1262,20 @@ public final class Util { if (b >= V.length) { return b; } - } while(l > V[b]); + } while (l > V[b]); return b; } - public static String[] splitButDifferent(String string,String delimiter){ - String[] strings= new String[StringUtils.countMatches(string,delimiter)+1]; - int lastEnd=0; - for(int i=0;i{ + public static class TT_ItemStack implements Comparable { public final Item mItem; public final int mStackSize; public final int mMetaData; public TT_ItemStack(Item aItem, long aStackSize, long aMetaData) { this.mItem = aItem; - this.mStackSize = (byte)((int)aStackSize); - this.mMetaData = (short)((int)aMetaData); + this.mStackSize = (byte) ((int) aStackSize); + this.mMetaData = (short) ((int) aMetaData); } public TT_ItemStack(ItemStack aStack) { - if(aStack==null){ - mItem=null; - mStackSize=mMetaData=0; - }else{ - mItem=aStack.getItem(); - mStackSize=aStack.stackSize; - mMetaData=Items.feather.getDamage(aStack); + if (aStack == null) { + mItem = null; + mStackSize = mMetaData = 0; + } else { + mItem = aStack.getItem(); + mStackSize = aStack.stackSize; + mMetaData = Items.feather.getDamage(aStack); } } @Override public int compareTo(TT_ItemStack o) { - if(mMetaData>o.mMetaData) return 1; - if(mMetaDatao.mStackSize) return 1; - if(mStackSize o.mMetaData) return 1; + if (mMetaData < o.mMetaData) return -1; + if (mStackSize > o.mStackSize) return 1; + if (mStackSize < o.mStackSize) return -1; + if (mItem != null && o.mItem != null) + return mItem.getUnlocalizedName().compareTo(o.mItem.getUnlocalizedName()); + if (mItem == null && o.mItem == null) return 0; + if (mItem != null) return 1; return -1; } @@ -1327,19 +1330,19 @@ public final class Util { public boolean equals(Object aStack) { return aStack == this || (aStack instanceof TT_ItemStack && - ((mItem==((TT_ItemStack) aStack).mItem) || ((TT_ItemStack) aStack).mItem.getUnlocalizedName().equals(this.mItem.getUnlocalizedName())) && + ((mItem == ((TT_ItemStack) aStack).mItem) || ((TT_ItemStack) aStack).mItem.getUnlocalizedName().equals(this.mItem.getUnlocalizedName())) && ((TT_ItemStack) aStack).mStackSize == this.mStackSize && ((TT_ItemStack) aStack).mMetaData == this.mMetaData); } @Override public int hashCode() { - return (mItem!=null?mItem.getUnlocalizedName().hashCode():0) ^ (mMetaData << 16) ^ (mStackSize<<24); + return (mItem != null ? mItem.getUnlocalizedName().hashCode() : 0) ^ (mMetaData << 16) ^ (mStackSize << 24); } @Override public String toString() { - return Integer.toString(hashCode())+' '+(mItem==null?"null":mItem.getUnlocalizedName())+' '+mMetaData+' '+mStackSize; + return Integer.toString(hashCode()) + ' ' + (mItem == null ? "null" : mItem.getUnlocalizedName()) + ' ' + mMetaData + ' ' + mStackSize; } } } 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 9c0008ab07..db20de53c5 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 @@ -22,7 +22,7 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.Util.V; import static com.github.technus.tectech.compatibility.thaumcraft.EssentiaCompat.essentiaContainerCompat; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; @@ -99,7 +99,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); } } - StructureBuilder(shape, blockType, blockMeta,1, 1, 0, iGregTechTileEntity,hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,1, 1, 0, iGregTechTileEntity,this,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 085884b80a..8c5387160d 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 @@ -22,7 +22,7 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.Util.V; import static com.github.technus.tectech.compatibility.thaumcraft.EssentiaCompat.essentiaContainerCompat; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; @@ -99,7 +99,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); } } - StructureBuilder(shape, blockType, blockMeta,1, 1, 0, iGregTechTileEntity,hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,1, 1, 0, iGregTechTileEntity,this,hintsOnly); } @Override 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 29533c5a0a..6fa5b552e5 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 @@ -6,6 +6,7 @@ import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.init.Blocks; import net.minecraft.util.IIcon; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; @@ -14,6 +15,10 @@ import org.lwjgl.opengl.GL11; public class BlockHint extends EntityFX { private IIcon[] icons = new IIcon[6]; + public BlockHint(World world){ + this(world,0,0,0, Blocks.stone,0); + } + 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/proxy/ClientProxy.java b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java index 92e0fa6822..8ed457ca79 100644 --- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java @@ -18,6 +18,7 @@ import net.minecraft.client.gui.GuiNewChat; import net.minecraft.client.particle.EntityExplodeFX; 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.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -63,6 +64,13 @@ public class ClientProxy extends CommonProxy { Minecraft.getMinecraft().effectRenderer.addEffect(particle); } + @Override + public void em_particle(World w,double x,double y,double z) {//CUTE! + EntityFX particle = new EntityExplodeFX(w, x + TecTech.Rnd.nextFloat() * 0.5F, y + TecTech.Rnd.nextFloat() * 0.5F, z + TecTech.Rnd.nextFloat() * 0.5F, 0, 0, 0); + particle.setRBGColorF(0, 0.6F * TecTech.Rnd.nextFloat(), 0.8f); + Minecraft.getMinecraft().effectRenderer.addEffect(particle); + } + @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { return null; @@ -113,4 +121,21 @@ public class ClientProxy extends CommonProxy { public void playSound(IGregTechTileEntity base,String name) { base.getWorld().playSoundEffect(base.getXCoord(),base.getYCoord(),base.getZCoord(), Reference.MODID+':'+name, 1, 1); } + + @Override + public void renderAABB(World w,AxisAlignedBB box) { + em_particle(w,box.minX,box.minY,box.minZ); + em_particle(w,box.minX,box.minY,box.maxZ); + em_particle(w,box.minX,box.maxY,box.maxZ); + em_particle(w,box.minX,box.maxY,box.minZ); + em_particle(w,box.maxX,box.maxY,box.minZ); + em_particle(w,box.maxX,box.maxY,box.maxZ); + em_particle(w,box.maxX,box.minY,box.maxZ); + em_particle(w,box.maxX,box.minY,box.minZ); + } + + @Override + public void renderAABB(AxisAlignedBB box) { + renderAABB(Minecraft.getMinecraft().theWorld,box); + } } 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 271887d579..7ccbe7472f 100644 --- a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java @@ -5,6 +5,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; @@ -13,6 +14,7 @@ public class CommonProxy implements IGuiHandler { public void hint_particle(World world, int x, int y, int z, Block block, int meta){} public void em_particle(IGregTechTileEntity aMuffler, byte facing) {}//CUTE! + public void em_particle(World w,double x,double y,double z){} @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { @@ -42,4 +44,7 @@ public class CommonProxy implements IGuiHandler { public void printInchat(String... strings){} public void playSound(IGregTechTileEntity base,String name){} + + public void renderAABB(AxisAlignedBB box){} + public void renderAABB(World w,AxisAlignedBB box){} } 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 ab83518607..8e42e9a371 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 @@ -25,7 +25,6 @@ import java.util.List; import static com.github.technus.tectech.Util.StructureBuilder; import static com.github.technus.tectech.auxiliary.Reference.MODID; -import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sHintCasingsTT; import static gregtech.api.GregTech_API.sBlockCasings1; /** @@ -34,7 +33,7 @@ import static gregtech.api.GregTech_API.sBlockCasings1; public final class ConstructableTriggerItem extends Item { public static ConstructableTriggerItem INSTANCE; - public static HashMap multiblockMap= new HashMap<>(); + private static HashMap multiblockMap= new HashMap<>(); private ConstructableTriggerItem() { setUnlocalizedName("em.debugBuilder"); @@ -122,20 +121,20 @@ public final class ConstructableTriggerItem extends Item { INSTANCE = new ConstructableTriggerItem(); GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName()); - multiblockMap.put(GT_MetaTileEntity_ElectricBlastFurnace.class.getCanonicalName(), new MultiblockInfoContainer() { + registerMetaClass(GT_MetaTileEntity_ElectricBlastFurnace.class, new MultiblockInfoContainer() { //region Structure private final String[][] shape = new String[][]{ - {"000","111","111"," . ",}, - {"0!0","1A1","1A1"," ",}, - {"000","111","111"," ",}, + {"000","\"\"\"","\"\"\""," . ",}, + {"0!0","\"A\"","\"A\""," ",}, + {"000","\"\"\"","\"\"\""," ",}, }; - private final Block[] blockType = new Block[]{sBlockCasings1, sHintCasingsTT}; - private final byte[] blockMeta = new byte[]{11, 12}; + 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", - "General - Coil blocks" + "3 - Coil blocks" }; //endregion @@ -156,4 +155,12 @@ public final class ConstructableTriggerItem extends Item { @SideOnly(Side.CLIENT) String[] getDescription(int stackSize); } + + public static void registerTileClass(Class clazz,MultiblockInfoContainer info){ + multiblockMap.put(clazz.getCanonicalName(),info); + } + + public static void registerMetaClass(Class clazz,MultiblockInfoContainer 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 4e7cb3e8b6..be9ff21e58 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 @@ -16,7 +16,7 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.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; @@ -91,7 +91,7 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta, 5, 5, 0,getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta, 5, 5, 0,getBaseMetaTileEntity(),this,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 1f72f00c20..15e9628b7a 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 @@ -16,7 +16,7 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.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; @@ -154,9 +154,9 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E @Override public void construct(int stackSize, boolean hintsOnly) { if((stackSize &1)==1) { - StructureBuilder(shape, blockType, blockMeta, 16, 16, 0, getBaseMetaTileEntity(), hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta, 16, 16, 0, getBaseMetaTileEntity(),this, hintsOnly); } else { - StructureBuilder(shape2, blockType2, blockMeta2, 16, 16, 0, getBaseMetaTileEntity(), hintsOnly); + StructureBuilderExtreme(shape2, blockType2, blockMeta2, 16, 16, 0, getBaseMetaTileEntity(),this, 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 c48cd143b2..fe3aba323d 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 @@ -21,7 +21,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.ForgeDirection; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.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; @@ -112,11 +112,6 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4]}; } - @Override - public boolean isFacingValid_EM(byte aFacing) { - return aFacing >= 2; - } - @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); @@ -183,9 +178,9 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } } if ((stackSize & 1) == 1) { - StructureBuilder(shape, blockType, blockMeta1, 11, 1, 18, iGregTechTileEntity, hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta1, 11, 1, 18, iGregTechTileEntity,this, hintsOnly); } else { - StructureBuilder(shape, blockType, blockMeta2, 11, 1, 18, iGregTechTileEntity, hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta2, 11, 1, 18, iGregTechTileEntity,this, 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 9ccdda3ca2..4ab25671b7 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 @@ -28,7 +28,7 @@ import net.minecraft.util.ResourceLocation; import java.util.ArrayList; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.Util.V; import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; @@ -320,16 +320,16 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB @Override public void construct(int stackSize, boolean hintsOnly) { IGregTechTileEntity igt=getBaseMetaTileEntity(); - StructureBuilder(front, blockType, blockMeta, 1, 2, 0, igt,hintsOnly); - StructureBuilder(cap, blockType, blockMeta, 1, 2, -1, igt,hintsOnly); + StructureBuilderExtreme(front, blockType, blockMeta, 1, 2, 0, igt,this,hintsOnly); + StructureBuilderExtreme(cap, blockType, blockMeta, 1, 2, -1, igt,this,hintsOnly); byte offset=-2; for (int rackSlices = stackSize >12?12: stackSize; rackSlices>0 ; rackSlices--) { - StructureBuilder(slice, blockType, blockMeta, 1, 2, offset--, igt,hintsOnly); + StructureBuilderExtreme(slice, blockType, blockMeta, 1, 2, offset--, igt,this,hintsOnly); } - StructureBuilder(cap, blockType, blockMeta, 1, 2, offset--, igt,hintsOnly); - StructureBuilder(terminator, blockType, blockMeta, 1, 2, offset,igt,hintsOnly); + StructureBuilderExtreme(cap, blockType, blockMeta, 1, 2, offset--, igt,this,hintsOnly); + StructureBuilderExtreme(terminator, blockType, blockMeta, 1, 2, offset,igt,this,hintsOnly); } @Override @@ -353,11 +353,6 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB }; } - @Override - public boolean isFacingValid_EM(byte aFacing) { - return aFacing >= 2; - } - //NEW METHOD public final boolean addRackToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { 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 e3e3ee4d71..c48f1fdbfe 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 @@ -16,7 +16,7 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.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; @@ -92,7 +92,7 @@ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockB @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),this,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 780a2d30bd..e0f309d941 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 @@ -21,7 +21,7 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.Util.VN; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; @@ -96,7 +96,7 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),this,hintsOnly); } @Override @@ -124,17 +124,22 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase }else if(eSafeVoid){ contents.clear(); }else if(contents.hasStacks()){ - startRecipe(null); + return startRecipe(null); } return false; } + @Override + protected void afterRecipeCheckFailed() { + super.afterRecipeCheckFailed(); + } + private boolean startRecipe(cElementalInstanceStack input) { if(input!=null) { contents.putUnify(input); } - mMaxProgresstime = 20;//(int)m3; + mMaxProgresstime = 20; mEfficiencyIncrease = 10000; float mass=contents.getMass(); 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 26793ba894..cf36547524 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 @@ -2,10 +2,10 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; -import com.github.technus.tectech.elementalMatter.core.transformations.iExchangeInfo; -import com.github.technus.tectech.elementalMatter.core.stacks.iHasElementalDefinition; import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; +import com.github.technus.tectech.elementalMatter.core.stacks.iHasElementalDefinition; import com.github.technus.tectech.elementalMatter.core.transformations.aOredictDequantizationInfo; +import com.github.technus.tectech.elementalMatter.core.transformations.iExchangeInfo; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; @@ -23,7 +23,7 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.ArrayList; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.Util.V; import static com.github.technus.tectech.elementalMatter.core.templates.iElementalDefinition.STABLE_RAW_LIFE_TIME; import static com.github.technus.tectech.elementalMatter.definitions.complex.atom.dAtomDefinition.refMass; @@ -84,7 +84,7 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(),this, 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 3a7b64de0b..693ea770e4 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 @@ -21,7 +21,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.auxiliary.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; @@ -70,11 +70,6 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa return activitySound; } - @Override - public boolean isFacingValid_EM(byte aFacing) { - return aFacing >= 2; - } - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_EM_infuser(mName); @@ -97,7 +92,7 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,1, 2, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,1, 2, 0, getBaseMetaTileEntity(),this,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 c50caf132f..03649f190e 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 @@ -11,7 +11,7 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.Util.V; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -61,7 +61,7 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),this,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 7b90703749..7f1c553840 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 @@ -89,7 +89,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(),this,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 b04a2d0cbd..1cf36476b3 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 @@ -109,7 +109,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),this,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 c259a8b7fa..ce16d939cd 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 @@ -10,7 +10,7 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.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; @@ -59,7 +59,7 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),this,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 bdc611434f..bc0f975b8f 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 @@ -20,7 +20,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.Util.V; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; @@ -84,7 +84,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),this,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 b17d692068..50b19a2d68 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 @@ -19,7 +19,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.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; @@ -89,7 +89,7 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),this,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 555e3fecc3..5e60f59807 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 @@ -16,7 +16,7 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.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; @@ -92,7 +92,7 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shape, blockType, blockMeta,4, 4, 0, getBaseMetaTileEntity(),hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta,4, 4, 0, getBaseMetaTileEntity(),this,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 a53c7f5469..68e6e53afc 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 @@ -22,12 +22,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; import java.util.HashSet; -import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.loader.MainLoader.microwaving; import static gregtech.api.GregTech_API.sBlockCasings4; @@ -38,7 +37,6 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock public static final int POWER_SETTING_DEFAULT=1000, TIMER_SETTING_DEFAULT=360; private int powerSetting,timerSetting,timerValue; private boolean hasBeenPausedThisCycle=false; - private boolean flipped=