Finished linking augmented

This commit is contained in:
boy0001 2015-05-01 22:42:10 +10:00
parent 435e33d079
commit 1e6db07e3a
4 changed files with 20 additions and 17 deletions

View File

@ -159,7 +159,7 @@ public class Setup extends SubCommand {
MainUtil.sendMessage(plr, "&7 - You may need to manually configure the other plugin"); MainUtil.sendMessage(plr, "&7 - You may need to manually configure the other plugin");
object.step = ((PlotGenerator) SetupUtils.generators.get(object.plotManager)).getNewPlotWorld(null).getSettingNodes(); object.step = ((PlotGenerator) SetupUtils.generators.get(object.plotManager)).getNewPlotWorld(null).getSettingNodes();
} }
MainUtil.sendMessage(plr, "&6What terrain would you like in plots?" + "\n&8 - &2NONE&8 - &7No terrain at all" + "\n&8 - &7ORE&8 - &7Just some ore veins and trees" + "\n&8 - &7ALL&8 - &7Entirely vanilla generation"); MainUtil.sendMessage(plr, "&6What terrain would you like in plots?" + "\n&8 - &2NONE&8 - &7No terrain at all" + "\n&8 - &7ORE&8 - &7Just some ore veins and trees" + "\n&8 - &7ROAD&8 - &7Terrain seperated by roads" + "\n&8 - &7ALL&8 - &7Entirely vanilla generation");
} }
object.current++; object.current++;
break; break;
@ -167,7 +167,7 @@ public class Setup extends SubCommand {
case 2: { // Choose terrain case 2: { // Choose terrain
final List<String> terrain = Arrays.asList(new String[] { "none", "ore", "road", "all" }); final List<String> terrain = Arrays.asList(new String[] { "none", "ore", "road", "all" });
if ((args.length != 1) || !terrain.contains(args[0].toLowerCase())) { if ((args.length != 1) || !terrain.contains(args[0].toLowerCase())) {
MainUtil.sendMessage(plr, "&cYou must choose the terrain!" + "\n&8 - &2NONE&8 - &7No terrain at all" + "\n&8 - &7ORE&8 - &7Just some ore veins and trees" + "\n&8 - &7ALL&8 - &7Entirely vanilla generation&8 - &7ROAD&8 - &7Vanilla except for roads\n" + "&8 - &7ALL&8 - &7Entirely vanilla generation"); MainUtil.sendMessage(plr, "&cYou must choose the terrain!" + "\n&8 - &2NONE&8 - &7No terrain at all" + "\n&8 - &7ORE&8 - &7Just some ore veins and trees" + "\n&8 - &7ROAD&8 - &7Terrain seperated by roads" + "\n&8 - &7ALL&8 - &7Entirely vanilla generation");
return false; return false;
} }
object.terrain = terrain.indexOf(args[0].toLowerCase()); object.terrain = terrain.indexOf(args[0].toLowerCase());

View File

@ -340,7 +340,7 @@ public class SQLManager implements AbstractDB {
if (subList.size() == 0) { if (subList.size() == 0) {
return; return;
} }
String statement = mod.getCreateMySQL(packet); String statement = mod.getCreateMySQL(subList.size());
PreparedStatement stmt = null; PreparedStatement stmt = null;
try { try {
stmt = this.connection.prepareStatement(statement.toString()); stmt = this.connection.prepareStatement(statement.toString());
@ -352,7 +352,7 @@ public class SQLManager implements AbstractDB {
stmt.close(); stmt.close();
} catch (final Exception e) { } catch (final Exception e) {
try { try {
String unionstmt = mod.getCreateSQLite(packet); String unionstmt = mod.getCreateSQLite(subList.size());
stmt = this.connection.prepareStatement(unionstmt.toString()); stmt = this.connection.prepareStatement(unionstmt.toString());
for (int i = 0; i < subList.size(); i++) { for (int i = 0; i < subList.size(); i++) {
mod.setSQLite(stmt, i, subList.get(i)); mod.setSQLite(stmt, i, subList.get(i));

View File

@ -458,6 +458,10 @@ public class MainUtil {
PlotId id2 = new PlotId(id.x + 1, id.y + 1); PlotId id2 = new PlotId(id.x + 1, id.y + 1);
Location pos1 = getPlotTopLoc(plot.world, id).add(1, 0, 1); Location pos1 = getPlotTopLoc(plot.world, id).add(1, 0, 1);
Location pos2 = getPlotBottomLoc(plot.world, id2); Location pos2 = getPlotBottomLoc(plot.world, id2);
pos1.setY(0);
pos2.setY(256);
System.out.print(pos1);
System.out.print(pos2);
ChunkManager.manager.regenerateRegion(pos1, pos2, null); ChunkManager.manager.regenerateRegion(pos1, pos2, null);
} }
else { else {
@ -472,7 +476,9 @@ public class MainUtil {
Location bot = getPlotBottomLocAbs(plot.world, id2); Location bot = getPlotBottomLocAbs(plot.world, id2);
Location top = getPlotTopLocAbs(plot.world, id); Location top = getPlotTopLocAbs(plot.world, id);
Location pos1 = new Location(plot.world, top.getX() + 1, 0, bot.getZ() + 1); Location pos1 = new Location(plot.world, top.getX() + 1, 0, bot.getZ() + 1);
Location pos2 = new Location(plot.world, bot.getX(), 0, top.getZ()); Location pos2 = new Location(plot.world, bot.getX(), 256, top.getZ());
System.out.print(pos1);
System.out.print(pos2);
ChunkManager.manager.regenerateRegion(pos1, pos2, null); ChunkManager.manager.regenerateRegion(pos1, pos2, null);
} }
else { else {
@ -487,7 +493,9 @@ public class MainUtil {
Location bot = getPlotBottomLocAbs(plot.world, id2); Location bot = getPlotBottomLocAbs(plot.world, id2);
Location top = getPlotTopLocAbs(plot.world, id); Location top = getPlotTopLocAbs(plot.world, id);
Location pos1 = new Location(plot.world, bot.getX() + 1, 0, top.getZ() + 1); Location pos1 = new Location(plot.world, bot.getX() + 1, 0, top.getZ() + 1);
Location pos2 = new Location(plot.world, top.getX(), 0, bot.getZ()); Location pos2 = new Location(plot.world, top.getX(), 256, bot.getZ());
System.out.print(pos1);
System.out.print(pos2);
ChunkManager.manager.regenerateRegion(pos1, pos2, null); ChunkManager.manager.regenerateRegion(pos1, pos2, null);
} }
else { else {
@ -505,7 +513,6 @@ public class MainUtil {
* @param greaterPlot * @param greaterPlot
*/ */
public static void mergePlot(final String world, final Plot lesserPlot, final Plot greaterPlot, final boolean removeRoads) { public static void mergePlot(final String world, final Plot lesserPlot, final Plot greaterPlot, final boolean removeRoads) {
final PlotManager manager = PlotSquared.getPlotManager(world);
final PlotWorld plotworld = PlotSquared.getPlotWorld(world); final PlotWorld plotworld = PlotSquared.getPlotWorld(world);
if (lesserPlot.id.x.equals(greaterPlot.id.x)) { if (lesserPlot.id.x.equals(greaterPlot.id.x)) {
if (!lesserPlot.settings.getMerged(2)) { if (!lesserPlot.settings.getMerged(2)) {

View File

@ -293,11 +293,8 @@ public class BukkitChunkManager extends ChunkManager {
@Override @Override
public void run() { public void run() {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
int allocated = SetBlockQueue.getAllocate(); while (System.currentTimeMillis() - start < 20) {
SetBlockQueue.allocate(0);
while (System.currentTimeMillis() - start < allocated) {
if (chunks.size() == 0) { if (chunks.size() == 0) {
SetBlockQueue.allocate(SetBlockQueue.getAllocate() + allocated);
TaskManager.runTaskLater(whenDone, 1); TaskManager.runTaskLater(whenDone, 1);
Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex)); Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex));
TaskManager.tasks.remove(currentIndex); TaskManager.tasks.remove(currentIndex);
@ -313,7 +310,6 @@ public class BukkitChunkManager extends ChunkManager {
final boolean result = chunk.load(false); final boolean result = chunk.load(false);
if (!result) { if (!result) {
loaded = false; loaded = false;
;
} }
if (!chunk.isLoaded()) { if (!chunk.isLoaded()) {
loaded = false; loaded = false;