aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/mayaqq/ygasi/gui/common/SkillGui.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/dev/mayaqq/ygasi/gui/common/SkillGui.java')
-rw-r--r--src/main/java/dev/mayaqq/ygasi/gui/common/SkillGui.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/java/dev/mayaqq/ygasi/gui/common/SkillGui.java b/src/main/java/dev/mayaqq/ygasi/gui/common/SkillGui.java
new file mode 100644
index 0000000..87cc0c8
--- /dev/null
+++ b/src/main/java/dev/mayaqq/ygasi/gui/common/SkillGui.java
@@ -0,0 +1,26 @@
+package dev.mayaqq.ygasi.gui.common;
+
+import eu.pb4.sgui.api.gui.SimpleGui;
+import net.minecraft.screen.ScreenHandlerType;
+import net.minecraft.server.network.ServerPlayerEntity;
+import net.minecraft.sound.SoundCategory;
+import net.minecraft.sound.SoundEvents;
+
+public class SkillGui extends SimpleGui {
+ // I'm doing the onOpen and onClose methods here because I want to play a sound when the gui is opened and closed for all of the guis so I don't have to do it in every gui class
+ public SkillGui(ScreenHandlerType<?> type, ServerPlayerEntity player, boolean manipulatePlayerSlots) {
+ super(type, player, manipulatePlayerSlots);
+ }
+
+ @Override
+ public void onOpen() {
+ this.player.playSound(SoundEvents.ITEM_BOOK_PAGE_TURN, SoundCategory.PLAYERS, 1.0F, 1.0F);
+ super.onOpen();
+ }
+
+ @Override
+ public void onClose() {
+ player.playSound(SoundEvents.ITEM_BOOK_PAGE_TURN, SoundCategory.PLAYERS, 1.0F, 1.0F);
+ super.onClose();
+ }
+} \ No newline at end of file