This commit is contained in:
boy0001 2015-03-10 20:01:06 +11:00
parent f83003e080
commit 61ebd2a144
5 changed files with 35 additions and 17 deletions

View File

@ -8,7 +8,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<artifactId>PlotSquared</artifactId>
<version>2.8.1</version>
<version>2.8.3</version>
<name>PlotSquared</name>
<packaging>jar</packaging>
<build>

View File

@ -20,6 +20,7 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
package com.intellectualcrafters.plot.commands;
import com.intellectualcrafters.plot.commands.SubCommand.CommandCategory;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.CmdInstance;
import com.intellectualcrafters.plot.object.PlotPlayer;
@ -32,7 +33,7 @@ import com.intellectualcrafters.plot.util.TaskManager;
*/
public class Confirm extends SubCommand {
public Confirm() {
super(Command.CONFIRM, "Confirm command execution", "confirm", CommandCategory.ACTIONS, true);
super("confirm", "plots.use", "Confirm an action", "confirm", "confirm", CommandCategory.ACTIONS, false);
}
@Override

View File

@ -85,6 +85,7 @@ public class BukkitHybridUtils extends HybridUtils {
final Chunk chunk = world.getChunkAt(x, z);
chunks2.add(chunk);
regenerateRoad(worldname, new ChunkLoc(x, z));
ChunkManager.manager.unloadChunk(worldname, new ChunkLoc(x, z));
}
}
BukkitSetBlockManager.setBlockManager.update(chunks2);
@ -92,6 +93,8 @@ public class BukkitHybridUtils extends HybridUtils {
private static boolean UPDATE = false;
private int task;
private long LAST = 0;
private double AV = 1000;
@Override
public boolean scheduleRoadUpdate(final String world) {
@ -109,6 +112,11 @@ public class BukkitHybridUtils extends HybridUtils {
Bukkit.getScheduler().cancelTask(BukkitHybridUtils.this.task);
return;
} else {
if (LAST == 0) {
LAST = System.currentTimeMillis();
}
AV = (System.currentTimeMillis() - LAST + AV) / 2;
if (AV < 1050) {
try {
final ChunkLoc loc = chunks.get(0);
PlotSquared.log("Updating .mcr: " + loc.x + ", " + loc.z + " (aprrox 256 chunks)");
@ -118,10 +126,22 @@ public class BukkitHybridUtils extends HybridUtils {
} catch (final Exception e) {
final ChunkLoc loc = chunks.get(0);
PlotSquared.log("&c[ERROR]&7 Could not update '" + world + "/region/r." + loc.x + "." + loc.z + ".mca' (Corrupt chunk?)");
final int sx = loc.x << 5;
final int sz = loc.z << 5;
for (int x = sx; x < (sx + 32); x++) {
for (int z = sz; z < (sz + 32); z++) {
ChunkManager.manager.unloadChunk(world, new ChunkLoc(x, z));
}
}
PlotSquared.log("&d - Potentially skipping 256 chunks");
PlotSquared.log("&d - TODO: recommend chunkster if corrupt");
}
}
else {
System.out.print("TPS LOW: " + (System.currentTimeMillis() - LAST) + " | " + AV);
}
LAST = System.currentTimeMillis();
}
}
}, 20, 20);
return true;

View File

@ -164,7 +164,6 @@ public abstract class HybridUtils {
}
}
}
ChunkManager.manager.unloadChunk(world, chunk);
return true;
}
}

View File

@ -169,8 +169,6 @@ public class BukkitChunkManager extends ChunkManager {
final int c2z = c2.getZ();
final int c3x = c3.getX();
final int c3z = c3.getZ();
final int c4x = c4.getX();
final int c4z = c4.getZ();
final ArrayList<Chunk> chunks = new ArrayList<>();
final ArrayList<Chunk> toGenerate = new ArrayList<>();
// Load chunks