This commit is contained in:
boy0001 2015-03-18 16:50:07 +11:00
parent 4d7cc990e2
commit fd39eb036d
3 changed files with 9 additions and 1 deletions

View File

@ -272,6 +272,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
try {
BukkitSetBlockManager.setBlockManager = new SetBlockFast();
} catch (final Throwable e) {
MainUtil.canSetFast = false;
BukkitSetBlockManager.setBlockManager = new SetBlockSlow();
}
}

View File

@ -19,7 +19,9 @@ import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotManager;
import com.intellectualcrafters.plot.object.PlotWorld;
import com.intellectualcrafters.plot.object.RegionWrapper;
import com.intellectualcrafters.plot.util.BlockUpdateUtil;
import com.intellectualcrafters.plot.util.ChunkManager;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.bukkit.BukkitChunkManager;
import com.intellectualcrafters.plot.util.bukkit.BukkitSetBlockManager;
@ -187,7 +189,11 @@ public class AugmentedPopulator extends BlockPopulator {
}
}
for (final BlockPopulator populator : this.generator.getDefaultPopulators(world)) {
populator.populate(world, this.r, world.getChunkAt(X, Z));
Chunk chunk = world.getChunkAt(X, Z);
if (MainUtil.canSetFast) {
((BukkitSetBlockManager) BlockUpdateUtil.setBlockManager).update(Arrays.asList(chunk));
}
populator.populate(world, this.r, chunk);
}
}

View File

@ -51,6 +51,7 @@ import com.intellectualcrafters.plot.util.bukkit.SendChunk;
public class MainUtil {
public final static HashMap<Plot, Integer> runners = new HashMap<>();
public static boolean canSendChunk = false;
public static boolean canSetFast = true;
public static ArrayList<String> runners_p = new ArrayList<>();
static long state = 1;
public static HashMap<String, PlotId> lastPlot = new HashMap<>();