mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-29 04:04:43 +02:00
World generation options for sponge
This commit is contained in:
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user