mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-13 19:04:43 +02:00
Compare commits
43 Commits
6.6.2
...
feature/v6
Author | SHA1 | Date | |
---|---|---|---|
a807b98f07 | |||
3dbbbc698e | |||
a71af4e76f | |||
5c0e538231 | |||
db963ffc61 | |||
7343319fe6 | |||
dc6d0e089f | |||
bbe31379e8 | |||
7c48fe198d | |||
c5ff743c9e | |||
fc93156362 | |||
c875487173 | |||
a100f497b5 | |||
99fa3f403e | |||
be417ae954 | |||
0e4c87fb8f | |||
a233bfe111 | |||
9328695c75 | |||
8e9a142be8 | |||
6cb88505a9 | |||
ae3b86ed53 | |||
3d0ceb4eb9 | |||
c8327bfa40 | |||
c4db968830 | |||
852c180bbd | |||
e45b2ba288 | |||
f45fb8fd6f | |||
b630baef55 | |||
d6b2b41c89 | |||
10c9425826 | |||
f369ccb30e | |||
026e3fc17e | |||
b9f6f9b2b8 | |||
a12fe280db | |||
ff60ad1e24 | |||
7d15cc3ba3 | |||
4367be9ad0 | |||
9f4bdaef40 | |||
0d468505bb | |||
fae95b758a | |||
f7dd0c1d38 | |||
80c39ec79a | |||
f1d9d4bdc7 |
1
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
1
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -27,7 +27,6 @@ body:
|
|||||||
description: Which server version version you using? If your server version is not listed, it is not supported. Update to a supported version first.
|
description: Which server version version you using? If your server version is not listed, it is not supported. Update to a supported version first.
|
||||||
multiple: false
|
multiple: false
|
||||||
options:
|
options:
|
||||||
- '1.18.2'
|
|
||||||
- '1.18.1'
|
- '1.18.1'
|
||||||
- '1.18'
|
- '1.18'
|
||||||
- '1.17.1'
|
- '1.17.1'
|
||||||
|
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -8,7 +8,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v3.0.0
|
uses: actions/checkout@v2.4.0
|
||||||
- name: Validate Gradle Wrapper"
|
- name: Validate Gradle Wrapper"
|
||||||
uses: gradle/wrapper-validation-action@v1.0.4
|
uses: gradle/wrapper-validation-action@v1.0.4
|
||||||
- name: Setup Java
|
- name: Setup Java
|
||||||
|
2
.github/workflows/codeql.yml
vendored
2
.github/workflows/codeql.yml
vendored
@ -23,7 +23,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v1
|
uses: github/codeql-action/init@v1
|
||||||
|
2
.github/workflows/release-drafter.yml
vendored
2
.github/workflows/release-drafter.yml
vendored
@ -14,6 +14,6 @@ jobs:
|
|||||||
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
|
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: release-drafter/release-drafter@v5.19.0
|
- uses: release-drafter/release-drafter@v5.18.1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@ -76,6 +76,7 @@ import com.plotsquared.core.util.EventDispatcher;
|
|||||||
import com.plotsquared.core.util.MathMan;
|
import com.plotsquared.core.util.MathMan;
|
||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.Permissions;
|
||||||
import com.plotsquared.core.util.PremiumVerification;
|
import com.plotsquared.core.util.PremiumVerification;
|
||||||
|
import com.plotsquared.core.util.RegExUtil;
|
||||||
import com.plotsquared.core.util.entity.EntityCategories;
|
import com.plotsquared.core.util.entity.EntityCategories;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import com.plotsquared.core.util.task.TaskTime;
|
import com.plotsquared.core.util.task.TaskTime;
|
||||||
@ -222,9 +223,10 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("StringSplitter")
|
||||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
||||||
public void playerCommand(PlayerCommandPreprocessEvent event) {
|
public void playerCommand(PlayerCommandPreprocessEvent event) {
|
||||||
String msg = event.getMessage().replace("/", "").toLowerCase(Locale.ROOT).trim();
|
String msg = event.getMessage().toLowerCase().replaceAll("/", "").trim();
|
||||||
if (msg.isEmpty()) {
|
if (msg.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -238,9 +240,11 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
String[] parts = msg.split(" ");
|
String[] parts = msg.split(" ");
|
||||||
Plot plot = plotPlayer.getCurrentPlot();
|
Plot plot = plotPlayer.getCurrentPlot();
|
||||||
// Check WorldEdit
|
// Check WorldEdit
|
||||||
switch (parts[0]) {
|
switch (parts[0].toLowerCase()) {
|
||||||
case "up":
|
case "up":
|
||||||
|
case "/up":
|
||||||
case "worldedit:up":
|
case "worldedit:up":
|
||||||
|
case "worldedit:/up":
|
||||||
if (plot == null || (!plot.isAdded(plotPlayer.getUUID()) && !Permissions
|
if (plot == null || (!plot.isAdded(plotPlayer.getUUID()) && !Permissions
|
||||||
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER, true))) {
|
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_BUILD_OTHER, true))) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -254,40 +258,15 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
List<String> blockedCommands = plot != null ?
|
List<String> blockedCommands = plot != null ?
|
||||||
plot.getFlag(BlockedCmdsFlag.class) :
|
plot.getFlag(BlockedCmdsFlag.class) :
|
||||||
area.getFlag(BlockedCmdsFlag.class);
|
area.getFlag(BlockedCmdsFlag.class);
|
||||||
if (blockedCommands.isEmpty()) {
|
if (!blockedCommands.isEmpty() && !Permissions
|
||||||
return;
|
.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS)) {
|
||||||
}
|
|
||||||
if (Permissions.hasPermission(plotPlayer, Permission.PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// When using namespaced commands, we're not interested in the namespace
|
|
||||||
String part = parts[0];
|
String part = parts[0];
|
||||||
if (part.contains(":")) {
|
if (parts[0].contains(":")) {
|
||||||
String[] namespaced = part.split(":");
|
part = parts[0].split(":")[1];
|
||||||
part = namespaced[1];
|
msg = msg.replace(parts[0].split(":")[0] + ':', "");
|
||||||
msg = msg.substring(namespaced[0].length() + 1);
|
|
||||||
}
|
}
|
||||||
msg = replaceAliases(msg, part);
|
|
||||||
for (String blocked : blockedCommands) {
|
|
||||||
if (blocked.equalsIgnoreCase(msg)) {
|
|
||||||
String perm;
|
|
||||||
if (plot != null && plot.isAdded(plotPlayer.getUUID())) {
|
|
||||||
perm = "plots.admin.command.blocked-cmds.shared";
|
|
||||||
} else {
|
|
||||||
perm = "plots.admin.command.blocked-cmds.road";
|
|
||||||
}
|
|
||||||
if (!Permissions.hasPermission(plotPlayer, perm)) {
|
|
||||||
plotPlayer.sendMessage(TranslatableCaption.of("blockedcmds.command_blocked"));
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String replaceAliases(String msg, String part) {
|
|
||||||
String s1 = part;
|
String s1 = part;
|
||||||
Set<String> aliases = new HashSet<>();
|
List<String> aliases = new ArrayList<>();
|
||||||
for (HelpTopic cmdLabel : Bukkit.getServer().getHelpMap().getHelpTopics()) {
|
for (HelpTopic cmdLabel : Bukkit.getServer().getHelpMap().getHelpTopics()) {
|
||||||
if (part.equals(cmdLabel.getName())) {
|
if (part.equals(cmdLabel.getName())) {
|
||||||
break;
|
break;
|
||||||
@ -296,8 +275,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
if (aliases.contains(label)) {
|
if (aliases.contains(label)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
PluginCommand p = Bukkit.getPluginCommand(label);
|
PluginCommand p;
|
||||||
if (p != null) {
|
if ((p = Bukkit.getPluginCommand(label)) != null) {
|
||||||
for (String a : p.getAliases()) {
|
for (String a : p.getAliases()) {
|
||||||
if (aliases.contains(a)) {
|
if (aliases.contains(a)) {
|
||||||
continue;
|
continue;
|
||||||
@ -314,7 +293,28 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
if (!s1.equals(part)) {
|
if (!s1.equals(part)) {
|
||||||
msg = msg.replace(s1, part);
|
msg = msg.replace(s1, part);
|
||||||
}
|
}
|
||||||
return msg;
|
for (String s : blockedCommands) {
|
||||||
|
Pattern pattern;
|
||||||
|
if (!RegExUtil.compiledPatterns.containsKey(s)) {
|
||||||
|
RegExUtil.compiledPatterns.put(s, pattern = Pattern.compile(s));
|
||||||
|
} else {
|
||||||
|
pattern = RegExUtil.compiledPatterns.get(s);
|
||||||
|
}
|
||||||
|
if (pattern.matcher(msg).matches()) {
|
||||||
|
String perm;
|
||||||
|
if (plot != null && plot.isAdded(plotPlayer.getUUID())) {
|
||||||
|
perm = "plots.admin.command.blocked-cmds.shared";
|
||||||
|
} else {
|
||||||
|
perm = "plots.admin.command.blocked-cmds.road";
|
||||||
|
}
|
||||||
|
if (!Permissions.hasPermission(plotPlayer, perm)) {
|
||||||
|
plotPlayer.sendMessage(TranslatableCaption.of("blockedcmds.command_blocked"));
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
|
@ -46,7 +46,7 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
|
|||||||
public class SingleWorldListener implements Listener {
|
public class SingleWorldListener implements Listener {
|
||||||
|
|
||||||
private final Method methodGetHandleChunk;
|
private final Method methodGetHandleChunk;
|
||||||
private Field shouldSave = null;
|
private Field shouldSave;
|
||||||
|
|
||||||
public SingleWorldListener() throws Exception {
|
public SingleWorldListener() throws Exception {
|
||||||
ReflectionUtils.RefClass classCraftChunk = getRefClass("{cb}.CraftChunk");
|
ReflectionUtils.RefClass classCraftChunk = getRefClass("{cb}.CraftChunk");
|
||||||
@ -59,12 +59,9 @@ public class SingleWorldListener implements Listener {
|
|||||||
} else {
|
} else {
|
||||||
this.shouldSave = classChunk.getField("s").getRealField();
|
this.shouldSave = classChunk.getField("s").getRealField();
|
||||||
}
|
}
|
||||||
} else if (PlotSquared.platform().serverVersion()[1] == 17) {
|
} else {
|
||||||
ReflectionUtils.RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.Chunk");
|
ReflectionUtils.RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.Chunk");
|
||||||
this.shouldSave = classChunk.getField("r").getRealField();
|
this.shouldSave = classChunk.getField("r").getRealField();
|
||||||
} else if (PlotSquared.platform().serverVersion()[1] == 18) {
|
|
||||||
ReflectionUtils.RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.IChunkAccess");
|
|
||||||
this.shouldSave = classChunk.getField("b").getRealField();
|
|
||||||
}
|
}
|
||||||
} catch (NoSuchFieldException e) {
|
} catch (NoSuchFieldException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -67,7 +67,7 @@ public class GenChunk extends ScopedQueueCoordinator {
|
|||||||
* @param minY minimum world Y, inclusive
|
* @param minY minimum world Y, inclusive
|
||||||
* @param maxY maximum world Y, inclusive
|
* @param maxY maximum world Y, inclusive
|
||||||
*
|
*
|
||||||
* @since 6.6.0
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
public GenChunk(int minY, int maxY) {
|
public GenChunk(int minY, int maxY) {
|
||||||
super(null, Location.at("", 0, minY, 0), Location.at("", 15, maxY, 15));
|
super(null, Location.at("", 0, minY, 0), Location.at("", 15, maxY, 15));
|
||||||
|
@ -347,16 +347,14 @@ public class BukkitUtil extends WorldUtil {
|
|||||||
final Block block = world.getBlockAt(location.getX(), location.getY(), location.getZ());
|
final Block block = world.getBlockAt(location.getX(), location.getY(), location.getZ());
|
||||||
final Material type = block.getType();
|
final Material type = block.getType();
|
||||||
if (type != Material.LEGACY_SIGN && type != Material.LEGACY_WALL_SIGN) {
|
if (type != Material.LEGACY_SIGN && type != Material.LEGACY_WALL_SIGN) {
|
||||||
BlockFace facing = BlockFace.NORTH;
|
BlockFace facing = BlockFace.EAST;
|
||||||
if (!world.getBlockAt(location.getX(), location.getY(), location.getZ() + 1).getType().isSolid()) {
|
if (world.getBlockAt(location.getX(), location.getY(), location.getZ() + 1).getType().isSolid()) {
|
||||||
if (world.getBlockAt(location.getX() - 1, location.getY(), location.getZ()).getType().isSolid()) {
|
facing = BlockFace.NORTH;
|
||||||
facing = BlockFace.EAST;
|
|
||||||
} else if (world.getBlockAt(location.getX() + 1, location.getY(), location.getZ()).getType().isSolid()) {
|
} else if (world.getBlockAt(location.getX() + 1, location.getY(), location.getZ()).getType().isSolid()) {
|
||||||
facing = BlockFace.WEST;
|
facing = BlockFace.WEST;
|
||||||
} else if (world.getBlockAt(location.getX(), location.getY(), location.getZ() - 1).getType().isSolid()) {
|
} else if (world.getBlockAt(location.getX(), location.getY(), location.getZ() - 1).getType().isSolid()) {
|
||||||
facing = BlockFace.SOUTH;
|
facing = BlockFace.SOUTH;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (PlotSquared.platform().serverVersion()[1] == 13) {
|
if (PlotSquared.platform().serverVersion()[1] == 13) {
|
||||||
block.setType(Material.valueOf(area.legacySignMaterial()), false);
|
block.setType(Material.valueOf(area.legacySignMaterial()), false);
|
||||||
} else {
|
} else {
|
||||||
|
@ -88,7 +88,7 @@ public class BukkitWorld implements World<org.bukkit.World> {
|
|||||||
/**
|
/**
|
||||||
* Get the min world height from a Bukkit {@link org.bukkit.World}. Inclusive
|
* Get the min world height from a Bukkit {@link org.bukkit.World}. Inclusive
|
||||||
*
|
*
|
||||||
* @since 6.6.0
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
public static int getMinWorldHeight(org.bukkit.World world) {
|
public static int getMinWorldHeight(org.bukkit.World world) {
|
||||||
return HAS_MIN_Y ? world.getMinHeight() : 0;
|
return HAS_MIN_Y ? world.getMinHeight() : 0;
|
||||||
@ -97,7 +97,7 @@ public class BukkitWorld implements World<org.bukkit.World> {
|
|||||||
/**
|
/**
|
||||||
* Get the max world height from a Bukkit {@link org.bukkit.World}. Exclusive
|
* Get the max world height from a Bukkit {@link org.bukkit.World}. Exclusive
|
||||||
*
|
*
|
||||||
* @since 6.6.0
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
public static int getMaxWorldHeight(org.bukkit.World world) {
|
public static int getMaxWorldHeight(org.bukkit.World world) {
|
||||||
return HAS_MIN_Y ? world.getMaxHeight() : 256;
|
return HAS_MIN_Y ? world.getMaxHeight() : 256;
|
||||||
@ -143,7 +143,7 @@ public class BukkitWorld implements World<org.bukkit.World> {
|
|||||||
/**
|
/**
|
||||||
* @deprecated This method is not meant to be invoked or overridden, with no replacement.
|
* @deprecated This method is not meant to be invoked or overridden, with no replacement.
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "6.6.0")
|
@Deprecated(forRemoval = true, since = "TODO")
|
||||||
protected boolean canEqual(final Object other) {
|
protected boolean canEqual(final Object other) {
|
||||||
return other instanceof BukkitWorld;
|
return other instanceof BukkitWorld;
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ public class FaweSchematicHandler extends SchematicHandler {
|
|||||||
final PlotPlayer<?> actor,
|
final PlotPlayer<?> actor,
|
||||||
final RunnableVal<Boolean> whenDone
|
final RunnableVal<Boolean> whenDone
|
||||||
) {
|
) {
|
||||||
delegate.paste(schematic, plot, xOffset, yOffset, zOffset, autoHeight, actor, whenDone);
|
delegate.paste(schematic, plot, xOffset, yOffset, zOffset, autoHeight, whenDone);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -102,7 +102,7 @@ public interface PlotPlatform<P> extends LocaleHolder {
|
|||||||
* Gets the default minimum world height for the version of Minecraft that the server is running.
|
* Gets the default minimum world height for the version of Minecraft that the server is running.
|
||||||
*
|
*
|
||||||
* @return minimum world height
|
* @return minimum world height
|
||||||
* @since 6.6.0
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
int versionMinHeight();
|
int versionMinHeight();
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ public interface PlotPlatform<P> extends LocaleHolder {
|
|||||||
* Gets the default maximum world height for the version of Minecraft that the server is running.
|
* Gets the default maximum world height for the version of Minecraft that the server is running.
|
||||||
*
|
*
|
||||||
* @return maximum world height (inclusive)
|
* @return maximum world height (inclusive)
|
||||||
* @since 6.6.0
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
int versionMaxHeight();
|
int versionMaxHeight();
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ public class Confirm extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("confirm.expired_confirm"));
|
player.sendMessage(TranslatableCaption.of("confirm.expired_confirm"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
TaskManager.runTask(command.command);
|
TaskManager.runTaskAsync(command.command);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@ import com.plotsquared.core.plot.schematic.Schematic;
|
|||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.Permissions;
|
||||||
import com.plotsquared.core.util.SchematicHandler;
|
import com.plotsquared.core.util.SchematicHandler;
|
||||||
import com.plotsquared.core.util.TimeUtil;
|
|
||||||
import com.plotsquared.core.util.task.RunnableVal;
|
import com.plotsquared.core.util.task.RunnableVal;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
@ -206,7 +205,7 @@ public class Load extends SubCommand {
|
|||||||
if (split.length < 5) {
|
if (split.length < 5) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String time = TimeUtil.secToTime((System.currentTimeMillis() / 1000) - Long.parseLong(split[0]));
|
String time = secToTime((System.currentTimeMillis() / 1000) - Long.parseLong(split[0]));
|
||||||
String world = split[1];
|
String world = split[1];
|
||||||
PlotId id = PlotId.fromString(split[2] + ';' + split[3]);
|
PlotId id = PlotId.fromString(split[2] + ';' + split[3]);
|
||||||
String size = split[4];
|
String size = split[4];
|
||||||
@ -224,10 +223,6 @@ public class Load extends SubCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Use {@link TimeUtil#secToTime(long)}
|
|
||||||
*/
|
|
||||||
@Deprecated(forRemoval = true, since = "6.6.2")
|
|
||||||
public String secToTime(long time) {
|
public String secToTime(long time) {
|
||||||
StringBuilder toreturn = new StringBuilder();
|
StringBuilder toreturn = new StringBuilder();
|
||||||
if (time >= 33868800) {
|
if (time >= 33868800) {
|
||||||
|
@ -605,7 +605,7 @@ public class HybridUtils {
|
|||||||
* @return if successful
|
* @return if successful
|
||||||
* @deprecated use {@link HybridUtils#regenerateRoad(PlotArea, BlockVector2, int, QueueCoordinator)}
|
* @deprecated use {@link HybridUtils#regenerateRoad(PlotArea, BlockVector2, int, QueueCoordinator)}
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "6.6.0")
|
@Deprecated(forRemoval = true, since = "TODO")
|
||||||
public boolean regenerateRoad(final PlotArea area, final BlockVector2 chunk, int extend) {
|
public boolean regenerateRoad(final PlotArea area, final BlockVector2 chunk, int extend) {
|
||||||
return regenerateRoad(area, chunk, extend, null);
|
return regenerateRoad(area, chunk, extend, null);
|
||||||
}
|
}
|
||||||
@ -618,7 +618,7 @@ public class HybridUtils {
|
|||||||
* @param extend How far to extend setting air above the road
|
* @param extend How far to extend setting air above the road
|
||||||
* @param queueCoordinator {@link QueueCoordinator} to use to set the blocks. Null if one should be created and enqueued
|
* @param queueCoordinator {@link QueueCoordinator} to use to set the blocks. Null if one should be created and enqueued
|
||||||
* @return if successful
|
* @return if successful
|
||||||
* @since 6.6.0
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
public boolean regenerateRoad(
|
public boolean regenerateRoad(
|
||||||
final PlotArea area,
|
final PlotArea area,
|
||||||
|
@ -35,7 +35,6 @@ import com.plotsquared.core.plot.world.PlotAreaManager;
|
|||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.Permissions;
|
||||||
import com.plotsquared.core.util.WEManager;
|
import com.plotsquared.core.util.WEManager;
|
||||||
import com.plotsquared.core.util.WorldUtil;
|
import com.plotsquared.core.util.WorldUtil;
|
||||||
import com.sk89q.worldedit.EditSession;
|
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
import com.sk89q.worldedit.entity.Player;
|
import com.sk89q.worldedit.entity.Player;
|
||||||
import com.sk89q.worldedit.event.extent.EditSessionEvent;
|
import com.sk89q.worldedit.event.extent.EditSessionEvent;
|
||||||
@ -68,9 +67,6 @@ public class WESubscriber {
|
|||||||
WorldEdit.getInstance().getEventBus().unregister(this);
|
WorldEdit.getInstance().getEventBus().unregister(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (event.getStage() != EditSession.Stage.BEFORE_HISTORY) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
World worldObj = event.getWorld();
|
World worldObj = event.getWorld();
|
||||||
if (worldObj == null) {
|
if (worldObj == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -61,7 +61,7 @@ public interface World<T> {
|
|||||||
/**
|
/**
|
||||||
* Get the min world height. Inclusive.
|
* Get the min world height. Inclusive.
|
||||||
*
|
*
|
||||||
* @since 6.6.0
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
int getMinHeight();
|
int getMinHeight();
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ public interface World<T> {
|
|||||||
/**
|
/**
|
||||||
* Get the max world height. Inclusive.
|
* Get the max world height. Inclusive.
|
||||||
*
|
*
|
||||||
* @since 6.6.0
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
int getMaxHeight();
|
int getMaxHeight();
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ import static com.plotsquared.core.util.entity.EntityCategories.CAP_VEHICLE;
|
|||||||
*/
|
*/
|
||||||
public class Plot {
|
public class Plot {
|
||||||
|
|
||||||
@Deprecated(forRemoval = true, since = "6.6.0")
|
@Deprecated(forRemoval = true, since = "TODO")
|
||||||
public static final int MAX_HEIGHT = 256;
|
public static final int MAX_HEIGHT = 256;
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + Plot.class.getSimpleName());
|
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + Plot.class.getSimpleName());
|
||||||
|
@ -1381,7 +1381,7 @@ public abstract class PlotArea {
|
|||||||
/**
|
/**
|
||||||
* Get the min height from which P2 will generate blocks. Inclusive.
|
* Get the min height from which P2 will generate blocks. Inclusive.
|
||||||
*
|
*
|
||||||
* @since 6.6.0
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
public int getMinGenHeight() {
|
public int getMinGenHeight() {
|
||||||
return this.minGenHeight;
|
return this.minGenHeight;
|
||||||
@ -1390,7 +1390,7 @@ public abstract class PlotArea {
|
|||||||
/**
|
/**
|
||||||
* Get the max height to which P2 will generate blocks. Inclusive.
|
* Get the max height to which P2 will generate blocks. Inclusive.
|
||||||
*
|
*
|
||||||
* @since 6.6.0
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
public int getMaxGenHeight() {
|
public int getMaxGenHeight() {
|
||||||
return this.maxGenHeight;
|
return this.maxGenHeight;
|
||||||
|
@ -125,7 +125,7 @@ public abstract class PlotWorld {
|
|||||||
/**
|
/**
|
||||||
* @deprecated This method is not meant to be invoked or overridden, with no replacement.
|
* @deprecated This method is not meant to be invoked or overridden, with no replacement.
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "6.6.0")
|
@Deprecated(forRemoval = true, since = "TODO")
|
||||||
protected boolean canEqual(final Object other) {
|
protected boolean canEqual(final Object other) {
|
||||||
return other instanceof PlotWorld;
|
return other instanceof PlotWorld;
|
||||||
}
|
}
|
||||||
|
@ -391,7 +391,7 @@ public class FlagContainer {
|
|||||||
/**
|
/**
|
||||||
* @deprecated This method is not meant to be invoked or overridden, with no replacement.
|
* @deprecated This method is not meant to be invoked or overridden, with no replacement.
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "6.6.0")
|
@Deprecated(forRemoval = true, since = "TODO")
|
||||||
protected boolean canEqual(final Object other) {
|
protected boolean canEqual(final Object other) {
|
||||||
return other instanceof FlagContainer;
|
return other instanceof FlagContainer;
|
||||||
}
|
}
|
||||||
|
@ -221,7 +221,7 @@ public abstract class PlotFlag<T, F extends PlotFlag<T, F>> {
|
|||||||
/**
|
/**
|
||||||
* @deprecated This method is not meant to be invoked or overridden, with no replacement.
|
* @deprecated This method is not meant to be invoked or overridden, with no replacement.
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "6.6.0")
|
@Deprecated(forRemoval = true, since = "TODO")
|
||||||
protected boolean canEqual(final Object other) {
|
protected boolean canEqual(final Object other) {
|
||||||
return other instanceof PlotFlag;
|
return other instanceof PlotFlag;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ public class LocalChunk {
|
|||||||
/**
|
/**
|
||||||
* Get the minimum layer position stored (usually -4 or 0).
|
* Get the minimum layer position stored (usually -4 or 0).
|
||||||
*
|
*
|
||||||
* @since 6.6.0
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
public int getMinSection() {
|
public int getMinSection() {
|
||||||
return this.minSection;
|
return this.minSection;
|
||||||
|
@ -77,7 +77,7 @@ public abstract class QueueCoordinator {
|
|||||||
* @return a new {@link ScopedQueueCoordinator}
|
* @return a new {@link ScopedQueueCoordinator}
|
||||||
* @deprecated Use {@link ScopedQueueCoordinator#getForChunk(int, int, int, int)}
|
* @deprecated Use {@link ScopedQueueCoordinator#getForChunk(int, int, int, int)}
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "6.6.0")
|
@Deprecated(forRemoval = true, since = "TODO")
|
||||||
public ScopedQueueCoordinator getForChunk(int x, int z) {
|
public ScopedQueueCoordinator getForChunk(int x, int z) {
|
||||||
if (getWorld() == null) {
|
if (getWorld() == null) {
|
||||||
return getForChunk(x, z, PlotSquared.platform().versionMinHeight(), PlotSquared.platform().versionMaxHeight());
|
return getForChunk(x, z, PlotSquared.platform().versionMinHeight(), PlotSquared.platform().versionMaxHeight());
|
||||||
@ -91,7 +91,7 @@ public abstract class QueueCoordinator {
|
|||||||
* @param x chunk x coordinate
|
* @param x chunk x coordinate
|
||||||
* @param z chunk z coordinate
|
* @param z chunk z coordinate
|
||||||
* @return a new {@link ScopedQueueCoordinator}
|
* @return a new {@link ScopedQueueCoordinator}
|
||||||
* @since 6.6.0
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
public ScopedQueueCoordinator getForChunk(int x, int z, int minY, int maxY) {
|
public ScopedQueueCoordinator getForChunk(int x, int z, int minY, int maxY) {
|
||||||
int bx = x << 4;
|
int bx = x << 4;
|
||||||
|
@ -29,7 +29,6 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@Deprecated(since = "6.6.2", forRemoval = true)
|
|
||||||
public class RegExUtil {
|
public class RegExUtil {
|
||||||
|
|
||||||
public static Map<String, Pattern> compiledPatterns;
|
public static Map<String, Pattern> compiledPatterns;
|
||||||
|
@ -379,7 +379,7 @@ public abstract class RegionManager {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated(forRemoval = true, since = "6.6.0")
|
@Deprecated(forRemoval = true, since = "TODO")
|
||||||
public void setBiome(
|
public void setBiome(
|
||||||
final CuboidRegion region,
|
final CuboidRegion region,
|
||||||
final int extendBiome,
|
final int extendBiome,
|
||||||
@ -398,7 +398,7 @@ public abstract class RegionManager {
|
|||||||
* @param biome biome to set
|
* @param biome biome to set
|
||||||
* @param area {@link PlotArea} in which the biome is being set
|
* @param area {@link PlotArea} in which the biome is being set
|
||||||
* @param whenDone task to run when complete
|
* @param whenDone task to run when complete
|
||||||
* @since 6.6.0
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
public void setBiome(
|
public void setBiome(
|
||||||
final CuboidRegion region,
|
final CuboidRegion region,
|
||||||
|
@ -76,7 +76,7 @@ public class RegionUtil {
|
|||||||
return new CuboidRegion(min, max);
|
return new CuboidRegion(min, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated(forRemoval = true, since = "6.6.0")
|
@Deprecated(forRemoval = true, since = "TODO")
|
||||||
public static CuboidRegion createRegion(int pos1x, int pos2x, int pos1z, int pos2z) {
|
public static CuboidRegion createRegion(int pos1x, int pos2x, int pos1z, int pos2z) {
|
||||||
return createRegion(pos1x, pos2x, 0, 255, pos1z, pos2z);
|
return createRegion(pos1x, pos2x, 0, 255, pos1z, pos2z);
|
||||||
}
|
}
|
||||||
|
@ -44,27 +44,27 @@ public final class TimeUtil {
|
|||||||
StringBuilder toReturn = new StringBuilder();
|
StringBuilder toReturn = new StringBuilder();
|
||||||
if (time >= 33868800) {
|
if (time >= 33868800) {
|
||||||
int years = (int) (time / 33868800);
|
int years = (int) (time / 33868800);
|
||||||
time -= years * 33868800L;
|
time -= years * 33868800;
|
||||||
toReturn.append(years).append("y ");
|
toReturn.append(years).append("y ");
|
||||||
}
|
}
|
||||||
if (time >= 604800) {
|
if (time >= 604800) {
|
||||||
int weeks = (int) (time / 604800);
|
int weeks = (int) (time / 604800);
|
||||||
time -= weeks * 604800L;
|
time -= weeks * 604800;
|
||||||
toReturn.append(weeks).append("w ");
|
toReturn.append(weeks).append("w ");
|
||||||
}
|
}
|
||||||
if (time >= 86400) {
|
if (time >= 86400) {
|
||||||
int days = (int) (time / 86400);
|
int days = (int) (time / 86400);
|
||||||
time -= days * 86400L;
|
time -= days * 86400;
|
||||||
toReturn.append(days).append("d ");
|
toReturn.append(days).append("d ");
|
||||||
}
|
}
|
||||||
if (time >= 3600) {
|
if (time >= 3600) {
|
||||||
int hours = (int) (time / 3600);
|
int hours = (int) (time / 3600);
|
||||||
time -= hours * 3600L;
|
time -= hours * 3600;
|
||||||
toReturn.append(hours).append("h ");
|
toReturn.append(hours).append("h ");
|
||||||
}
|
}
|
||||||
if (time >= 60) {
|
if (time >= 60) {
|
||||||
int minutes = (int) (time / 60);
|
int minutes = (int) (time / 60);
|
||||||
time -= minutes * 60L;
|
time -= minutes * 60;
|
||||||
toReturn.append(minutes).append("m ");
|
toReturn.append(minutes).append("m ");
|
||||||
}
|
}
|
||||||
if (toReturn.length() == 0 || time > 0) {
|
if (toReturn.length() == 0 || time > 0) {
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.util;
|
package com.plotsquared.core.util;
|
||||||
|
|
||||||
|
import com.fastasyncworldedit.core.regions.RegionWrapper;
|
||||||
import com.plotsquared.core.PlotSquared;
|
import com.plotsquared.core.PlotSquared;
|
||||||
import com.plotsquared.core.configuration.Settings;
|
import com.plotsquared.core.configuration.Settings;
|
||||||
import com.plotsquared.core.location.Location;
|
import com.plotsquared.core.location.Location;
|
||||||
@ -44,9 +45,6 @@ import java.util.UUID;
|
|||||||
|
|
||||||
public class WEManager {
|
public class WEManager {
|
||||||
|
|
||||||
private static final BlockVector3 MIN = BlockVector3.at(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE);
|
|
||||||
private static final BlockVector3 MAX = BlockVector3.at(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE);
|
|
||||||
|
|
||||||
public static boolean maskContains(Set<CuboidRegion> mask, int x, int y, int z) {
|
public static boolean maskContains(Set<CuboidRegion> mask, int x, int y, int z) {
|
||||||
for (CuboidRegion region : mask) {
|
for (CuboidRegion region : mask) {
|
||||||
if (RegionUtil.contains(region, x, y, z)) {
|
if (RegionUtil.contains(region, x, y, z)) {
|
||||||
@ -94,7 +92,7 @@ public class WEManager {
|
|||||||
Location location = player.getLocation();
|
Location location = player.getLocation();
|
||||||
String world = location.getWorldName();
|
String world = location.getWorldName();
|
||||||
if (!PlotSquared.get().getPlotAreaManager().hasPlotArea(world)) {
|
if (!PlotSquared.get().getPlotAreaManager().hasPlotArea(world)) {
|
||||||
regions.add(new CuboidRegion(MIN, MAX));
|
regions.add(RegionWrapper.GLOBAL());
|
||||||
return regions;
|
return regions;
|
||||||
}
|
}
|
||||||
PlotArea area = player.getApplicablePlotArea();
|
PlotArea area = player.getApplicablePlotArea();
|
||||||
|
@ -96,7 +96,7 @@ public abstract class WorldUtil {
|
|||||||
* @param world World name
|
* @param world World name
|
||||||
* @param region Region
|
* @param region Region
|
||||||
* @param biome Biome
|
* @param biome Biome
|
||||||
* @since 6.6.0
|
* @since TODO
|
||||||
*/
|
*/
|
||||||
public static void setBiome(String world, final CuboidRegion region, BiomeType biome) {
|
public static void setBiome(String world, final CuboidRegion region, BiomeType biome) {
|
||||||
PlotSquared.platform().worldUtil().setBiomes(world, region, biome);
|
PlotSquared.platform().worldUtil().setBiomes(world, region, biome);
|
||||||
|
@ -71,7 +71,7 @@ public class UUIDMapping {
|
|||||||
/**
|
/**
|
||||||
* @deprecated This method is not meant to be invoked or overridden, with no replacement.
|
* @deprecated This method is not meant to be invoked or overridden, with no replacement.
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "6.6.0")
|
@Deprecated(forRemoval = true, since = "TODO")
|
||||||
protected boolean canEqual(final Object other) {
|
protected boolean canEqual(final Object other) {
|
||||||
return other instanceof UUIDMapping;
|
return other instanceof UUIDMapping;
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ plugins {
|
|||||||
idea
|
idea
|
||||||
}
|
}
|
||||||
|
|
||||||
version = "6.6.2"
|
version = "6.5.2-SNAPSHOT"
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
group = "com.plotsquared"
|
group = "com.plotsquared"
|
||||||
|
@ -6,7 +6,7 @@ guava = "31.0.1-jre" # Version set by Minecraft
|
|||||||
|
|
||||||
# Platform expectations
|
# Platform expectations
|
||||||
paper = "1.18.1-R0.1-SNAPSHOT"
|
paper = "1.18.1-R0.1-SNAPSHOT"
|
||||||
checker-qual = "3.21.4"
|
checker-qual = "3.21.2"
|
||||||
guice = "5.1.0"
|
guice = "5.1.0"
|
||||||
findbugs = "3.0.1"
|
findbugs = "3.0.1"
|
||||||
snakeyaml = "1.30" # Version set by Bukkit
|
snakeyaml = "1.30" # Version set by Bukkit
|
||||||
@ -17,12 +17,12 @@ adventure-text-minimessage = "4.1.0-SNAPSHOT"
|
|||||||
adventure-platform-bukkit = "4.0.1"
|
adventure-platform-bukkit = "4.0.1"
|
||||||
|
|
||||||
# Plugins
|
# Plugins
|
||||||
worldedit = "7.2.10"
|
worldedit = "7.2.9"
|
||||||
fawe = "2.1.0"
|
fawe = "2.0.1"
|
||||||
vault = "1.7.1"
|
vault = "1.7.1"
|
||||||
placeholderapi = "2.11.1"
|
placeholderapi = "2.11.1"
|
||||||
luckperms = "5.4"
|
luckperms = "5.4"
|
||||||
essentialsx = "2.19.4"
|
essentialsx = "2.19.2"
|
||||||
mvdwapi = "3.1.1"
|
mvdwapi = "3.1.1"
|
||||||
|
|
||||||
# Third party
|
# Third party
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
@ -8,8 +8,7 @@
|
|||||||
"com.google.guava:guava",
|
"com.google.guava:guava",
|
||||||
"com.google.code.gson:gson",
|
"com.google.code.gson:gson",
|
||||||
"gson",
|
"gson",
|
||||||
"snakeyaml",
|
"snakeyaml"
|
||||||
"net.kyori"
|
|
||||||
],
|
],
|
||||||
"timezone": "Europe/Berlin",
|
"timezone": "Europe/Berlin",
|
||||||
"schedule": [
|
"schedule": [
|
||||||
|
Reference in New Issue
Block a user