fellkesz crystal kit

This commit is contained in:
2025-03-06 23:54:55 +01:00
parent 757cdc86b6
commit d3adf205d4
4 changed files with 81 additions and 55 deletions

View File

@@ -142,11 +142,11 @@ public class EditKitCommand implements CommandExecutor, TabCompleter {
player.openInventory(gui); player.openInventory(gui);
break; break;
case "boxcart": case "cart":
inv.clear(); inv.clear();
inv.setContents(kitManager.getBoxCartKit(player).getContents()); inv.setContents(kitManager.getCartKit(player).getContents());
infoMeta.setDisplayName("§fBoxCart Kit"); infoMeta.setDisplayName("§fCart Kit");
infoItem.setItemMeta(infoMeta); infoItem.setItemMeta(infoMeta);
gui.setItem(3, infoItem); gui.setItem(3, infoItem);
gui.setItem(4, infoItem); gui.setItem(4, infoItem);
@@ -227,7 +227,7 @@ public class EditKitCommand implements CommandExecutor, TabCompleter {
@Override @Override
public @Nullable List<String> onTabComplete(@NotNull CommandSender cmds, @NotNull Command command, @NotNull String s, @NotNull String[] args) { public @Nullable List<String> onTabComplete(@NotNull CommandSender cmds, @NotNull Command command, @NotNull String s, @NotNull String[] args) {
if (args.length == 1) { if (args.length == 1) {
return List.of("sword", "uhc", "boxcart", "mace", "axe", "diasmp"); return List.of("sword", "uhc", "cart", "mace", "axe", "diasmp");
} }
return List.of(); return List.of();
} }

View File

@@ -113,12 +113,12 @@ public class TpToFfaCommand implements CommandExecutor, TabCompleter {
} }
} }
break; break;
case "boxcart": case "cart":
if (args.length > 1) { if (args.length > 1) {
Player target = Bukkit.getPlayer(args[1]); Player target = Bukkit.getPlayer(args[1]);
if (target instanceof Player player) { if (target instanceof Player player) {
player.getInventory().clear(); player.getInventory().clear();
player.getInventory().setContents(kitManager.getBoxCartKit(player).getContents()); player.getInventory().setContents(kitManager.getCartKit(player).getContents());
World world = Bukkit.getWorld("world"); World world = Bukkit.getWorld("world");
double x = -1000.5; double x = -1000.5;
@@ -220,7 +220,7 @@ public class TpToFfaCommand implements CommandExecutor, TabCompleter {
@Override @Override
public @Nullable List<String> onTabComplete(@NotNull CommandSender cmds, @NotNull Command command, @NotNull String s, @NotNull String[] args) { public @Nullable List<String> onTabComplete(@NotNull CommandSender cmds, @NotNull Command command, @NotNull String s, @NotNull String[] args) {
if (args.length == 1) { if (args.length == 1) {
return List.of("sword", "uhc", "boxcart", "mace", "axe", "diamp"); return List.of("sword", "uhc", "cart", "mace", "axe", "diamp");
} else if (args.length == 2) { } else if (args.length == 2) {
return null; return null;
} }

View File

@@ -57,7 +57,7 @@ public class KitListener implements Listener {
plugin.saveConfig(); plugin.saveConfig();
plugin.reloadConfig(); plugin.reloadConfig();
} }
if (plugin.getConfig().getString("kits.boxcart." + player.getUniqueId()) == null) { if (plugin.getConfig().getString("kits.cart." + player.getUniqueId()) == null) {
Map<String, Object> kit = new HashMap<>(); Map<String, Object> kit = new HashMap<>();
int[] strength = new int[]{16, 25, 34}; int[] strength = new int[]{16, 25, 34};
int[] speed = new int[]{17, 26, 35}; int[] speed = new int[]{17, 26, 35};
@@ -83,7 +83,7 @@ public class KitListener implements Listener {
kit.put("shulker", 27); kit.put("shulker", 27);
kit.put("flintandsteel", 28); kit.put("flintandsteel", 28);
kit.put("totem", 40); kit.put("totem", 40);
plugin.getConfig().set("kits.boxcart." + player.getUniqueId(), kit); plugin.getConfig().set("kits.cart." + player.getUniqueId(), kit);
plugin.saveConfig(); plugin.saveConfig();
plugin.reloadConfig(); plugin.reloadConfig();
} }
@@ -245,31 +245,31 @@ public class KitListener implements Listener {
if (item != null) { if (item != null) {
if (item.getType() == Material.NETHERITE_AXE) { if (item.getType() == Material.NETHERITE_AXE) {
plugin.getConfig().set("kits.boxcart." + player.getUniqueId() + ".axe", i); plugin.getConfig().set("kits.cart." + player.getUniqueId() + ".axe", i);
} else if (item.getType() == Material.NETHERITE_SWORD) { } else if (item.getType() == Material.NETHERITE_SWORD) {
plugin.getConfig().set("kits.boxcart." + player.getUniqueId() + ".sword", i); plugin.getConfig().set("kits.cart." + player.getUniqueId() + ".sword", i);
} else if (item.getType() == Material.ENDER_PEARL) { } else if (item.getType() == Material.ENDER_PEARL) {
boxcartenderpearlSlots.add(i); boxcartenderpearlSlots.add(i);
} else if (item.getType() == Material.RAIL) { } else if (item.getType() == Material.RAIL) {
plugin.getConfig().set("kits.boxcart." + player.getUniqueId() + ".rail", i); plugin.getConfig().set("kits.cart." + player.getUniqueId() + ".rail", i);
} else if (item.getType() == Material.TNT_MINECART) { } else if (item.getType() == Material.TNT_MINECART) {
boxcartcartSlots.add(i); boxcartcartSlots.add(i);
} else if (item.getType() == Material.GOLDEN_APPLE) { } else if (item.getType() == Material.GOLDEN_APPLE) {
plugin.getConfig().set("kits.boxcart." + player.getUniqueId() + ".goldenapple", i); plugin.getConfig().set("kits.cart." + player.getUniqueId() + ".goldenapple", i);
} else if (item.getType() == Material.COBWEB) { } else if (item.getType() == Material.COBWEB) {
plugin.getConfig().set("kits.boxcart." + player.getUniqueId() + ".cobweb", i); plugin.getConfig().set("kits.cart." + player.getUniqueId() + ".cobweb", i);
} else if (item.getType() == Material.SHIELD) { } else if (item.getType() == Material.SHIELD) {
plugin.getConfig().set("kits.boxcart." + player.getUniqueId() + ".shield", i); plugin.getConfig().set("kits.cart." + player.getUniqueId() + ".shield", i);
} else if (item.getType() == Material.BOW) { } else if (item.getType() == Material.BOW) {
plugin.getConfig().set("kits.boxcart." + player.getUniqueId() + ".bow", i); plugin.getConfig().set("kits.cart." + player.getUniqueId() + ".bow", i);
} else if (item.getType() == Material.ARROW) { } else if (item.getType() == Material.ARROW) {
plugin.getConfig().set("kits.boxcart." + player.getUniqueId() + ".arrow", i); plugin.getConfig().set("kits.cart." + player.getUniqueId() + ".arrow", i);
} else if (item.getType() == Material.CHERRY_LOG) { } else if (item.getType() == Material.CHERRY_LOG) {
plugin.getConfig().set("kits.boxcart." + player.getUniqueId() + ".cherrylog", i); plugin.getConfig().set("kits.cart." + player.getUniqueId() + ".cherrylog", i);
} else if (item.getType() == Material.CROSSBOW) { } else if (item.getType() == Material.CROSSBOW) {
plugin.getConfig().set("kits.boxcart." + player.getUniqueId() + ".crossbow", i); plugin.getConfig().set("kits.cart." + player.getUniqueId() + ".crossbow", i);
} else if (item.getType() == Material.FLINT_AND_STEEL) { } else if (item.getType() == Material.FLINT_AND_STEEL) {
plugin.getConfig().set("kits.boxcart." + player.getUniqueId() + ".flintandsteel", i); plugin.getConfig().set("kits.cart." + player.getUniqueId() + ".flintandsteel", i);
} else if (item.getType() == Material.SPLASH_POTION) { } else if (item.getType() == Material.SPLASH_POTION) {
if (item.getItemMeta().getDisplayName().equals("§fSplash Potion of Strength")) { if (item.getItemMeta().getDisplayName().equals("§fSplash Potion of Strength")) {
boxcartstrenghtSlots.add(i); boxcartstrenghtSlots.add(i);
@@ -279,17 +279,17 @@ public class KitListener implements Listener {
boxcartfireresistanceSlots.add(i); boxcartfireresistanceSlots.add(i);
} }
} else if (item.getType() == Material.RED_SHULKER_BOX) { } else if (item.getType() == Material.RED_SHULKER_BOX) {
plugin.getConfig().set("kits.boxcart." + player.getUniqueId() + ".shulker", i); plugin.getConfig().set("kits.cart." + player.getUniqueId() + ".shulker", i);
} else if (item.getType() == Material.NETHERITE_PICKAXE) { } else if (item.getType() == Material.NETHERITE_PICKAXE) {
plugin.getConfig().set("kits.boxcart." + player.getUniqueId() + ".pickaxe", i); plugin.getConfig().set("kits.cart." + player.getUniqueId() + ".pickaxe", i);
} }
} }
} }
plugin.getConfig().set("kits.boxcart." + player.getUniqueId() + ".enderpearl", boxcartenderpearlSlots); plugin.getConfig().set("kits.cart." + player.getUniqueId() + ".enderpearl", boxcartenderpearlSlots);
plugin.getConfig().set("kits.boxcart." + player.getUniqueId() + ".cart", boxcartcartSlots); plugin.getConfig().set("kits.cart." + player.getUniqueId() + ".cart", boxcartcartSlots);
plugin.getConfig().set("kits.boxcart." + player.getUniqueId() + ".strength", boxcartstrenghtSlots); plugin.getConfig().set("kits.cart." + player.getUniqueId() + ".strength", boxcartstrenghtSlots);
plugin.getConfig().set("kits.boxcart." + player.getUniqueId() + ".speed", boxcartspeedSlots); plugin.getConfig().set("kits.cart." + player.getUniqueId() + ".speed", boxcartspeedSlots);
plugin.getConfig().set("kits.boxcart." + player.getUniqueId() + ".fireresistance", boxcartfireresistanceSlots); plugin.getConfig().set("kits.cart." + player.getUniqueId() + ".fireresistance", boxcartfireresistanceSlots);
} else if (gui.getItem(13).getItemMeta().getDisplayName().equals("§fMace Kit")) { } else if (gui.getItem(13).getItemMeta().getDisplayName().equals("§fMace Kit")) {
macetotemSlots = new ArrayList<>(); macetotemSlots = new ArrayList<>();
maceenderpearlSlots = new ArrayList<>(); maceenderpearlSlots = new ArrayList<>();

View File

@@ -56,7 +56,7 @@ public class Kits {
return Collections.singletonList(-1); return Collections.singletonList(-1);
} }
public Inventory getSwordKit(Player player) { public PlayerInventory getSwordKit(Player player) {
PlayerInventory inv = player.getInventory(); PlayerInventory inv = player.getInventory();
@@ -70,7 +70,7 @@ public class Kits {
chestplate.addEnchantment(Enchantment.PROTECTION, 3); chestplate.addEnchantment(Enchantment.PROTECTION, 3);
leggings.addEnchantment(Enchantment.PROTECTION, 3); leggings.addEnchantment(Enchantment.PROTECTION, 3);
boots.addEnchantment(Enchantment.PROTECTION, 3); boots.addEnchantment(Enchantment.PROTECTION, 3);
sword.addEnchantment(Enchantment.UNBREAKING, 3); sword.addEnchantment(Enchantment.SWEEPING_EDGE, 3);
inv.setArmorContents(new ItemStack[]{boots, leggings, chestplate, helmet}); inv.setArmorContents(new ItemStack[]{boots, leggings, chestplate, helmet});
inv.setItem(getItemSlot("sword", "sword", player), sword); inv.setItem(getItemSlot("sword", "sword", player), sword);
@@ -78,7 +78,7 @@ public class Kits {
return inv; return inv;
} }
public Inventory getUhcKit(Player player) { public PlayerInventory getUhcKit(Player player) {
PlayerInventory inv = player.getInventory(); PlayerInventory inv = player.getInventory();
@@ -100,8 +100,8 @@ public class Kits {
ItemStack planks = new ItemStack(Material.OAK_PLANKS, 64); ItemStack planks = new ItemStack(Material.OAK_PLANKS, 64);
ItemStack pickaxe = new ItemStack(Material.DIAMOND_PICKAXE); ItemStack pickaxe = new ItemStack(Material.DIAMOND_PICKAXE);
helmet.addEnchantment(Enchantment.PROTECTION, 2); helmet.addEnchantment(Enchantment.PROTECTION, 3);
chestplate.addEnchantment(Enchantment.PROTECTION, 3); chestplate.addEnchantment(Enchantment.PROTECTION, 2);
leggings.addEnchantment(Enchantment.PROTECTION, 3); leggings.addEnchantment(Enchantment.PROTECTION, 3);
boots.addEnchantment(Enchantment.PROTECTION, 3); boots.addEnchantment(Enchantment.PROTECTION, 3);
axe.addEnchantment(Enchantment.SHARPNESS, 1); axe.addEnchantment(Enchantment.SHARPNESS, 1);
@@ -136,7 +136,7 @@ public class Kits {
return inv; return inv;
} }
public Inventory getBoxCartKit(Player player) { public PlayerInventory getCartKit(Player player) {
PlayerInventory inv = player.getInventory(); PlayerInventory inv = player.getInventory();
@@ -228,40 +228,40 @@ public class Kits {
shulker.setItemMeta(shulkermeta); shulker.setItemMeta(shulkermeta);
inv.setArmorContents(new ItemStack[]{boots, leggings, chestplate, helmet}); inv.setArmorContents(new ItemStack[]{boots, leggings, chestplate, helmet});
inv.setItem(getItemSlot("axe", "boxcart", player), axe); inv.setItem(getItemSlot("axe", "cart", player), axe);
inv.setItem(getItemSlot("sword", "boxcart", player), sword); inv.setItem(getItemSlot("sword", "cart", player), sword);
for (int slot : getItemSlotArray("enderpearl", "boxcart", player)) { for (int slot : getItemSlotArray("enderpearl", "cart", player)) {
inv.setItem(slot, enderpearl); inv.setItem(slot, enderpearl);
} }
inv.setItem(getItemSlot("rail", "boxcart", player), rail); inv.setItem(getItemSlot("rail", "cart", player), rail);
for (int slot : getItemSlotArray("cart", "boxcart", player)) { for (int slot : getItemSlotArray("cart", "cart", player)) {
inv.setItem(slot, cart); inv.setItem(slot, cart);
} }
inv.setItem(getItemSlot("goldenapple", "boxcart", player), goldenapple); inv.setItem(getItemSlot("goldenapple", "cart", player), goldenapple);
inv.setItem(getItemSlot("cobweb", "boxcart", player), cobweb); inv.setItem(getItemSlot("cobweb", "cart", player), cobweb);
inv.setItem(getItemSlot("shield", "boxcart", player), shield); inv.setItem(getItemSlot("shield", "cart", player), shield);
inv.setItem(getItemSlot("bow", "boxcart", player), bow); inv.setItem(getItemSlot("bow", "cart", player), bow);
inv.setItem(getItemSlot("arrow", "boxcart", player), arrow); inv.setItem(getItemSlot("arrow", "cart", player), arrow);
for (int slot : getItemSlotArray("fireresistance", "boxcart", player)) { for (int slot : getItemSlotArray("fireresistance", "cart", player)) {
inv.setItem(slot, fireresistance); inv.setItem(slot, fireresistance);
} }
for (int slot : getItemSlotArray("strength", "boxcart", player)) { for (int slot : getItemSlotArray("strength", "cart", player)) {
inv.setItem(slot, strength); inv.setItem(slot, strength);
} }
for (int slot : getItemSlotArray("speed", "boxcart", player)) { for (int slot : getItemSlotArray("speed", "cart", player)) {
inv.setItem(slot, speed); inv.setItem(slot, speed);
} }
inv.setItem(getItemSlot("cherrylog", "boxcart", player), cherrylog); inv.setItem(getItemSlot("cherrylog", "cart", player), cherrylog);
inv.setItem(getItemSlot("crossbow", "boxcart", player), crossbow); inv.setItem(getItemSlot("crossbow", "cart", player), crossbow);
inv.setItem(getItemSlot("flintandsteel", "boxcart", player), flintandsteel); inv.setItem(getItemSlot("flintandsteel", "cart", player), flintandsteel);
inv.setItem(getItemSlot("totem", "boxcart", player), totem); inv.setItem(getItemSlot("totem", "cart", player), totem);
inv.setItem(getItemSlot("pickaxe", "boxcart", player), pickaxe); inv.setItem(getItemSlot("pickaxe", "cart", player), pickaxe);
inv.setItem(getItemSlot("shulker", "boxcart", player), shulker); inv.setItem(getItemSlot("shulker", "cart", player), shulker);
return inv; return inv;
} }
public Inventory getMaceKit(Player player) { public PlayerInventory getMaceKit(Player player) {
PlayerInventory inv = player.getInventory(); PlayerInventory inv = player.getInventory();
@@ -355,7 +355,7 @@ public class Kits {
return inv; return inv;
} }
public Inventory getAxeKit(Player player) { public PlayerInventory getAxeKit(Player player) {
PlayerInventory inv = player.getInventory(); PlayerInventory inv = player.getInventory();
@@ -376,7 +376,7 @@ public class Kits {
return inv; return inv;
} }
public Inventory getDiamondSmpKit(Player player) { public PlayerInventory getDiamondSmpKit(Player player) {
PlayerInventory inv = player.getInventory(); PlayerInventory inv = player.getInventory();
@@ -471,4 +471,30 @@ public class Kits {
return inv; return inv;
} }
public PlayerInventory getCrystalKit(Player player) {
PlayerInventory inv = player.getInventory();
ItemStack helmet = new ItemStack(Material.NETHERITE_HELMET);
ItemStack chestplate = new ItemStack(Material.NETHERITE_CHESTPLATE);
ItemStack leggings = new ItemStack(Material.NETHERITE_LEGGINGS);
ItemStack boots = new ItemStack(Material.NETHERITE_BOOTS);
ItemStack anchor = new ItemStack(Material.RESPAWN_ANCHOR, 64);
ItemStack glowstone = new ItemStack(Material.GLOWSTONE, 64);
ItemStack enderpearl = new ItemStack(Material.ENDER_PEARL, 16);
ItemStack shield = new ItemStack(Material.SHIELD);
ItemStack goldenapple = new ItemStack(Material.GOLDEN_APPLE, 64);
ItemStack obsidian = new ItemStack(Material.OBSIDIAN, 64);
ItemStack crystal = new ItemStack(Material.END_CRYSTAL, 64);
ItemStack sword = new ItemStack(Material.NETHERITE_SWORD);
ItemStack totem = new ItemStack(Material.TOTEM_OF_UNDYING);
ItemStack xp = new ItemStack(Material.EXPERIENCE_BOTTLE, 64);
ItemStack arrow = new ItemStack(Material.TIPPED_ARROW, 64);
ItemStack axe = new ItemStack(Material.NETHERITE_AXE);
ItemStack crossbow = new ItemStack(Material.CROSSBOW);
ItemStack pickaxe = new ItemStack(Material.NETHERITE_PICKAXE);
return inv;
}
} }