aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/mayaqq/ygasi/gui/DruidryGui.java
diff options
context:
space:
mode:
authorMaximusbarcz <maxim.baranek@gmail.com>2022-12-23 11:29:31 +0100
committerMaximusbarcz <maxim.baranek@gmail.com>2022-12-23 11:29:31 +0100
commite5bc4dae41d2d3e04440a4fe02793d4084427437 (patch)
tree739ad7936b322f506b4a845cada07372ac40576a /src/main/java/dev/mayaqq/ygasi/gui/DruidryGui.java
parentca23a48ec1efa4ebcc578c8dc876a0e8794a885b (diff)
downloadygasi-e5bc4dae41d2d3e04440a4fe02793d4084427437.tar.gz
ygasi-e5bc4dae41d2d3e04440a4fe02793d4084427437.tar.bz2
ygasi-e5bc4dae41d2d3e04440a4fe02793d4084427437.zip
Added DataGen to the build.gradle (not done yet)
Diffstat (limited to 'src/main/java/dev/mayaqq/ygasi/gui/DruidryGui.java')
-rw-r--r--src/main/java/dev/mayaqq/ygasi/gui/DruidryGui.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/main/java/dev/mayaqq/ygasi/gui/DruidryGui.java b/src/main/java/dev/mayaqq/ygasi/gui/DruidryGui.java
new file mode 100644
index 0000000..4054ead
--- /dev/null
+++ b/src/main/java/dev/mayaqq/ygasi/gui/DruidryGui.java
@@ -0,0 +1,41 @@
+package dev.mayaqq.ygasi.gui;
+
+import dev.mayaqq.ygasi.registry.PlayerDataRegistry;
+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.stat.Stats;
+import net.minecraft.text.Text;
+
+import java.util.UUID;
+
+import static dev.mayaqq.ygasi.registry.StatRegistry.SKILL_POINTS;
+
+public class DruidryGui {
+ public static void gui(ServerPlayerEntity player) {
+ try {
+ UUID playerUUID = player.getUuid();
+ PlayerDataRegistry.load(playerUUID);
+ if (PlayerDataRegistry.PLAYERDATA.branches.get("druidry") == null || !PlayerDataRegistry.PLAYERDATA.branches.get("druidry")) {
+ 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) {};
+
+ gui.setTitle(Text.of( "§a§lDruidry " + "§3Skill Points: " + player.getStatHandler().getStat(Stats.CUSTOM.getOrCreateStat(SKILL_POINTS))));
+
+ for (int x = 0; x <= 53; x++) {
+ gui.setSlot(x, new GuiElementBuilder()
+ .setItem(Items.GRAY_STAINED_GLASS_PANE)
+ .setName(Text.of(" "))
+ );
+ }
+ gui.open();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}