Skip to content

Commit

Permalink
Adapt the "onAlloyIteraction" and "canUpgrade" methods to ITier
Browse files Browse the repository at this point in the history
  • Loading branch information
lostmyself8 committed Nov 9, 2024
1 parent 3fea841 commit c5b894d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/api/java/mekanism/api/IAlloyInteraction.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
<TIER extends ITier> void onAlloyInteraction(Player player, ItemStack stack, @NotNull TIER tier);
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -15,7 +14,7 @@ public interface IUpgradeableTransmitter<DATA extends TransmitterUpgradeData> {

ITier getTier();

default boolean canUpgrade(AlloyTier alloyTier) {
default <TIER extends ITier> boolean canUpgrade(TIER alloyTier) {
return alloyTier.getBaseTier().ordinal() == getTier().getBaseTier().ordinal() + 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -322,7 +322,7 @@ protected TransmitterModelData initModelData() {
}

@Override
public void onAlloyInteraction(Player player, ItemStack stack, @NotNull AlloyTier tier) {
public <TIER extends ITier> void onAlloyInteraction(Player player, ItemStack stack, @NotNull TIER tier) {
if (getLevel() != null && getTransmitter().hasTransmitterNetwork()) {
DynamicNetwork<?, ?, ?> transmitterNetwork = getTransmitter().getTransmitterNetwork();
List<Transmitter<?, ?, ?>> list = new ArrayList<>(transmitterNetwork.getTransmitters());
Expand Down

0 comments on commit c5b894d

Please sign in to comment.