mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-28 03:34:42 +02:00
Database changes
This commit is contained in:
@ -126,6 +126,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
Bukkit.getScheduler().cancelTasks(this);
|
||||
PS.get().disable();
|
||||
THIS = null;
|
||||
}
|
||||
@ -554,12 +555,6 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
|
||||
World world = BukkitUtil.getWorld(worldname);
|
||||
if (world == null) {
|
||||
// create world
|
||||
|
||||
System.out.print("CREATING WORLD: " + worldname);
|
||||
System.out.print("CREATING WORLD: " + worldname);
|
||||
System.out.print("CREATING WORLD: " + worldname);
|
||||
System.out.print("CREATING WORLD: " + worldname);
|
||||
|
||||
ConfigurationSection worldConfig = PS.get().config.getConfigurationSection("worlds." + worldname);
|
||||
String manager = worldConfig.getString("generator.plugin");
|
||||
if (manager == null) {
|
||||
|
@ -64,6 +64,7 @@ public class SendChunk {
|
||||
if (!chunk.isLoaded()) {
|
||||
continue;
|
||||
}
|
||||
boolean unload = true;
|
||||
final Object c = methodGetHandle.of(chunk).call();
|
||||
final Object w = world.of(c).get();
|
||||
final Object p = players.of(w).get();
|
||||
@ -73,6 +74,7 @@ public class SendChunk {
|
||||
diffx = Math.abs(x - (chunk.getX() << 4));
|
||||
diffz = Math.abs(z - (chunk.getZ() << 4));
|
||||
if ((diffx <= view) && (diffz <= view)) {
|
||||
unload = false;
|
||||
if (v1_7_10) {
|
||||
chunk.getWorld().refreshChunk(chunk.getX(), chunk.getZ());
|
||||
chunk.load(true);
|
||||
@ -84,6 +86,15 @@ public class SendChunk {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (unload) {
|
||||
try {
|
||||
chunk.unload(true, true);
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user