diff --git a/src/main/java/io/github/cottonmc/energy/api/ElectricalEnergyType.java b/src/main/java/io/github/cottonmc/energy/api/ElectricalEnergyType.java index 9e9fac8..f2e6a75 100644 --- a/src/main/java/io/github/cottonmc/energy/api/ElectricalEnergyType.java +++ b/src/main/java/io/github/cottonmc/energy/api/ElectricalEnergyType.java @@ -1,6 +1,6 @@ package io.github.cottonmc.energy.api; -import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.text.TranslatableText; public class ElectricalEnergyType implements EnergyType { @@ -16,22 +16,22 @@ public int getMaximumTransferSize() { } @Override - public TranslatableComponent getDisplayAmount(int amount) { + public TranslatableText getDisplayAmount(int amount) { //TODO: handle KWU, MWU, and GWU if (amount < 1000) { // x < 1M - return new TranslatableComponent("info.cotton.energy.electrical.amount", amount); + return new TranslatableText("info.cotton.energy.electrical.amount", amount); } else if (amount < 1_000_000) { // 1K < x < 1M float tAmount = amount / 1000; - return new TranslatableComponent("info.cotton.energy.electrical.amount.k", tAmount); + return new TranslatableText("info.cotton.energy.electrical.amount.k", tAmount); } else if (amount < 1_000_000_000) { // 1M < x < 1G float tAmount = amount / 1_000_1000; - return new TranslatableComponent("info.cotton.energy.electrical.amount.m", tAmount); + return new TranslatableText("info.cotton.energy.electrical.amount.m", tAmount); } else { // 1G < x float tAmount = amount / 1_000_000_000; - return new TranslatableComponent("info.cotton.energy.electrical.amount.g", tAmount); + return new TranslatableText("info.cotton.energy.electrical.amount.g", tAmount); } } diff --git a/src/main/java/io/github/cottonmc/energy/api/EnergyType.java b/src/main/java/io/github/cottonmc/energy/api/EnergyType.java index 6cde873..f04dea1 100644 --- a/src/main/java/io/github/cottonmc/energy/api/EnergyType.java +++ b/src/main/java/io/github/cottonmc/energy/api/EnergyType.java @@ -1,6 +1,6 @@ package io.github.cottonmc.energy.api; -import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.text.TranslatableText; import java.util.Optional; @@ -14,9 +14,9 @@ public interface EnergyType { /** * Gets human-readable text representing an energy value of this type. * @param amount the total aggregate number of energy units being represented. - * @return a TextComponent representing this quantity and its relevant units, such as "300 WU". + * @return a TextText representing this quantity and its relevant units, such as "300 WU". */ - TranslatableComponent getDisplayAmount(int amount); + TranslatableText getDisplayAmount(int amount); /** * Returns true if this EnergyType knows how to convert energy to and from the specified other