World generation options for sponge

This commit is contained in:
boy0001
2015-08-03 05:25:41 +10:00
parent b77c2d1049
commit 4d8b9f9674
23 changed files with 559 additions and 111 deletions

View File

@ -3,6 +3,7 @@ package com.intellectualcrafters.plot.util;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map.Entry;
import java.util.Random;
import org.bukkit.Bukkit;

View File

@ -47,7 +47,6 @@ import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.object.schematic.PlotItem;
import com.plotsquared.bukkit.object.schematic.StateWrapper;
import com.plotsquared.bukkit.util.WorldEditSchematic;
public abstract class SchematicHandler {
public static SchematicHandler manager;
@ -98,40 +97,38 @@ public abstract class SchematicHandler {
if (area > 4096) {
PS.debug("The plot is > 64 x 64 - Fast lossy schematic saving will be used");
}
if (area <= 4096 && PS.get().worldEdit != null) {
new WorldEditSchematic().saveSchematic(directory + File.separator + name + ".schematic", plot.world, plot.id);
}
else {
final Runnable THIS = this;
SchematicHandler.manager.getCompoundTag(plot.world, plot.id, new RunnableVal<CompoundTag>() {
@Override
public void run() {
if (value == null) {
MainUtil.sendMessage(null, "&7 - Skipped plot &c" + plot.id);
}
else {
TaskManager.runTaskAsync(new Runnable() {
@Override
public void run() {
MainUtil.sendMessage(null, "&6ID: " + plot.id);
final boolean result = SchematicHandler.manager.save(value, directory + File.separator + name + ".schematic");
if (!result) {
MainUtil.sendMessage(null, "&7 - Failed to save &c" + plot.id);
} else {
MainUtil.sendMessage(null, "&7 - &a success: " + plot.id);
}
TaskManager.runTask(new Runnable() {
@Override
public void run() {
THIS.run();
}
});
}
});
}
// if (area <= 4096 && PS.get().worldEdit != null) {
// new WorldEditSchematic().saveSchematic(directory + File.separator + name + ".schematic", plot.world, plot.id);
// }
final Runnable THIS = this;
SchematicHandler.manager.getCompoundTag(plot.world, plot.id, new RunnableVal<CompoundTag>() {
@Override
public void run() {
if (value == null) {
MainUtil.sendMessage(null, "&7 - Skipped plot &c" + plot.id);
}
});
}
else {
TaskManager.runTaskAsync(new Runnable() {
@Override
public void run() {
MainUtil.sendMessage(null, "&6ID: " + plot.id);
final boolean result = SchematicHandler.manager.save(value, directory + File.separator + name + ".schematic");
if (!result) {
MainUtil.sendMessage(null, "&7 - Failed to save &c" + plot.id);
} else {
MainUtil.sendMessage(null, "&7 - &a success: " + plot.id);
}
TaskManager.runTask(new Runnable() {
@Override
public void run() {
THIS.run();
}
});
}
});
}
}
});
}
});
return true;

View File

@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.Map;
import com.intellectualcrafters.plot.generator.PlotGenerator;
import com.intellectualcrafters.plot.object.PlotCluster;
import com.intellectualcrafters.plot.object.PlotWorld;
import com.intellectualcrafters.plot.object.SetupObject;
@ -19,4 +20,6 @@ public abstract class SetupUtils {
public abstract String getGenerator(PlotWorld plotworld);
public abstract String setupWorld(final SetupObject object);
public abstract void removePopulator(String world, PlotCluster cluster);
}