mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 23:26:45 +01:00
.
This commit is contained in:
parent
b14b7102b9
commit
6487184d42
@ -277,7 +277,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
|||||||
if ((destroy != null) && ((HashSet<PlotBlock>) destroy.getValue()).contains(new PlotBlock((short) block.getTypeId(), block.getData()))) {
|
if ((destroy != null) && ((HashSet<PlotBlock>) destroy.getValue()).contains(new PlotBlock((short) block.getTypeId(), block.getData()))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (BukkitMain.hasPermission(event.getPlayer(), "plots.admin.destroy.other")) {
|
if (Permissions.hasPermission(BukkitUtil.getPlayer(player), "plots.admin.destroy.other")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.NO_PERMISSION, "plots.admin.destroy.other");
|
MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.NO_PERMISSION, "plots.admin.destroy.other");
|
||||||
@ -286,7 +286,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (BukkitMain.hasPermission(event.getPlayer(), "plots.admin.destroy.road")) {
|
if (Permissions.hasPermission(BukkitUtil.getPlayer(player), "plots.admin.destroy.road")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isPlotArea(loc)) {
|
if (isPlotArea(loc)) {
|
||||||
@ -671,19 +671,19 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
|||||||
if (isInPlot(q)) {
|
if (isInPlot(q)) {
|
||||||
final Plot plot = getCurrentPlot(q);
|
final Plot plot = getCurrentPlot(q);
|
||||||
|
|
||||||
if (plot.isDenied(event.getPlayer())) {
|
if (plot.isDenied(player)) {
|
||||||
BukkitPlayerFunctions.sendMessage(event.getPlayer(), C.YOU_BE_DENIED);
|
BukkitPlayerFunctions.sendMessage(player, C.YOU_BE_DENIED);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (enteredPlot(f, t)) {
|
if (enteredPlot(f, t)) {
|
||||||
plotEntry(event.getPlayer(), plot);
|
plotEntry(player, plot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (leftPlot(f, t)) {
|
if (leftPlot(f, t)) {
|
||||||
final Plot plot = getCurrentPlot(event.getFrom());
|
final Plot plot = getCurrentPlot(event.getFrom());
|
||||||
plotExit(event.getPlayer(), plot);
|
plotExit(player, plot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((q.getX() >= 29999999) || (q.getX() <= -29999999) || (q.getZ() >= 29999999) || (q.getZ() <= -29999999)) {
|
if ((q.getX() >= 29999999) || (q.getX() <= -29999999) || (q.getZ() >= 29999999) || (q.getZ() <= -29999999)) {
|
||||||
@ -744,12 +744,12 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public static void onLeave(final PlayerQuitEvent event) {
|
public static void onLeave(final PlayerQuitEvent event) {
|
||||||
if (Setup.setupMap.containsKey(event.getPlayer().getName())) {
|
if (Setup.setupMap.containsKey(player.getName())) {
|
||||||
Setup.setupMap.remove(event.getPlayer().getName());
|
Setup.setupMap.remove(player.getName());
|
||||||
}
|
}
|
||||||
BukkitUtil.removePlayer(event.getPlayer().getName());
|
BukkitUtil.removePlayer(player.getName());
|
||||||
if (Settings.DELETE_PLOTS_ON_BAN && event.getPlayer().isBanned()) {
|
if (Settings.DELETE_PLOTS_ON_BAN && event.getPlayer().isBanned()) {
|
||||||
final Collection<Plot> plots = PlotSquared.getPlots(event.getPlayer().getName()).values();
|
final Collection<Plot> plots = PlotSquared.getPlots(player.getName()).values();
|
||||||
for (final Plot plot : plots) {
|
for (final Plot plot : plots) {
|
||||||
final PlotWorld plotworld = PlotSquared.getPlotWorld(plot.world);
|
final PlotWorld plotworld = PlotSquared.getPlotWorld(plot.world);
|
||||||
final PlotManager manager = PlotSquared.getPlotManager(plot.world);
|
final PlotManager manager = PlotSquared.getPlotManager(plot.world);
|
||||||
@ -1070,7 +1070,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
|||||||
if (!isPlotWorld(world)) {
|
if (!isPlotWorld(world)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (BukkitMain.hasPermission(event.getPlayer(), "plots.admin")) {
|
if (Permissions.hasPermission(BukkitUtil.getPlayer(player), "plots.admin")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
|
@ -223,26 +223,26 @@ public class PlotPlusListener extends PlotListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerQuit(final PlayerQuitEvent event) {
|
public void onPlayerQuit(final PlayerQuitEvent event) {
|
||||||
if (feedRunnable.containsKey(event.getPlayer().getName())) {
|
if (feedRunnable.containsKey(player.getName())) {
|
||||||
feedRunnable.remove(event.getPlayer().getName());
|
feedRunnable.remove(player.getName());
|
||||||
}
|
}
|
||||||
if (healRunnable.containsKey(event.getPlayer().getName())) {
|
if (healRunnable.containsKey(player.getName())) {
|
||||||
healRunnable.remove(event.getPlayer().getName());
|
healRunnable.remove(player.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlotLeave(final PlayerLeavePlotEvent event) {
|
public void onPlotLeave(final PlayerLeavePlotEvent event) {
|
||||||
event.getPlayer().playEffect(event.getPlayer().getLocation(), Effect.RECORD_PLAY, 0);
|
event.getPlayer().playEffect(player.getLocation(), Effect.RECORD_PLAY, 0);
|
||||||
final Plot plot = event.getPlot();
|
final Plot plot = event.getPlot();
|
||||||
if (FlagManager.getPlotFlag(plot, "farewell") != null) {
|
if (FlagManager.getPlotFlag(plot, "farewell") != null) {
|
||||||
event.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes('&', C.PREFIX_FAREWELL.s().replaceAll("%id%", plot.id + "") + FlagManager.getPlotFlag(plot, "farewell").getValueString()));
|
event.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes('&', C.PREFIX_FAREWELL.s().replaceAll("%id%", plot.id + "") + FlagManager.getPlotFlag(plot, "farewell").getValueString()));
|
||||||
}
|
}
|
||||||
if (feedRunnable.containsKey(event.getPlayer().getName())) {
|
if (feedRunnable.containsKey(player.getName())) {
|
||||||
feedRunnable.remove(event.getPlayer().getName());
|
feedRunnable.remove(player.getName());
|
||||||
}
|
}
|
||||||
if (healRunnable.containsKey(event.getPlayer().getName())) {
|
if (healRunnable.containsKey(player.getName())) {
|
||||||
healRunnable.remove(event.getPlayer().getName());
|
healRunnable.remove(player.getName());
|
||||||
}
|
}
|
||||||
if (booleanFlag(plot, "notify-leave", false)) {
|
if (booleanFlag(plot, "notify-leave", false)) {
|
||||||
if (plot.hasOwner()) {
|
if (plot.hasOwner()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user