From 0e4e310f7ba9d7ed04154fbf3d6da2929badcac8 Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Sat, 6 Jul 2024 12:46:51 -0500 Subject: [PATCH] PhatLoots v5.6.1 - Fixed SampleLoot failing to load on pre 1.20.5 Minecraft versions - The SampleLoot can now be deleted if it is no longer desired - Fixed the **/loot reset** and **/loot clean** commands not targeting the right block - Ensured that new config options are now auto-populated to old configurations, rather than just using the default values - Updated default item values to contain netherite tools, armor, etc. - Fixed a bug causing auto-generated vanilla item names being in italic if no formatting was applied --- build.gradle.kts | 4 +- .../plugins/phatloots/PhatLoots.java | 18 +- .../plugins/phatloots/PhatLootsConfig.java | 27 +- .../phatloots/commands/LootCommand.java | 12 +- .../plugins/phatloots/loot/Item.java | 27 +- .../plugins/phatloots/util/PhatLootsUtil.java | 15 +- .../resources/{ => LootTables}/SampleLoot.yml | 580 +++++++++--------- src/main/resources/plugin.yml | 2 +- src/main/resources/tiers.yml | 22 +- 9 files changed, 370 insertions(+), 337 deletions(-) rename src/main/resources/{ => LootTables}/SampleLoot.yml (57%) diff --git a/build.gradle.kts b/build.gradle.kts index cabb05e2..d0c36b1f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ plugins { val supportedVersions = listOf("1.20", "1.20.1", "1.20.2", "1.20.3", "1.20.4", "1.20.5", "1.20.6", "1.21") group = "com.codisimus.plugins" -version = "5.6.0" +version = "5.6.1" java { toolchain.languageVersion.set(JavaLanguageVersion.of(17)) @@ -46,7 +46,7 @@ dependencies { tasks { runServer { - minecraftVersion("1.20.4") + minecraftVersion("1.20") } shadowJar { diff --git a/src/main/java/com/codisimus/plugins/phatloots/PhatLoots.java b/src/main/java/com/codisimus/plugins/phatloots/PhatLoots.java index 290d7b30..af3d15f8 100644 --- a/src/main/java/com/codisimus/plugins/phatloots/PhatLoots.java +++ b/src/main/java/com/codisimus/plugins/phatloots/PhatLoots.java @@ -84,6 +84,8 @@ public void onEnable() { dataFolder = dir.getPath(); dir = new File(dataFolder, "LootTables"); + boolean lootTablesExists = dir.exists(); + if (!dir.isDirectory()) { dir.mkdir(); } @@ -99,18 +101,10 @@ public void onEnable() { } //Save SampleLoot.yml if it does not exist - File file = new File(dataFolder, "LootTables" + File.separator + "SampleLoot.yml"); - if (!file.exists()) { - try (InputStream inputStream = this.getResource("SampleLoot.yml")) { - try (OutputStream outputStream = new FileOutputStream(file)) { - int read; - byte[] bytes = new byte[1024]; - - while ((read = inputStream.read(bytes)) != -1) { - outputStream.write(bytes, 0, read); - } - } - } catch (IOException ex) { + if (!lootTablesExists) { + try { + this.saveResource("LootTables/SampleLoot.yml", false); + } catch (Exception ex) { logger.log(Level.WARNING, "Could not save resource: SampleLoot.yml", ex); } } diff --git a/src/main/java/com/codisimus/plugins/phatloots/PhatLootsConfig.java b/src/main/java/com/codisimus/plugins/phatloots/PhatLootsConfig.java index 2e8c1958..9f25464d 100644 --- a/src/main/java/com/codisimus/plugins/phatloots/PhatLootsConfig.java +++ b/src/main/java/com/codisimus/plugins/phatloots/PhatLootsConfig.java @@ -7,6 +7,8 @@ import com.codisimus.plugins.phatloots.loot.LootCollection; import java.io.File; import java.util.*; +import java.util.function.BiConsumer; +import java.util.function.Function; import java.util.logging.Level; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -71,6 +73,8 @@ public class PhatLootsConfig { public static String tierPrefix; + private static boolean configDirty; + public static void load() { FileConfiguration config = PhatLoots.plugin.getConfig(); @@ -92,10 +96,10 @@ public static void load() { } } - cancelIfRegionHasPlayerOwner = config.getBoolean("CancelOpenIfRegionHasPlayerOwner", true); - cancelIfRegionHasPlayerMember = config.getBoolean("CancelOpenIfRegionHasPlayerMember", true); - cancelIfRegionHasGroupOwner = config.getBoolean("CancelOpenIfRegionHasGroupOwner", true); - cancelIfRegionHasGroupMember = config.getBoolean("CancelOpenIfRegionHasGroupMember", true); + cancelIfRegionHasPlayerOwner = getOrRun(config, "CancelOpenIfRegionHasPlayerOwner", true, config::getBoolean, config::set); + cancelIfRegionHasPlayerMember = getOrRun(config, "CancelOpenIfRegionHasPlayerMember", true, config::getBoolean, config::set); + cancelIfRegionHasGroupOwner = getOrRun(config, "CancelOpenIfRegionHasGroupOwner", true, config::getBoolean, config::set); + cancelIfRegionHasGroupMember = getOrRun(config, "CancelOpenIfRegionHasGroupMember", true, config::getBoolean, config::set); checkIfRegionHasOwnerOrMember = (cancelIfRegionHasPlayerOwner || cancelIfRegionHasPlayerMember || cancelIfRegionHasGroupOwner || cancelIfRegionHasGroupMember); ConfigurationSection section = config.getConfigurationSection("AutoLink"); if (section != null) { @@ -238,6 +242,10 @@ public static void load() { PhatLoots.autoSavePeriod = config.getInt("AutoSavePeriod") * 20L; PhatLootsListener.autoBreakOnPunch = config.getBoolean("AutoBreakOnPunch"); + if (configDirty) { + PhatLoots.plugin.saveConfig(); + PhatLoots.logger.info("Config file has been updated with new values."); + } /* LORES.YML */ @@ -296,4 +304,15 @@ private static String getString(ConfigurationSection config, String key) { String string = ChatColor.translateAlternateColorCodes('&', config.getString(key)); return string.isEmpty() ? null : string; } + + private static T getOrRun(ConfigurationSection section, String location, T defaultValue, Function getter, BiConsumer consumer) { + if (!section.contains(location, true)) { + consumer.accept(location, defaultValue); + configDirty = true; + + return defaultValue; + } + + return getter.apply(location); + } } diff --git a/src/main/java/com/codisimus/plugins/phatloots/commands/LootCommand.java b/src/main/java/com/codisimus/plugins/phatloots/commands/LootCommand.java index bd26e0e8..da4bfac1 100644 --- a/src/main/java/com/codisimus/plugins/phatloots/commands/LootCommand.java +++ b/src/main/java/com/codisimus/plugins/phatloots/commands/LootCommand.java @@ -139,7 +139,7 @@ public boolean linkHand(Player player, PhatLoot phatLoot) { ) public boolean link(Player player, PhatLoot phatLoot) { //Cancel if the player is not targeting a correct Block - Block block = player.getTargetBlock(EnumSet.of(Material.AIR, Material.CAVE_AIR, Material.VOID_AIR), 10); + Block block = player.getTargetBlock(null, 10); String blockName = PhatLootsUtil.getBlockName(block); if (!PhatLootsUtil.isLinkableType(block)) { player.sendMessage("§6" + blockName + "§4 is not a linkable type."); @@ -278,7 +278,7 @@ public boolean unlinkHand(Player player, PhatLoot phatLoot) { permission = "phatloots.unlink" ) public boolean unlink(Player player, PhatLoot phatLoot) { - Block block = player.getTargetBlock(EnumSet.of(Material.AIR, Material.CAVE_AIR, Material.VOID_AIR), 10); + Block block = player.getTargetBlock(null, 10); phatLoot.removeChest(block); player.sendMessage("§5Target §6" + PhatLootsUtil.getBlockName(block) + "§5 has been unlinked from PhatLoot §6" + phatLoot.name); phatLoot.saveChests(); @@ -772,8 +772,8 @@ public boolean give(CommandSender sender, World world, PhatLoot phatLoot, String permission = "phatloots.reset" ) public boolean reset(Player player) { - Block block = player.getTargetBlock(EnumSet.noneOf(Material.class), 10); - for (PhatLoot phatLoot : PhatLootsUtil.getPhatLoots(player)) { + Block block = player.getTargetBlock(null, 10); + for (PhatLoot phatLoot : PhatLootsUtil.getPhatLoots(player, block)) { phatLoot.reset(block); player.sendMessage("§5Target §6" + PhatLootsUtil.getBlockName(block) + "§5 has been reset."); } @@ -809,8 +809,8 @@ public boolean reset(CommandSender sender, String string) { permission = "phatloots.clean" ) public boolean clean(Player player) { - Block block = player.getTargetBlock(EnumSet.noneOf(Material.class), 10); - for (PhatLoot phatLoot : PhatLootsUtil.getPhatLoots(player)) { + Block block = player.getTargetBlock(null, 10); + for (PhatLoot phatLoot : PhatLootsUtil.getPhatLoots(player, block)) { phatLoot.clean(block); player.sendMessage("§5Target §6" + PhatLootsUtil.getBlockName(block) + "§5 has been cleaned."); } diff --git a/src/main/java/com/codisimus/plugins/phatloots/loot/Item.java b/src/main/java/com/codisimus/plugins/phatloots/loot/Item.java index 87de8638..e7695877 100644 --- a/src/main/java/com/codisimus/plugins/phatloots/loot/Item.java +++ b/src/main/java/com/codisimus/plugins/phatloots/loot/Item.java @@ -95,6 +95,8 @@ public class Item extends Loot { }; /* MATERIALS */ private static final EnumSet ARMOR_MATERIAL_SET = EnumSet.of( + Material.NETHERITE_HELMET, Material.NETHERITE_CHESTPLATE, + Material.NETHERITE_LEGGINGS, Material.NETHERITE_BOOTS, Material.DIAMOND_HELMET, Material.DIAMOND_CHESTPLATE, Material.DIAMOND_LEGGINGS, Material.DIAMOND_BOOTS, Material.IRON_HELMET, Material.IRON_CHESTPLATE, @@ -104,27 +106,28 @@ public class Item extends Loot { Material.CHAINMAIL_HELMET, Material.CHAINMAIL_CHESTPLATE, Material.CHAINMAIL_LEGGINGS, Material.CHAINMAIL_BOOTS, Material.LEATHER_HELMET, Material.LEATHER_CHESTPLATE, - Material.LEATHER_LEGGINGS, Material.LEATHER_BOOTS + Material.LEATHER_LEGGINGS, Material.LEATHER_BOOTS, + Material.TURTLE_HELMET ); private static final EnumSet SWORD_MATERIAL_SET = EnumSet.of( - Material.DIAMOND_SWORD, Material.IRON_SWORD, Material.GOLDEN_SWORD, - Material.STONE_SWORD, Material.WOODEN_SWORD + Material.NETHERITE_SWORD, Material.DIAMOND_SWORD, Material.IRON_SWORD, + Material.GOLDEN_SWORD, Material.STONE_SWORD, Material.WOODEN_SWORD ); private static final EnumSet AXE_MATERIAL_SET = EnumSet.of( - Material.DIAMOND_AXE, Material.IRON_AXE, Material.GOLDEN_AXE, - Material.STONE_AXE, Material.WOODEN_AXE + Material.NETHERITE_AXE, Material.DIAMOND_AXE, Material.IRON_AXE, + Material.GOLDEN_AXE, Material.STONE_AXE, Material.WOODEN_AXE ); private static final EnumSet PICKAXE_MATERIAL_SET = EnumSet.of( - Material.DIAMOND_PICKAXE, Material.IRON_PICKAXE, Material.GOLDEN_PICKAXE, - Material.STONE_PICKAXE, Material.WOODEN_PICKAXE + Material.NETHERITE_PICKAXE, Material.DIAMOND_PICKAXE, Material.IRON_PICKAXE, + Material.GOLDEN_PICKAXE, Material.STONE_PICKAXE, Material.WOODEN_PICKAXE ); private static final EnumSet SPADE_MATERIAL_SET = EnumSet.of( - Material.DIAMOND_SHOVEL, Material.IRON_SHOVEL, Material.GOLDEN_SHOVEL, - Material.STONE_SHOVEL, Material.WOODEN_SHOVEL + Material.NETHERITE_SHOVEL, Material.DIAMOND_SHOVEL, Material.IRON_SHOVEL, + Material.GOLDEN_SHOVEL, Material.STONE_SHOVEL, Material.WOODEN_SHOVEL ); private static final EnumSet HOE_MATERIAL_SET = EnumSet.of( - Material.DIAMOND_HOE, Material.IRON_HOE, Material.GOLDEN_HOE, - Material.STONE_HOE, Material.WOODEN_HOE + Material.NETHERITE_HOE, Material.DIAMOND_HOE, Material.IRON_HOE, + Material.GOLDEN_HOE, Material.STONE_HOE, Material.WOODEN_HOE ); public static int tierNotify; public static FileConfiguration loreConfig; @@ -472,7 +475,7 @@ public ItemStack getItem() { } //Set the new display name of the item - meta.setDisplayName(nameBuilder.toString()); + meta.setDisplayName(ChatColor.RESET + nameBuilder.toString()); clone.setItemMeta(meta); } diff --git a/src/main/java/com/codisimus/plugins/phatloots/util/PhatLootsUtil.java b/src/main/java/com/codisimus/plugins/phatloots/util/PhatLootsUtil.java index 8a156824..66e47c2d 100644 --- a/src/main/java/com/codisimus/plugins/phatloots/util/PhatLootsUtil.java +++ b/src/main/java/com/codisimus/plugins/phatloots/util/PhatLootsUtil.java @@ -113,7 +113,7 @@ public static String getItemName(ItemStack item) { //Return the Display name of the item if there is one if (item.hasItemMeta()) { String name = item.getItemMeta().getDisplayName(); - if (name != null && !name.isEmpty()) { + if (!name.isEmpty()) { return name; } } @@ -187,9 +187,20 @@ public static Player getNearestPlayer(Location location) { * @return The LinkedList of PhatLoots */ public static LinkedList getPhatLoots(Player player) { + Block block = player.getTargetBlock(null, 10); + return getPhatLoots(player, block); + } + + /** + * Returns a LinkedList of PhatLoots that are linked to the target Block + * + * @param player The Player targeting a Block + * @param block The Block that the Player is targeting + * @return The LinkedList of PhatLoots + */ + public static LinkedList getPhatLoots(Player player, Block block) { LinkedList phatLoots = new LinkedList<>(); //Cancel if the sender is not targeting a correct Block - Block block = player.getTargetBlock(EnumSet.of(Material.AIR, Material.CAVE_AIR, Material.VOID_AIR), 10); String blockName = PhatLootsUtil.getBlockName(block); if (!PhatLootsUtil.isLinkableType(block)) { player.sendMessage("§6" + blockName + "§4 is not a linkable type."); diff --git a/src/main/resources/SampleLoot.yml b/src/main/resources/LootTables/SampleLoot.yml similarity index 57% rename from src/main/resources/SampleLoot.yml rename to src/main/resources/LootTables/SampleLoot.yml index d38b19b0..5ca08a64 100644 --- a/src/main/resources/SampleLoot.yml +++ b/src/main/resources/LootTables/SampleLoot.yml @@ -14,16 +14,16 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: DIAMOND_SWORD meta: ==: ItemMeta meta-type: UNSPECIFIC lore: - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 40.0 Tiered: true - ==: Item @@ -31,16 +31,16 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: DIAMOND_AXE meta: ==: ItemMeta meta-type: UNSPECIFIC lore: - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 60.0 Tiered: true LowerNumberOfLoots: 1 @@ -54,16 +54,16 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: IRON_SWORD meta: ==: ItemMeta meta-type: UNSPECIFIC lore: - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 40.0 Tiered: true - ==: Item @@ -71,16 +71,16 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: IRON_AXE meta: ==: ItemMeta meta-type: UNSPECIFIC lore: - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 60.0 Tiered: true LowerNumberOfLoots: 1 @@ -94,16 +94,16 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: GOLDEN_SWORD meta: ==: ItemMeta meta-type: UNSPECIFIC lore: - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 40.0 Tiered: true - ==: Item @@ -111,16 +111,16 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: GOLDEN_AXE meta: ==: ItemMeta meta-type: UNSPECIFIC lore: - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 60.0 Tiered: true LowerNumberOfLoots: 1 @@ -134,16 +134,16 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: STONE_SWORD meta: ==: ItemMeta meta-type: UNSPECIFIC lore: - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 40.0 Tiered: true - ==: Item @@ -151,16 +151,16 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: STONE_AXE meta: ==: ItemMeta meta-type: UNSPECIFIC lore: - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 60.0 Tiered: true LowerNumberOfLoots: 1 @@ -174,16 +174,16 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: WOODEN_SWORD meta: ==: ItemMeta meta-type: UNSPECIFIC lore: - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 40.0 Tiered: true - ==: Item @@ -191,16 +191,16 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: WOODEN_AXE meta: ==: ItemMeta meta-type: UNSPECIFIC lore: - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 60.0 Tiered: true LowerNumberOfLoots: 1 @@ -222,17 +222,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: DIAMOND_HELMET meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true - ==: Item @@ -240,17 +240,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: DIAMOND_CHESTPLATE meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true - ==: Item @@ -258,17 +258,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: DIAMOND_LEGGINGS meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true - ==: Item @@ -276,17 +276,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: DIAMOND_BOOTS meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true LowerNumberOfLoots: 0 @@ -300,17 +300,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: IRON_HELMET meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true - ==: Item @@ -318,17 +318,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: IRON_CHESTPLATE meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true - ==: Item @@ -336,17 +336,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: IRON_LEGGINGS meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true - ==: Item @@ -354,17 +354,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: IRON_BOOTS meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true LowerNumberOfLoots: 0 @@ -378,17 +378,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: GOLDEN_HELMET meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true - ==: Item @@ -396,17 +396,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: GOLDEN_CHESTPLATE meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true - ==: Item @@ -414,17 +414,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: GOLDEN_LEGGINGS meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true - ==: Item @@ -432,17 +432,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: GOLDEN_BOOTS meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true LowerNumberOfLoots: 0 @@ -456,17 +456,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: CHAINMAIL_HELMET meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true - ==: Item @@ -474,17 +474,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: CHAINMAIL_CHESTPLATE meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true - ==: Item @@ -492,17 +492,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: CHAINMAIL_LEGGINGS meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true - ==: Item @@ -510,17 +510,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: CHAINMAIL_BOOTS meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true LowerNumberOfLoots: 0 @@ -534,17 +534,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: LEATHER_HELMET meta: ==: ItemMeta meta-type: COLORABLE_ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true - ==: Item @@ -552,17 +552,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: LEATHER_CHESTPLATE meta: ==: ItemMeta meta-type: COLORABLE_ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true - ==: Item @@ -570,17 +570,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: LEATHER_LEGGINGS meta: ==: ItemMeta meta-type: COLORABLE_ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true - ==: Item @@ -588,17 +588,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: LEATHER_BOOTS meta: ==: ItemMeta meta-type: COLORABLE_ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 100.0 Tiered: true LowerNumberOfLoots: 0 @@ -618,17 +618,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: DIAMOND_HELMET meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 1.0 Tiered: true - ==: Item @@ -636,17 +636,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: IRON_HELMET meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 9.0 Tiered: true - ==: Item @@ -654,17 +654,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: GOLDEN_HELMET meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 15.0 Tiered: true - ==: Item @@ -672,17 +672,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: CHAINMAIL_HELMET meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 25.0 Tiered: true - ==: Item @@ -690,17 +690,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: LEATHER_HELMET meta: ==: ItemMeta meta-type: COLORABLE_ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 50.0 Tiered: true LowerNumberOfLoots: 1 @@ -714,17 +714,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: DIAMOND_CHESTPLATE meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 1.0 Tiered: true - ==: Item @@ -732,17 +732,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: IRON_CHESTPLATE meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 9.0 Tiered: true - ==: Item @@ -750,17 +750,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: GOLDEN_CHESTPLATE meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 15.0 Tiered: true - ==: Item @@ -768,17 +768,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: CHAINMAIL_CHESTPLATE meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 25.0 Tiered: true - ==: Item @@ -786,17 +786,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: LEATHER_CHESTPLATE meta: ==: ItemMeta meta-type: COLORABLE_ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 50.0 Tiered: true LowerNumberOfLoots: 1 @@ -810,17 +810,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: DIAMOND_LEGGINGS meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 1.0 Tiered: true - ==: Item @@ -828,17 +828,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: IRON_LEGGINGS meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 9.0 Tiered: true - ==: Item @@ -846,17 +846,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: GOLDEN_LEGGINGS meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 15.0 Tiered: true - ==: Item @@ -864,17 +864,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: CHAINMAIL_LEGGINGS meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 25.0 Tiered: true - ==: Item @@ -882,17 +882,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: LEATHER_LEGGINGS meta: ==: ItemMeta meta-type: COLORABLE_ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 50.0 Tiered: true LowerNumberOfLoots: 1 @@ -906,17 +906,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: DIAMOND_BOOTS meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 1.0 Tiered: true - ==: Item @@ -924,17 +924,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: IRON_BOOTS meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 9.0 Tiered: true - ==: Item @@ -942,17 +942,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: GOLDEN_BOOTS meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 15.0 Tiered: true - ==: Item @@ -960,17 +960,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: CHAINMAIL_BOOTS meta: ==: ItemMeta meta-type: ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 25.0 Tiered: true - ==: Item @@ -978,17 +978,17 @@ SampleLoot: GenerateName: true ItemStack: ==: org.bukkit.inventory.ItemStack - v: 3839 + v: 3463 type: LEATHER_BOOTS meta: ==: ItemMeta meta-type: COLORABLE_ARMOR lore: - - '""' - - '""' - - '""' - - '""' - - '""' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' + - '{"extra":[{"text":""}],"text":""}' Probability: 50.0 Tiered: true LowerNumberOfLoots: 1 diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 0f46592b..efa6e1e5 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,7 +1,7 @@ name: PhatLoots main: com.codisimus.plugins.phatloots.PhatLoots version: ${version} -api-version: 1.20 +api-version: '1.20' author: Codisimus authors: [Redned] description: Chests with randomly generated money/items diff --git a/src/main/resources/tiers.yml b/src/main/resources/tiers.yml index 631c956d..78a5e69c 100644 --- a/src/main/resources/tiers.yml +++ b/src/main/resources/tiers.yml @@ -31,6 +31,12 @@ TIERS: Suffix: ' (Poor)' BaseValues: + NETHERITE_SWORD: 40 + NETHERITE_AXE: 40 + NETHERITE_HELMET: 40 + NETHERITE_CHESTPLATE: 40 + NETHERITE_LEGGINGS: 40 + NETHERITE_BOOTS: 40 DIAMOND_SWORD: 30 DIAMOND_AXE: 30 DIAMOND_HELMET: 30 @@ -43,20 +49,20 @@ BaseValues: IRON_CHESTPLATE: 20 IRON_LEGGINGS: 20 IRON_BOOTS: 20 - GOLD_SWORD: 20 - GOLD_AXE: 20 - GOLD_HELMET: 20 - GOLD_CHESTPLATE: 20 - GOLD_LEGGINGS: 20 - GOLD_BOOTS: 20 + GOLDEN_SWORD: 20 + GOLDEN_AXE: 20 + GOLDEN_HELMET: 20 + GOLDEN_CHESTPLATE: 20 + GOLDEN_LEGGINGS: 20 + GOLDEN_BOOTS: 20 STONE_SWORD: 10 STONE_AXE: 10 CHAINMAIL_HELMET: 10 CHAINMAIL_CHESTPLATE: 10 CHAINMAIL_LEGGINGS: 10 CHAINMAIL_BOOTS: 10 - WOOD_SWORD: 0 - WOOD_AXE: 0 + WOODEN_SWORD: 0 + WOODEN_AXE: 0 LEATHER_HELMET: 0 LEATHER_CHESTPLATE: 0 LEATHER_LEGGINGS: 0