aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/mayaqq/ygasi/gui/MercenaryGui.java
diff options
context:
space:
mode:
authorMaximusbarcz <maxim.baranek@gmail.com>2023-01-02 18:12:41 +0100
committerMaximusbarcz <maxim.baranek@gmail.com>2023-01-02 18:12:41 +0100
commit255cbe744535466951b8f1699202763520f1fc95 (patch)
treeed97f5fd15ce1a539cfcf2150a23c269e6a2acd4 /src/main/java/dev/mayaqq/ygasi/gui/MercenaryGui.java
parent730ba6e636d952e9730e3b9bbc035c894dfff25b (diff)
downloadygasi-255cbe744535466951b8f1699202763520f1fc95.tar.gz
ygasi-255cbe744535466951b8f1699202763520f1fc95.tar.bz2
ygasi-255cbe744535466951b8f1699202763520f1fc95.zip
Added some nifty features (like a reset gui and a reset all advancements util)
Diffstat (limited to 'src/main/java/dev/mayaqq/ygasi/gui/MercenaryGui.java')
-rw-r--r--src/main/java/dev/mayaqq/ygasi/gui/MercenaryGui.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/dev/mayaqq/ygasi/gui/MercenaryGui.java b/src/main/java/dev/mayaqq/ygasi/gui/MercenaryGui.java
index 79cc08d..ac722b6 100644
--- a/src/main/java/dev/mayaqq/ygasi/gui/MercenaryGui.java
+++ b/src/main/java/dev/mayaqq/ygasi/gui/MercenaryGui.java
@@ -1,5 +1,6 @@
package dev.mayaqq.ygasi.gui;
+import dev.mayaqq.ygasi.registry.ConfigRegistry;
import dev.mayaqq.ygasi.util.YgasiUtils;
import eu.pb4.sgui.api.elements.GuiElementBuilder;
import net.minecraft.item.Items;
@@ -13,7 +14,7 @@ import static dev.mayaqq.ygasi.registry.StatRegistry.SKILL_POINTS;
public class MercenaryGui {
public static void gui(ServerPlayerEntity player) {
try {
- if (!YgasiUtils.getAdvancementProgress(player, "mercenary")) {
+ if (!YgasiUtils.getAdvancementProgress(player, "minecraft", "ygasi/mercenary")) {
player.sendMessage(Text.of("§cYou have not unlocked this branch yet!"), false);
BranchGui.gui(player);
} else {
@@ -35,6 +36,15 @@ public class MercenaryGui {
.addLoreLine(Text.of("§3Skill Points: " + player.getStatHandler().getStat(Stats.CUSTOM.getOrCreateStat(SKILL_POINTS))))
);
+ if (!YgasiUtils.getAdvancementProgress(player, "minecraft", "ygasi/offence1")) {
+ gui.setSlot(10, new GuiElementBuilder()
+ .setItem(Items.DIAMOND_SWORD)
+ .setName(Text.translatable("gui.ygasi.mercenary.offence1"))
+ .addLoreLine(Text.translatable("gui.ygasi.mercenary.offence1.lore"))
+ .addLoreLine(Text.translatable("gui.ygasi.mercenary.offence1.lore.cost".replace("%cost%", ConfigRegistry.CONFIG.offence1Cost + "")))
+ );
+ }
+
gui.open();
}
} catch (Exception e) {