Added particle-amount option to villagers

This commit is contained in:
Auxilor 2021-08-02 14:45:28 +01:00
parent 90288261ff
commit 10b4ed559c
2 changed files with 6 additions and 4 deletions

View File

@ -118,7 +118,7 @@ public class VillagerListeners extends PluginDependent<EcoPlugin> implements Lis
recipe.setIngredients(ingredients);
event.setRecipe(recipe);
if (this.getPlugin().getConfigYml().getBool("villager.notify-on-special")) {
if (this.getPlugin().getConfigYml().getBool("villager.notify-on-special.enabled")) {
if (applied.getType().equals(EnchantmentType.SPECIAL)) {
showParticles(event.getEntity());
}
@ -236,7 +236,7 @@ public class VillagerListeners extends PluginDependent<EcoPlugin> implements Lis
recipe.setIngredients(ingredients);
event.setRecipe(recipe);
if (this.getPlugin().getConfigYml().getBool("villager.notify-on-special")) {
if (this.getPlugin().getConfigYml().getBool("villager.notify-on-special.enabled")) {
if (toAdd.keySet().stream().anyMatch(enchant -> enchant.getType().equals(EnchantmentType.SPELL))) {
showParticles(event.getEntity());
}
@ -256,7 +256,7 @@ public class VillagerListeners extends PluginDependent<EcoPlugin> implements Lis
location.add(0, 1, 0);
int limit = NumberUtils.randInt(8, 13);
int limit = this.getPlugin().getConfigYml().getInt("villager.notify-on-special.particle-amount");
for (int i = 0; i < limit; i++) {
Location spawnLoc = location.clone();

View File

@ -86,7 +86,9 @@ enchanting-table:
villager:
enabled: true # Enable EcoEnchants through villagers
book-times-less-likely: 7 # Times less likely to get an enchantment from a book with a villager. Recommended to be higher as books can only have one enchantment on them.
notify-on-special: true # Show particles when the villager unlocks a special enchantment trade
notify-on-special: # Show particles when the villager unlocks a special enchantment trade
enabled: true
particle-amount: 14
reduce-probability: # Reduce probability of adding new enchantment by factor after each enchantment added. Does not apply to books as they only ever contain one enchantment.
enabled: true # Enable reduction