mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
actually fix all conflicts
This commit is contained in:
parent
82a887fd3b
commit
c5ec8e1931
@ -2966,24 +2966,21 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
return false;
|
||||
}
|
||||
} else if (EntityCategories.ANIMAL.contains(entityType)) { // victim is animal
|
||||
<<<<<<<HEAD if (isPlot) {
|
||||
if (isPlot) {
|
||||
if (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");
|
||||
return true;
|
||||
}
|
||||
} else if (roadFlags && (area.getFlag(AnimalAttackFlag.class) || area
|
||||
.getFlag(PveFlag.class))) {
|
||||
=======
|
||||
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)) {
|
||||
if (!Permissions.hasPermission(plotPlayer, "plots.admin.pve." + stub)) {
|
||||
MainUtil.sendMessage(plotPlayer, Captions.NO_PERMISSION_EVENT,
|
||||
"plots.admin.pve." + stub);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else if (EntityCategories.VEHICLE
|
||||
.contains(entityType)) { // Vehicles are managed in vehicle destroy event
|
||||
return true;
|
||||
@ -3004,7 +3001,8 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} return true;
|
||||
}
|
||||
return true;
|
||||
} else if (dplot != null && (!dplot.equals(vplot) || Objects
|
||||
.equals(dplot.getOwnerAbs(), vplot.getOwnerAbs()))) {
|
||||
return vplot != null && vplot.getFlag(PveFlag.class);
|
||||
@ -3024,7 +3022,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onPlayerEggThrow (PlayerEggThrowEvent event){
|
||||
public void onPlayerEggThrow(PlayerEggThrowEvent event) {
|
||||
Location location = BukkitUtil.getLocation(event.getEgg().getLocation());
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
@ -3055,7 +3053,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void blockCreate (BlockPlaceEvent event){
|
||||
public void blockCreate(BlockPlaceEvent event) {
|
||||
Location location = BukkitUtil.getLocation(event.getBlock().getLocation());
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
@ -3092,8 +3090,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
MainUtil.sendMessage(pp, Captions.NO_PERMISSION_EVENT,
|
||||
Captions.PERMISSION_ADMIN_BUILD_OTHER);
|
||||
event.setCancelled(true);
|
||||
plot.debug(
|
||||
player.getName() + " could not place " + event.getBlock().getType()
|
||||
plot.debug(player.getName() + " could not place " + event.getBlock().getType()
|
||||
+ " because of the place flag");
|
||||
return;
|
||||
}
|
||||
@ -3120,7 +3117,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH) public void onDamage (EntityDamageEvent event){
|
||||
@EventHandler(priority = EventPriority.HIGH) public void onDamage(EntityDamageEvent event) {
|
||||
if (event.getEntityType() != EntityType.PLAYER) {
|
||||
return;
|
||||
}
|
||||
@ -3137,25 +3134,22 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
return;
|
||||
}
|
||||
if (plot.getFlag(InvincibleFlag.class)) {
|
||||
plot.debug(event.getEntity().getName()
|
||||
+ " could not take damage because invincible = true");
|
||||
plot.debug(
|
||||
event.getEntity().getName() + " could not take damage because invincible = true");
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler public void onItemDrop (PlayerDropItemEvent event){
|
||||
@EventHandler public void onItemDrop(PlayerDropItemEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
<<<<<<<HEAD PlotPlayer pp = BukkitUtil.getPlayer(player);
|
||||
BukkitPlayer pp = BukkitUtil.getPlayer(player);
|
||||
Location location = pp.getLocation();
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
return;
|
||||
}
|
||||
Plot plot = location.getOwnedPlot();
|
||||
=======
|
||||
BukkitPlayer pp = BukkitUtil.getPlayer(player);
|
||||
Plot plot = BukkitUtil.getLocation(player).getOwnedPlot();
|
||||
>>>>>>>v5 if (plot == null) {
|
||||
if (plot == null) {
|
||||
if (area.isRoadRespectingGlobalFlags() && area.getFlag(ItemDropFlag.class)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -3164,45 +3158,40 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
UUID uuid = pp.getUUID();
|
||||
if (!plot.isAdded(uuid)) {
|
||||
if (!plot.getFlag(ItemDropFlag.class)) {
|
||||
plot.debug(
|
||||
player.getName() + " could not drop item because of item-drop = false");
|
||||
plot.debug(player.getName() + " could not drop item because of item-drop = false");
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler public void onItemPickup (EntityPickupItemEvent event){
|
||||
@EventHandler public void onItemPickup(EntityPickupItemEvent event) {
|
||||
LivingEntity ent = event.getEntity();
|
||||
if (ent instanceof Player) {
|
||||
Player player = (Player) ent;
|
||||
<<<<<<<HEAD PlotPlayer pp = BukkitUtil.getPlayer(player);
|
||||
BukkitPlayer pp = BukkitUtil.getPlayer(player);
|
||||
Location location = pp.getLocation();
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
return;
|
||||
}
|
||||
Plot plot = location.getOwnedPlot();
|
||||
=======
|
||||
BukkitPlayer pp = BukkitUtil.getPlayer(player);
|
||||
Plot plot = BukkitUtil.getLocation(player).getOwnedPlot();
|
||||
>>>>>>>v5 if (plot == null) {
|
||||
if (area.isRoadRespectingGlobalFlags() && area
|
||||
.getFlag(DropProtectionFlag.class)) {
|
||||
if (plot == null) {
|
||||
if (area.isRoadRespectingGlobalFlags() && area.getFlag(DropProtectionFlag.class)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
UUID uuid = pp.getUUID();
|
||||
if (!plot.isAdded(uuid) && plot.getFlag(DropProtectionFlag.class)) {
|
||||
plot.debug(player.getName()
|
||||
+ " could not pick up item because of drop-protection = true");
|
||||
plot.debug(
|
||||
player.getName() + " could not pick up item because of drop-protection = true");
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler public void onDeath ( final PlayerDeathEvent event){
|
||||
<<<<<<<HEAD Location location = BukkitUtil.getLocation(event.getEntity());
|
||||
@EventHandler public void onDeath(final PlayerDeathEvent event) {
|
||||
Location location = BukkitUtil.getLocation(event.getEntity());
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
return;
|
||||
@ -3215,13 +3204,11 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
return;
|
||||
}
|
||||
if (plot.getFlag(KeepInventoryFlag.class)) {
|
||||
=======
|
||||
final Plot plot = BukkitUtil.getPlayer(event.getEntity()).getCurrentPlot();
|
||||
if (plot != null && plot.getFlag(KeepInventoryFlag.class)) {
|
||||
if (plot.getFlag(KeepInventoryFlag.class)) {
|
||||
plot.debug(event.getEntity().getName()
|
||||
+ " kept their inventory because of keep-inventory = true");
|
||||
>>>>>>>v5 event.setKeepInventory(true);
|
||||
event.setKeepInventory(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user