aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/metatileentity
diff options
context:
space:
mode:
authorHarry <harryyunull@gmail.com>2023-08-28 14:31:11 +0800
committerGitHub <noreply@github.com>2023-08-28 08:31:11 +0200
commitadf838e7ff067f64a6518cd659f55dd566306497 (patch)
tree533e62b199c644ce6baf237506c54f6a16500fe6 /src/main/java/gregtech/api/metatileentity
parentc18e91469b33a60df690cde8cbace1b7c38bbee2 (diff)
downloadGT5-Unofficial-adf838e7ff067f64a6518cd659f55dd566306497.tar.gz
GT5-Unofficial-adf838e7ff067f64a6518cd659f55dd566306497.tar.bz2
GT5-Unofficial-adf838e7ff067f64a6518cd659f55dd566306497.zip
Crafting input hatches QoLs (#2200)
* Fixes + Detect Inventory Slot Changes * support rename + check for updates * add back onChangeListener + fix npe * ICustomNameObject TileEntity * Fix NPEs * Use IInterfaceTerminalSupport * fix * register * dep * spotless * General Crafting Input Hatch QoL fixes (#2212) * feat: refactor naming && include circuit and catalyst in default name * feat: add 4 more slot to solve my ocd * fix: formatting * feat: migrate from 4x8 to 4x9 * spotlessApply (#2213) Co-authored-by: GitHub GTNH Actions <> * QoLs * 9 manual items * spotless * feat: open master GUI when used, without holding a data-stick (#2221) * fix destpos * optimize empty check * Fix error when fluidInventory.size() == 0 If the fluidInventory size is 0, there is no element to get. Add a check for it. * name in waila + fix int overflow * unnecssary super * update deps --------- Co-authored-by: Fox_white <39846845+foxwhite25@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Firenoo <49818773+firenoo@users.noreply.github.com> Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity')
-rw-r--r--src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
index 882a94599e..1c403dcf7f 100644
--- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
@@ -44,6 +44,7 @@ import appeng.api.networking.IGridNode;
import appeng.api.networking.security.IActionHost;
import appeng.api.util.AECableType;
import appeng.api.util.DimensionalCoord;
+import appeng.helpers.ICustomNameObject;
import appeng.me.helpers.AENetworkProxy;
import appeng.me.helpers.IGridProxyable;
import appeng.tile.TileEvent;
@@ -87,7 +88,7 @@ import mcp.mobius.waila.api.IWailaDataAccessor;
*/
public class BaseMetaTileEntity extends CommonMetaTileEntity
implements IGregTechTileEntity, IActionHost, IGridProxyable, IAlignmentProvider, IConstructableProvider,
- IDebugableTileEntity, IGregtechWailaProvider, ICleanroomReceiver {
+ IDebugableTileEntity, IGregtechWailaProvider, ICleanroomReceiver, ICustomNameObject {
private static final Field ENTITY_ITEM_HEALTH_FIELD = ReflectionHelper
.findField(EntityItem.class, "health", "field_70291_e");
@@ -2446,4 +2447,20 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity
public int[] getTimeStatistics() {
return mTimeStatistics;
}
+
+ @Override
+ public String getCustomName() {
+ return getMetaTileEntity() instanceof ICustomNameObject customNameObject ? customNameObject.getCustomName()
+ : null;
+ }
+
+ @Override
+ public boolean hasCustomName() {
+ return getMetaTileEntity() instanceof ICustomNameObject customNameObject && customNameObject.hasCustomName();
+ }
+
+ @Override
+ public void setCustomName(String name) {
+ if (getMetaTileEntity() instanceof ICustomNameObject customNameObject) customNameObject.setCustomName(name);
+ }
}