holnap folytatom
This commit is contained in:
@@ -40,6 +40,20 @@ public class EditKitCommand implements CommandExecutor, TabCompleter {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int[] getItemSlotArray(String key, String kit, Player player) {
|
||||||
|
String path = "kits." + kit + "." + player.getUniqueId() + "." + key;
|
||||||
|
|
||||||
|
if (plugin.getConfig().contains(path)) {
|
||||||
|
try {
|
||||||
|
return new int[]{plugin.getConfig().getInt(path)};
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
plugin.getLogger().warning("Invalid slot number in config for " + path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new int[]{-1};
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(@NotNull CommandSender cmds, @NotNull Command command, @NotNull String s, @NotNull String[] args) {
|
public boolean onCommand(@NotNull CommandSender cmds, @NotNull Command command, @NotNull String s, @NotNull String[] args) {
|
||||||
if (cmds.hasPermission("wolfffa.command.editkit")) {
|
if (cmds.hasPermission("wolfffa.command.editkit")) {
|
||||||
@@ -110,19 +124,14 @@ public class EditKitCommand implements CommandExecutor, TabCompleter {
|
|||||||
ItemStack uhcaxe = new ItemStack(Material.DIAMOND_AXE);
|
ItemStack uhcaxe = new ItemStack(Material.DIAMOND_AXE);
|
||||||
ItemStack uhcsword = new ItemStack(Material.DIAMOND_SWORD);
|
ItemStack uhcsword = new ItemStack(Material.DIAMOND_SWORD);
|
||||||
ItemStack uhclava = new ItemStack(Material.LAVA_BUCKET);
|
ItemStack uhclava = new ItemStack(Material.LAVA_BUCKET);
|
||||||
ItemStack uhclava2 = new ItemStack(Material.LAVA_BUCKET);
|
|
||||||
ItemStack uhccobweb = new ItemStack(Material.COBWEB, 8);
|
ItemStack uhccobweb = new ItemStack(Material.COBWEB, 8);
|
||||||
ItemStack uhccobblestone = new ItemStack(Material.COBBLESTONE, 64);
|
ItemStack uhccobblestone = new ItemStack(Material.COBBLESTONE, 64);
|
||||||
ItemStack uhcgoldenapple = new ItemStack(Material.GOLDEN_APPLE, 13);
|
ItemStack uhcgoldenapple = new ItemStack(Material.GOLDEN_APPLE, 13);
|
||||||
ItemStack uhcwater = new ItemStack(Material.WATER_BUCKET);
|
ItemStack uhcwater = new ItemStack(Material.WATER_BUCKET);
|
||||||
ItemStack uhcwater2 = new ItemStack(Material.WATER_BUCKET);
|
|
||||||
ItemStack uhcwater3 = new ItemStack(Material.WATER_BUCKET);
|
|
||||||
ItemStack uhcwater4 = new ItemStack(Material.WATER_BUCKET);
|
|
||||||
ItemStack uhccrossbow = new ItemStack(Material.CROSSBOW);
|
ItemStack uhccrossbow = new ItemStack(Material.CROSSBOW);
|
||||||
ItemStack uhcbow = new ItemStack(Material.BOW);
|
ItemStack uhcbow = new ItemStack(Material.BOW);
|
||||||
ItemStack uhcarrow = new ItemStack(Material.ARROW, 16);
|
ItemStack uhcarrow = new ItemStack(Material.ARROW, 16);
|
||||||
ItemStack uhcshield = new ItemStack(Material.SHIELD);
|
ItemStack uhcshield = new ItemStack(Material.SHIELD);
|
||||||
ItemStack uhcshield2 = new ItemStack(Material.SHIELD);
|
|
||||||
ItemStack uhcplanks = new ItemStack(Material.OAK_PLANKS, 64);
|
ItemStack uhcplanks = new ItemStack(Material.OAK_PLANKS, 64);
|
||||||
ItemStack uhcpickaxe = new ItemStack(Material.DIAMOND_PICKAXE);
|
ItemStack uhcpickaxe = new ItemStack(Material.DIAMOND_PICKAXE);
|
||||||
|
|
||||||
@@ -140,45 +149,25 @@ public class EditKitCommand implements CommandExecutor, TabCompleter {
|
|||||||
uhcpickaxe.addEnchantment(Enchantment.UNBREAKING,3);
|
uhcpickaxe.addEnchantment(Enchantment.UNBREAKING,3);
|
||||||
uhcpickaxe.addEnchantment(Enchantment.EFFICIENCY, 3);
|
uhcpickaxe.addEnchantment(Enchantment.EFFICIENCY, 3);
|
||||||
|
|
||||||
ItemMeta uhcmetalava2 = uhclava2.getItemMeta();
|
|
||||||
ItemMeta uhcmetawater2 = uhcwater2.getItemMeta();
|
|
||||||
ItemMeta uhcmetawater3 = uhcwater3.getItemMeta();
|
|
||||||
ItemMeta uhcmetawater4 = uhcwater4.getItemMeta();
|
|
||||||
ItemMeta uhcmetashield2 = uhcshield2.getItemMeta();
|
|
||||||
|
|
||||||
uhcmetalava2.getPersistentDataContainer().set(new NamespacedKey("wolfffa", "lavab"), PersistentDataType.STRING, "lava2uuid");
|
|
||||||
uhclava2.setItemMeta(uhcmetalava2);
|
|
||||||
|
|
||||||
uhcmetawater2.getPersistentDataContainer().set(new NamespacedKey("wolfffa", "waterb"), PersistentDataType.STRING, "water2uuid");
|
|
||||||
uhcwater2.setItemMeta(uhcmetawater2);
|
|
||||||
|
|
||||||
uhcmetawater3.getPersistentDataContainer().set(new NamespacedKey("wolfffa", "waterc"), PersistentDataType.STRING, "water3uuid");
|
|
||||||
uhcwater3.setItemMeta(uhcmetawater3);
|
|
||||||
|
|
||||||
uhcmetawater4.getPersistentDataContainer().set(new NamespacedKey("wolfffa", "waterd"), PersistentDataType.STRING, "water4uuid");
|
|
||||||
uhcwater4.setItemMeta(uhcmetawater4);
|
|
||||||
|
|
||||||
uhcmetashield2.getPersistentDataContainer().set(new NamespacedKey("wolfffa", "shieldb"), PersistentDataType.STRING, "shield2uuid");
|
|
||||||
uhcshield2.setItemMeta(uhcmetashield2);
|
|
||||||
|
|
||||||
inv.setItem(getItemSlot("axe", "uhc", player), uhcaxe);
|
inv.setItem(getItemSlot("axe", "uhc", player), uhcaxe);
|
||||||
inv.setItem(getItemSlot("sword", "uhc", player), uhcsword);
|
inv.setItem(getItemSlot("sword", "uhc", player), uhcsword);
|
||||||
inv.setItem(getItemSlot("lava", "uhc", player), uhclava);
|
for (int slot : getItemSlotArray("lava", "uhc", player)) {
|
||||||
|
inv.setItem(slot, uhclava);
|
||||||
|
}
|
||||||
inv.setItem(getItemSlot("cobweb", "uhc", player), uhccobweb);
|
inv.setItem(getItemSlot("cobweb", "uhc", player), uhccobweb);
|
||||||
inv.setItem(getItemSlot("cobblestone", "uhc", player), uhccobblestone);
|
inv.setItem(getItemSlot("cobblestone", "uhc", player), uhccobblestone);
|
||||||
inv.setItem(getItemSlot("goldenapple", "uhc", player), uhcgoldenapple);
|
inv.setItem(getItemSlot("goldenapple", "uhc", player), uhcgoldenapple);
|
||||||
inv.setItem(getItemSlot("water", "uhc", player), uhcwater);
|
for (int slot : getItemSlotArray("water", "uhc", player)) {
|
||||||
|
inv.setItem(slot, uhcwater);
|
||||||
|
}
|
||||||
inv.setItem(getItemSlot("crossbow", "uhc", player), uhccrossbow);
|
inv.setItem(getItemSlot("crossbow", "uhc", player), uhccrossbow);
|
||||||
inv.setItem(getItemSlot("bow", "uhc", player), uhcbow);
|
inv.setItem(getItemSlot("bow", "uhc", player), uhcbow);
|
||||||
inv.setItem(getItemSlot("shield", "uhc", player), uhcshield);
|
for (int slot : getItemSlotArray("shield", "uhc", player)) {
|
||||||
|
inv.setItem(slot, uhcshield);
|
||||||
|
}
|
||||||
inv.setItem(getItemSlot("arrow", "uhc", player), uhcarrow);
|
inv.setItem(getItemSlot("arrow", "uhc", player), uhcarrow);
|
||||||
inv.setItem(getItemSlot("shield2", "uhc", player), uhcshield2);
|
|
||||||
inv.setItem(getItemSlot("planks", "uhc", player), uhcplanks);
|
inv.setItem(getItemSlot("planks", "uhc", player), uhcplanks);
|
||||||
inv.setItem(getItemSlot("pickaxe", "uhc", player), uhcpickaxe);
|
inv.setItem(getItemSlot("pickaxe", "uhc", player), uhcpickaxe);
|
||||||
inv.setItem(getItemSlot("lava2", "uhc", player), uhclava2);
|
|
||||||
inv.setItem(getItemSlot("water2", "uhc", player), uhcwater2);
|
|
||||||
inv.setItem(getItemSlot("water3", "uhc", player), uhcwater3);
|
|
||||||
inv.setItem(getItemSlot("water4", "uhc", player), uhcwater4);
|
|
||||||
|
|
||||||
infoMeta.setDisplayName("§fUHC Kit");
|
infoMeta.setDisplayName("§fUHC Kit");
|
||||||
infoItem.setItemMeta(infoMeta);
|
infoItem.setItemMeta(infoMeta);
|
||||||
|
|||||||
@@ -40,6 +40,20 @@ public class TpToFfaCommand implements CommandExecutor, TabCompleter {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int[] getItemSlotArray(String key, String kit, Player player) {
|
||||||
|
String path = "kits." + kit + "." + player.getUniqueId() + "." + key;
|
||||||
|
|
||||||
|
if (plugin.getConfig().contains(path)) {
|
||||||
|
try {
|
||||||
|
return new int[]{plugin.getConfig().getInt(path)};
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
plugin.getLogger().warning("Invalid slot number in config for " + path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new int[]{-1};
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(@NotNull CommandSender cmds, @NotNull Command command, @NotNull String s, @NotNull String[] args) {
|
public boolean onCommand(@NotNull CommandSender cmds, @NotNull Command command, @NotNull String s, @NotNull String[] args) {
|
||||||
if (cmds.hasPermission("wolfffa.admin.tptoffa")) {
|
if (cmds.hasPermission("wolfffa.admin.tptoffa")) {
|
||||||
@@ -114,22 +128,23 @@ public class TpToFfaCommand implements CommandExecutor, TabCompleter {
|
|||||||
player.getInventory().setArmorContents(new ItemStack[]{boots, leggings, chestplate, helmet});
|
player.getInventory().setArmorContents(new ItemStack[]{boots, leggings, chestplate, helmet});
|
||||||
player.getInventory().setItem(getItemSlot("axe", "uhc", player), axe);
|
player.getInventory().setItem(getItemSlot("axe", "uhc", player), axe);
|
||||||
player.getInventory().setItem(getItemSlot("sword", "uhc", player), sword);
|
player.getInventory().setItem(getItemSlot("sword", "uhc", player), sword);
|
||||||
player.getInventory().setItem(getItemSlot("lava", "uhc", player), lava);
|
for (int slot : getItemSlotArray("lava", "uhc", player)) {
|
||||||
|
player.getInventory().setItem(slot, lava);
|
||||||
|
}
|
||||||
player.getInventory().setItem(getItemSlot("cobweb", "uhc", player), cobweb);
|
player.getInventory().setItem(getItemSlot("cobweb", "uhc", player), cobweb);
|
||||||
player.getInventory().setItem(getItemSlot("cobblestone", "uhc", player), cobblestone);
|
player.getInventory().setItem(getItemSlot("cobblestone", "uhc", player), cobblestone);
|
||||||
player.getInventory().setItem(getItemSlot("goldenapple", "uhc", player), goldenapple);
|
player.getInventory().setItem(getItemSlot("goldenapple", "uhc", player), goldenapple);
|
||||||
player.getInventory().setItem(getItemSlot("water", "uhc", player), water);
|
for (int slot : getItemSlotArray("water", "uhc", player)) {
|
||||||
|
player.getInventory().setItem(slot, water);
|
||||||
|
}
|
||||||
player.getInventory().setItem(getItemSlot("crossbow", "uhc", player), crossbow);
|
player.getInventory().setItem(getItemSlot("crossbow", "uhc", player), crossbow);
|
||||||
player.getInventory().setItem(getItemSlot("bow", "uhc", player), bow);
|
player.getInventory().setItem(getItemSlot("bow", "uhc", player), bow);
|
||||||
player.getInventory().setItem(getItemSlot("arrow", "uhc", player), arrow);
|
player.getInventory().setItem(getItemSlot("arrow", "uhc", player), arrow);
|
||||||
player.getInventory().setItem(getItemSlot("shield2", "uhc", player), shield);
|
for (int slot : getItemSlotArray("shield", "uhc", player)) {
|
||||||
|
player.getInventory().setItem(slot, shield);
|
||||||
|
}
|
||||||
player.getInventory().setItem(getItemSlot("planks", "uhc", player), planks);
|
player.getInventory().setItem(getItemSlot("planks", "uhc", player), planks);
|
||||||
player.getInventory().setItem(getItemSlot("pickaxe", "uhc", player), pickaxe);
|
player.getInventory().setItem(getItemSlot("pickaxe", "uhc", player), pickaxe);
|
||||||
player.getInventory().setItem(getItemSlot("lava2", "uhc", player), lava);
|
|
||||||
player.getInventory().setItem(getItemSlot("water2", "uhc", player), water);
|
|
||||||
player.getInventory().setItem(getItemSlot("water3", "uhc", player), water);
|
|
||||||
player.getInventory().setItem(getItemSlot("water4", "uhc", player), water);
|
|
||||||
player.getInventory().setItem(getItemSlot("shield", "uhc", player), shield);
|
|
||||||
|
|
||||||
World world = Bukkit.getWorld("world");
|
World world = Bukkit.getWorld("world");
|
||||||
double x = 0.5;
|
double x = 0.5;
|
||||||
@@ -142,6 +157,62 @@ public class TpToFfaCommand implements CommandExecutor, TabCompleter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "boxcart":
|
||||||
|
if (args.length > 1) {
|
||||||
|
Player target = Bukkit.getPlayer(args[1]);
|
||||||
|
if (target instanceof Player player) {
|
||||||
|
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 axe = new ItemStack(Material.NETHERITE_AXE);
|
||||||
|
ItemStack sword = new ItemStack(Material.NETHERITE_SWORD);
|
||||||
|
ItemStack enderpearl = new ItemStack(Material.ENDER_PEARL, 16);
|
||||||
|
ItemStack rail = new ItemStack(Material.RAIL, 64);
|
||||||
|
ItemStack cart = new ItemStack(Material.TNT_MINECART);
|
||||||
|
ItemStack goldenapple = new ItemStack(Material.GOLDEN_APPLE, 64);
|
||||||
|
ItemStack cobweb = new ItemStack(Material.COBWEB, 64);
|
||||||
|
ItemStack shield = new ItemStack(Material.SHIELD);
|
||||||
|
ItemStack bow = new ItemStack(Material.BOW);
|
||||||
|
ItemStack arrow = new ItemStack(Material.ARROW, 64);
|
||||||
|
ItemStack fireresistance = new ItemStack(Material.SPLASH_POTION);
|
||||||
|
ItemStack strenght = new ItemStack(Material.SPLASH_POTION);
|
||||||
|
ItemStack speed = new ItemStack(Material.SPLASH_POTION);
|
||||||
|
ItemStack cherrylog = new ItemStack(Material.CHERRY_LOG, 64);
|
||||||
|
ItemStack crossbow = new ItemStack(Material.CROSSBOW);
|
||||||
|
ItemStack flintandsteel = new ItemStack(Material.FLINT_AND_STEEL);
|
||||||
|
|
||||||
|
player.getInventory().setArmorContents(new ItemStack[]{boots, leggings, chestplate, helmet});
|
||||||
|
player.getInventory().setItem(getItemSlot("axe", "boxcart", player), axe);
|
||||||
|
player.getInventory().setItem(getItemSlot("sword", "boxcart", player), sword);
|
||||||
|
for (int slot : getItemSlotArray("enderpearl", "boxcart", player)) {
|
||||||
|
player.getInventory().setItem(slot, enderpearl);
|
||||||
|
}
|
||||||
|
player.getInventory().setItem(getItemSlot("rail", "boxcart", player), rail);
|
||||||
|
for (int slot : getItemSlotArray("cart", "boxcart", player)) {
|
||||||
|
player.getInventory().setItem(slot, cart);
|
||||||
|
}
|
||||||
|
player.getInventory().setItem(getItemSlot("goldenapple", "boxcart", player), goldenapple);
|
||||||
|
player.getInventory().setItem(getItemSlot("cobweb", "boxcart", player), cobweb);
|
||||||
|
player.getInventory().setItem(getItemSlot("shield", "boxcart", player), shield);
|
||||||
|
player.getInventory().setItem(getItemSlot("bow", "boxcart", player), bow);
|
||||||
|
player.getInventory().setItem(getItemSlot("arrow", "boxcart", player), arrow);
|
||||||
|
for (int slot : getItemSlotArray("fireresistance", "boxcart", player)) {
|
||||||
|
player.getInventory().setItem(slot, fireresistance);
|
||||||
|
}
|
||||||
|
for (int slot : getItemSlotArray("strenght", "boxcart", player)) {
|
||||||
|
player.getInventory().setItem(slot, strenght);
|
||||||
|
}
|
||||||
|
for (int slot : getItemSlotArray("speed", "boxcart", player)) {
|
||||||
|
player.getInventory().setItem(slot, speed);
|
||||||
|
}
|
||||||
|
player.getInventory().setItem(getItemSlot("cherrylog", "boxcart", player), cherrylog);
|
||||||
|
player.getInventory().setItem(getItemSlot("crossbow", "boxcart", player), crossbow);
|
||||||
|
player.getInventory().setItem(getItemSlot("flintandsteel", "boxcart", player), flintandsteel);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
cmds.sendMessage("§cNincs ilyen FFA típus.");
|
cmds.sendMessage("§cNincs ilyen FFA típus.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,9 +13,10 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
|||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.persistence.PersistentDataType;
|
import org.bukkit.persistence.PersistentDataType;
|
||||||
import org.checkerframework.checker.units.qual.N;
|
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class KitListener implements Listener {
|
public class KitListener implements Listener {
|
||||||
@@ -35,27 +36,46 @@ public class KitListener implements Listener {
|
|||||||
plugin.saveConfig();
|
plugin.saveConfig();
|
||||||
plugin.reloadConfig();
|
plugin.reloadConfig();
|
||||||
Map <String, Object> uhcKit = new HashMap<>();
|
Map <String, Object> uhcKit = new HashMap<>();
|
||||||
|
int[] uhcshield = new int[] {13, 40};
|
||||||
|
int[] uhcwater = new int[] {6, 22, 23, 24};
|
||||||
|
int[] uhclava = new int[] {2, 21};
|
||||||
uhcKit.put("axe", 0);
|
uhcKit.put("axe", 0);
|
||||||
uhcKit.put("sword", 1);
|
uhcKit.put("sword", 1);
|
||||||
uhcKit.put("lava", 2);
|
uhcKit.put("lava", uhclava);
|
||||||
uhcKit.put("cobweb", 3);
|
uhcKit.put("cobweb", 3);
|
||||||
uhcKit.put("cobblestone", 4);
|
uhcKit.put("cobblestone", 4);
|
||||||
uhcKit.put("goldenapple", 5);
|
uhcKit.put("goldenapple", 5);
|
||||||
uhcKit.put("water", 6);
|
uhcKit.put("water", uhcwater);
|
||||||
uhcKit.put("crossbow", 7);
|
uhcKit.put("crossbow", 7);
|
||||||
uhcKit.put("bow", 8);
|
uhcKit.put("bow", 8);
|
||||||
uhcKit.put("arrow", 9);
|
uhcKit.put("arrow", 9);
|
||||||
uhcKit.put("shield2", 13);
|
|
||||||
uhcKit.put("planks", 17);
|
uhcKit.put("planks", 17);
|
||||||
uhcKit.put("pickaxe", 20);
|
uhcKit.put("pickaxe", 20);
|
||||||
uhcKit.put("lava2", 21);
|
uhcKit.put("shield", uhcshield);
|
||||||
uhcKit.put("water2", 22);
|
|
||||||
uhcKit.put("water3", 23);
|
|
||||||
uhcKit.put("water4", 24);
|
|
||||||
uhcKit.put("shield", 40);
|
|
||||||
plugin.getConfig().set("kits.uhc." + player.getUniqueId(), uhcKit);
|
plugin.getConfig().set("kits.uhc." + player.getUniqueId(), uhcKit);
|
||||||
plugin.saveConfig();
|
plugin.saveConfig();
|
||||||
plugin.reloadConfig();
|
plugin.reloadConfig();
|
||||||
|
Map <String, Object> boxcartKit = new HashMap<>();
|
||||||
|
int[] boxcartstrenght = new int[] {17, 26, 35};
|
||||||
|
int[] boxcartspeed = new int[] {18, 27, 36};
|
||||||
|
int[] boxcartfireresistance = new int[] {19, 28};
|
||||||
|
int[] boxcartcart = new int[] {4, 13, 22, 31, 14, 23, 32, 15, 24, 33, 16, 25, 34};
|
||||||
|
int[] boxcartenderpearl = new int[] {2, 12, 21, 30};
|
||||||
|
boxcartKit.put("axe", 0);
|
||||||
|
boxcartKit.put("sword", 1);
|
||||||
|
boxcartKit.put("enderpearl", boxcartenderpearl);
|
||||||
|
boxcartKit.put("rail", 3);
|
||||||
|
boxcartKit.put("cart", boxcartcart);
|
||||||
|
boxcartKit.put("goldenapple", 5);
|
||||||
|
boxcartKit.put("cobweb", 6);
|
||||||
|
boxcartKit.put("shield", 7);
|
||||||
|
boxcartKit.put("bow", 8);
|
||||||
|
boxcartKit.put("arrow", 9);
|
||||||
|
boxcartKit.put("strength", boxcartstrenght);
|
||||||
|
boxcartKit.put("speed", boxcartspeed);
|
||||||
|
boxcartKit.put("cherrylog", 11);
|
||||||
|
boxcartKit.put("crossbow", 20);
|
||||||
|
boxcartKit.put("flintandsteel", 29);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,6 +88,9 @@ public class KitListener implements Listener {
|
|||||||
if (event.getClickedInventory() == event.getView().getTopInventory() && event.getView().title().equals(Component.text("Kit Editor"))) {
|
if (event.getClickedInventory() == event.getView().getTopInventory() && event.getView().title().equals(Component.text("Kit Editor"))) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
if ((0 <= event.getSlot() && event.getSlot() <= 2) || (9 <= event.getSlot() && event.getSlot() <= 11) || (18 <= event.getSlot() && event.getSlot() <= 20)) {
|
if ((0 <= event.getSlot() && event.getSlot() <= 2) || (9 <= event.getSlot() && event.getSlot() <= 11) || (18 <= event.getSlot() && event.getSlot() <= 20)) {
|
||||||
|
List<Integer> lavaSlots = null;
|
||||||
|
List<Integer> waterSlots = null;
|
||||||
|
List<Integer> shieldSlots = null;
|
||||||
if (gui.getItem(13).getItemMeta().getDisplayName().equals("§fSword Kit")) {
|
if (gui.getItem(13).getItemMeta().getDisplayName().equals("§fSword Kit")) {
|
||||||
for (int i = 0; i < inv.length; i++) {
|
for (int i = 0; i < inv.length; i++) {
|
||||||
ItemStack item = inv[i];
|
ItemStack item = inv[i];
|
||||||
@@ -79,6 +102,10 @@ public class KitListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (gui.getItem(13).getItemMeta().getDisplayName().equals("§fUHC Kit")) {
|
} else if (gui.getItem(13).getItemMeta().getDisplayName().equals("§fUHC Kit")) {
|
||||||
|
|
||||||
|
lavaSlots = new ArrayList<>();
|
||||||
|
waterSlots = new ArrayList<>();
|
||||||
|
shieldSlots = new ArrayList<>();
|
||||||
for (int i = 0; i < inv.length; i++) {
|
for (int i = 0; i < inv.length; i++) {
|
||||||
ItemStack item = inv[i];
|
ItemStack item = inv[i];
|
||||||
|
|
||||||
@@ -88,11 +115,7 @@ public class KitListener implements Listener {
|
|||||||
} else if (item.getType() == Material.DIAMOND_SWORD) {
|
} else if (item.getType() == Material.DIAMOND_SWORD) {
|
||||||
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".sword", i);
|
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".sword", i);
|
||||||
} else if (item.getType() == Material.LAVA_BUCKET) {
|
} else if (item.getType() == Material.LAVA_BUCKET) {
|
||||||
if (item.getItemMeta().getPersistentDataContainer().has(new NamespacedKey("wolfffa", "lavab"), PersistentDataType.STRING)) {
|
lavaSlots.add(i);
|
||||||
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".lava2", i);
|
|
||||||
} else {
|
|
||||||
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".lava", i);
|
|
||||||
}
|
|
||||||
} else if (item.getType() == Material.COBWEB) {
|
} else if (item.getType() == Material.COBWEB) {
|
||||||
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".cobweb", i);
|
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".cobweb", i);
|
||||||
} else if (item.getType() == Material.COBBLESTONE) {
|
} else if (item.getType() == Material.COBBLESTONE) {
|
||||||
@@ -100,15 +123,7 @@ public class KitListener implements Listener {
|
|||||||
} else if (item.getType() == Material.GOLDEN_APPLE) {
|
} else if (item.getType() == Material.GOLDEN_APPLE) {
|
||||||
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".goldenapple", i);
|
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".goldenapple", i);
|
||||||
} else if (item.getType() == Material.WATER_BUCKET) {
|
} else if (item.getType() == Material.WATER_BUCKET) {
|
||||||
if (item.getItemMeta().getPersistentDataContainer().has(new NamespacedKey("wolfffa", "waterb"), PersistentDataType.STRING)) {
|
waterSlots.add(i);
|
||||||
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".water2", i);
|
|
||||||
} else if (item.getItemMeta().getPersistentDataContainer().has(new NamespacedKey("wolfffa", "waterc"), PersistentDataType.STRING)) {
|
|
||||||
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".water3", i);
|
|
||||||
} else if (item.getItemMeta().getPersistentDataContainer().has(new NamespacedKey("wolfffa", "waterd"), PersistentDataType.STRING)) {
|
|
||||||
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".water4", i);
|
|
||||||
} else {
|
|
||||||
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".water", i);
|
|
||||||
}
|
|
||||||
} else if (item.getType() == Material.CROSSBOW) {
|
} else if (item.getType() == Material.CROSSBOW) {
|
||||||
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".crossbow", i);
|
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".crossbow", i);
|
||||||
} else if (item.getType() == Material.BOW) {
|
} else if (item.getType() == Material.BOW) {
|
||||||
@@ -120,15 +135,14 @@ public class KitListener implements Listener {
|
|||||||
} else if (item.getType() == Material.DIAMOND_PICKAXE) {
|
} else if (item.getType() == Material.DIAMOND_PICKAXE) {
|
||||||
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".pickaxe", i);
|
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".pickaxe", i);
|
||||||
} else if (item.getType() == Material.SHIELD) {
|
} else if (item.getType() == Material.SHIELD) {
|
||||||
if (item.getItemMeta().getPersistentDataContainer().has(new NamespacedKey("wolfffa", "shieldb"), PersistentDataType.STRING)) {
|
shieldSlots.add(i);
|
||||||
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".shield2", i);
|
|
||||||
} else {
|
|
||||||
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".shield", i);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".lava", lavaSlots);
|
||||||
|
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".water", waterSlots);
|
||||||
|
plugin.getConfig().set("kits.uhc." + player.getUniqueId() + ".shield", shieldSlots);
|
||||||
plugin.saveConfig();
|
plugin.saveConfig();
|
||||||
plugin.reloadConfig();
|
plugin.reloadConfig();
|
||||||
player.sendMessage("§aSikeresen elmentetted a kitedet!");
|
player.sendMessage("§aSikeresen elmentetted a kitedet!");
|
||||||
|
|||||||
Reference in New Issue
Block a user