Added option to not drop xp in InfernalTouch

This commit is contained in:
Auxilor 2021-01-24 16:11:47 +00:00
parent 1c00b6b109
commit ebbf40d9a2
2 changed files with 7 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import com.willfp.eco.util.drops.DropQueue;
import com.willfp.eco.util.integrations.antigrief.AntigriefManager;
import com.willfp.eco.util.tuplets.Pair;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
import com.willfp.ecoenchants.enchantments.util.EnchantChecks;
import org.bukkit.Bukkit;
@ -65,6 +66,7 @@ public class InfernalTouch extends EcoEnchant {
}
return toReturn;
}
@EventHandler
public void infernalTouchBreak(@NotNull final BlockDropItemEvent event) {
Player player = event.getPlayer();
@ -116,6 +118,10 @@ public class InfernalTouch extends EcoEnchant {
event.getItems().clear();
if (!this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "drop-xp")) {
experience = 0;
}
new DropQueue(player)
.setLocation(block.getLocation())
.addItems(drops)

View File

@ -22,4 +22,4 @@ general-config:
- stone_switcher
config:
# No config is available for this enchantment
drop-xp: true # If experience should be given