Respect DO_MOB_LOOT game rule.

This commit is contained in:
Brianna 2019-12-16 17:23:53 -05:00
parent 23d846f937
commit 160f345b89

View File

@ -7,6 +7,7 @@ import com.songoda.ultimatestacker.UltimateStacker;
import com.songoda.ultimatestacker.entity.EntityStack;
import com.songoda.ultimatestacker.settings.Settings;
import com.songoda.ultimatestacker.utils.DropUtils;
import org.bukkit.GameRule;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.ChestedHorse;
@ -52,6 +53,9 @@ public class DeathListeners implements Listener {
}
}
if (!event.getEntity().getWorld().getGameRuleValue(GameRule.DO_MOB_LOOT))
drops.clear();
if (instance.getEntityStackManager().isStacked(event.getEntity()))
instance.getEntityStackManager().getStack(event.getEntity())
.onDeath(event.getEntity(), drops, custom, event.getDroppedExp(), event);