|
@@ -1,13 +1,31 @@
|
|
|
package xyz.tbvns.rogue_block.Upgrades;
|
|
|
|
|
|
+import net.kyori.adventure.text.Component;
|
|
|
+import net.kyori.adventure.text.TextComponent;
|
|
|
+import net.kyori.adventure.text.format.Style;
|
|
|
+import net.kyori.adventure.text.format.TextColor;
|
|
|
+import net.kyori.adventure.text.format.TextDecoration;
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
import net.minecraft.item.Items;
|
|
|
+import net.minecraft.text.OrderedText;
|
|
|
+import net.minecraft.text.Text;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
|
|
|
public interface Upgrade {
|
|
|
default Class getParent() {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ default String getName() {
|
|
|
+ return "unnamed upgrade";
|
|
|
+ }
|
|
|
+
|
|
|
+ default String getDesc() {
|
|
|
+ return "no description";
|
|
|
+ }
|
|
|
+
|
|
|
default int getCost() {
|
|
|
return 0;
|
|
|
}
|
|
@@ -27,4 +45,50 @@ public interface Upgrade {
|
|
|
default UpgradeRarity getRarity() {
|
|
|
return UpgradeRarity.common;
|
|
|
}
|
|
|
+
|
|
|
+ default Component generateTooltip() {
|
|
|
+ Component component;
|
|
|
+
|
|
|
+ switch (getRarity()) {
|
|
|
+ case rare -> component = Component.text(getName(),
|
|
|
+ TextColor.color(255, 59, 208),
|
|
|
+ TextDecoration.BOLD);
|
|
|
+ case medium -> component = Component.text(getName(),
|
|
|
+ TextColor.color(255, 211, 0),
|
|
|
+ TextDecoration.BOLD);
|
|
|
+ default -> component = Component.text(getName(),
|
|
|
+ TextColor.color(13, 255, 0),
|
|
|
+ TextDecoration.BOLD);
|
|
|
+ }
|
|
|
+
|
|
|
+ component =
|
|
|
+ component.appendNewline()
|
|
|
+ .append(Component.text(getDesc())
|
|
|
+ .color(TextColor.color(136, 133, 136))
|
|
|
+ .decoration(TextDecoration.UNDERLINED, false)
|
|
|
+ .decoration(TextDecoration.BOLD, false)
|
|
|
+ )
|
|
|
+ .appendNewline()
|
|
|
+ .append(Component.text("Type: ", TextColor.color(255, 77, 0)))
|
|
|
+ .append(Component.text(
|
|
|
+ getType().toString(),
|
|
|
+ TextColor.color(255, 184, 0),
|
|
|
+ TextDecoration.BOLD,
|
|
|
+ TextDecoration.UNDERLINED)
|
|
|
+ )
|
|
|
+ .decoration(TextDecoration.UNDERLINED, false)
|
|
|
+ .appendNewline()
|
|
|
+ .append(Component.text("Price: ",
|
|
|
+ TextColor.color(94, 229, 83),
|
|
|
+ TextDecoration.BOLD)
|
|
|
+ )
|
|
|
+ .append(Component.text(getCost(),
|
|
|
+ TextColor.color(0, 238, 255),
|
|
|
+ TextDecoration.BOLD,
|
|
|
+ TextDecoration.UNDERLINED
|
|
|
+ )
|
|
|
+ );
|
|
|
+
|
|
|
+ return component;
|
|
|
+ }
|
|
|
}
|