Fix refresh chunk for 1.7.X

This commit is contained in:
boy0001 2015-06-10 06:00:53 +10:00
parent 5f3fab5e42
commit 3aa7a74626
6 changed files with 12 additions and 22 deletions

View File

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

View File

@ -438,6 +438,12 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
e.printStackTrace();
BukkitSetBlockManager.setBlockManager = new SetBlockSlow();
}
try {
new SendChunk();
MainUtil.canSendChunk = true;
} catch (final Throwable e) {
MainUtil.canSendChunk = false;
}
} else {
try {
BukkitSetBlockManager.setBlockManager = new SetBlockFast();
@ -447,12 +453,6 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
}
}
BlockUpdateUtil.setBlockManager = BukkitSetBlockManager.setBlockManager;
try {
new SendChunk();
MainUtil.canSendChunk = true;
} catch (final Throwable e) {
MainUtil.canSendChunk = false;
}
return BlockManager.manager = new BukkitUtil();
}

View File

@ -373,11 +373,6 @@ public class PlotSquared {
if (!config.contains(path)) {
config.createSection(path);
}
System.out.print("GENERATOR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
System.out.print(generator != null);
System.out.print(generator instanceof PlotGenerator);
plotWorld.TYPE = generator instanceof PlotGenerator ? 0 : 2;
plotWorld.TERRAIN = 0;
plotWorld.saveConfiguration(config.getConfigurationSection(path));

View File

@ -26,17 +26,11 @@ public class BukkitSetupUtils extends SetupUtils {
}
final String testWorld = "CheckingPlotSquaredGenerator";
for (final Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
System.out.print(plugin.getName());
if (plugin.isEnabled()) {
System.out.print(" - enabled");
final ChunkGenerator generator = plugin.getDefaultWorldGenerator(testWorld, "");
if (generator != null) {
System.out.print(" - non null");
PlotSquared.removePlotWorld(testWorld);
final String name = plugin.getDescription().getName();
if (generator instanceof PlotGenerator) {
System.out.print(" - ps gen");
}
// final PlotGenerator pgen = (PlotGenerator) generator;
// if (pgen.getPlotManager() instanceof SquarePlotManager) {
SetupUtils.generators.put(name, generator);

View File

@ -121,8 +121,9 @@ public class SetBlockFast extends BukkitSetBlockManager {
}
if (!MainUtil.canSendChunk) {
for (Chunk chunk : chunks) {
chunk.getWorld().refreshChunk(chunk.getX(), chunk.getZ());
chunk.load(true);
chunk.unload(true, false);
// chunk.getWorld().refreshChunk(chunk.getX(), chunk.getZ());
chunk.load();
}
return;
}

View File

@ -333,8 +333,8 @@ public class SetBlockFast_1_8 extends BukkitSetBlockManager {
}
if (!MainUtil.canSendChunk) {
for (Chunk chunk : chunks) {
chunk.getWorld().refreshChunk(chunk.getX(), chunk.getZ());
chunk.load(true);
chunk.unload(true, false);
chunk.load();
}
return;
}