diff --git a/build.properties b/build.properties index 29f39ddd..ecfa377c 100644 --- a/build.properties +++ b/build.properties @@ -1,7 +1,7 @@ minecraft.version=1.7.10 forge.version=10.13.4.1566-1.7.10 -gt.version=5.09.30pre2 +gt.version=5.09.30pre3 ae2.version=rv2-beta-33 applecore.version=1.7.10-1.2.1+107.59407 diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java index d6d1985e..ca9d57ef 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java @@ -11,6 +11,7 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.metatileentity.IMetaTileEntityCable; import gregtech.api.interfaces.tileentity.IColoredTileEntity; +import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IEnergyConnected; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaPipeEntity; @@ -106,8 +107,30 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { - //if (!mCanShock) return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); - return AxisAlignedBB.getBoundingBox(aX + 0.0625D, aY + 0.0625D, aZ + 0.0625D, aX + 0.9375D, aY + 0.9375D, aZ + 0.9375D); + float tSpace = (1f - getThickNess())/2; + float tSide0 = tSpace; + float tSide1 = 1f - tSpace; + float tSide2 = tSpace; + float tSide3 = 1f - tSpace; + float tSide4 = tSpace; + float tSide5 = 1f - tSpace; + + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;} + + byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections; + if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f; + if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f; + if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f; + if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f; + if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f; + if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f; + + return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3); } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java index ddba7b39..26a3ba4a 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java @@ -146,7 +146,30 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity { @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { - return AxisAlignedBB.getBoundingBox(aX + 0.0625D, aY + 0.0625D, aZ + 0.0625D, aX + 0.9375D, aY + 0.9375D, aZ + 0.9375D); + float tSpace = (1f - getThickNess())/2; + float tSide0 = tSpace; + float tSide1 = 1f - tSpace; + float tSide2 = tSpace; + float tSide3 = 1f - tSpace; + float tSide4 = tSpace; + float tSide5 = 1f - tSpace; + + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;} + + byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections; + if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f; + if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f; + if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f; + if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f; + if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f; + if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f; + + return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3); } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java index 7e2e7b78..b3d10883 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java @@ -20,6 +20,7 @@ import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.tileentity.TileEntityHopper; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; import java.util.concurrent.ConcurrentHashMap; @@ -319,6 +320,30 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { - return AxisAlignedBB.getBoundingBox(aX + 0.0625D, aY + 0.0625D, aZ + 0.0625D, aX + 0.9375D, aY + 0.9375D, aZ + 0.9375D); + float tSpace = (1f - getThickNess())/2; + float tSide0 = tSpace; + float tSide1 = 1f - tSpace; + float tSide2 = tSpace; + float tSide3 = 1f - tSpace; + float tSide4 = tSpace; + float tSide5 = 1f - tSpace; + + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 0) != 0){tSide0=tSide2=tSide4=0;tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 1) != 0){tSide2=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 2) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 3) != 0){tSide0=tSide4=0;tSide1=tSide3=tSide5=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 4) != 0){tSide0=tSide2=tSide4=0;tSide1=tSide3=1;} + if(getBaseMetaTileEntity().getCoverIDAtSide((byte) 5) != 0){tSide0=tSide2=0;tSide1=tSide3=tSide5=1;} + + byte tConn = ((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections; + if((tConn & (1 << ForgeDirection.DOWN.ordinal()) ) != 0) tSide0 = 0f; + if((tConn & (1 << ForgeDirection.UP.ordinal()) ) != 0) tSide1 = 1f; + if((tConn & (1 << ForgeDirection.NORTH.ordinal())) != 0) tSide2 = 0f; + if((tConn & (1 << ForgeDirection.SOUTH.ordinal())) != 0) tSide3 = 1f; + if((tConn & (1 << ForgeDirection.WEST.ordinal()) ) != 0) tSide4 = 0f; + if((tConn & (1 << ForgeDirection.EAST.ordinal()) ) != 0) tSide5 = 1f; + + return AxisAlignedBB.getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3); + } } \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java index 29b47ab9..315c9032 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java @@ -346,7 +346,13 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) return true; - aBaseMetaTileEntity.openGUI(aPlayer); + for(byte i=0;i < 6; i++){ + if(aBaseMetaTileEntity.getAirAtSide(i)){ + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + } + GT_Utility.sendChatToPlayer(aPlayer,"No free Side!"); return true; } diff --git a/src/main/java/gregtech/loaders/misc/GT_CoverLoader.java b/src/main/java/gregtech/loaders/misc/GT_CoverLoader.java index ae6c08a3..55d2e1af 100644 --- a/src/main/java/gregtech/loaders/misc/GT_CoverLoader.java +++ b/src/main/java/gregtech/loaders/misc/GT_CoverLoader.java @@ -19,7 +19,7 @@ public class GT_CoverLoader GregTech_API.registerCover(GT_ModHandler.getIC2Item("reactorVent", 1L, 1), new GT_RenderedTexture(Textures.BlockIcons.VENT_NORMAL), new GT_Cover_Vent(1)); GregTech_API.registerCover(GT_ModHandler.getIC2Item("reactorVentCore", 1L, 1), new GT_RenderedTexture(Textures.BlockIcons.VENT_NORMAL), new GT_Cover_Vent(1)); GregTech_API.registerCover(GT_ModHandler.getIC2Item("reactorVentGold", 1L, 1), new GT_RenderedTexture(Textures.BlockIcons.VENT_ADVANCED), new GT_Cover_Vent(2)); - GregTech_API.registerCover(GT_ModHandler.getIC2Item("reactorVentSpread", 1L, 1), new GT_RenderedTexture(Textures.BlockIcons.VENT_NORMAL), new GT_Cover_Vent(2)); + GregTech_API.registerCover(GT_ModHandler.getIC2Item("reactorVentSpread", 1L), new GT_RenderedTexture(Textures.BlockIcons.VENT_NORMAL), new GT_Cover_Vent(2)); GregTech_API.registerCover(GT_ModHandler.getIC2Item("reactorVentDiamond", 1L, 1), new GT_RenderedTexture(Textures.BlockIcons.VENT_ADVANCED), new GT_Cover_Vent(3)); } }