From 80772e0bf7c63850ecfee5292c2dd81885b629f3 Mon Sep 17 00:00:00 2001 From: Brianna Date: Thu, 27 May 2021 09:37:51 -0500 Subject: [PATCH] Added the ability to prevent armor from dropping. --- .../com/songoda/ultimatestacker/listeners/DeathListeners.java | 2 ++ .../java/com/songoda/ultimatestacker/settings/Settings.java | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/main/java/com/songoda/ultimatestacker/listeners/DeathListeners.java b/src/main/java/com/songoda/ultimatestacker/listeners/DeathListeners.java index e552e52..7fb6612 100644 --- a/src/main/java/com/songoda/ultimatestacker/listeners/DeathListeners.java +++ b/src/main/java/com/songoda/ultimatestacker/listeners/DeathListeners.java @@ -87,6 +87,8 @@ public class DeathListeners implements Listener { private boolean shouldDrop(LivingEntity entity, Material material) { if (entity.getEquipment() != null && entity.getEquipment().getArmorContents().length != 0) { + if (Settings.DONT_DROP_ARMOR.getBoolean()) + return false; if (finalItems.containsKey(entity.getUniqueId())) { List items = finalItems.get(entity.getUniqueId()); for (ItemStack item : items) diff --git a/src/main/java/com/songoda/ultimatestacker/settings/Settings.java b/src/main/java/com/songoda/ultimatestacker/settings/Settings.java index f6e8bee..27deae0 100644 --- a/src/main/java/com/songoda/ultimatestacker/settings/Settings.java +++ b/src/main/java/com/songoda/ultimatestacker/settings/Settings.java @@ -88,6 +88,9 @@ public class Settings { public static final ConfigSetting NO_EXP_INSTANT_KILL = new ConfigSetting(config, "Entities.No Exp For Instant Kills", false, "Should no experience be dropped when an instant kill is performed?"); + public static final ConfigSetting DONT_DROP_ARMOR = new ConfigSetting(config, "Entities.Dont Drop Armor", false, + "Should entities not drop their armor when custom drops are enabled?"); + public static final ConfigSetting STACK_CHECKS = new ConfigSetting(config, "Entities.Stack Checks", Arrays.asList(Check.values()).stream() .filter(Check::isEnabledByDefault).map(Check::name).collect(Collectors.toList()), "These are checks that are processed before an entity is stacked.",