diff options
author | Maximusbarcz <maxim.baranek@gmail.com> | 2022-12-23 22:31:38 +0100 |
---|---|---|
committer | Maximusbarcz <maxim.baranek@gmail.com> | 2022-12-23 22:31:38 +0100 |
commit | f7ca47ba8132addd94928aa8615448c47a6b3d7b (patch) | |
tree | a46151060500ffba77630e64817a4bfb842268e0 /src/main/java/dev/mayaqq/ygasi/gui/MercenaryGui.java | |
parent | e5bc4dae41d2d3e04440a4fe02793d4084427437 (diff) | |
download | ygasi-f7ca47ba8132addd94928aa8615448c47a6b3d7b.tar.gz ygasi-f7ca47ba8132addd94928aa8615448c47a6b3d7b.tar.bz2 ygasi-f7ca47ba8132addd94928aa8615448c47a6b3d7b.zip |
Enormous amounts of trolling :tomfoolery:, not only that I fixed basically everything and switched the entire system to advancements, it now also has a cool custom book that you can open and stuff! Only issue I'm currently facing is that you get a skill point when you get the advancement for opening the gui and clicking stuff... right not that big of an issue but when I add 2 billion advancements its gonna hurt a bit. Love, Mayaqq
Diffstat (limited to 'src/main/java/dev/mayaqq/ygasi/gui/MercenaryGui.java')
-rw-r--r-- | src/main/java/dev/mayaqq/ygasi/gui/MercenaryGui.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/main/java/dev/mayaqq/ygasi/gui/MercenaryGui.java b/src/main/java/dev/mayaqq/ygasi/gui/MercenaryGui.java index 5c95eb2..c3e89b1 100644 --- a/src/main/java/dev/mayaqq/ygasi/gui/MercenaryGui.java +++ b/src/main/java/dev/mayaqq/ygasi/gui/MercenaryGui.java @@ -1,28 +1,26 @@ package dev.mayaqq.ygasi.gui; -import dev.mayaqq.ygasi.registry.PlayerDataRegistry; +import dev.mayaqq.ygasi.util.GetAdvancementProgress; import eu.pb4.sgui.api.elements.GuiElementBuilder; import eu.pb4.sgui.api.gui.SimpleGui; import net.minecraft.item.Items; import net.minecraft.screen.ScreenHandlerType; import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvents; import net.minecraft.stat.Stats; import net.minecraft.text.Text; -import java.util.UUID; - import static dev.mayaqq.ygasi.registry.StatRegistry.SKILL_POINTS; public class MercenaryGui { public static void gui(ServerPlayerEntity player) { try { - UUID playerUUID = player.getUuid(); - PlayerDataRegistry.load(playerUUID); - if (PlayerDataRegistry.PLAYERDATA.branches.get("mercenary") == null || !PlayerDataRegistry.PLAYERDATA.branches.get("mercenary")) { + if (!GetAdvancementProgress.get(player, "mercenary")) { player.sendMessage(Text.of("§cYou have not unlocked this branch yet!"), false); BranchGui.gui(player); } else { - SimpleGui gui = new SimpleGui(ScreenHandlerType.GENERIC_9X6, player, false) {}; + SkillGui gui = new SkillGui(ScreenHandlerType.GENERIC_9X6, player, false) {}; gui.setTitle(Text.of( "§c§lMercenary " + "§3Skill Points: " + player.getStatHandler().getStat(Stats.CUSTOM.getOrCreateStat(SKILL_POINTS)))); @@ -38,4 +36,4 @@ public class MercenaryGui { e.printStackTrace(); } } -} +}
\ No newline at end of file |