Added the ability to prevent armor from dropping.

This commit is contained in:
Brianna 2021-05-27 09:37:51 -05:00
parent 6564cc520a
commit 80772e0bf7
2 changed files with 5 additions and 0 deletions

View File

@ -87,6 +87,8 @@ public class DeathListeners implements Listener {
private boolean shouldDrop(LivingEntity entity, Material material) { private boolean shouldDrop(LivingEntity entity, Material material) {
if (entity.getEquipment() != null && entity.getEquipment().getArmorContents().length != 0) { if (entity.getEquipment() != null && entity.getEquipment().getArmorContents().length != 0) {
if (Settings.DONT_DROP_ARMOR.getBoolean())
return false;
if (finalItems.containsKey(entity.getUniqueId())) { if (finalItems.containsKey(entity.getUniqueId())) {
List<ItemStack> items = finalItems.get(entity.getUniqueId()); List<ItemStack> items = finalItems.get(entity.getUniqueId());
for (ItemStack item : items) for (ItemStack item : items)

View File

@ -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, 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?"); "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() 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()), .filter(Check::isEnabledByDefault).map(Check::name).collect(Collectors.toList()),
"These are checks that are processed before an entity is stacked.", "These are checks that are processed before an entity is stacked.",