aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java
diff options
context:
space:
mode:
authorMartin Robertz <dream-master@gmx.net>2022-10-01 12:38:45 +0200
committerMartin Robertz <dream-master@gmx.net>2022-10-01 12:38:45 +0200
commit83a59b8babdccf6eb29967a52cda15c6bc2fd8c9 (patch)
tree3c850aecc7916c02ceeebbc6ac000c6b7ad8fbba /src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java
parent1f68b3430593b9bdec6bf3c96dcafe1eb9cf730c (diff)
parent0268d287a9d165899ff456b674d56ba10d382d81 (diff)
downloadGT5-Unofficial-83a59b8babdccf6eb29967a52cda15c6bc2fd8c9.tar.gz
GT5-Unofficial-83a59b8babdccf6eb29967a52cda15c6bc2fd8c9.tar.bz2
GT5-Unofficial-83a59b8babdccf6eb29967a52cda15c6bc2fd8c9.zip
Merge branch 'advanced_redstone_covers'
# Conflicts: # src/main/java/gregtech/api/util/GT_Utility.java
Diffstat (limited to 'src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java')
-rw-r--r--src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java b/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java
index efbff79957..1092a24307 100644
--- a/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java
+++ b/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java
@@ -131,6 +131,20 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
}
/**
+ * Called before receiving data from network. Use {@link ICoverable#isClientSide()} to determine the side.
+ */
+ public final void preDataChanged(
+ byte aSide,
+ int aCoverID,
+ int aNewCoverId,
+ ISerializableObject aCoverVariable,
+ ISerializableObject aNewCoverVariable,
+ ICoverable aTileEntity) {
+ preDataChangedImpl(
+ aSide, aCoverID, aNewCoverId, forceCast(aCoverVariable), forceCast(aNewCoverVariable), aTileEntity);
+ }
+
+ /**
* Called upon cover being removed. Called on both server and client.
*/
public final void onDropped(byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
@@ -222,6 +236,15 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
}
/**
+ * Called upon Base TE being destroyed (once getDrops is called),
+ * thus getting called only when destroyed in survival.
+ */
+ public final void onBaseTEDestroyed(
+ byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ onBaseTEDestroyedImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
+ }
+
+ /**
* Gives a small Text for the status of the Cover.
*/
public final String getDescription(
@@ -410,8 +433,13 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
protected void onDataChangedImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity) {}
+ protected void preDataChangedImpl(
+ byte aSide, int aCoverID, int aNewCoverId, T aCoverVariable, T aNewCoverVariable, ICoverable aTileEntity) {}
+
protected void onDroppedImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity) {}
+ protected void onBaseTEDestroyedImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity) {}
+
protected boolean isRedstoneSensitiveImpl(
byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, long aTimer) {
return true;