Fixing some stuff after testing

This commit is contained in:
boy0001
2015-07-28 03:28:39 +10:00
parent 5b2e83587b
commit 955fa674d0
16 changed files with 79 additions and 86 deletions

View File

@ -408,6 +408,9 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
@Override
public BukkitGeneratorWrapper getGenerator(final String world, final String name) {
if (name == null) {
return new BukkitGeneratorWrapper(world, null);
}
final Plugin gen_plugin = Bukkit.getPluginManager().getPlugin(name);
ChunkGenerator gen;
if ((gen_plugin != null) && gen_plugin.isEnabled()) {

View File

@ -46,9 +46,6 @@ public class BukkitGeneratorWrapper extends PlotGenerator<ChunkGenerator> {
if (gen_wrapper != null) {
generator = gen_wrapper.generator;
}
else {
System.out.print("INVALID GENERATOR: " + gen_string);
}
}
}

View File

@ -38,9 +38,6 @@ public class WorldEvents implements Listener {
if (PS.get().config.contains("worlds." + name)) {
PS.get().loadWorld(name, new BukkitGeneratorWrapper(name, null));
}
else if (gen != null) {
System.out.print("NOT INSTANCE OF BukkitGeneratorWrapper: " + gen.getClass().getName());
}
}
lastWorld = null;
}

View File

@ -63,6 +63,7 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;
public class BukkitChunkManager extends ChunkManager {
@ -359,6 +360,7 @@ public class BukkitChunkManager extends ChunkManager {
}
}
}
final Random r = new Random(System.currentTimeMillis());
final AugmentedPopulator ap = augpop;
TaskManager.runTask(new Runnable() {
@Override
@ -380,7 +382,7 @@ public class BukkitChunkManager extends ChunkManager {
CURRENT_PLOT_CLEAR = new RegionWrapper(pos1.getX(), pos2.getX(), pos1.getZ(), pos2.getZ());
if (xxb >= p1x && xxt <= p2x && zzb >= p1z && zzt <= p2z) {
if (canRegen && ap != null) {
ap.populate(worldObj, null, chunkObj);
ap.populate(worldObj, r, chunkObj);
}
else {
regenerateChunk(world, chunk);
@ -452,7 +454,7 @@ public class BukkitChunkManager extends ChunkManager {
}
saveEntitiesOut(chunkObj, CURRENT_PLOT_CLEAR);
if (canRegen && ap != null) {
ap.populate(worldObj, null, chunkObj);
ap.populate(worldObj, r, chunkObj);
}
else {
regenerateChunk(world, chunk);

View File

@ -50,6 +50,6 @@ public class SetGenCB {
}
}
}
PS.get().loadWorld(world.getName(), null);
PS.get().loadWorld(world.getName(), PS.get().IMP.getGenerator(world.getName(), null));
}
}