From 7d335300ea21e7e80bdae2a86ad0118066f55d71 Mon Sep 17 00:00:00 2001 From: Technus Date: Sat, 10 Feb 2018 18:00:44 +0100 Subject: JUMBO COMMIT frontal rotation api Changes to decay gen and EM def/instance some bugfixes??? --- .../java/com/github/technus/tectech/TecTech.java | 4 +- src/main/java/com/github/technus/tectech/Util.java | 393 ++++++++++- .../definitions/dComplexAspectDefinition.java | 10 + .../core/stacks/cElementalInstanceStack.java | 124 +++- .../core/templates/cElementalPrimitive.java | 10 + .../core/templates/iElementalDefinition.java | 4 + .../definitions/complex/atom/dAtomDefinition.java | 22 + .../complex/hadron/dHadronDefinition.java | 10 + .../definitions/primitive/eBosonDefinition.java | 2 +- .../technus/tectech/loader/ThingsLoader.java | 1 + .../github/technus/tectech/network/Dispatcher.java | 18 - .../thing/item/FrontRotationTriggerItem.java | 66 ++ .../thing/metaTileEntity/IFrontRotation.java | 11 + .../multi/GT_MetaTileEntity_EM_annihilation.java | 4 +- .../multi/GT_MetaTileEntity_EM_bhg.java | 4 +- .../multi/GT_MetaTileEntity_EM_collider.java | 6 +- .../multi/GT_MetaTileEntity_EM_computer.java | 6 +- .../multi/GT_MetaTileEntity_EM_crafting.java | 4 +- .../multi/GT_MetaTileEntity_EM_decay.java | 52 +- .../multi/GT_MetaTileEntity_EM_infuser.java | 2 +- .../multi/GT_MetaTileEntity_EM_research.java | 16 +- .../multi/GT_MetaTileEntity_EM_scanner.java | 2 +- .../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 | 6 +- .../multi/base/GT_GUIContainer_MultiMachineEM.java | 3 +- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 111 ++- .../multi/base/network/RotationMessage.java | 140 ++++ .../base/network/RotationPacketDispatcher.java | 21 + .../multi/base/render/TT_RenderedTexture.java | 768 +++++++++++++++++++++ .../em_machine/GT_MetaTileEntity_EM_machine.java | 2 +- 32 files changed, 1705 insertions(+), 129 deletions(-) delete mode 100644 src/main/java/com/github/technus/tectech/network/Dispatcher.java create mode 100644 src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/IFrontRotation.java create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/RotationMessage.java create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/RotationPacketDispatcher.java create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedTexture.java (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 9a4e803f67..4616bf8671 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -2,11 +2,12 @@ package com.github.technus.tectech; import com.github.technus.tectech.auxiliary.Reference; import com.github.technus.tectech.auxiliary.TecTechConfig; -import com.github.technus.tectech.elementalMatter.core.commands.ListEM; import com.github.technus.tectech.elementalMatter.core.commands.GiveEM; +import com.github.technus.tectech.elementalMatter.core.commands.ListEM; import com.github.technus.tectech.loader.MainLoader; import com.github.technus.tectech.loader.ModGuiHandler; import com.github.technus.tectech.proxy.CommonProxy; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.RotationPacketDispatcher; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.SidedProxy; @@ -83,6 +84,7 @@ public class TecTech { GTCustomLoader.load(); + new RotationPacketDispatcher(); NetworkRegistry.INSTANCE.registerGuiHandler(instance, new ModGuiHandler()); proxy.registerRenderInfo(); diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index 25327e1369..87f3a2bebb 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -1,6 +1,7 @@ package com.github.technus.tectech; import com.github.technus.tectech.thing.casing.TT_Container_Casings; +import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -67,6 +68,7 @@ public final class Util { return result.toString(); } + /* //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller //This only checks for REGULAR BLOCKS! public static boolean StructureChecker(String[][] structure,//0-9 casing, +- air no air, A... ignore 'A'-CHAR-1 blocks @@ -219,8 +221,7 @@ public final class Util { IMetaTileEntity imt = aBaseMetaTileEntity.getMetaTileEntity(); int x, y, z, a, b, c, pointer; - int - baseX=aBaseMetaTileEntity.getXCoord(), + int baseX=aBaseMetaTileEntity.getXCoord(), baseZ=aBaseMetaTileEntity.getZCoord(), baseY=aBaseMetaTileEntity.getYCoord(); //a,b,c - relative to block face! @@ -321,7 +322,264 @@ public final class Util { if (igt == null || !(boolean) adder.invoke(imt, addingMethods[pointer], igt, casingTextures[pointer])) { if (world.getBlock(x, y, z) != blockTypeFallback[pointer]) { if (DEBUG_MODE) { - TecTech.Logger.info("Fallback-struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + blockTypeFallback[pointer].getUnlocalizedName()); + TecTech.Logger.info("Fallback-struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName())); + } + return false; + } + if (world.getBlockMetadata(x, y, z) != blockMetaFallback[pointer]) { + if (DEBUG_MODE) { + TecTech.Logger.info("Fallback-Struct-meta-id-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlockMetadata(x, y, z) + ' ' + blockMetaFallback[pointer]); + } + return false; + } + } + } catch (InvocationTargetException | IllegalAccessException e) { + if (DEBUG_MODE) { + e.printStackTrace(); + } + return false; + } + } + } + } else if (forceCheck) { + return false; + } + a++;//block in horizontal layer + } + } + b--;//horizontal layer + } + c++;//depth + } + return true; + } + */ + + //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 + Method adder, + String[] addingMethods, + short[] casingTextures, + Block[] blockTypeFallback,//use numbers 0-9 for casing types + byte[] blockMetaFallback,//use numbers 0-9 for casing types + int horizontalOffset, int verticalOffset, int depthOffset, + IGregTechTileEntity aBaseMetaTileEntity, + IFrontRotation frontRotation, + boolean forceCheck) { + World world = aBaseMetaTileEntity.getWorld(); + if (world.isRemote) { + return false; + } + //TE Rotation + 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(); + //a,b,c - relative to block face! + //x,y,z - relative to block position on map! + //yPos - absolute height of checked block + + //perform your duties + c = -depthOffset; + for (String[] _structure : structure) {//front to back + b = verticalOffset; + for (String __structure : _structure) {//top to bottom + a = -horizontalOffset; + for (char block : __structure.toCharArray()) {//left to right + if (block < ' ') {//Control chars allow skipping + b -= block; + break; + } else if (block > '@') //characters allow to skip check A-1 skip, B-2 skips etc. + { + a += block - '@'; + }//else if (block < '+')//used to mark THINGS + // a++; + else if (block=='.') { + a++; + } else { + //get x y z from rotation + switch (facingAndRotation) {//translation + case 4: + x = baseX + c; + z = baseZ + a; + y = baseY + b; + break; + case 12: + x = baseX + c; + y = baseY - a; + z = baseZ + b; + break; + case 20: + x = baseX + c; + z = baseZ - a; + y = baseY - b; + break; + case 28: + x = baseX + c; + y = baseY + a; + z = baseZ - b; + break; + + case 3: + x = baseX + a; + z = baseZ - c; + y = baseY + b; + break; + case 11: + y = baseY - a; + z = baseZ - c; + x = baseX + b; + break; + case 19: + x = baseX - a; + z = baseZ - c; + y = baseY - b; + break; + case 27: + y = baseY + a; + z = baseZ - c; + x = baseX - b; + break; + + case 5: + x = baseX - c; + z = baseZ - a; + y = baseY + b; + break; + case 13: + x = baseX - c; + y = baseY - a; + z = baseZ - b; + break; + case 21: + x = baseX - c; + z = baseZ + a; + y = baseY - b; + break; + case 29: + x = baseX - c; + y = baseY + a; + z = baseZ + b; + break; + + case 2: + x = baseX - a; + z = baseZ + c; + y = baseY + b; + break; + case 10: + y = baseY - a; + z = baseZ + c; + x = baseX - b; + break; + case 18: + x = baseX + a; + z = baseZ + c; + y = baseY - b; + break; + case 26: + y = baseY + a; + z = baseZ + c; + x = baseX + b; + break; + //Things get odd if the block faces up or down... + case 1: + x = baseX + a; + z = baseZ - b; + y = baseY - c; + break;//similar to 3 + case 9: + z = baseZ + a; + x = baseX + b; + y = baseY - c; + break;//similar to 3 + case 17: + x = baseX - a; + z = baseZ + b; + y = baseY - c; + break;//similar to 3 + case 25: + z = baseZ - a; + x = baseX - b; + y = baseY - c; + break;//similar to 3 + + case 0: + x = baseX - a; + z = baseZ - b; + y = baseY + c; + break;//similar to 2 + case 8: + z = baseZ + a; + x = baseX - b; + y = baseY + c; + break; + case 16: + x = baseX + a; + z = baseZ + b; + y = baseY + c; + break; + case 24: + z = baseZ - a; + x = baseX + b; + y = baseY + c; + break; + default: + if(DEBUG_MODE) { + TecTech.Logger.info("facing = " + facingAndRotation); + } + return false; + } + + //that must be here since in some cases other axis (b,c) controls y + if (y < 0 || y >= 256) { + return false; + } + + //Check block + if (world.blockExists(x, y, z)) {//this actually checks if the chunk is loaded at this pos + switch (block) { + case '-'://must be air + if (world.getBlock(x, y, z).getMaterial() != Material.air) { + return false; + } + break; + case '+'://must not be air + if (world.getBlock(x, y, z).getMaterial() == Material.air) { + return false; + } + break; + default://check for block (countable) + if ((pointer = block - '0') >= 0) { + //countable air -> net.minecraft.block.BlockAir + if (world.getBlock(x, y, z) != blockType[pointer]) { + if (DEBUG_MODE) { + TecTech.Logger.info("Struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + blockType[pointer].getUnlocalizedName()); + } + return false; + } + if (world.getBlockMetadata(x, y, z) != blockMeta[pointer]) { + if (DEBUG_MODE) { + TecTech.Logger.info("Struct-meta-id-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlockMetadata(x, y, z) + ' ' + blockMeta[pointer]); + } + return false; + } + } else if ((pointer = block - ' ') >= 0) { + igt = aBaseMetaTileEntity.getIGregTechTileEntity(x, y, z); + try { + if (igt == null || !(boolean) adder.invoke(imt, addingMethods[pointer], igt, casingTextures[pointer])) { + if (world.getBlock(x, y, z) != blockTypeFallback[pointer]) { + if (DEBUG_MODE) { + TecTech.Logger.info("Fallback-struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName())); } return false; } @@ -359,17 +617,37 @@ public final class Util { int horizontalOffset, int verticalOffset, int depthOffset, IGregTechTileEntity aBaseMetaTileEntity, boolean hintsOnly) { byte facing = aBaseMetaTileEntity.getFrontFacing(); - return StructureBuilder(structure,blockType,blockMeta, + return StructureBuilderExtreme(structure,blockType,blockMeta, horizontalOffset,verticalOffset,depthOffset, - aBaseMetaTileEntity.getWorld().getTileEntity(aBaseMetaTileEntity.getXCoord(),aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord()), + 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) { + byte facing = aBaseMetaTileEntity.getFrontFacing(); + 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, int facing, boolean hintsOnly) { + TileEntity tileEntity, IFrontRotation frontRotation, int facing, boolean hintsOnly) { if(!tileEntity.hasWorldObj()) { return false; } @@ -387,6 +665,9 @@ public final class Util { baseY=tileEntity.yCoord; //a,b,c - relative to block face! //x,y,z - relative to block position on map! + if(frontRotation!=null) { + facing += frontRotation.getFrontRotation() << 3; + } //perform your duties c = -depthOffset; @@ -408,39 +689,136 @@ public final class Util { a++; } else { //get x y z from rotation - switch (facing) {//translation + switch (facing) { case 4: x = baseX + c; z = baseZ + a; y = baseY + b; break; + case 12: + x = baseX + c; + y = baseY - a; + z = baseZ + b; + break; + case 20: + x = baseX + c; + z = baseZ - a; + y = baseY - b; + break; + case 28: + x = baseX + c; + y = baseY + a; + z = baseZ - b; + break; + case 3: x = baseX + a; z = baseZ - c; y = baseY + b; break; + case 11: + y = baseY - a; + z = baseZ - c; + x = baseX + b; + break; + case 19: + x = baseX - a; + z = baseZ - c; + y = baseY - b; + break; + case 27: + y = baseY + a; + z = baseZ - c; + x = baseX - b; + break; + case 5: x = baseX - c; z = baseZ - a; y = baseY + b; break; + case 13: + x = baseX - c; + y = baseY - a; + z = baseZ - b; + break; + case 21: + x = baseX - c; + z = baseZ + a; + y = baseY - b; + break; + case 29: + x = baseX - c; + y = baseY + a; + z = baseZ + b; + break; + case 2: x = baseX - a; z = baseZ + c; y = baseY + b; break; + case 10: + y = baseY - a; + z = baseZ + c; + x = baseX - b; + break; + case 18: + x = baseX + a; + z = baseZ + c; + y = baseY - b; + break; + case 26: + y = baseY + a; + z = baseZ + c; + x = baseX + b; + break; //Things get odd if the block faces up or down... case 1: x = baseX + a; + z = baseZ - b; + y = baseY - c; + break;//similar to 3 + case 9: + z = baseZ + a; + x = baseX + b; + y = baseY - c; + break;//similar to 3 + case 17: + x = baseX - a; z = baseZ + b; y = baseY - c; break;//similar to 3 + case 25: + z = baseZ - a; + x = baseX - b; + y = baseY - c; + break;//similar to 3 + case 0: x = baseX - a; z = baseZ - b; y = baseY + c; break;//similar to 2 + case 8: + z = baseZ + a; + x = baseX - b; + y = baseY + c; + break; + case 16: + x = baseX + a; + z = baseZ + b; + y = baseY + c; + break; + case 24: + z = baseZ - a; + x = baseX + b; + y = baseY + c; + break; default: + if(DEBUG_MODE) { + TecTech.Logger.info("facing = " + facing); + } return false; } @@ -507,6 +885,7 @@ public final class Util { return true; } + public static String[] StructureWriter(IGregTechTileEntity aBaseMetaTileEntity, int horizontalOffset, int verticalOffset, int depthOffset, int horizontalSize, int verticalSize, int depthSize, boolean ignoreAir) { diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java index 3d29927a6c..6e57ffd788 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java @@ -181,6 +181,16 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme return false; } + @Override + public boolean usesMultipleDecayCalls(long energyLevel) { + return false; + } + + @Override + public boolean decayMakesEnergy(long energyLevel) { + return false; + } + @Override public cElementalDecay[] getNaturalDecayInstant() { return noDecay; diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalInstanceStack.java b/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalInstanceStack.java index 4193153d57..de677f7197 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalInstanceStack.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalInstanceStack.java @@ -12,12 +12,15 @@ import net.minecraft.nbt.NBTTagCompound; import java.util.ArrayList; import static com.github.technus.tectech.elementalMatter.definitions.primitive.cPrimitiveDefinition.null__; +import static com.github.technus.tectech.elementalMatter.definitions.primitive.eBosonDefinition.deadEnd; import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_scanner.*; /** * Created by danie_000 on 22.10.2016. */ public final class cElementalInstanceStack implements iHasElementalDefinition { + public static int MIN_MULTIPLE_DECAY_CALLS=4,MAX_MULTIPLE_DECAY_CALLS=16,DECAY_CALL_PER=144; + public final iElementalDefinition definition; //energy - if positive then particle should try to decay private long energy; @@ -92,7 +95,7 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { public void setEnergy(long newEnergyLevel){ energy=newEnergyLevel; - setLifeTimeMultipleOfBaseValue(getLifeTimeMult()); + setLifeTimeMultiplier(getLifeTimeMultiplier()); } @Deprecated //can be done from definition @@ -136,10 +139,10 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { return lifeTime; } - public float setLifeTimeMultipleOfBaseValue(float mult) { + public float setLifeTimeMultiplier(float mult) { if(mult<=0) //since infinity*0=nan { - throw new IllegalArgumentException("mult must be >0"); + throw new IllegalArgumentException("multiplier must be >0"); } lifeTimeMult = mult; if (definition.getRawTimeSpan(energy) <= 0) { @@ -149,7 +152,7 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { return lifeTime; } - public float getLifeTimeMult() { + public float getLifeTimeMultiplier() { return lifeTimeMult; } @@ -162,24 +165,45 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { } public cElementalInstanceStackMap decay(float lifeTimeMult, long apparentAge, long postEnergize) { - long newEnergyLevel=postEnergize+ energy; - if(newEnergyLevel>0) { + long newEnergyLevel = postEnergize + energy; + if (newEnergyLevel > 0) { newEnergyLevel -= 1; - } else if(newEnergyLevel<0) { + } else if (newEnergyLevel < 0) { newEnergyLevel += 1; } + if(definition.usesMultipleDecayCalls(energy)){ + long amountTemp=amount; + long decayCnt=Math.min(Math.max(amount/DECAY_CALL_PER,MIN_MULTIPLE_DECAY_CALLS),MAX_MULTIPLE_DECAY_CALLS); + long amountPer=amount/decayCnt; + amount-=amountPer*(--decayCnt); + cElementalInstanceStackMap output=decayMechanics(lifeTimeMult,apparentAge,newEnergyLevel); + if(output==null)return null; + if(amountPer>0){ + amount=amountPer; + for(int i=0;i 0 && !definition.usesSpecialEnergeticDecayHandling()) { - setLifeTimeMultipleOfBaseValue(getLifeTimeMult()); + setLifeTimeMultiplier(getLifeTimeMultiplier()); return decayCompute(definition.getEnergyInducedDecay(energy), lifeTimeMult, -1, newEnergyLevel); - }else if (definition.getRawTimeSpan(energy) < 0) { + } else if (definition.getRawTimeSpan(energy) < 0) { return null;//return null, decay cannot be achieved - } else if(definition.isTimeSpanHalfLife()){ - return exponentialDecayCompute(energy>0?definition.getEnergyInducedDecay(energy):definition.getDecayArray(), lifeTimeMult, -1, newEnergyLevel); - } else{ + } else if (definition.isTimeSpanHalfLife()) { + return exponentialDecayCompute(energy > 0 ? definition.getEnergyInducedDecay(energy) : definition.getDecayArray(), lifeTimeMult, -1, newEnergyLevel); + } else { if (1F > lifeTime) { - return decayCompute(energy>0?definition.getEnergyInducedDecay(energy):definition.getNaturalDecayInstant(), lifeTimeMult, 0, newEnergyLevel); + return decayCompute(energy > 0 ? definition.getEnergyInducedDecay(energy) : definition.getNaturalDecayInstant(), lifeTimeMult, 0, newEnergyLevel); } else if ((float) apparentAge > lifeTime) { - return decayCompute(energy>0?definition.getEnergyInducedDecay(energy):definition.getDecayArray(), lifeTimeMult, 0, newEnergyLevel); + return decayCompute(energy > 0 ? definition.getEnergyInducedDecay(energy) : definition.getDecayArray(), lifeTimeMult, 0, newEnergyLevel); } } return null;//return null since decay cannot be achieved @@ -190,6 +214,16 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { double decayInverseRatio=Math.pow(2d,1d/* 1 second *//(double)lifeTime); double newAmount=(double)amount/decayInverseRatio; long amountRemaining= (long)Math.floor(newAmount) +(TecTech.Rnd.nextDouble()<=newAmount-Math.floor(newAmount)?1:0); + //if(definition.getSymbol().startsWith("U ")) { + // System.out.println("newAmount = " + newAmount); + // System.out.println("amountRemaining = " + amountRemaining); + // for(cElementalDecay decay:decays){ + // System.out.println("prob = "+decay.probability); + // for(cElementalDefinitionStack stack:decay.outputStacks.values()){ + // System.out.println("stack = " + stack.getDefinition().getSymbol() + " " + stack.amount); + // } + // } + //} if(amountRemaining==amount) { return null;//nothing decayed } else if(amountRemaining<=0) { @@ -206,12 +240,19 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { } //Use to get direct decay output providing correct decay array - public cElementalInstanceStackMap decayCompute(cElementalDecay[] decays, float lifeTimeMult, long newProductsAge, long energy) { + private cElementalInstanceStackMap decayCompute(cElementalDecay[] decays, float lifeTimeMult, long newProductsAge, long energy) { if (decays == null) { return null;//Can not decay so it wont - } else if (decays.length == 0) { + } + if (decays.length == 0) { + if(definition.decayMakesEnergy(this.energy)) { + return null; + } return new cElementalInstanceStackMap();//provide non null 0 length array for annihilation } else if (decays.length == 1) {//only one type of decay :D, doesn't need dead end + if(decays[0]==deadEnd && definition.decayMakesEnergy(this.energy)) { + return null; + } cElementalInstanceStackMap products=decays[0].getResults(lifeTimeMult, newProductsAge, energy, amount); if(newProductsAge<0){ for(cElementalInstanceStack stack:products.values()){ @@ -236,25 +277,22 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { float remainingProbability = 1F; for (int i = 0; i < differentDecays; i++) { - if (decays[i].probability > 1F) { + if (decays[i].probability >= 1F) { long thisDecayAmount = (long) Math.floor(remainingProbability * (double) amount); - if (thisDecayAmount == 0) { - //remainingProbability=something; - break; - } else if (thisDecayAmount <= amountRemaining) { - amountRemaining -= thisDecayAmount; - qttyOfDecay[i] += thisDecayAmount; - break; + if (thisDecayAmount > 0) { + if (thisDecayAmount <= amountRemaining) { + amountRemaining -= thisDecayAmount; + qttyOfDecay[i] += thisDecayAmount; + }else {//in case too much was made + qttyOfDecay[i] += amountRemaining; + amountRemaining = 0; + //remainingProbability=0; + } } - //in case too much was made - qttyOfDecay[i] += amountRemaining; - amountRemaining = 0; - //remainingProbability=0; break; } long thisDecayAmount = (long) Math.floor(decays[i].probability * (double) amount); if (thisDecayAmount <= amountRemaining && thisDecayAmount > 0) {//some was made - remainingProbability -= decays[i].probability; amountRemaining -= thisDecayAmount; qttyOfDecay[i] += thisDecayAmount; } else if (thisDecayAmount > amountRemaining) {//too much was made @@ -262,7 +300,11 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { amountRemaining = 0; //remainingProbability=0; break; - }//if 0 + } + remainingProbability -= decays[i].probability; + if(remainingProbability<=0) { + break; + } } for (int i = 0; i < amountRemaining; i++) { @@ -276,9 +318,23 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { } } - for (int i = 0; i < differentDecays; i++) { - if (qttyOfDecay[i] > 0) { - output.putUnifyAll(decays[i].getResults(lifeTimeMult, newProductsAge, energy, qttyOfDecay[i])); + if(definition.decayMakesEnergy(this.energy)){ + for (int i = 0; i < differentDecays; i++) { + if (qttyOfDecay[i] > 0) { + if(decays[i]==deadEnd){ + cElementalInstanceStack clone=this.clone(); + clone.amount=qttyOfDecay[i]; + output.putUnify(clone); + }else { + output.putUnifyAll(decays[i].getResults(lifeTimeMult, newProductsAge, energy, qttyOfDecay[i])); + } + } + } + }else{ + for (int i = 0; i < differentDecays; i++) { + if (qttyOfDecay[i] > 0) { + output.putUnifyAll(decays[i].getResults(lifeTimeMult, newProductsAge, energy, qttyOfDecay[i])); + } } } @@ -322,7 +378,7 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { } this.energy = energy; - setLifeTimeMultipleOfBaseValue(lifeTimeMul); + setLifeTimeMultiplier(lifeTimeMul); return this; } diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalPrimitive.java b/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalPrimitive.java index ab571e9d4c..c7b754432f 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalPrimitive.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/cElementalPrimitive.java @@ -134,6 +134,16 @@ public abstract class cElementalPrimitive extends cElementalDefinition { return false; } + @Override + public boolean usesMultipleDecayCalls(long energyLevel) { + return false; + } + + @Override + public boolean decayMakesEnergy(long energyLevel) { + return false; + } + @Override public cElementalDecay[] getDecayArray() { return elementalDecays; diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/iElementalDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/iElementalDefinition.java index 23d2df06a8..8a0bd486c0 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/iElementalDefinition.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/core/templates/iElementalDefinition.java @@ -41,6 +41,10 @@ public abstract class iElementalDefinition implements Comparableiaea.energeticStatesArray.length) { + state = iaea.energeticStatesArray[iaea.energeticStatesArray.length - 1]; + } else if(energyLevel<=0) { + state = iaea.energeticStatesArray[0]; + } else { + state = iaea.energeticStatesArray[(int) energyLevel]; + } + for (iaeaNuclide.iaeaDecay decay:state.decaymodes){ + if(decay.decayName.contains("F")) return true;//if is fissile + } + return false; + } + + @Override + public boolean decayMakesEnergy(long energyLevel) { + return iaeaDefinitionExistsAndHasEnergyLevels; + } + @Override public cElementalDecay[] getNaturalDecayInstant() { //disembody diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/hadron/dHadronDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/hadron/dHadronDefinition.java index c08588090d..50f1b2d1ce 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/hadron/dHadronDefinition.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/hadron/dHadronDefinition.java @@ -221,6 +221,16 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi return false; } + @Override + public boolean usesMultipleDecayCalls(long energyLevel) { + return false; + } + + @Override + public boolean decayMakesEnergy(long energyLevel) { + return false; + } + @Override public cElementalDecay[] getDecayArray() { cElementalDefinitionStack[] quarkStacks = this.quarkStacks.values(); diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/primitive/eBosonDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/primitive/eBosonDefinition.java index 636cd9b8fc..5d98f3cb71 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/primitive/eBosonDefinition.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/primitive/eBosonDefinition.java @@ -36,6 +36,6 @@ public final class eBosonDefinition extends cElementalPrimitive { @Override public boolean isTimeSpanHalfLife() { - return false; + return this==boson_H__; } } diff --git a/src/main/java/com/github/technus/tectech/loader/ThingsLoader.java b/src/main/java/com/github/technus/tectech/loader/ThingsLoader.java index 5906f3d3de..3cd285a858 100644 --- a/src/main/java/com/github/technus/tectech/loader/ThingsLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/ThingsLoader.java @@ -48,6 +48,7 @@ public class ThingsLoader implements Runnable { TecTech.Logger.info("Reactor Simulator registered"); ConstructableTriggerItem.run(); + FrontRotationTriggerItem.run(); ParametrizerMemoryCard.run(); ElementalDefinitionScanStorage_EM.run(); TecTech.Logger.info("Useful Items registered"); diff --git a/src/main/java/com/github/technus/tectech/network/Dispatcher.java b/src/main/java/com/github/technus/tectech/network/Dispatcher.java deleted file mode 100644 index cae93a7ce8..0000000000 --- a/src/main/java/com/github/technus/tectech/network/Dispatcher.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.github.technus.tectech.network; - -import com.github.technus.tectech.auxiliary.Reference; -import eu.usrv.yamcore.network.PacketDispatcher; - -/** - * Created by Bass on 25/07/2017. - */ -public class Dispatcher extends PacketDispatcher { - public Dispatcher() { - super(Reference.MODID); - } - - @Override - public void registerPackets() { - //this.registerMessage(SpawnParticleFXMessage.SpawnParticleFXMessageHandler.class, SpawnParticleFXMessage.class); - } -} 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 new file mode 100644 index 0000000000..8f5b7e8fae --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java @@ -0,0 +1,66 @@ +package com.github.technus.tectech.thing.item; + +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation; +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; + +import static com.github.technus.tectech.auxiliary.Reference.MODID; + +/** + * Created by Tec on 15.03.2017. + */ +public final class FrontRotationTriggerItem extends Item { + public static FrontRotationTriggerItem INSTANCE; + + private FrontRotationTriggerItem() { + setUnlocalizedName("em.frontRotate"); + setTextureName(MODID + ":itemFrontRotate"); + } + + @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 IFrontRotation) { + ((IFrontRotation) metaTE).rotateAroundFrontPlane(!aPlayer.isSneaking()); + System.out.println("DID SHIT"); + return true; + } + } else if (tTileEntity instanceof IFrontRotation) { + ((IFrontRotation) tTileEntity).rotateAroundFrontPlane(!aPlayer.isSneaking()); + return true; + } + } + return false; + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) { + aList.add(CommonValues.TEC_MARK_GENERAL); + aList.add("Triggers Front Rotation Interface"); + aList.add(EnumChatFormatting.BLUE + "Rotates only the front panel,"); + aList.add(EnumChatFormatting.BLUE + "which allows structure rotation."); + } + + public static void run() { + INSTANCE = new FrontRotationTriggerItem(); + GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName()); + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/IFrontRotation.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/IFrontRotation.java new file mode 100644 index 0000000000..7ac296e41f --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/IFrontRotation.java @@ -0,0 +1,11 @@ +package com.github.technus.tectech.thing.metaTileEntity; + +public interface IFrontRotation { + boolean isFrontRotationValid(byte frontRotation, byte frontFacing); + + void rotateAroundFrontPlane(boolean direction); + + void forceSetRotationDoRender(byte frontRotation); + + byte getFrontRotation(); +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java index cfcbf1ac90..4e7cb3e8b6 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 @@ -4,13 +4,13 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; 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 gregtech.api.objects.GT_RenderedTexture; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; @@ -79,7 +79,7 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12]}; } 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 748fa18f5a..1f72f00c20 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 @@ -4,13 +4,13 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; 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 gregtech.api.objects.GT_RenderedTexture; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; @@ -176,7 +176,7 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12]}; } 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 bc814e30d2..c48cd143b2 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 @@ -6,13 +6,13 @@ import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; 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 gregtech.api.objects.GT_RenderedTexture; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -107,13 +107,13 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4]}; } @Override - public boolean isFacingValid(byte aFacing) { + public boolean isFacingValid_EM(byte aFacing) { return aFacing >= 2; } 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 66c32ac761..9ccdda3ca2 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 @@ -10,6 +10,7 @@ import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_H 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.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -19,7 +20,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; @@ -97,7 +97,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][3], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][3], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][3]}; } @@ -354,7 +354,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override - public boolean isFacingValid(byte aFacing) { + public boolean isFacingValid_EM(byte aFacing) { return aFacing >= 2; } 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 4c382c178a..e3e3ee4d71 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 @@ -4,13 +4,13 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; 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 gregtech.api.objects.GT_RenderedTexture; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; @@ -80,7 +80,7 @@ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockB @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; } return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12]}; } 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 7edd9caa5f..780a2d30bd 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 @@ -5,7 +5,9 @@ import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMa import com.github.technus.tectech.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; +import