mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 15:16:45 +01:00
Various fixes
Fixed issue with augmented plot world and mob / entity interaction Fixed an issue with async plot diff calculation including upper chunks outside of plot in result PlotMeConverter will now try a force save of the PS configuration right away Incremented version number Tweaked behaviour of plot list command
This commit is contained in:
parent
c76536b8b0
commit
1c7f7a2dfc
@ -8,7 +8,7 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<artifactId>PlotSquared</artifactId>
|
<artifactId>PlotSquared</artifactId>
|
||||||
<version>2.9.4</version>
|
<version>2.9.5</version>
|
||||||
<name>PlotSquared</name>
|
<name>PlotSquared</name>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<build>
|
<build>
|
||||||
|
@ -192,12 +192,18 @@ public class list extends SubCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
displayPlots(plr, plots, page);
|
displayPlots(plr, plots, page, world);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void displayPlots(PlotPlayer player, Collection<Plot> oldPlots, int page) {
|
public void displayPlots(PlotPlayer player, Collection<Plot> oldPlots, int page, String world) {
|
||||||
ArrayList<Plot> plots = PlotSquared.sortPlots(oldPlots);
|
ArrayList<Plot> plots;
|
||||||
|
if (world != null) {
|
||||||
|
plots = PlotSquared.sortPlots(oldPlots, world);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
plots = PlotSquared.sortPlots(oldPlots);
|
||||||
|
}
|
||||||
if (page < 0) {
|
if (page < 0) {
|
||||||
page = 0;
|
page = 0;
|
||||||
}
|
}
|
||||||
|
@ -250,6 +250,7 @@ public class PlotMeConverter {
|
|||||||
height = 64;
|
height = 64;
|
||||||
}
|
}
|
||||||
PlotSquared.config.set("worlds." + world + ".road.height", height);
|
PlotSquared.config.set("worlds." + world + ".road.height", height);
|
||||||
|
PlotSquared.config.save(PlotSquared.configFile);
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
sendMessage("&c-- &lFailed to save configuration for world '" + world + "'\nThis will need to be done using the setup command, or manually");
|
sendMessage("&c-- &lFailed to save configuration for world '" + world + "'\nThis will need to be done using the setup command, or manually");
|
||||||
}
|
}
|
||||||
@ -300,6 +301,7 @@ public class PlotMeConverter {
|
|||||||
PlotSquared.config.set("worlds." + world + ".road.height", height);
|
PlotSquared.config.set("worlds." + world + ".road.height", height);
|
||||||
PlotSquared.config.set("worlds." + world + ".plot.height", height);
|
PlotSquared.config.set("worlds." + world + ".plot.height", height);
|
||||||
PlotSquared.config.set("worlds." + world + ".wall.height", height);
|
PlotSquared.config.set("worlds." + world + ".wall.height", height);
|
||||||
|
PlotSquared.config.save(PlotSquared.configFile);
|
||||||
}
|
}
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ import com.intellectualcrafters.plot.object.Plot;
|
|||||||
import com.intellectualcrafters.plot.object.PlotBlock;
|
import com.intellectualcrafters.plot.object.PlotBlock;
|
||||||
import com.intellectualcrafters.plot.object.PlotWorld;
|
import com.intellectualcrafters.plot.object.PlotWorld;
|
||||||
import com.intellectualcrafters.plot.object.RegionWrapper;
|
import com.intellectualcrafters.plot.object.RegionWrapper;
|
||||||
|
import com.intellectualcrafters.plot.object.RunnableVal;
|
||||||
import com.intellectualcrafters.plot.util.ChunkManager;
|
import com.intellectualcrafters.plot.util.ChunkManager;
|
||||||
import com.intellectualcrafters.plot.util.MainUtil;
|
import com.intellectualcrafters.plot.util.MainUtil;
|
||||||
import com.intellectualcrafters.plot.util.TaskManager;
|
import com.intellectualcrafters.plot.util.TaskManager;
|
||||||
@ -29,7 +30,7 @@ import com.intellectualcrafters.plot.util.bukkit.BukkitUtil;
|
|||||||
|
|
||||||
public class BukkitHybridUtils extends HybridUtils {
|
public class BukkitHybridUtils extends HybridUtils {
|
||||||
|
|
||||||
public void checkModified(final Plot plot, final int requiredChanges, final Runnable whenDone, final Runnable ifFailed) {
|
public void checkModified(final Plot plot, final RunnableVal whenDone) {
|
||||||
TaskManager.index.increment();
|
TaskManager.index.increment();
|
||||||
|
|
||||||
final Location bot = MainUtil.getPlotBottomLoc(plot.world, plot.id).add(1, 0, 1);
|
final Location bot = MainUtil.getPlotBottomLoc(plot.world, plot.id).add(1, 0, 1);
|
||||||
@ -41,7 +42,6 @@ public class BukkitHybridUtils extends HybridUtils {
|
|||||||
int tx = top.getX() >> 4;
|
int tx = top.getX() >> 4;
|
||||||
int tz = top.getZ() >> 4;
|
int tz = top.getZ() >> 4;
|
||||||
|
|
||||||
int size = (tx-bx) << 4;
|
|
||||||
World world = BukkitUtil.getWorld(plot.world);
|
World world = BukkitUtil.getWorld(plot.world);
|
||||||
|
|
||||||
final HashSet<Chunk> chunks = new HashSet<>();
|
final HashSet<Chunk> chunks = new HashSet<>();
|
||||||
@ -53,6 +53,7 @@ public class BukkitHybridUtils extends HybridUtils {
|
|||||||
|
|
||||||
PlotWorld plotworld = PlotSquared.getPlotWorld(plot.world);
|
PlotWorld plotworld = PlotSquared.getPlotWorld(plot.world);
|
||||||
if (!(plotworld instanceof ClassicPlotWorld)) {
|
if (!(plotworld instanceof ClassicPlotWorld)) {
|
||||||
|
whenDone.value = -1;
|
||||||
TaskManager.runTaskLater(whenDone, 1);
|
TaskManager.runTaskLater(whenDone, 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -65,23 +66,19 @@ public class BukkitHybridUtils extends HybridUtils {
|
|||||||
final Integer task = TaskManager.runTaskRepeat(new Runnable() {
|
final Integer task = TaskManager.runTaskRepeat(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (count.intValue() >= requiredChanges) {
|
|
||||||
TaskManager.runTaskLater(whenDone, 1);
|
|
||||||
Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex));
|
|
||||||
TaskManager.tasks.remove(currentIndex);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (chunks.size() == 0) {
|
if (chunks.size() == 0) {
|
||||||
TaskManager.runTaskLater(ifFailed, 1);
|
whenDone.value = 0;
|
||||||
|
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);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final Chunk chunk = chunks.iterator().next();
|
final Chunk chunk = chunks.iterator().next();
|
||||||
|
chunks.iterator().remove();
|
||||||
int bx = Math.max(chunk.getX() >> 4, bot.getX());
|
int bx = Math.max(chunk.getX() >> 4, bot.getX());
|
||||||
int bz = Math.max(chunk.getZ() >> 4, bot.getZ());
|
int bz = Math.max(chunk.getZ() >> 4, bot.getZ());
|
||||||
int ex = Math.max((chunk.getX() >> 4) + 15, top.getX());
|
int ex = Math.min((chunk.getX() >> 4) + 15, top.getX());
|
||||||
int ez = Math.max((chunk.getZ() >> 4) + 15, top.getZ());
|
int ez = Math.min((chunk.getZ() >> 4) + 15, top.getZ());
|
||||||
// count changes
|
// count changes
|
||||||
count.add(checkModified(plot.world, bx, ex, 1, cpw.PLOT_HEIGHT - 1, bz, ez, cpw.MAIN_BLOCK));
|
count.add(checkModified(plot.world, bx, ex, 1, cpw.PLOT_HEIGHT - 1, bz, ez, cpw.MAIN_BLOCK));
|
||||||
count.add(checkModified(plot.world, bx, ex, cpw.PLOT_HEIGHT, cpw.PLOT_HEIGHT, bz, ez, cpw.TOP_BLOCK));
|
count.add(checkModified(plot.world, bx, ex, cpw.PLOT_HEIGHT, cpw.PLOT_HEIGHT, bz, ez, cpw.TOP_BLOCK));
|
||||||
|
@ -12,6 +12,7 @@ import com.intellectualcrafters.plot.object.PlotBlock;
|
|||||||
import com.intellectualcrafters.plot.object.PlotId;
|
import com.intellectualcrafters.plot.object.PlotId;
|
||||||
import com.intellectualcrafters.plot.object.PlotLoc;
|
import com.intellectualcrafters.plot.object.PlotLoc;
|
||||||
import com.intellectualcrafters.plot.object.PlotManager;
|
import com.intellectualcrafters.plot.object.PlotManager;
|
||||||
|
import com.intellectualcrafters.plot.object.RunnableVal;
|
||||||
import com.intellectualcrafters.plot.util.BlockManager;
|
import com.intellectualcrafters.plot.util.BlockManager;
|
||||||
import com.intellectualcrafters.plot.util.ChunkManager;
|
import com.intellectualcrafters.plot.util.ChunkManager;
|
||||||
import com.intellectualcrafters.plot.util.MainUtil;
|
import com.intellectualcrafters.plot.util.MainUtil;
|
||||||
@ -21,7 +22,7 @@ public abstract class HybridUtils {
|
|||||||
|
|
||||||
public static HybridUtils manager;
|
public static HybridUtils manager;
|
||||||
|
|
||||||
public abstract void checkModified(Plot plot, int requiredChanges, Runnable ifPassed, Runnable ifFailed);
|
public abstract void checkModified(final Plot plot, final RunnableVal whenDone);
|
||||||
|
|
||||||
public abstract int checkModified(final String world, final int x1, final int x2, final int y1, final int y2, final int z1, final int z2, final PlotBlock[] blocks);
|
public abstract int checkModified(final String world, final int x1, final int x2, final int y1, final int y2, final int z1, final int z2, final PlotBlock[] blocks);
|
||||||
|
|
||||||
|
@ -1060,6 +1060,9 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
|||||||
final Player p = e.getPlayer();
|
final Player p = e.getPlayer();
|
||||||
final PlotPlayer pp = BukkitUtil.getPlayer(p);
|
final PlotPlayer pp = BukkitUtil.getPlayer(p);
|
||||||
if (!isInPlot(l)) {
|
if (!isInPlot(l)) {
|
||||||
|
if (!isPlotArea(l)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!Permissions.hasPermission(pp, "plots.admin.interact.road")) {
|
if (!Permissions.hasPermission(pp, "plots.admin.interact.road")) {
|
||||||
MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.interact.road");
|
MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.interact.road");
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
|
@ -23,6 +23,9 @@ public class PlayerEvents_1_8 extends PlotListener implements Listener {
|
|||||||
e.getPlayer();
|
e.getPlayer();
|
||||||
final PlotPlayer pp = BukkitUtil.getPlayer(e.getPlayer());
|
final PlotPlayer pp = BukkitUtil.getPlayer(e.getPlayer());
|
||||||
if (!isInPlot(l)) {
|
if (!isInPlot(l)) {
|
||||||
|
if (!isPlotArea(l)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!Permissions.hasPermission(pp, "plots.admin.interact.road")) {
|
if (!Permissions.hasPermission(pp, "plots.admin.interact.road")) {
|
||||||
MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.interact.road");
|
MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.interact.road");
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
package com.intellectualcrafters.plot.object;
|
||||||
|
|
||||||
|
public abstract class RunnableVal implements Runnable {
|
||||||
|
public Object value;
|
||||||
|
|
||||||
|
public abstract void run();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user