aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/common/covers
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2023-05-26 14:41:09 +0900
committerGitHub <noreply@github.com>2023-05-26 07:41:09 +0200
commit67b48690b1078b489bcb017e8db9200f26b77a0c (patch)
tree83cd38af2a564a016680652327623748a73f2bf5 /src/main/java/gtPlusPlus/xmod/gregtech/common/covers
parent69791bd5a4e5fc5ff6d79b0510c572612ce8bae8 (diff)
downloadGT5-Unofficial-67b48690b1078b489bcb017e8db9200f26b77a0c.tar.gz
GT5-Unofficial-67b48690b1078b489bcb017e8db9200f26b77a0c.tar.bz2
GT5-Unofficial-67b48690b1078b489bcb017e8db9200f26b77a0c.zip
Deprecation cleanup (#637)
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common/covers')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java7
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java16
2 files changed, 8 insertions, 15 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java
index e99feff75a..af80b7c684 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java
@@ -21,7 +21,6 @@ import gregtech.api.util.GT_Utility;
import gregtech.api.util.ISerializableObject;
import gregtech.common.gui.modularui.widget.CoverDataControllerWidget;
import gregtech.common.gui.modularui.widget.CoverDataFollower_TextFieldWidget;
-import gtPlusPlus.core.util.minecraft.LangUtils;
public class GTPP_Cover_Overflow extends GT_CoverBehavior {
@@ -86,7 +85,7 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior {
}
GT_Utility.sendChatToPlayer(
aPlayer,
- LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L"));
+ GT_Utility.trans("322", "Overflow point: ") + aCoverVariable + GT_Utility.trans("323", "L"));
return aCoverVariable;
}
@@ -107,8 +106,8 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior {
}
GT_Utility.sendChatToPlayer(
aPlayer,
- LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L"));
- aTileEntity.setCoverDataAtSide(side, aCoverVariable);
+ GT_Utility.trans("322", "Overflow point: ") + aCoverVariable + GT_Utility.trans("323", "L"));
+ aTileEntity.setCoverDataAtSide(side, new ISerializableObject.LegacyCoverData(aCoverVariable));
return true;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java
index f7657de5a9..2366bbe87f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java
@@ -12,10 +12,11 @@ import net.minecraftforge.fluids.Fluid;
import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_CoverBehavior;
+import gregtech.api.util.GT_Utility;
+import gregtech.api.util.ISerializableObject;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.minecraft.BlockPos;
import gtPlusPlus.api.objects.random.XSTR;
-import gtPlusPlus.core.util.minecraft.LangUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior {
@@ -40,7 +41,7 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior {
public boolean onCoverRightclick(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
EntityPlayer aPlayer, float aX, float aY, float aZ) {
PlayerUtils
- .messagePlayer(aPlayer, LangUtils.trans("756", "Connectable: ") + getConnectionState(aCoverVariable));
+ .messagePlayer(aPlayer, GT_Utility.trans("756", "Connectable: ") + getConnectionState(aCoverVariable));
return super.onCoverRightclick(side, aCoverID, aCoverVariable, aTileEntity, aPlayer, aX, aY, aZ);
}
@@ -77,10 +78,6 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior {
return getConnectionState(aCoverVariable);
}
- public String getDescription(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return LangUtils.trans("756", "Connectable: ") + getConnectionState(aCoverVariable);
- }
-
public int getTickRate(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
return 1;
}
@@ -158,11 +155,8 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior {
private static final void trySetState(ForgeDirection side, int aState, ICoverable aTile) {
// Try set cover state directly
- if (aTile instanceof IGregTechTileEntity) {
- IGregTechTileEntity gTileEntity = (IGregTechTileEntity) aTile;
- if (gTileEntity != null) {
- gTileEntity.setCoverDataAtSide(side, aState);
- }
+ if (aTile instanceof IGregTechTileEntity gTileEntity) {
+ gTileEntity.setCoverDataAtSide(side, new ISerializableObject.LegacyCoverData(aState));
}
}