mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-24 12:16:44 +01:00
Don't kill owned road entities (leashed / named) (#3829)
This commit is contained in:
parent
3effaefda7
commit
d5445cfbef
@ -849,11 +849,11 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
||||
// managed elsewhere
|
||||
continue;
|
||||
case "SHULKER":
|
||||
if (Settings.Enabled_Components.KILL_ROAD_MOBS) {
|
||||
if (Settings.Enabled_Components.KILL_ROAD_MOBS && (Settings.Enabled_Components.KILL_NAMED_ROAD_MOBS || entity.getCustomName() == null)) {
|
||||
LivingEntity livingEntity = (LivingEntity) entity;
|
||||
List<MetadataValue> meta = entity.getMetadata("shulkerPlot");
|
||||
if (!meta.isEmpty()) {
|
||||
if (livingEntity.isLeashed()) {
|
||||
if (livingEntity.isLeashed() && !Settings.Enabled_Components.KILL_OWNED_ROAD_MOBS) {
|
||||
continue;
|
||||
}
|
||||
List<MetadataValue> keep = entity.getMetadata("keep");
|
||||
@ -973,7 +973,9 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
||||
|| !entity.hasMetadata("keep")) {
|
||||
Entity passenger = entity.getPassenger();
|
||||
if ((Settings.Enabled_Components.KILL_OWNED_ROAD_MOBS
|
||||
|| !(passenger instanceof Player)) && entity.getMetadata("keep").isEmpty()) {
|
||||
|| !((passenger instanceof Player) || livingEntity.isLeashed()))
|
||||
&& (Settings.Enabled_Components.KILL_NAMED_ROAD_MOBS || entity.getCustomName() == null)
|
||||
&& entity.getMetadata("keep").isEmpty()) {
|
||||
if (entity.hasMetadata("ps-tmp-teleport")) {
|
||||
continue;
|
||||
}
|
||||
@ -983,8 +985,9 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
||||
}
|
||||
} else {
|
||||
Entity passenger = entity.getPassenger();
|
||||
if ((Settings.Enabled_Components.KILL_OWNED_ROAD_MOBS
|
||||
|| !(passenger instanceof Player)) && entity.getMetadata("keep").isEmpty()) {
|
||||
if ((Settings.Enabled_Components.KILL_OWNED_ROAD_MOBS || !(passenger instanceof Player))
|
||||
&& (Settings.Enabled_Components.KILL_NAMED_ROAD_MOBS && entity.getCustomName() != null)
|
||||
&& entity.getMetadata("keep").isEmpty()) {
|
||||
if (entity.hasMetadata("ps-tmp-teleport")) {
|
||||
continue;
|
||||
}
|
||||
|
@ -759,6 +759,8 @@ public class Settings extends Config {
|
||||
@Comment("Also kill any road mobs that are being ridden, or are leashed")
|
||||
public static boolean
|
||||
KILL_OWNED_ROAD_MOBS = false;
|
||||
@Comment("Also kill any road mobs that are named")
|
||||
public static boolean KILL_NAMED_ROAD_MOBS = false;
|
||||
@Comment("Kill items on roads (Stick, Paper, etc.)")
|
||||
public static boolean KILL_ROAD_ITEMS = false;
|
||||
@Comment("Kill vehicles on roads (Boat, Minecart, etc.)")
|
||||
|
Loading…
Reference in New Issue
Block a user