Fix multiple schematic issues (which I caused)

This commit is contained in:
boy0001
2015-07-26 04:12:35 +10:00
parent c2fff8cbd7
commit b76899c6e2
9 changed files with 211 additions and 109 deletions

View File

@ -32,6 +32,9 @@ import java.util.UUID;
import org.apache.commons.lang.StringUtils;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.block.Biome;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
@ -39,6 +42,7 @@ import com.intellectualcrafters.plot.flag.FlagManager;
import com.intellectualcrafters.plot.generator.BukkitHybridUtils;
import com.intellectualcrafters.plot.generator.HybridUtils;
import com.intellectualcrafters.plot.object.ChunkLoc;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotAnalysis;
@ -61,6 +65,24 @@ public class DebugExec extends SubCommand {
if (args.length > 0) {
final String arg = args[0].toLowerCase();
switch (arg) {
case "biome": {
if (player == null) {
MainUtil.sendMessage(player, C.IS_CONSOLE);
return false;
}
Location loc = player.getLocation();
World world = Bukkit.getWorld(loc.getWorld());
int bx = (loc.getX() >> 4) << 4;
int bz = (loc.getZ() >> 4) << 4;
for (int x = bx; x < bx + 16; x++) {
for (int z = bz; z < bz + 16; z++) {
world.setBiome(x, z, Biome.DESERT);
}
}
MainUtil.update(loc.getWorld(), new ChunkLoc(loc.getX() >> 4, loc.getZ() >> 4));
System.out.print("SET BIOME TO FOREST: " + bx + "," + bz);
return true;
}
case "analyze": {
if (player == null) {
MainUtil.sendMessage(player, C.IS_CONSOLE);

View File

@ -246,8 +246,18 @@ public class Set extends SubCommand {
MainUtil.sendMessage(plr, getBiomeList(BlockManager.manager.getBiomeList()));
return true;
}
plot.setBiome(args[1].toUpperCase());
MainUtil.sendMessage(plr, C.BIOME_SET_TO.s() + args[1].toLowerCase());
if (MainUtil.runners.containsKey(plot)) {
MainUtil.sendMessage(plr, C.WAIT_FOR_TIMER);
return false;
}
MainUtil.runners.put(plot, 1);
plot.setBiome(args[1].toUpperCase(), new Runnable() {
@Override
public void run() {
MainUtil.runners.remove(plot);
MainUtil.sendMessage(plr, C.BIOME_SET_TO.s() + args[1].toLowerCase());
}
});
return true;
}
// Get components