Biome update

This commit is contained in:
boy0001 2015-04-19 23:42:55 +10:00
parent 5ca5ff1198
commit d8fbd90c52
2 changed files with 26 additions and 14 deletions

View File

@ -3,9 +3,12 @@ package com.intellectualcrafters.plot.listeners.worldedit;
import java.util.HashSet; import java.util.HashSet;
import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.PlotSquared;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings; import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.RegionWrapper; import com.intellectualcrafters.plot.object.RegionWrapper;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.bukkit.UUIDHandler; import com.intellectualcrafters.plot.util.bukkit.UUIDHandler;
import com.sk89q.worldedit.event.extent.EditSessionEvent; import com.sk89q.worldedit.event.extent.EditSessionEvent;
import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Actor;
@ -29,6 +32,9 @@ public class WESubscriber {
PlotPlayer player = UUIDHandler.getPlayer(actor.getName()); PlotPlayer player = UUIDHandler.getPlayer(actor.getName());
HashSet<RegionWrapper> mask = WEManager.getMask(player); HashSet<RegionWrapper> mask = WEManager.getMask(player);
if (mask.size() == 0) { if (mask.size() == 0) {
if (Permissions.hasPermission(player, "plots.worldedit.bypass")) {
MainUtil.sendMessage(player, C.WORLDEDIT_BYPASS);
}
event.setExtent(new NullExtent()); event.setExtent(new NullExtent());
return; return;
} }

View File

@ -200,20 +200,25 @@ public class MainUtil {
BlockUpdateUtil.setBlockManager.update(world, Arrays.asList(loc)); BlockUpdateUtil.setBlockManager.update(world, Arrays.asList(loc));
} }
// public static void update(final Location loc) { public static void update(final Plot plot) {
// final String world = loc.getWorld(); Location bot = getPlotBottomLoc(plot.world, plot.id).add(1, 0, 1);
// int ox = loc.getX() >> 4; Location top = getPlotBottomLoc(plot.world, plot.id);
// int oz = loc.getZ() >> 4;
// final ArrayList<ChunkLoc> chunks = new ArrayList<>(); int bx = bot.getX() >> 4;
// final int distance = BukkitUtil.getViewDistance(); int bz = bot.getZ() >> 4;
// for (int cx = -distance; cx <= distance; cx++) {
// for (int cz = -distance; cz <= distance; cz++) { int tx = 1 + (top.getX() >> 4);
// final ChunkLoc chunk = new ChunkLoc(ox + cx, oz + cz); int tz = 1 + (top.getZ() >> 4);
// chunks.add(chunk);
// } ArrayList<ChunkLoc> chunks = new ArrayList<>();
// }
// BlockUpdateUtil.setBlockManager.update(world, chunks); for (int x = bx; x <= tx; x++) {
// } for (int z = bz; z <= tz; z++) {
chunks.add(new ChunkLoc(x, z));
}
}
BlockUpdateUtil.setBlockManager.update(plot.world, chunks);
}
public static void createWorld(final String world, final String generator) { public static void createWorld(final String world, final String generator) {
} }
@ -637,6 +642,7 @@ public class MainUtil {
final int bottomZ = getPlotBottomLoc(world, plot.id).getZ() + 1; final int bottomZ = getPlotBottomLoc(world, plot.id).getZ() + 1;
final int topZ = getPlotTopLoc(world, plot.id).getZ(); final int topZ = getPlotTopLoc(world, plot.id).getZ();
BukkitUtil.setBiome(world, bottomX, bottomZ, topX, topZ, biome); BukkitUtil.setBiome(world, bottomX, bottomZ, topX, topZ, biome);
update(plot);
} }
public static int getHeighestBlock(final String world, final int x, final int z) { public static int getHeighestBlock(final String world, final int x, final int z) {