From b900a14274f26e7b20ad4dff6a42604b3470da44 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sun, 1 Aug 2021 19:18:27 +0100 Subject: [PATCH] Added particle-amount option to enchanting table --- .../com/willfp/ecoenchants/proxy/v1_17_R1/FastGetEnchants.java | 3 --- .../enchantments/support/obtaining/EnchantingListeners.java | 2 +- eco-core/core-plugin/src/main/resources/config.yml | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/eco-core/core-nms/v1_17_R1/src/main/java/com/willfp/ecoenchants/proxy/v1_17_R1/FastGetEnchants.java b/eco-core/core-nms/v1_17_R1/src/main/java/com/willfp/ecoenchants/proxy/v1_17_R1/FastGetEnchants.java index 69b2c08e..56a02877 100644 --- a/eco-core/core-nms/v1_17_R1/src/main/java/com/willfp/ecoenchants/proxy/v1_17_R1/FastGetEnchants.java +++ b/eco-core/core-nms/v1_17_R1/src/main/java/com/willfp/ecoenchants/proxy/v1_17_R1/FastGetEnchants.java @@ -6,7 +6,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.world.item.ItemEnchantedBook; import org.bukkit.Material; -import org.bukkit.NamespacedKey; import org.bukkit.craftbukkit.v1_17_R1.inventory.CraftItemStack; import org.bukkit.craftbukkit.v1_17_R1.util.CraftNamespacedKey; import org.bukkit.enchantments.Enchantment; @@ -14,9 +13,7 @@ import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; import java.util.HashMap; -import java.util.HashSet; import java.util.Map; -import java.util.Set; public final class FastGetEnchants implements FastGetEnchantsProxy { @Override diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/obtaining/EnchantingListeners.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/obtaining/EnchantingListeners.java index 7b5e8c66..4ff77892 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/obtaining/EnchantingListeners.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/obtaining/EnchantingListeners.java @@ -224,7 +224,7 @@ public class EnchantingListeners extends PluginDependent implements L location.add(0, 1, 0); - int limit = NumberUtils.randInt(8, 13); + int limit = this.getPlugin().getConfigYml().getInt("enchanting-table.notify-on-special.particle-amount"); for (int i = 0; i < limit; i++) { Location spawnLoc = location.clone(); diff --git a/eco-core/core-plugin/src/main/resources/config.yml b/eco-core/core-plugin/src/main/resources/config.yml index ec70a35c..a1bf6d63 100644 --- a/eco-core/core-plugin/src/main/resources/config.yml +++ b/eco-core/core-plugin/src/main/resources/config.yml @@ -73,6 +73,7 @@ enchanting-table: sound: ENTITY_PLAYER_LEVELUP pitch: 1.5 show-particles: true + particle-amount: 26 cap-amount: # Prevent getting above a certain amount of enchantments enabled: true # Enable capping