mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-24 22:26:45 +01:00
Fix if-condition limited to roads for animal attack cancelling on plots (#3079)
* Negate mob-place flag debug message * fixed a little typo :) * Added check for dragon egg teleportation event https://github.com/IntellectualSites/PlotSquared/issues/3074 * Basic dragon egg interact bugfix (Left-click interaction) * Lifted admin if-condition out of roads (out-of-plot) only block (for animals) Co-authored-by: NotMyFault <mc.cache@web.de>
This commit is contained in:
parent
5a5d1f5e62
commit
8a244d12fc
@ -279,19 +279,22 @@ public class BukkitEntityUtil {
|
|||||||
if (isPlot) {
|
if (isPlot) {
|
||||||
if (plot.getFlag(AnimalAttackFlag.class) || plot.getFlag(PveFlag.class) || plot
|
if (plot.getFlag(AnimalAttackFlag.class) || plot.getFlag(PveFlag.class) || plot
|
||||||
.isAdded(plotPlayer.getUUID())) {
|
.isAdded(plotPlayer.getUUID())) {
|
||||||
plot.debug(player.getName() + " could not attack " + entityType
|
|
||||||
+ " because pve = false OR animal-attack = false");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else if (roadFlags && (area.getRoadFlag(AnimalAttackFlag.class) || area
|
} else if (roadFlags && (area.getRoadFlag(AnimalAttackFlag.class) || area
|
||||||
.getFlag(PveFlag.class))) {
|
.getFlag(PveFlag.class))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
if (!Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_PVE + "." + stub)) {
|
||||||
plotPlayer.sendMessage(
|
plotPlayer.sendMessage(
|
||||||
TranslatableCaption.of("permission.no_permission_event"),
|
TranslatableCaption.of("permission.no_permission_event"),
|
||||||
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
Template.of("node", Permission.PERMISSION_ADMIN_PVE + "." + stub)
|
||||||
);
|
);
|
||||||
return false;
|
if (plot != null) {
|
||||||
|
plot.debug(player.getName() + " could not attack " + entityType
|
||||||
|
+ " because pve = false OR animal-attack = false");
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
} else if (EntityCategories.VEHICLE
|
} else if (EntityCategories.VEHICLE
|
||||||
.contains(entityType)) { // Vehicles are managed in vehicle destroy event
|
.contains(entityType)) { // Vehicles are managed in vehicle destroy event
|
||||||
|
Loading…
Reference in New Issue
Block a user