From e0cd4376b164244c8d29a5710d06b852cafdde02 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Mon, 12 Jun 2017 11:34:25 +0200 Subject: [PATCH 1/4] change back the component heat exchanger damage value --- build.properties | 2 +- src/main/java/gregtech/loaders/misc/GT_CoverLoader.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/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)); } } From 8e043d00d992040c7394a04797c2984847a19dd2 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Mon, 12 Jun 2017 11:58:26 +0200 Subject: [PATCH 2/4] Cables and pipes now change hitboxes dynamicly depending on connections or covers --- .../GT_MetaPipeEntity_Cable.java | 27 +++++++++++++++++-- .../GT_MetaPipeEntity_Fluid.java | 25 ++++++++++++++++- .../GT_MetaPipeEntity_Item.java | 27 ++++++++++++++++++- 3 files changed, 75 insertions(+), 4 deletions(-) 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 From ef22bf6ab925f2b1693eccdae9394a27aaed5cb8 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Mon, 12 Jun 2017 12:18:54 +0200 Subject: [PATCH 3/4] Only open machine gui if front is free. --- .../implementations/GT_MetaTileEntity_BasicMachine.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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..ebe16f04 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,11 @@ 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); + if(aBaseMetaTileEntity.getAirAtSide((byte) mMainFacing)){ + aBaseMetaTileEntity.openGUI(aPlayer); + }else{ + GT_Utility.sendChatToPlayer(aPlayer,"Front blocked!"); + } return true; } From e85a761e82b2aa1d3d49c19e03c5c32fb72ec40b Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Mon, 12 Jun 2017 13:48:54 +0200 Subject: [PATCH 4/4] At last one free face. --- .../GT_MetaTileEntity_BasicMachine.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 ebe16f04..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,11 +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; - if(aBaseMetaTileEntity.getAirAtSide((byte) mMainFacing)){ - aBaseMetaTileEntity.openGUI(aPlayer); - }else{ - GT_Utility.sendChatToPlayer(aPlayer,"Front blocked!"); + 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; }