Update GUI_Listener.java

This commit is contained in:
JaTiTV 2022-01-03 18:11:51 +01:00
parent b80eaa08be
commit 91f8d744cc

View File

@ -19,6 +19,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
@ -145,7 +146,7 @@ public class GUI_Listener implements Listener {
} else } else
{ {
*/ */
if (e.isLeftClick()) { if (e.getClick() == ClickType.LEFT) {
if (slot.ConfigOptionPremat.equals("String")) { if (slot.ConfigOptionPremat.equals("String")) {
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigStringValueLeft); yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigStringValueLeft);
} else if (slot.ConfigOptionPremat.equals("Boolean")) { } else if (slot.ConfigOptionPremat.equals("Boolean")) {
@ -160,7 +161,7 @@ public class GUI_Listener implements Listener {
player.sendMessage("§cCheck the Option §6SetConfig/Option/Premat"); //todo player.sendMessage("§cCheck the Option §6SetConfig/Option/Premat"); //todo
} }
} }
if (e.isRightClick()) { if (e.getClick() == ClickType.RIGHT) {
if (slot.ConfigOptionPremat.equals("String")) { if (slot.ConfigOptionPremat.equals("String")) {
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigStringValueRight); yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigStringValueRight);
} else if (slot.ConfigOptionPremat.equals("Boolean")) { } else if (slot.ConfigOptionPremat.equals("Boolean")) {