mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 23:26:45 +01:00
main
This commit is contained in:
parent
e6c3c143b6
commit
fab06a0063
@ -93,7 +93,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
|
|||||||
|
|
||||||
// TODO restructure this
|
// TODO restructure this
|
||||||
public static boolean teleportPlayer(final Player player, final Location from, final Plot plot) {
|
public static boolean teleportPlayer(final Player player, final Location from, final Plot plot) {
|
||||||
final Plot bot = PlayerFunctions.getBottomPlot(player.getWorld().getName(), plot);
|
final Plot bot = PlotHelper.getBottomPlot(player.getWorld().getName(), plot);
|
||||||
final PlayerTeleportToPlotEvent event = new PlayerTeleportToPlotEvent(player, from, bot);
|
final PlayerTeleportToPlotEvent event = new PlayerTeleportToPlotEvent(player, from, bot);
|
||||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
@ -247,7 +247,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
|
|||||||
final Entity[] entities = chunk.getEntities();
|
final Entity[] entities = chunk.getEntities();
|
||||||
Entity entity;
|
Entity entity;
|
||||||
for (int i = entities.length - 1; i >= 0; i--) {
|
for (int i = entities.length - 1; i >= 0; i--) {
|
||||||
if (!((entity = entities[i]) instanceof Player) && !.isInPlot(entity.getLocation())) {
|
if (!((entity = entities[i]) instanceof Player) && (PlotHelper.getPlot(BukkitUtil.getLocation(entity)) == null)) {
|
||||||
entity.remove();
|
entity.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -562,7 +562,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Location loc = BukkitUtil.getLocation(event.getLocation());
|
Location loc = BukkitUtil.getLocation(event.getLocation());
|
||||||
final String world = loc.getWorld().getName();
|
final String world = loc.getWorld();
|
||||||
if (!isPlotWorld(world)) {
|
if (!isPlotWorld(world)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -621,12 +621,15 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
|||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (!plot.isAdded(p)) {
|
} else {
|
||||||
if (!BukkitMain.hasPermission(p, "plots.admin.build.other")) {
|
UUID uuid = UUIDHandler.getUUID(p);
|
||||||
if (isPlotArea(loc)) {
|
if (!plot.isAdded(uuid))
|
||||||
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.other");
|
if (!BukkitMain.hasPermission(p, "plots.admin.build.other")) {
|
||||||
e.setCancelled(true);
|
if (isPlotArea(loc)) {
|
||||||
return;
|
PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.other");
|
||||||
|
e.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user