From c5b894d933a30f9918b60dd167e1c648c9ed07d9 Mon Sep 17 00:00:00 2001 From: 10565552046 <1056552046@qq.com> Date: Sat, 9 Nov 2024 19:54:49 +0800 Subject: [PATCH] Adapt the "onAlloyIteraction" and "canUpgrade" methods to ITier --- src/api/java/mekanism/api/IAlloyInteraction.java | 4 ++-- .../content/network/transmitter/IUpgradeableTransmitter.java | 3 +-- .../common/tile/transmitter/TileEntityTransmitter.java | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/api/java/mekanism/api/IAlloyInteraction.java b/src/api/java/mekanism/api/IAlloyInteraction.java index fd749a60031..1701a15a13e 100644 --- a/src/api/java/mekanism/api/IAlloyInteraction.java +++ b/src/api/java/mekanism/api/IAlloyInteraction.java @@ -1,6 +1,6 @@ package mekanism.api; -import mekanism.api.tier.AlloyTier; +import mekanism.api.tier.ITier; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; @@ -19,5 +19,5 @@ public interface IAlloyInteraction { * @param stack - the stack of alloy being right-clicked * @param tier - the tier of the alloy */ - void onAlloyInteraction(Player player, ItemStack stack, @NotNull AlloyTier tier); + void onAlloyInteraction(Player player, ItemStack stack, @NotNull TIER tier); } \ No newline at end of file diff --git a/src/main/java/mekanism/common/content/network/transmitter/IUpgradeableTransmitter.java b/src/main/java/mekanism/common/content/network/transmitter/IUpgradeableTransmitter.java index 728f03e666e..553715ba4e8 100644 --- a/src/main/java/mekanism/common/content/network/transmitter/IUpgradeableTransmitter.java +++ b/src/main/java/mekanism/common/content/network/transmitter/IUpgradeableTransmitter.java @@ -1,6 +1,5 @@ package mekanism.common.content.network.transmitter; -import mekanism.api.tier.AlloyTier; import mekanism.api.tier.ITier; import mekanism.common.upgrade.transmitter.TransmitterUpgradeData; import org.jetbrains.annotations.NotNull; @@ -15,7 +14,7 @@ public interface IUpgradeableTransmitter { ITier getTier(); - default boolean canUpgrade(AlloyTier alloyTier) { + default boolean canUpgrade(TIER alloyTier) { return alloyTier.getBaseTier().ordinal() == getTier().getBaseTier().ordinal() + 1; } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/tile/transmitter/TileEntityTransmitter.java b/src/main/java/mekanism/common/tile/transmitter/TileEntityTransmitter.java index 50a17dc8863..975eafff2cc 100644 --- a/src/main/java/mekanism/common/tile/transmitter/TileEntityTransmitter.java +++ b/src/main/java/mekanism/common/tile/transmitter/TileEntityTransmitter.java @@ -7,8 +7,8 @@ import mekanism.api.IConfigurable; import mekanism.api.providers.IBlockProvider; import mekanism.api.text.EnumColor; -import mekanism.api.tier.AlloyTier; import mekanism.api.tier.BaseTier; +import mekanism.api.tier.ITier; import mekanism.client.model.data.TransmitterModelData; import mekanism.common.Mekanism; import mekanism.common.MekanismLang; @@ -322,7 +322,7 @@ protected TransmitterModelData initModelData() { } @Override - public void onAlloyInteraction(Player player, ItemStack stack, @NotNull AlloyTier tier) { + public void onAlloyInteraction(Player player, ItemStack stack, @NotNull TIER tier) { if (getLevel() != null && getTransmitter().hasTransmitterNetwork()) { DynamicNetwork transmitterNetwork = getTransmitter().getTransmitterNetwork(); List> list = new ArrayList<>(transmitterNetwork.getTransmitters());