allow "owned" road mobs to be killed as well

(those that are leashed, being ridden, etc)
This commit is contained in:
dordsor21
2020-12-10 21:14:32 +00:00
parent 540f4c0958
commit b4f3e85001
2 changed files with 8 additions and 3 deletions

View File

@ -898,9 +898,11 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
if (BukkitUtil.adapt(location).isPlotRoad()) {
if (entity instanceof LivingEntity) {
LivingEntity livingEntity = (LivingEntity) entity;
if (!livingEntity.isLeashed() || !entity.hasMetadata("keep")) {
if ((Settings.Enabled_Components.KILL_OWNED_ROAD_MOBS || !livingEntity.isLeashed())
|| !entity.hasMetadata("keep")) {
Entity passenger = entity.getPassenger();
if (!(passenger instanceof Player) && entity.getMetadata("keep").isEmpty()) {
if ((Settings.Enabled_Components.KILL_OWNED_ROAD_MOBS
|| !(passenger instanceof Player)) && entity.getMetadata("keep").isEmpty()) {
if (entity.hasMetadata("ps-tmp-teleport")) {
continue;
}
@ -911,7 +913,8 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
}
} else {
Entity passenger = entity.getPassenger();
if (!(passenger instanceof Player) && entity.getMetadata("keep").isEmpty()) {
if ((Settings.Enabled_Components.KILL_OWNED_ROAD_MOBS
|| !(passenger instanceof Player)) && entity.getMetadata("keep").isEmpty()) {
if (entity.hasMetadata("ps-tmp-teleport")) {
continue;
}