actually fix all conflicts

This commit is contained in:
dordsor21 2020-07-01 14:21:18 +01:00
parent 82a887fd3b
commit c5ec8e1931
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B

View File

@ -2966,24 +2966,21 @@ public class PlayerEvents extends PlotListener implements Listener {
return false; return false;
} }
} else if (EntityCategories.ANIMAL.contains(entityType)) { // victim is animal } else if (EntityCategories.ANIMAL.contains(entityType)) { // victim is animal
<<<<<<<HEAD 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.getFlag(AnimalAttackFlag.class) || area } else if (roadFlags && (area.getFlag(AnimalAttackFlag.class) || area
.getFlag(PveFlag.class))) { .getFlag(PveFlag.class))) {
======= if (!Permissions.hasPermission(plotPlayer, "plots.admin.pve." + stub)) {
if (plot != null && (plot.getFlag(AnimalAttackFlag.class) || plot
.getFlag(PveFlag.class) || plot.isAdded(plotPlayer.getUUID()))) {
plot.debug(player.getName() + " could not attack " + entityType
+ " because pve = false OR animal-attack = false");
>>>>>>>v5 return true;
} if (!Permissions.hasPermission(plotPlayer, "plots.admin.pve." + stub)) {
MainUtil.sendMessage(plotPlayer, Captions.NO_PERMISSION_EVENT, MainUtil.sendMessage(plotPlayer, Captions.NO_PERMISSION_EVENT,
"plots.admin.pve." + stub); "plots.admin.pve." + stub);
return 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
return true; return true;
@ -3004,7 +3001,8 @@ public class PlayerEvents extends PlotListener implements Listener {
} }
return false; return false;
} }
} return true; }
return true;
} else if (dplot != null && (!dplot.equals(vplot) || Objects } else if (dplot != null && (!dplot.equals(vplot) || Objects
.equals(dplot.getOwnerAbs(), vplot.getOwnerAbs()))) { .equals(dplot.getOwnerAbs(), vplot.getOwnerAbs()))) {
return vplot != null && vplot.getFlag(PveFlag.class); return vplot != null && vplot.getFlag(PveFlag.class);
@ -3092,8 +3090,7 @@ public class PlayerEvents extends PlotListener implements Listener {
MainUtil.sendMessage(pp, Captions.NO_PERMISSION_EVENT, MainUtil.sendMessage(pp, Captions.NO_PERMISSION_EVENT,
Captions.PERMISSION_ADMIN_BUILD_OTHER); Captions.PERMISSION_ADMIN_BUILD_OTHER);
event.setCancelled(true); event.setCancelled(true);
plot.debug( plot.debug(player.getName() + " could not place " + event.getBlock().getType()
player.getName() + " could not place " + event.getBlock().getType()
+ " because of the place flag"); + " because of the place flag");
return; return;
} }
@ -3137,25 +3134,22 @@ public class PlayerEvents extends PlotListener implements Listener {
return; return;
} }
if (plot.getFlag(InvincibleFlag.class)) { if (plot.getFlag(InvincibleFlag.class)) {
plot.debug(event.getEntity().getName() plot.debug(
+ " could not take damage because invincible = true"); event.getEntity().getName() + " could not take damage because invincible = true");
event.setCancelled(true); event.setCancelled(true);
} }
} }
@EventHandler public void onItemDrop(PlayerDropItemEvent event) { @EventHandler public void onItemDrop(PlayerDropItemEvent event) {
Player player = event.getPlayer(); Player player = event.getPlayer();
<<<<<<<HEAD PlotPlayer pp = BukkitUtil.getPlayer(player); BukkitPlayer pp = BukkitUtil.getPlayer(player);
Location location = pp.getLocation(); Location location = pp.getLocation();
PlotArea area = location.getPlotArea(); PlotArea area = location.getPlotArea();
if (area == null) { if (area == null) {
return; return;
} }
Plot plot = location.getOwnedPlot(); Plot plot = location.getOwnedPlot();
======= if (plot == null) {
BukkitPlayer pp = BukkitUtil.getPlayer(player);
Plot plot = BukkitUtil.getLocation(player).getOwnedPlot();
>>>>>>>v5 if (plot == null) {
if (area.isRoadRespectingGlobalFlags() && area.getFlag(ItemDropFlag.class)) { if (area.isRoadRespectingGlobalFlags() && area.getFlag(ItemDropFlag.class)) {
event.setCancelled(true); event.setCancelled(true);
} }
@ -3164,8 +3158,7 @@ public class PlayerEvents extends PlotListener implements Listener {
UUID uuid = pp.getUUID(); UUID uuid = pp.getUUID();
if (!plot.isAdded(uuid)) { if (!plot.isAdded(uuid)) {
if (!plot.getFlag(ItemDropFlag.class)) { if (!plot.getFlag(ItemDropFlag.class)) {
plot.debug( plot.debug(player.getName() + " could not drop item because of item-drop = false");
player.getName() + " could not drop item because of item-drop = false");
event.setCancelled(true); event.setCancelled(true);
} }
} }
@ -3175,34 +3168,30 @@ public class PlayerEvents extends PlotListener implements Listener {
LivingEntity ent = event.getEntity(); LivingEntity ent = event.getEntity();
if (ent instanceof Player) { if (ent instanceof Player) {
Player player = (Player) ent; Player player = (Player) ent;
<<<<<<<HEAD PlotPlayer pp = BukkitUtil.getPlayer(player); BukkitPlayer pp = BukkitUtil.getPlayer(player);
Location location = pp.getLocation(); Location location = pp.getLocation();
PlotArea area = location.getPlotArea(); PlotArea area = location.getPlotArea();
if (area == null) { if (area == null) {
return; return;
} }
Plot plot = location.getOwnedPlot(); Plot plot = location.getOwnedPlot();
======= if (plot == null) {
BukkitPlayer pp = BukkitUtil.getPlayer(player); if (area.isRoadRespectingGlobalFlags() && area.getFlag(DropProtectionFlag.class)) {
Plot plot = BukkitUtil.getLocation(player).getOwnedPlot();
>>>>>>>v5 if (plot == null) {
if (area.isRoadRespectingGlobalFlags() && area
.getFlag(DropProtectionFlag.class)) {
event.setCancelled(true); event.setCancelled(true);
} }
return; return;
} }
UUID uuid = pp.getUUID(); UUID uuid = pp.getUUID();
if (!plot.isAdded(uuid) && plot.getFlag(DropProtectionFlag.class)) { if (!plot.isAdded(uuid) && plot.getFlag(DropProtectionFlag.class)) {
plot.debug(player.getName() plot.debug(
+ " could not pick up item because of drop-protection = true"); player.getName() + " could not pick up item because of drop-protection = true");
event.setCancelled(true); event.setCancelled(true);
} }
} }
} }
@EventHandler public void onDeath(final PlayerDeathEvent event) { @EventHandler public void onDeath(final PlayerDeathEvent event) {
<<<<<<<HEAD Location location = BukkitUtil.getLocation(event.getEntity()); Location location = BukkitUtil.getLocation(event.getEntity());
PlotArea area = location.getPlotArea(); PlotArea area = location.getPlotArea();
if (area == null) { if (area == null) {
return; return;
@ -3215,13 +3204,11 @@ public class PlayerEvents extends PlotListener implements Listener {
return; return;
} }
if (plot.getFlag(KeepInventoryFlag.class)) { if (plot.getFlag(KeepInventoryFlag.class)) {
======= if (plot.getFlag(KeepInventoryFlag.class)) {
final Plot plot = BukkitUtil.getPlayer(event.getEntity()).getCurrentPlot();
if (plot != null && plot.getFlag(KeepInventoryFlag.class)) {
plot.debug(event.getEntity().getName() plot.debug(event.getEntity().getName()
+ " kept their inventory because of keep-inventory = true"); + " kept their inventory because of keep-inventory = true");
>>>>>>>v5 event.setKeepInventory(true); event.setKeepInventory(true);
}
} }
} }
} }