mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-11-23 10:35:22 +01:00
Added the ability to prevent armor from dropping.
This commit is contained in:
parent
6564cc520a
commit
80772e0bf7
@ -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)
|
||||||
|
@ -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.",
|
||||||
|
Loading…
Reference in New Issue
Block a user