mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 15:16:45 +01:00
Merge remote-tracking branch 'origin/master'
Conflicts: PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitChunkManager.java
This commit is contained in:
commit
1815fb09b3
@ -416,7 +416,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
|||||||
final Set<Player> recipients = event.getRecipients();
|
final Set<Player> recipients = event.getRecipients();
|
||||||
recipients.clear();
|
recipients.clear();
|
||||||
for (final Player p : Bukkit.getOnlinePlayers()) {
|
for (final Player p : Bukkit.getOnlinePlayers()) {
|
||||||
if (plot.equals(MainUtil.getPlot(BukkitUtil.getLocation(p)))) {
|
if (p.hasPermission("plots.admin.command.chat") || plot.equals(MainUtil.getPlot(BukkitUtil.getLocation(p)))) {
|
||||||
recipients.add(p);
|
recipients.add(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -272,7 +272,7 @@ public class MainUtil {
|
|||||||
z = bot.getZ() + plotworld.DEFAULT_HOME.z;
|
z = bot.getZ() + plotworld.DEFAULT_HOME.z;
|
||||||
}
|
}
|
||||||
final int y = Math.max(getHeighestBlock(plot.world, x, z), manager.getSignLoc(PlotSquared.getPlotWorld(plot.world), plot).getY());
|
final int y = Math.max(getHeighestBlock(plot.world, x, z), manager.getSignLoc(PlotSquared.getPlotWorld(plot.world), plot).getY());
|
||||||
return new Location(plot.world, x, y, z);
|
return new Location(plot.world, x, y + 1, z);
|
||||||
}
|
}
|
||||||
final Location top = getPlotTopLoc(plot.world, plot.id);
|
final Location top = getPlotTopLoc(plot.world, plot.id);
|
||||||
final Location bot = getPlotBottomLoc(plot.world, plot.id);
|
final Location bot = getPlotBottomLoc(plot.world, plot.id);
|
||||||
@ -280,7 +280,7 @@ public class MainUtil {
|
|||||||
final int z = bot.getZ();
|
final int z = bot.getZ();
|
||||||
PlotManager manager = PlotSquared.getPlotManager(plot.world);
|
PlotManager manager = PlotSquared.getPlotManager(plot.world);
|
||||||
final int y = Math.max(getHeighestBlock(plot.world, x, z), manager.getSignLoc(PlotSquared.getPlotWorld(plot.world), plot).getY());
|
final int y = Math.max(getHeighestBlock(plot.world, x, z), manager.getSignLoc(PlotSquared.getPlotWorld(plot.world), plot).getY());
|
||||||
return new Location(plot.world, x, y, z);
|
return new Location(plot.world, x, y + 1, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean teleportPlayer(final PlotPlayer player, final Location from, final Plot plot) {
|
public static boolean teleportPlayer(final PlotPlayer player, final Location from, final Plot plot) {
|
||||||
|
@ -96,14 +96,14 @@ public class BukkitChunkManager extends ChunkManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void regenerateChunk(String world, ChunkLoc loc) {
|
public void regenerateChunk(String world, ChunkLoc loc) {
|
||||||
World bukkitWorld = Bukkit.getWorld(world);
|
World worldObj = Bukkit.getWorld(world);
|
||||||
bukkitWorld.regenerateChunk(loc.x, loc.z);
|
worldObj.regenerateChunk(loc.x, loc.z);
|
||||||
Chunk chunk = bukkitWorld.getChunkAt(loc.x, loc.z);
|
for (final Player player : worldObj.getPlayers()) {
|
||||||
for (final Entity entity : chunk.getEntities()) {
|
org.bukkit.Location locObj = player.getLocation();
|
||||||
if (entity instanceof Player) {
|
if (locObj.getBlockX() >> 4 == loc.x && locObj.getBlockZ() >> 4 == loc.z && !locObj.getBlock().isEmpty()) {
|
||||||
final Plot plot = MainUtil.getPlot(BukkitUtil.getLocation(entity.getLocation()));
|
final Plot plot = MainUtil.getPlot(BukkitUtil.getLocation(locObj));
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
final PlotPlayer pp = BukkitUtil.getPlayer((Player) entity);
|
final PlotPlayer pp = BukkitUtil.getPlayer(player);
|
||||||
pp.teleport(MainUtil.getDefaultHome(plot));
|
pp.teleport(MainUtil.getDefaultHome(plot));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user