3
0
Mirror von https://github.com/TheSilentPro/HeadDB.git synchronisiert 2024-12-28 03:40:06 +01:00
Dieser Commit ist enthalten in:
Silent 2022-02-16 23:32:12 +01:00
Ursprung b3c06013de
Commit c0f1cb28c0
4 geänderte Dateien mit 6 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -26,7 +26,7 @@ public class Head {
private int id; private int id;
private List<String> tags; private List<String> tags;
private ItemStack menuItem; private ItemStack menuItem;
private ItemStack itemStack; //Unimplemented private ItemStack itemStack;
public Head() {} public Head() {}
@ -70,6 +70,7 @@ public class Head {
return menuItem; return menuItem;
} }
/* For some reason this causes issues with some heads in categories not having lore
public ItemStack getItemStack() { public ItemStack getItemStack() {
if (itemStack == null) { if (itemStack == null) {
itemStack = menuItem; itemStack = menuItem;
@ -85,6 +86,7 @@ public class Head {
return itemStack; return itemStack;
} }
*/
public String getName() { public String getName() {
return name; return name;

Datei anzeigen

@ -122,7 +122,7 @@ public class CommandHeadDB implements CommandExecutor {
Utils.sendMessage(sender, "&cCould not find head with id &e" + id); Utils.sendMessage(sender, "&cCould not find head with id &e" + id);
return true; return true;
} }
ItemStack item = head.getItemStack(); ItemStack item = head.getMenuItem();
item.setAmount(amount); item.setAmount(amount);
target.getInventory().addItem(item); target.getInventory().addItem(item);
Utils.sendMessage(sender, "&7Gave &6" + target.getName() + " &ex" + amount + " " + head.getName()); Utils.sendMessage(sender, "&7Gave &6" + target.getName() + " &ex" + amount + " " + head.getName());

Datei anzeigen

@ -344,7 +344,7 @@ public class InventoryUtils {
PlayerHeadPurchaseEvent event = new PlayerHeadPurchaseEvent(player, head, getCategoryCost(player, category)); PlayerHeadPurchaseEvent event = new PlayerHeadPurchaseEvent(player, head, getCategoryCost(player, category));
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {
ItemStack item = head.getItemStack(); ItemStack item = head.getMenuItem();
item.setAmount(amount); item.setAmount(amount);
player.getInventory().addItem(item); player.getInventory().addItem(item);
} }

Datei anzeigen

@ -10,10 +10,4 @@ menu:
tagSearch: "&c&lHeadDB &8- &eTag Search: %search%" tagSearch: "&c&lHeadDB &8- &eTag Search: %search%"
search: "&c&lHeadDB &8- &eSearch: %search%" search: "&c&lHeadDB &8- &eSearch: %search%"
favorites: "&c&lHeadDB &8- &eFavorites: %player%" favorites: "&c&lHeadDB &8- &eFavorites: %player%"
local: "&c&lHeadDB &8- &aLocal Heads &7(%size%)" local: "&c&lHeadDB &8- &aLocal Heads &7(%size%)"
# Head item given to players
head:
name: "%name%"
lore:
- ''