aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/interfaces/tileentity
diff options
context:
space:
mode:
authorHoleFish <48403212+HoleFish@users.noreply.github.com>2024-03-11 18:06:51 +0800
committerGitHub <noreply@github.com>2024-03-11 11:06:51 +0100
commitad49276a25535ff110a3e37934f72dbea8eec258 (patch)
tree57620a84a6928bc9d01516835cf0a6ec1f30d915 /src/main/java/gregtech/api/interfaces/tileentity
parent34c34137ba1c888feff65b1695992d609f33a7f1 (diff)
downloadGT5-Unofficial-ad49276a25535ff110a3e37934f72dbea8eec258.tar.gz
GT5-Unofficial-ad49276a25535ff110a3e37934f72dbea8eec258.tar.bz2
GT5-Unofficial-ad49276a25535ff110a3e37934f72dbea8eec258.zip
Add messages about the reasons for machine shutdown during processing (#2522)
* ShutDownReason setup * implement * fix machine not turn on
Diffstat (limited to 'src/main/java/gregtech/api/interfaces/tileentity')
-rw-r--r--src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java5
-rw-r--r--src/main/java/gregtech/api/interfaces/tileentity/IMachineProgress.java10
2 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java
index cf39f4c22a..d8231ee544 100644
--- a/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java
+++ b/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java
@@ -4,6 +4,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
+import javax.annotation.Nonnull;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -19,6 +21,7 @@ import gregtech.api.interfaces.IDescribable;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.modularui.IAddInventorySlots;
import gregtech.api.interfaces.modularui.IGetGUITextureSet;
+import gregtech.api.util.shutdown.ShutDownReason;
import gregtech.common.blocks.GT_Block_Machines;
/**
@@ -179,6 +182,8 @@ public interface IGregTechTileEntity extends ITexturedTileEntity, IGearEnergyTil
default void setShutdownStatus(boolean newStatus) {}
+ default void setShutDownReason(@Nonnull ShutDownReason reason) {}
+
/**
* A randomly called display update to be able to add particles or other items for display The event is proxied by
* the {@link GT_Block_Machines#randomDisplayTick}
diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IMachineProgress.java b/src/main/java/gregtech/api/interfaces/tileentity/IMachineProgress.java
index 517f4a0cd3..83570fedcc 100644
--- a/src/main/java/gregtech/api/interfaces/tileentity/IMachineProgress.java
+++ b/src/main/java/gregtech/api/interfaces/tileentity/IMachineProgress.java
@@ -1,5 +1,10 @@
package gregtech.api.interfaces.tileentity;
+import javax.annotation.Nonnull;
+
+import gregtech.api.util.shutdown.ShutDownReason;
+import gregtech.api.util.shutdown.ShutDownReasonRegistry;
+
/**
* For Machines which have Progress
*/
@@ -83,4 +88,9 @@ public interface IMachineProgress extends IHasWorldObjectAndCoords {
default boolean wasShutdown() {
return false;
}
+
+ @Nonnull
+ default ShutDownReason getLastShutDownReason() {
+ return ShutDownReasonRegistry.NONE;
+ }
}