mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Finished linking augmented
This commit is contained in:
parent
435e33d079
commit
1e6db07e3a
@ -50,16 +50,16 @@ public class Setup extends SubCommand {
|
|||||||
for (Entry<String, ChunkGenerator> entry : SetupUtils.generators.entrySet()) {
|
for (Entry<String, ChunkGenerator> entry : SetupUtils.generators.entrySet()) {
|
||||||
// + prefix + StringUtils.join(SetupUtils.generators.keySet(), prefix).replaceAll("PlotSquared", "&2PlotSquared")
|
// + prefix + StringUtils.join(SetupUtils.generators.keySet(), prefix).replaceAll("PlotSquared", "&2PlotSquared")
|
||||||
if (entry.getKey().equals("PlotSquared")) {
|
if (entry.getKey().equals("PlotSquared")) {
|
||||||
message.append("\n&8 - &2" + entry.getKey() + "(Hybrid Generator)");
|
message.append("\n&8 - &2" + entry.getKey() + " (Hybrid Generator)");
|
||||||
}
|
}
|
||||||
else if (entry.getValue() instanceof HybridGen) {
|
else if (entry.getValue() instanceof HybridGen) {
|
||||||
message.append("\n&8 - &7" + entry.getKey() + "(Hybrid Generator)");
|
message.append("\n&8 - &7" + entry.getKey() + " (Hybrid Generator)");
|
||||||
}
|
}
|
||||||
else if (entry.getValue() instanceof PlotGenerator) {
|
else if (entry.getValue() instanceof PlotGenerator) {
|
||||||
message.append("\n&8 - &7" + entry.getKey() + "(Plot Generator)");
|
message.append("\n&8 - &7" + entry.getKey() + " (Plot Generator)");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
message.append("\n&8 - &7" + entry.getKey() + "(Unknown structure)");
|
message.append("\n&8 - &7" + entry.getKey() + " (Unknown structure)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MainUtil.sendMessage(plr, message.toString());
|
MainUtil.sendMessage(plr, message.toString());
|
||||||
@ -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());
|
||||||
|
@ -285,7 +285,7 @@ public class SQLManager implements AbstractDB {
|
|||||||
public String getCreateSQL() {
|
public String getCreateSQL() {
|
||||||
return CREATE_PLOT;
|
return CREATE_PLOT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setMySQL(PreparedStatement stmt, int i, Plot plot) throws SQLException {
|
public void setMySQL(PreparedStatement stmt, int i, Plot plot) throws SQLException {
|
||||||
stmt.setInt((i * 4) + 1, plot.id.x);
|
stmt.setInt((i * 4) + 1, plot.id.x);
|
||||||
@ -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));
|
||||||
|
@ -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)) {
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user