mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-12-31 21:07:47 +01:00
Fix compatibility issues with 3rd party plugins
This commit is contained in:
parent
0229178e7d
commit
3beb451db5
@ -17,6 +17,7 @@ import org.bukkit.entity.EntityType;
|
|||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
@ -56,9 +57,15 @@ public class DeathListeners implements Listener {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler(priority = EventPriority.LOW)
|
||||||
public void onEntityDeath(EntityDeathEvent event) {
|
public void onEntityDeath(EntityDeathEvent event) {
|
||||||
LivingEntity entity = event.getEntity();
|
LivingEntity entity = event.getEntity();
|
||||||
|
|
||||||
|
if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)
|
||||||
|
&& !entity.getWorld().getGameRuleValue(GameRule.DO_MOB_LOOT)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (event.getEntityType() == EntityType.PLAYER
|
if (event.getEntityType() == EntityType.PLAYER
|
||||||
|| event.getEntityType() == EntityType.ARMOR_STAND) return;
|
|| event.getEntityType() == EntityType.ARMOR_STAND) return;
|
||||||
|
|
||||||
@ -76,12 +83,7 @@ public class DeathListeners implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)
|
|
||||||
&& !entity.getWorld().getGameRuleValue(GameRule.DO_MOB_LOOT))
|
|
||||||
drops.clear();
|
|
||||||
|
|
||||||
if (plugin.getCustomEntityManager().getCustomEntity(entity) == null) {
|
if (plugin.getCustomEntityManager().getCustomEntity(entity) == null) {
|
||||||
//replace %player% in drop commands with the last player to damage the entity
|
|
||||||
//Run commands here, or it will be buggy
|
//Run commands here, or it will be buggy
|
||||||
runCommands(entity, drops);
|
runCommands(entity, drops);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user