Added plot entry event for unowned plots

This commit is contained in:
boy0001 2015-07-21 14:30:41 +10:00
parent 9fefdf3313
commit 0c81dd82b3

View File

@ -110,10 +110,9 @@ public class PlotListener extends APlotListener {
} }
pp.setMeta("lastplot", plot); pp.setMeta("lastplot", plot);
final Player player = ((BukkitPlayer) pp).player; final Player player = ((BukkitPlayer) pp).player;
if (plot.hasOwner()) {
final PlayerEnterPlotEvent callEvent = new PlayerEnterPlotEvent(player, plot); final PlayerEnterPlotEvent callEvent = new PlayerEnterPlotEvent(player, plot);
Bukkit.getPluginManager().callEvent(callEvent); Bukkit.getPluginManager().callEvent(callEvent);
if (plot.hasOwner()) {
HashMap<String, Flag> flags = FlagManager.getPlotFlags(plot); HashMap<String, Flag> flags = FlagManager.getPlotFlags(plot);
int size = flags.size(); int size = flags.size();
boolean titles = Settings.TITLES; boolean titles = Settings.TITLES;
@ -229,6 +228,7 @@ public class PlotListener extends APlotListener {
Player player = ((BukkitPlayer) pp).player; Player player = ((BukkitPlayer) pp).player;
final PlayerLeavePlotEvent callEvent = new PlayerLeavePlotEvent(player, plot); final PlayerLeavePlotEvent callEvent = new PlayerLeavePlotEvent(player, plot);
Bukkit.getPluginManager().callEvent(callEvent); Bukkit.getPluginManager().callEvent(callEvent);
if (plot.hasOwner()) {
if (FlagManager.getPlotFlag(plot, "fly") != null) { if (FlagManager.getPlotFlag(plot, "fly") != null) {
player.setAllowFlight(Bukkit.getAllowFlight()); player.setAllowFlight(Bukkit.getAllowFlight());
} }
@ -253,6 +253,7 @@ public class PlotListener extends APlotListener {
pp.deleteMeta("music"); pp.deleteMeta("music");
player.playEffect(lastLoc, Effect.RECORD_PLAY, 0); player.playEffect(lastLoc, Effect.RECORD_PLAY, 0);
} }
}
return true; return true;
} }