mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
2.8.3
This commit is contained in:
parent
f83003e080
commit
61ebd2a144
@ -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>
|
||||
|
@ -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
|
||||
|
@ -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,18 +112,35 @@ public class BukkitHybridUtils extends HybridUtils {
|
||||
Bukkit.getScheduler().cancelTask(BukkitHybridUtils.this.task);
|
||||
return;
|
||||
} else {
|
||||
try {
|
||||
final ChunkLoc loc = chunks.get(0);
|
||||
PlotSquared.log("Updating .mcr: " + loc.x + ", " + loc.z + " (aprrox 256 chunks)");
|
||||
PlotSquared.log("Remaining regions: " + chunks.size());
|
||||
regenerateChunkChunk(world, loc);
|
||||
chunks.remove(0);
|
||||
} 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?)");
|
||||
PlotSquared.log("&d - Potentially skipping 256 chunks");
|
||||
PlotSquared.log("&d - TODO: recommend chunkster if corrupt");
|
||||
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)");
|
||||
PlotSquared.log("Remaining regions: " + chunks.size());
|
||||
regenerateChunkChunk(world, loc);
|
||||
chunks.remove(0);
|
||||
} 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);
|
||||
|
@ -164,7 +164,6 @@ public abstract class HybridUtils {
|
||||
}
|
||||
}
|
||||
}
|
||||
ChunkManager.manager.unloadChunk(world, chunk);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
@ -254,7 +252,7 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
tasks.put(currentIndex, loadTask);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean regenerateRegion(final Location pos1, final Location pos2, final Runnable whenDone) {
|
||||
index.increment();
|
||||
|
Loading…
Reference in New Issue
Block a user