From e30abbb03c2af80a00d2036808d3125c58331b19 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Mon, 2 Jan 2023 16:22:37 +0800 Subject: add callhook for pre block destroy (#1625) * add callhook for pre block destroy Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> * spotless Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> --- src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java | 5 +++++ src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'src/main/java/gregtech/api/metatileentity') diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index 87a865641f..09b62c0657 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -1358,6 +1358,11 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity return (mConnections & IConnectable.HAS_FOAM) != 0 ? 50.0F : 5.0F; } + @Override + public void onBlockDestroyed() { + if (canAccessData()) getMetaTileEntity().onBlockDestroyed(); + } + @Override public boolean isMufflerUpgradable() { return false; diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 8c6076a56e..f2da90cde9 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -2234,6 +2234,11 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity return canAccessData() ? Math.max(0, getMetaTileEntity().getExplosionResistance(aSide)) : 10.0F; } + @Override + public void onBlockDestroyed() { + if (canAccessData()) getMetaTileEntity().onBlockDestroyed(); + } + @Override public boolean isUniversalEnergyStored(long aEnergyAmount) { if (getUniversalEnergyStored() >= aEnergyAmount) return true; -- cgit