2 Commits

Author SHA1 Message Date
91f8d744cc Update GUI_Listener.java 2022-01-03 18:11:51 +01:00
b80eaa08be Update OpenGUI.java 2022-01-01 17:48:42 +01:00
2 changed files with 6 additions and 9 deletions

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")) {

View File

@@ -90,10 +90,10 @@ public class OpenGUI {
send.error(plugin, "Playerheads are only available from version 1.13!"); send.error(plugin, "Playerheads are only available from version 1.13!");
send.console(prefix + " §bGUI: §6" + Replace.replace(prefix, gui.GUI_Name).toString() + " §bSlot: §6" + (slot.Slot + 1) + " §7- " + Replace.replace(prefix, slot.Name)); send.console(prefix + " §bGUI: §6" + Replace.replace(prefix, gui.GUI_Name).toString() + " §bSlot: §6" + (slot.Slot + 1) + " §7- " + Replace.replace(prefix, slot.Name));
} else { } else {
if (slot.Base64_Enable) {
ItemStack item = ItemVersion.getHeadIS(); ItemStack item = ItemVersion.getHeadIS();
SkullMeta itemMeta = (SkullMeta) item.getItemMeta(); SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
if (slot.Base64_Enable) {
if (Main.PaPi) { if (Main.PaPi) {
itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName()))); itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName())));
itemMeta.setLore(Replace.replacePrice(prefix, player, slot.Lore, slot.Price + " " + SelectConfig.Currency)); itemMeta.setLore(Replace.replacePrice(prefix, player, slot.Lore, slot.Price + " " + SelectConfig.Currency));
@@ -120,8 +120,6 @@ public class OpenGUI {
inventory.setItem(slot.Slot, item); inventory.setItem(slot.Slot, item);
} else { } else {
if (slot.PlayerWhoHasOpenedTheGUI) { if (slot.PlayerWhoHasOpenedTheGUI) {
ItemStack item = ItemVersion.getHeadIS();
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
if (Main.PaPi) { if (Main.PaPi) {
itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName()))); itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName())));
itemMeta.setLore(Replace.replacePrice(prefix, player, slot.Lore, slot.Price + " " + SelectConfig.Currency)); itemMeta.setLore(Replace.replacePrice(prefix, player, slot.Lore, slot.Price + " " + SelectConfig.Currency));
@@ -138,8 +136,6 @@ public class OpenGUI {
item.setAmount(am); item.setAmount(am);
inventory.setItem(slot.Slot, item); inventory.setItem(slot.Slot, item);
} else { } else {
ItemStack item = ItemVersion.getHeadIS();
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
if (Main.PaPi) { if (Main.PaPi) {
itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName()))); itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName())));
itemMeta.setLore(Replace.replacePrice(prefix, player, slot.Lore, slot.Price + " " + SelectConfig.Currency)); itemMeta.setLore(Replace.replacePrice(prefix, player, slot.Lore, slot.Price + " " + SelectConfig.Currency));