aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNotAPenguin <michiel.vandeginste@gmail.com>2024-09-12 07:35:55 +0200
committerGitHub <noreply@github.com>2024-09-12 05:35:55 +0000
commit4221744e308cf19cecf9e0d2b06769abe9d7e8e5 (patch)
tree3198ab9fe84e3e5ee38d37f3aec9daf36561c3b3
parent118be67d5375cc618016252f9aef9868cbf206c9 (diff)
downloadGT5-Unofficial-4221744e308cf19cecf9e0d2b06769abe9d7e8e5.tar.gz
GT5-Unofficial-4221744e308cf19cecf9e0d2b06769abe9d7e8e5.tar.bz2
GT5-Unofficial-4221744e308cf19cecf9e0d2b06769abe9d7e8e5.zip
Fix final frame box issues (#3160)
Co-authored-by: BucketBrigade <138534411+CookieBrigade@users.noreply.github.com>
-rw-r--r--dependencies.gradle2
-rw-r--r--src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java10
-rw-r--r--src/main/java/gregtech/common/blocks/BlockFrameBox.java14
3 files changed, 15 insertions, 11 deletions
diff --git a/dependencies.gradle b/dependencies.gradle
index 5bf41a4e73..850f9d99c3 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -37,7 +37,7 @@ dependencies {
api("com.github.GTNewHorizons:StructureLib:1.3.4:dev")
api("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.6.35-GTNH:dev")
- api("com.github.GTNewHorizons:NotEnoughIds:2.1.1:dev")
+ api("com.github.GTNewHorizons:NotEnoughIds:2.1.2:dev")
api("com.github.GTNewHorizons:GTNHLib:0.5.5:dev")
api("com.github.GTNewHorizons:ModularUI:1.2.5:dev")
api("com.github.GTNewHorizons:ModularUI2:2.1.6-1.7.10:dev")
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
index aae3ddcebb..56a63de65a 100644
--- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java
@@ -1000,16 +1000,12 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity
if (getCoverInfoAtSide(side).onCoverRightClick(aPlayer, aX, aY, aZ)) return true;
}
-
if (!getCoverInfoAtSide(side).isGUIClickable()) return false;
-
try {
if (!aPlayer.isSneaking() && hasValidMetaTileEntity()) {
- final boolean handled = mMetaTileEntity.onRightclick(this, aPlayer, side, aX, aY, aZ);
- if (handled) {
- mMetaTileEntity.markDirty();
- }
- return handled;
+ mMetaTileEntity.onRightclick(this, aPlayer, side, aX, aY, aZ);// Always returns false?
+ mMetaTileEntity.markDirty();
+ return true; // Play the animation
}
} catch (Throwable e) {
GT_FML_LOGGER.error("Encountered Exception while right clicking TileEntity", e);
diff --git a/src/main/java/gregtech/common/blocks/BlockFrameBox.java b/src/main/java/gregtech/common/blocks/BlockFrameBox.java
index 59ca98ef8e..ab05d95032 100644
--- a/src/main/java/gregtech/common/blocks/BlockFrameBox.java
+++ b/src/main/java/gregtech/common/blocks/BlockFrameBox.java
@@ -11,6 +11,7 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@@ -125,6 +126,7 @@ public class BlockFrameBox extends BlockContainer {
ForgeDirection direction = ForgeDirection.getOrientation(side);
// If this block already holds a TE, just forward the call
TileEntity te = worldIn.getTileEntity(x, y, z);
+
if (te instanceof BaseMetaPipeEntity baseTileEntity) {
// If this baseTileEntity has no MetaTileEntity associated with it, we need to create it
// This happens on world load for some reason
@@ -139,8 +141,7 @@ public class BlockFrameBox extends BlockContainer {
ItemStack item = player.getHeldItem();
if (isCover(item)) {
BaseMetaPipeEntity newTileEntity = spawnFrameEntity(worldIn, x, y, z);
- newTileEntity.onRightclick(player, direction, subX, subY, subZ);
- return true;
+ return newTileEntity.onRightclick(player, direction, subX, subY, subZ);
}
return false;
@@ -183,7 +184,7 @@ public class BlockFrameBox extends BlockContainer {
@Override
public int getHarvestLevel(int aMeta) {
- return aMeta % 4;
+ return 3;
}
@Override
@@ -209,6 +210,8 @@ public class BlockFrameBox extends BlockContainer {
@Override
public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetadata) {
+ if (aWorld.isRemote) return;
+
final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if (tTileEntity instanceof IGregTechTileEntity gtTE) {
gtTE.onBlockDestroyed();
@@ -237,6 +240,11 @@ public class BlockFrameBox extends BlockContainer {
}
@Override
+ public float getBlockHardness(World aWorld, int aX, int aY, int aZ) {
+ return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ);
+ }
+
+ @Override
public float getPlayerRelativeBlockHardness(EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) {
final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
return (tTileEntity instanceof BaseMetaTileEntity baseMTE) && baseMTE.privateAccess()