Compare commits

...

41 Commits

Author SHA1 Message Date
2633aa41a0 Fix wrong plot id calculation for negative coordinates 2022-12-28 19:40:54 +01:00
742d78a505 Add 1.19.3 to the issue template 2022-12-23 13:41:58 +01:00
120bf37196 Fix dispensers loading Legacy Material Support (#3894)
Fixes https://github.com/IntellectualSites/PlotSquared/issues/3883
2022-12-23 09:08:38 +00:00
2a40a6b35e Update dependency com.intellectualsites.bom:bom-1.18.x to v1.21 (#3890)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-13 22:45:51 +01:00
ea1f35b45a Update dependency cloud.commandframework:cloud-services to v1.8.0 (#3891)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-13 22:44:29 +01:00
15e63378a7 Update worldedit to v7.2.13 (#3889)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-11 08:39:32 +01:00
f3bc504a6f refactor: adjust specific Nullable annotations used (#3869) 2022-12-02 12:39:38 +00:00
3a8fae47a0 Update dependency com.intellectualsites.bom:bom-1.18.x to v1.20 (#3882)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-28 15:23:44 +01:00
70cb1cd100 Back to snapshot for development 2022-11-28 11:18:56 +01:00
2067cc1670 Release 6.10.5 2022-11-28 11:18:06 +01:00
e6338976dd Update dependency gradle to v7.6 (#3880)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-25 19:20:37 +01:00
90ebd5d5ed feat: add a permission to override-allow a merge if the other plot's owner is offline (#3844) 2022-11-25 10:48:33 +00:00
c973ee8649 Revert "feat: check merge limits when completing auto-merge (#3868)" - Fixes a bug in 6.10.4 (#3876)
Revert "feat: check merge limits when completing auto-merge (#3868)"

This reverts commit 25ce7a83f1.
2022-11-20 10:58:04 +01:00
c1543f034c feat: improve handling of null issues in plot analysis (#3867) 2022-11-17 17:23:44 +00:00
6baf339ecb Update dependency com.intellectualsites.bom:bom-1.18.x to v1.19 (#3874)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-16 18:35:03 +01:00
11906ef1c9 Back to snapshot for development 2022-11-16 11:30:23 +01:00
ee8902154a Release 6.10.4 2022-11-16 11:26:03 +01:00
b5bc1988e5 feature: implement road flags as widely as seems reasonable (#3870)
* feature: implement road flags as widely as seems reasonable
 - Closes #3047
 - Any further road flag implementations would be very specific from what I can gather, and thus the gist of #3047 is now implemented

* Add javadoc since tag

Co-authored-by: Alexander Brandes <mc.cache@web.de>

* Create util class for method

Co-authored-by: Alexander Brandes <mc.cache@web.de>
2022-11-15 19:07:38 +01:00
2147012beb chore: deprecate paper 1.13 listener as P2 effectively doesn't support 1.13 (#3872) 2022-11-14 22:58:05 +01:00
52bb561689 fix: attempt to recover from IllegalStateException when restoring block tags (#3838)
- Fixes #3801
2022-11-14 16:47:24 +01:00
25ce7a83f1 feat: check merge limits when completing auto-merge (#3868)
- Closes #3748
2022-11-13 11:57:41 +01:00
55c8a590e7 Fix item thrower/owner can be null (#3866)
fix: item thrower/owner can be nuill
 - Fixes #3862
2022-11-12 17:10:21 +01:00
28bd993680 Update dependency com.intellectualsites.bom:bom-1.18.x to v1.18 (#3864)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-06 11:13:29 +01:00
8330f37d8a Back to snapshot for development 2022-11-02 09:35:57 +01:00
985fae65b6 ÂRelease 6.10.3 2022-11-02 09:34:33 +01:00
db2d590e8e fix: account for mismatched road-schematic heights (#3854) 2022-10-23 21:22:21 +02:00
c8d356783a Update dependency com.intellectualsites.bom:bom-1.18.x to v1.17 (#3853)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-20 10:23:56 +02:00
4947450ff0 Back to snapshot for development 2022-10-18 23:14:03 +02:00
de4e91ff62 Release 6.10.2 2022-10-18 23:12:27 +02:00
fe5e3d5f6d Annotate ExpireManager with @Inject (#3852)
fix: annotate ExpireManager with @Inject
2022-10-18 10:17:34 +02:00
b8b3098022 feat: Move ExpireManager to Guice by removing legacy IMP references (#3845)
* feat: Move ExpireManager to Guice by removing legacy IMP references

* Mark ExpireManager IMP as deprecated and add comments

* Add import for PlotPlatform for function reference

* Add ExpireManager instance call and optimize performance
2022-10-17 09:31:48 +02:00
0ae8fc46b8 Update dependency com.github.spotbugs:spotbugs-annotations to v4.7.3 (#3851)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-17 09:24:42 +02:00
e0762f63a8 chore: Replace paper reference in favor of bom 2022-10-15 16:04:30 +02:00
9f3850000c fix: adjust nullability checks for shulkers in the kill road mobs task (#3842)
- Fixes #3789
2022-10-15 15:26:14 +02:00
76c6be9ba7 Fix 'No resource for locale 'lang' found ' error (#3830)
* Fix #3820

* Reword message and add link to completed translations

* Fix #3820

* Reword message and add link to completed translations

* Add line breaks for better code readability

* Add line breaks for better code readability

Co-authored-by: Alexander Brandes <mc.cache@web.de>
2022-10-13 19:19:20 +02:00
308a5aa781 Ensure all setBlock methods in BlockArrayCacheScopedQueueCoordinator apply the correct offset (#3843)
- Fixes #3783
2022-10-13 19:17:27 +02:00
e244527538 Make more complex patterns work correctly (#3847)
allow more complex patterns to work correctly
2022-10-13 19:16:19 +02:00
11dd013333 fix: Adjust schematic height logic when pasting and actually set air as well (#3840) 2022-10-13 16:46:29 +01:00
b740d5854c Support MiniMessage in plot-title flag (#3835) 2022-10-10 17:41:35 +01:00
d5445cfbef Don't kill owned road entities (leashed / named) (#3829) 2022-10-10 17:41:25 +01:00
3effaefda7 chore: Announce releases on Discord (#3839) 2022-10-09 16:40:51 +02:00
52 changed files with 452 additions and 246 deletions

View File

@ -27,6 +27,7 @@ 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.19.3'
- '1.19.2' - '1.19.2'
- '1.19.1' - '1.19.1'
- '1.19' - '1.19'

View File

@ -0,0 +1,25 @@
name: Announce release on discord
on:
release:
types: [published]
jobs:
send_announcement:
runs-on: ubuntu-latest
steps:
- name: send custom message with args
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: PlotSquared Release
DISCORD_AVATAR: https://raw.githubusercontent.com/IntellectualSites/Assets/main/plugins/PlotSquared/PlotSquared.png
uses: Ilshidur/action-discord@0.3.2
with:
args: |
"<@&525015541815967744> <@&679322738552471574> <@&699293353862496266>"
""
"<:plotsquared:730750385886593039> **PlotSquared ${{ github.event.release.tag_name }} has been released!**"
""
"Click here to view changelog: https://github.com/IntellectualSites/PlotSquared/releases/tag/${{ github.event.release.tag_name }}"
""
"The download is available at:"
"- Spigot: <https://www.spigotmc.org/resources/77506/>"

View File

@ -24,7 +24,7 @@ dependencies {
implementation("org.bstats:bstats-bukkit") implementation("org.bstats:bstats-bukkit")
// Paper // Paper
compileOnly(libs.paper) compileOnly("io.papermc.paper:paper-api")
implementation("io.papermc:paperlib") implementation("io.papermc:paperlib")
// Plugins // Plugins

View File

@ -849,11 +849,11 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
// managed elsewhere // managed elsewhere
continue; continue;
case "SHULKER": case "SHULKER":
if (Settings.Enabled_Components.KILL_ROAD_MOBS) { if (Settings.Enabled_Components.KILL_ROAD_MOBS && (Settings.Enabled_Components.KILL_NAMED_ROAD_MOBS || entity.getCustomName() == null)) {
LivingEntity livingEntity = (LivingEntity) entity; LivingEntity livingEntity = (LivingEntity) entity;
List<MetadataValue> meta = entity.getMetadata("shulkerPlot"); List<MetadataValue> meta = entity.getMetadata("shulkerPlot");
if (!meta.isEmpty()) { if (!meta.isEmpty()) {
if (livingEntity.isLeashed()) { if (livingEntity.isLeashed() && !Settings.Enabled_Components.KILL_OWNED_ROAD_MOBS) {
continue; continue;
} }
List<MetadataValue> keep = entity.getMetadata("keep"); List<MetadataValue> keep = entity.getMetadata("keep");
@ -866,10 +866,8 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
com.plotsquared.core.location.Location pLoc = BukkitUtil.adapt(entity.getLocation()); com.plotsquared.core.location.Location pLoc = BukkitUtil.adapt(entity.getLocation());
PlotArea area = pLoc.getPlotArea(); PlotArea area = pLoc.getPlotArea();
if (area != null) { if (area != null) {
PlotId currentPlotId = area.getPlotAbs(pLoc).getId(); Plot currentPlot = area.getPlotAbs(pLoc);
if (!originalPlotId.equals(currentPlotId) && (currentPlotId == null || !area.getPlot( if (currentPlot == null || !originalPlotId.equals(currentPlot.getId())) {
originalPlotId)
.equals(area.getPlot(currentPlotId)))) {
if (entity.hasMetadata("ps-tmp-teleport")) { if (entity.hasMetadata("ps-tmp-teleport")) {
continue; continue;
} }
@ -883,11 +881,11 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
com.plotsquared.core.location.Location pLoc = BukkitUtil.adapt(entity.getLocation()); com.plotsquared.core.location.Location pLoc = BukkitUtil.adapt(entity.getLocation());
PlotArea area = pLoc.getPlotArea(); PlotArea area = pLoc.getPlotArea();
if (area != null) { if (area != null) {
PlotId currentPlotId = area.getPlotAbs(pLoc).getId(); Plot currentPlot = area.getPlotAbs(pLoc);
if (currentPlotId != null) { if (currentPlot != null) {
entity.setMetadata( entity.setMetadata(
"shulkerPlot", "shulkerPlot",
new FixedMetadataValue((Plugin) PlotSquared.platform(), currentPlotId) new FixedMetadataValue((Plugin) PlotSquared.platform(), currentPlot.getId())
); );
} }
} }
@ -973,7 +971,9 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|| !entity.hasMetadata("keep")) { || !entity.hasMetadata("keep")) {
Entity passenger = entity.getPassenger(); Entity passenger = entity.getPassenger();
if ((Settings.Enabled_Components.KILL_OWNED_ROAD_MOBS if ((Settings.Enabled_Components.KILL_OWNED_ROAD_MOBS
|| !(passenger instanceof Player)) && entity.getMetadata("keep").isEmpty()) { || !((passenger instanceof Player) || livingEntity.isLeashed()))
&& (Settings.Enabled_Components.KILL_NAMED_ROAD_MOBS || entity.getCustomName() == null)
&& entity.getMetadata("keep").isEmpty()) {
if (entity.hasMetadata("ps-tmp-teleport")) { if (entity.hasMetadata("ps-tmp-teleport")) {
continue; continue;
} }
@ -983,8 +983,9 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
} }
} else { } else {
Entity passenger = entity.getPassenger(); Entity passenger = entity.getPassenger();
if ((Settings.Enabled_Components.KILL_OWNED_ROAD_MOBS if ((Settings.Enabled_Components.KILL_OWNED_ROAD_MOBS || !(passenger instanceof Player))
|| !(passenger instanceof Player)) && entity.getMetadata("keep").isEmpty()) { && (Settings.Enabled_Components.KILL_NAMED_ROAD_MOBS && entity.getCustomName() != null)
&& entity.getMetadata("keep").isEmpty()) {
if (entity.hasMetadata("ps-tmp-teleport")) { if (entity.hasMetadata("ps-tmp-teleport")) {
continue; continue;
} }

View File

@ -33,7 +33,6 @@ import org.bukkit.Chunk;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.BlockPopulator;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.NotNull;
import java.util.Random; import java.util.Random;
@ -51,7 +50,7 @@ final class LegacyBlockStatePopulator extends BlockPopulator {
} }
@Override @Override
public void populate(@NotNull final World world, @NotNull final Random random, @NotNull final Chunk source) { public void populate(@NonNull final World world, @NonNull final Random random, @NonNull final Chunk source) {
int chunkMinX = source.getX() << 4; int chunkMinX = source.getX() << 4;
int chunkMinZ = source.getZ() << 4; int chunkMinZ = source.getZ() << 4;
PlotArea area = Location.at(world.getName(), chunkMinX, 0, chunkMinZ).getPlotArea(); PlotArea area = Location.at(world.getName(), chunkMinX, 0, chunkMinZ).getPlotArea();

View File

@ -56,6 +56,7 @@ import com.plotsquared.core.plot.flag.types.BlockTypeWrapper;
import com.plotsquared.core.plot.flag.types.BooleanFlag; import com.plotsquared.core.plot.flag.types.BooleanFlag;
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.PlotFlagUtil;
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;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
@ -70,6 +71,7 @@ import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.block.data.BlockData; import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.type.Dispenser;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Fireball; import org.bukkit.entity.Fireball;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -99,7 +101,6 @@ import org.bukkit.event.block.EntityBlockFormEvent;
import org.bukkit.event.block.LeavesDecayEvent; import org.bukkit.event.block.LeavesDecayEvent;
import org.bukkit.event.block.SpongeAbsorbEvent; import org.bukkit.event.block.SpongeAbsorbEvent;
import org.bukkit.event.world.StructureGrowEvent; import org.bukkit.event.world.StructureGrowEvent;
import org.bukkit.material.Directional;
import org.bukkit.projectiles.BlockProjectileSource; import org.bukkit.projectiles.BlockProjectileSource;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
@ -166,7 +167,7 @@ public class BlockEventListener implements Listener {
} }
Plot plot = location.getOwnedPlot(); Plot plot = location.getOwnedPlot();
if (plot == null) { if (plot == null) {
if (area.isRoadFlags() && !area.getRoadFlag(RedstoneFlag.class)) { if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, RedstoneFlag.class, false)) {
event.setNewCurrent(0); event.setNewCurrent(0);
} }
return; return;
@ -925,6 +926,9 @@ public class BlockEventListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockDispense(BlockDispenseEvent event) { public void onBlockDispense(BlockDispenseEvent event) {
if (!this.plotAreaManager.hasPlotArea(event.getBlock().getWorld().getName())) {
return;
}
Material type = event.getItem().getType(); Material type = event.getItem().getType();
switch (type.toString()) { switch (type.toString()) {
case "SHULKER_BOX", "WHITE_SHULKER_BOX", "ORANGE_SHULKER_BOX", "MAGENTA_SHULKER_BOX", "LIGHT_BLUE_SHULKER_BOX", case "SHULKER_BOX", "WHITE_SHULKER_BOX", "ORANGE_SHULKER_BOX", "MAGENTA_SHULKER_BOX", "LIGHT_BLUE_SHULKER_BOX",
@ -936,7 +940,7 @@ public class BlockEventListener implements Listener {
if (event.getBlock().getType() == Material.DROPPER) { if (event.getBlock().getType() == Material.DROPPER) {
return; return;
} }
BlockFace targetFace = ((Directional) event.getBlock().getState().getData()).getFacing(); BlockFace targetFace = ((Dispenser) event.getBlock().getBlockData()).getFacing();
Location location = BukkitUtil.adapt(event.getBlock().getRelative(targetFace).getLocation()); Location location = BukkitUtil.adapt(event.getBlock().getRelative(targetFace).getLocation());
if (location.isPlotRoad()) { if (location.isPlotRoad()) {
event.setCancelled(true); event.setCancelled(true);
@ -1084,7 +1088,10 @@ public class BlockEventListener implements Listener {
return; return;
} }
if (plot == null) { if (plot == null) {
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_ROAD)) { if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, BlockIgnitionFlag.class, true) && !Permissions.hasPermission(
pp,
Permission.PERMISSION_ADMIN_BUILD_ROAD
)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD)) Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_ROAD))
@ -1092,7 +1099,10 @@ public class BlockEventListener implements Listener {
event.setCancelled(true); event.setCancelled(true);
} }
} else if (!plot.hasOwner()) { } else if (!plot.hasOwner()) {
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) { if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, BlockIgnitionFlag.class, true) && !Permissions.hasPermission(
pp,
Permission.PERMISSION_ADMIN_BUILD_UNOWNED
)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED)) Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_BUILD_UNOWNED))

View File

@ -26,6 +26,7 @@ import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.flag.implementations.CopperOxideFlag; import com.plotsquared.core.plot.flag.implementations.CopperOxideFlag;
import com.plotsquared.core.plot.flag.implementations.MiscInteractFlag; import com.plotsquared.core.plot.flag.implementations.MiscInteractFlag;
import com.plotsquared.core.util.PlotFlagUtil;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
@ -91,7 +92,8 @@ public class BlockEventListener117 implements Listener {
} }
Plot plot = location.getOwnedPlot(); Plot plot = location.getOwnedPlot();
if (plot == null || !plot.getFlag(MiscInteractFlag.class)) { if (plot == null && !PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, MiscInteractFlag.class, true) || plot != null && !plot.getFlag(
MiscInteractFlag.class)) {
if (plotPlayer != null) { if (plotPlayer != null) {
if (plot != null) { if (plot != null) {
if (!plot.isAdded(plotPlayer.getUUID())) { if (!plot.isAdded(plotPlayer.getUUID())) {
@ -104,6 +106,12 @@ public class BlockEventListener117 implements Listener {
if (entity instanceof Item item) { if (entity instanceof Item item) {
UUID itemThrower = item.getThrower(); UUID itemThrower = item.getThrower();
if (plot != null) { if (plot != null) {
if (itemThrower == null && (itemThrower = item.getOwner()) == null) {
plot.debug(
"A thrown item couldn't trigger sculk sensors because misc-interact = false and the item's owner could not be resolved.");
event.setCancelled(true);
return;
}
if (!plot.isAdded(itemThrower)) { if (!plot.isAdded(itemThrower)) {
if (!plot.isAdded(itemThrower)) { if (!plot.isAdded(itemThrower)) {
plot.debug("A thrown item couldn't trigger sculk sensors because misc-interact = false"); plot.debug("A thrown item couldn't trigger sculk sensors because misc-interact = false");

View File

@ -38,6 +38,7 @@ import com.plotsquared.core.plot.flag.implementations.InvincibleFlag;
import com.plotsquared.core.plot.world.PlotAreaManager; import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.util.EventDispatcher; import com.plotsquared.core.util.EventDispatcher;
import com.plotsquared.core.util.Permissions; import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.PlotFlagUtil;
import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockType;
import org.bukkit.Material; import org.bukkit.Material;
@ -261,7 +262,7 @@ public class EntityEventListener implements Listener {
} }
Plot plot = location.getOwnedPlot(); Plot plot = location.getOwnedPlot();
if (plot == null) { if (plot == null) {
if (area.isRoadFlags() && area.getRoadFlag(InvincibleFlag.class)) { if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, InvincibleFlag.class, true)) {
event.setCancelled(true); event.setCancelled(true);
} }
return; return;

View File

@ -44,6 +44,7 @@ import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag;
import com.plotsquared.core.plot.flag.types.BooleanFlag; import com.plotsquared.core.plot.flag.types.BooleanFlag;
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.PlotFlagUtil;
import net.kyori.adventure.text.minimessage.Template; import net.kyori.adventure.text.minimessage.Template;
import org.bukkit.Chunk; import org.bukkit.Chunk;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -326,14 +327,18 @@ public class PaperListener implements Listener {
return; return;
} }
Location location = BukkitUtil.adapt(entity.getLocation()); Location location = BukkitUtil.adapt(entity.getLocation());
if (!this.plotAreaManager.hasPlotArea(location.getWorldName())) { PlotArea area = location.getPlotArea();
if (area == null) {
return; return;
} }
PlotPlayer<Player> pp = BukkitUtil.adapt((Player) shooter); PlotPlayer<Player> pp = BukkitUtil.adapt((Player) shooter);
Plot plot = location.getOwnedPlot(); Plot plot = location.getOwnedPlot();
if (plot == null) { if (plot == null) {
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) { if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true) && !Permissions.hasPermission(
pp,
Permission.PERMISSION_ADMIN_PROJECTILE_ROAD
)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD))

View File

@ -48,6 +48,10 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.BlockPlaceEvent;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
/**
* @deprecated P2 effectively no longer supports 1.13
*/
@Deprecated(forRemoval = true, since = "6.10.4")
public class PaperListener113 extends PaperListener { public class PaperListener113 extends PaperListener {
@Inject @Inject

View File

@ -68,6 +68,7 @@ import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.util.EventDispatcher; 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.PlotFlagUtil;
import com.plotsquared.core.util.PremiumVerification; import com.plotsquared.core.util.PremiumVerification;
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;
@ -889,8 +890,7 @@ public class PlayerEventListener implements Listener {
} }
} else { } else {
PlotArea area = pp.getPlotAreaAbs(); PlotArea area = pp.getPlotAreaAbs();
if (area != null && area.isRoadFlags() && area if (area != null && PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, PreventCreativeCopyFlag.class, true)) {
.getRoadFlag(PreventCreativeCopyFlag.class)) {
final ItemStack newStack = final ItemStack newStack =
new ItemStack(newItem.getType(), newItem.getAmount()); new ItemStack(newItem.getType(), newItem.getAmount());
event.setCursor(newStack); event.setCursor(newStack);
@ -998,8 +998,10 @@ public class PlayerEventListener implements Listener {
Plot plot = location.getPlotAbs(); Plot plot = location.getPlotAbs();
BukkitPlayer pp = BukkitUtil.adapt(e.getPlayer()); BukkitPlayer pp = BukkitUtil.adapt(e.getPlayer());
if (plot == null) { if (plot == null) {
if (!area.isRoadFlags() && !area.getRoadFlag(MiscInteractFlag.class) && !Permissions if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, MiscInteractFlag.class, true) && !Permissions.hasPermission(
.hasPermission(pp, Permission.PERMISSION_ADMIN_INTERACT_ROAD)) { pp,
Permission.PERMISSION_ADMIN_INTERACT_ROAD
)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD)) Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_INTERACT_ROAD))
@ -1009,9 +1011,7 @@ public class PlayerEventListener implements Listener {
} else { } else {
if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) { if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) { if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_BUILD_OTHER)) {
pp.sendMessage( pp.sendMessage(TranslatableCaption.of("done.building_restricted"));
TranslatableCaption.of("done.building_restricted")
);
e.setCancelled(true); e.setCancelled(true);
return; return;
} }
@ -1594,7 +1594,10 @@ public class PlayerEventListener implements Listener {
BukkitPlayer pp = BukkitUtil.adapt(p); BukkitPlayer pp = BukkitUtil.adapt(p);
Plot plot = area.getPlot(location); Plot plot = area.getPlot(location);
if (plot == null) { if (plot == null) {
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD)) { if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, VehicleBreakFlag.class, true) && !Permissions.hasPermission(
pp,
Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD
)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD)) Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_DESTROY_VEHICLE_ROAD))
@ -1642,7 +1645,7 @@ public class PlayerEventListener implements Listener {
} }
Plot plot = location.getOwnedPlot(); Plot plot = location.getOwnedPlot();
if (plot == null) { if (plot == null) {
if (area.isRoadFlags() && !area.getRoadFlag(ItemDropFlag.class)) { if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ItemDropFlag.class, false)) {
event.setCancelled(true); event.setCancelled(true);
} }
return; return;
@ -1668,7 +1671,7 @@ public class PlayerEventListener implements Listener {
} }
Plot plot = location.getOwnedPlot(); Plot plot = location.getOwnedPlot();
if (plot == null) { if (plot == null) {
if (area.isRoadFlags() && area.getRoadFlag(DropProtectionFlag.class)) { if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, DropProtectionFlag.class, true)) {
event.setCancelled(true); event.setCancelled(true);
} }
return; return;
@ -1690,17 +1693,15 @@ public class PlayerEventListener implements Listener {
} }
Plot plot = location.getOwnedPlot(); Plot plot = location.getOwnedPlot();
if (plot == null) { if (plot == null) {
if (area.isRoadFlags() && area.getRoadFlag(KeepInventoryFlag.class)) { if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, KeepInventoryFlag.class, true)) {
event.setCancelled(true); event.setCancelled(true);
} }
return; return;
} }
if (plot.getFlag(KeepInventoryFlag.class)) { if (plot.getFlag(KeepInventoryFlag.class)) {
if (plot.getFlag(KeepInventoryFlag.class)) { plot.debug(event.getEntity().getName() + " kept their inventory because of keep-inventory = true");
plot.debug(event.getEntity().getName() + " kept their inventory because of keep-inventory = true"); event.getDrops().clear();
event.getDrops().clear(); event.setKeepInventory(true);
event.setKeepInventory(true);
}
} }
} }
@ -1725,16 +1726,14 @@ public class PlayerEventListener implements Listener {
} }
Plot plot = location.getOwnedPlot(); Plot plot = location.getOwnedPlot();
if (plot == null) { if (plot == null) {
if (area.isRoadFlags() && area.getRoadFlag(DenyPortalTravelFlag.class)) { if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, DenyPortalTravelFlag.class, true)) {
event.setCancelled(true); event.setCancelled(true);
} }
return; return;
} }
if (plot.getFlag(DenyPortalTravelFlag.class)) { if (plot.getFlag(DenyPortalTravelFlag.class)) {
if (plot.getFlag(DenyPortalTravelFlag.class)) { plot.debug(event.getPlayer().getName() + " did not travel thru a portal because of deny-portal-travel = true");
plot.debug(event.getPlayer().getName() + " did not travel thru a portal because of deny-portal-travel = true"); event.setCancelled(true);
event.setCancelled(true);
}
} }
} }
@ -1772,7 +1771,7 @@ public class PlayerEventListener implements Listener {
} }
Plot plot = location.getOwnedPlot(); Plot plot = location.getOwnedPlot();
if (plot == null) { if (plot == null) {
if (area.isRoadFlags() && area.getRoadFlag(DenyPortalsFlag.class)) { if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, DenyPortalsFlag.class, true)) {
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
@ -1801,16 +1800,14 @@ public class PlayerEventListener implements Listener {
} }
Plot plot = location.getOwnedPlot(); Plot plot = location.getOwnedPlot();
if (plot == null) { if (plot == null) {
if (area.isRoadFlags() && area.getRoadFlag(LecternReadBookFlag.class)) { if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, LecternReadBookFlag.class, true)) {
event.setCancelled(true); event.setCancelled(true);
} }
return; return;
} }
if (plot.getFlag(LecternReadBookFlag.class)) { if (plot.getFlag(LecternReadBookFlag.class)) {
if (plot.getFlag(LecternReadBookFlag.class)) { plot.debug(event.getPlayer().getName() + " could not take the book because of lectern-read-book = true");
plot.debug(event.getPlayer().getName() + " could not take the book because of lectern-read-book = true"); event.setCancelled(true);
event.setCancelled(true);
}
} }
} }

View File

@ -31,6 +31,7 @@ import com.plotsquared.core.plot.PlotHandler;
import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag; import com.plotsquared.core.plot.flag.implementations.ProjectilesFlag;
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.PlotFlagUtil;
import net.kyori.adventure.text.minimessage.Template; import net.kyori.adventure.text.minimessage.Template;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
@ -97,14 +98,18 @@ public class ProjectileEventListener implements Listener {
return; return;
} }
Location location = BukkitUtil.adapt(entity.getLocation()); Location location = BukkitUtil.adapt(entity.getLocation());
if (!this.plotAreaManager.hasPlotArea(location.getWorldName())) { PlotArea area = location.getPlotArea();
if (area == null) {
return; return;
} }
PlotPlayer<Player> pp = BukkitUtil.adapt((Player) shooter); PlotPlayer<Player> pp = BukkitUtil.adapt((Player) shooter);
Plot plot = location.getOwnedPlot(); Plot plot = location.getOwnedPlot();
if (plot == null) { if (plot == null) {
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) { if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true) && !Permissions.hasPermission(
pp,
Permission.PERMISSION_ADMIN_PROJECTILE_ROAD
)) {
pp.sendMessage( pp.sendMessage(
TranslatableCaption.of("permission.no_permission_event"), TranslatableCaption.of("permission.no_permission_event"),
Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD)) Template.of("node", String.valueOf(Permission.PERMISSION_ADMIN_PROJECTILE_ROAD))
@ -154,6 +159,8 @@ public class ProjectileEventListener implements Listener {
if (plot.isAdded(((Player) shooter).getUniqueId()) || plot.getFlag(ProjectilesFlag.class)) { if (plot.isAdded(((Player) shooter).getUniqueId()) || plot.getFlag(ProjectilesFlag.class)) {
return; return;
} }
} else if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true)) {
return;
} }
entity.remove(); entity.remove();
@ -163,7 +170,10 @@ public class ProjectileEventListener implements Listener {
PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter); PlotPlayer<?> pp = BukkitUtil.adapt((Player) shooter);
if (plot == null) { if (plot == null) {
if (!Permissions.hasPermission(pp, Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED)) { if (!PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, ProjectilesFlag.class, true) && !Permissions.hasPermission(
pp,
Permission.PERMISSION_ADMIN_PROJECTILE_UNOWNED
)) {
entity.remove(); entity.remove();
event.setCancelled(true); event.setCancelled(true);
} }
@ -194,7 +204,6 @@ public class ProjectileEventListener implements Listener {
if (sPlot == null || !PlotHandler.sameOwners(plot, sPlot)) { if (sPlot == null || !PlotHandler.sameOwners(plot, sPlot)) {
entity.remove(); entity.remove();
event.setCancelled(true); event.setCancelled(true);
return;
} }
} }
} }

View File

@ -183,7 +183,11 @@ public class GenChunk extends ScopedQueueCoordinator {
@Override @Override
public boolean setBlock(int x, int y, int z, @NonNull Pattern pattern) { public boolean setBlock(int x, int y, int z, @NonNull Pattern pattern) {
return setBlock(x, y, z, PatternUtil.apply(Preconditions.checkNotNull(pattern, "Pattern may not be null"), x, y, z)); final BaseBlock block = PatternUtil.apply(Preconditions.checkNotNull(
pattern,
"Pattern may not be null"
), x + (chunkX << 4), y, z + (chunkZ << 4));
return setBlock(x, y, z, block);
} }
@Override @Override

View File

@ -44,6 +44,7 @@ public class LimitedRegionWrapperQueue extends DelegateQueueCoordinator {
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + LimitedRegionWrapperQueue.class.getSimpleName()); private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + LimitedRegionWrapperQueue.class.getSimpleName());
private final LimitedRegion limitedRegion; private final LimitedRegion limitedRegion;
private boolean useOtherRestoreTagMethod = false;
/** /**
* @since 6.9.0 * @since 6.9.0
@ -65,10 +66,18 @@ public class LimitedRegionWrapperQueue extends DelegateQueueCoordinator {
CompoundTag tag = id.getNbtData(); CompoundTag tag = id.getNbtData();
StateWrapper sw = new StateWrapper(tag); StateWrapper sw = new StateWrapper(tag);
try { try {
sw.restoreTag(limitedRegion.getBlockState(x, y, z).getBlock()); if (useOtherRestoreTagMethod && getWorld() != null) {
sw.restoreTag(getWorld().getName(), x, y, z);
} else {
sw.restoreTag(limitedRegion.getBlockState(x, y, z).getBlock());
}
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
LOGGER.error("Error attempting to populate tile entity into the world at location {},{},{}", x, y, z, e); LOGGER.error("Error attempting to populate tile entity into the world at location {},{},{}", x, y, z, e);
return false; return false;
} catch (IllegalStateException e) {
useOtherRestoreTagMethod = true;
LOGGER.warn("IllegalStateException attempting to populate tile entity into the world at location {},{},{}. " +
"Possibly on <=1.17.1, switching to secondary method.", x, y, z, e);
} }
} }
return result; return result;

View File

@ -36,8 +36,7 @@ import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeType;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.NotNull; import org.checkerframework.checker.nullness.qual.Nullable;
import org.jetbrains.annotations.Nullable;
import java.util.Set; import java.util.Set;
@ -46,10 +45,7 @@ public class FaweRegionManager extends BukkitRegionManager {
private final FaweDelegateRegionManager delegate = new FaweDelegateRegionManager(); private final FaweDelegateRegionManager delegate = new FaweDelegateRegionManager();
@Inject @Inject
public FaweRegionManager( public FaweRegionManager(WorldUtil worldUtil, GlobalBlockQueue blockQueue, ProgressSubscriberFactory subscriberFactory) {
@NonNull WorldUtil worldUtil, @NonNull GlobalBlockQueue blockQueue, @NonNull
ProgressSubscriberFactory subscriberFactory
) {
super(worldUtil, blockQueue, subscriberFactory); super(worldUtil, blockQueue, subscriberFactory);
} }
@ -76,9 +72,9 @@ public class FaweRegionManager extends BukkitRegionManager {
@Override @Override
public boolean handleClear( public boolean handleClear(
@NotNull Plot plot, @NonNull Plot plot,
@Nullable Runnable whenDone, @Nullable Runnable whenDone,
@NotNull PlotManager manager, @NonNull PlotManager manager,
final @Nullable PlotPlayer<?> player final @Nullable PlotPlayer<?> player
) { ) {
if (!Settings.FAWE_Components.CLEAR || !(manager instanceof HybridPlotManager)) { if (!Settings.FAWE_Components.CLEAR || !(manager instanceof HybridPlotManager)) {

View File

@ -29,7 +29,7 @@ import com.plotsquared.core.util.SchematicHandler;
import com.plotsquared.core.util.WorldUtil; import com.plotsquared.core.util.WorldUtil;
import com.plotsquared.core.util.task.RunnableVal; import com.plotsquared.core.util.task.RunnableVal;
import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.CompoundTag;
import org.jetbrains.annotations.NotNull; import org.checkerframework.checker.nullness.qual.NonNull;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;
@ -40,7 +40,7 @@ public class FaweSchematicHandler extends SchematicHandler {
private final FaweDelegateSchematicHandler delegate = new FaweDelegateSchematicHandler(); private final FaweDelegateSchematicHandler delegate = new FaweDelegateSchematicHandler();
@Inject @Inject
public FaweSchematicHandler(@NotNull WorldUtil worldUtil, @NotNull ProgressSubscriberFactory subscriberFactory) { public FaweSchematicHandler(WorldUtil worldUtil, ProgressSubscriberFactory subscriberFactory) {
super(worldUtil, subscriberFactory); super(worldUtil, subscriberFactory);
} }
@ -75,7 +75,7 @@ public class FaweSchematicHandler extends SchematicHandler {
} }
@Override @Override
public Schematic getSchematic(@NotNull InputStream is) { public Schematic getSchematic(@NonNull InputStream is) {
return delegate.getSchematic(is); return delegate.getSchematic(is);
} }

View File

@ -32,6 +32,7 @@ import com.plotsquared.core.inject.annotations.DefaultGenerator;
import com.plotsquared.core.location.World; import com.plotsquared.core.location.World;
import com.plotsquared.core.permissions.PermissionHandler; import com.plotsquared.core.permissions.PermissionHandler;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.expiration.ExpireManager;
import com.plotsquared.core.plot.world.PlotAreaManager; import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.queue.GlobalBlockQueue; import com.plotsquared.core.queue.GlobalBlockQueue;
import com.plotsquared.core.util.ChunkManager; import com.plotsquared.core.util.ChunkManager;
@ -284,6 +285,16 @@ public interface PlotPlatform<P> extends LocaleHolder {
return injector().getInstance(ChunkManager.class); return injector().getInstance(ChunkManager.class);
} }
/**
* Get the {@link ExpireManager} implementation for the platform
*
* @return Expire manager
* @since 6.10.2
*/
default @NonNull ExpireManager expireManager() {
return injector().getInstance(ExpireManager.class);
}
/** /**
* Get the {@link PlotAreaManager} implementation. * Get the {@link PlotAreaManager} implementation.
* *

View File

@ -290,11 +290,11 @@ public class PlotSquared {
public void startExpiryTasks() { public void startExpiryTasks() {
if (Settings.Enabled_Components.PLOT_EXPIRY) { if (Settings.Enabled_Components.PLOT_EXPIRY) {
ExpireManager.IMP = new ExpireManager(this.eventDispatcher); ExpireManager expireManager = PlotSquared.platform().expireManager();
ExpireManager.IMP.runAutomatedTask(); expireManager.runAutomatedTask();
for (Settings.Auto_Clear settings : Settings.AUTO_CLEAR.getInstances()) { for (Settings.Auto_Clear settings : Settings.AUTO_CLEAR.getInstances()) {
ExpiryTask task = new ExpiryTask(settings, this.getPlotAreaManager()); ExpiryTask task = new ExpiryTask(settings, this.getPlotAreaManager());
ExpireManager.IMP.addTask(task); expireManager.addTask(task);
} }
} }
} }
@ -645,7 +645,8 @@ public class PlotSquared {
} else { } else {
list = new ArrayList<>(input); list = new ArrayList<>(input);
} }
list.sort(Comparator.comparingLong(a -> ExpireManager.IMP.getTimestamp(a.getOwnerAbs()))); ExpireManager expireManager = PlotSquared.platform().expireManager();
list.sort(Comparator.comparingLong(a -> expireManager.getTimestamp(a.getOwnerAbs())));
return list; return list;
} }

View File

@ -19,6 +19,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.caption.StaticCaption; import com.plotsquared.core.configuration.caption.StaticCaption;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.events.PlotFlagRemoveEvent; import com.plotsquared.core.events.PlotFlagRemoveEvent;
@ -139,10 +140,7 @@ public class DebugExec extends SubCommand {
return true; return true;
} }
case "start-expire" -> { case "start-expire" -> {
if (ExpireManager.IMP == null) { if (PlotSquared.platform().expireManager().runAutomatedTask()) {
ExpireManager.IMP = new ExpireManager(this.eventDispatcher);
}
if (ExpireManager.IMP.runAutomatedTask()) {
player.sendMessage(TranslatableCaption.of("debugexec.expiry_started")); player.sendMessage(TranslatableCaption.of("debugexec.expiry_started"));
} else { } else {
player.sendMessage(TranslatableCaption.of("debugexec.expiry_already_started")); player.sendMessage(TranslatableCaption.of("debugexec.expiry_already_started"));
@ -150,7 +148,7 @@ public class DebugExec extends SubCommand {
return true; return true;
} }
case "stop-expire" -> { case "stop-expire" -> {
if (ExpireManager.IMP == null || !ExpireManager.IMP.cancelTask()) { if (!PlotSquared.platform().expireManager().cancelTask()) {
player.sendMessage(TranslatableCaption.of("debugexec.task_halted")); player.sendMessage(TranslatableCaption.of("debugexec.task_halted"));
} else { } else {
player.sendMessage(TranslatableCaption.of("debugexec.task_cancelled")); player.sendMessage(TranslatableCaption.of("debugexec.task_cancelled"));

View File

@ -19,6 +19,7 @@
package com.plotsquared.core.command; package com.plotsquared.core.command;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.events.PlotDoneEvent; import com.plotsquared.core.events.PlotDoneEvent;
@ -29,7 +30,6 @@ import com.plotsquared.core.location.Location;
import com.plotsquared.core.permissions.Permission; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.expiration.ExpireManager;
import com.plotsquared.core.plot.expiration.PlotAnalysis; import com.plotsquared.core.plot.expiration.PlotAnalysis;
import com.plotsquared.core.plot.flag.PlotFlag; import com.plotsquared.core.plot.flag.PlotFlag;
import com.plotsquared.core.plot.flag.implementations.DoneFlag; import com.plotsquared.core.plot.flag.implementations.DoneFlag;
@ -94,7 +94,7 @@ public class Done extends SubCommand {
Template.of("plot", plot.getId().toString()) Template.of("plot", plot.getId().toString())
); );
final Settings.Auto_Clear doneRequirements = Settings.AUTO_CLEAR.get("done"); final Settings.Auto_Clear doneRequirements = Settings.AUTO_CLEAR.get("done");
if (ExpireManager.IMP == null || doneRequirements == null) { if (PlotSquared.platform().expireManager() == null || doneRequirements == null) {
finish(plot, player, true); finish(plot, player, true);
plot.removeRunning(); plot.removeRunning();
} else { } else {

View File

@ -30,7 +30,6 @@ import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.expiration.ExpireManager;
import com.plotsquared.core.plot.flag.implementations.DoneFlag; import com.plotsquared.core.plot.flag.implementations.DoneFlag;
import com.plotsquared.core.plot.flag.implementations.PriceFlag; import com.plotsquared.core.plot.flag.implementations.PriceFlag;
import com.plotsquared.core.plot.flag.implementations.ServerPlotFlag; import com.plotsquared.core.plot.flag.implementations.ServerPlotFlag;
@ -240,7 +239,7 @@ public class ListCmd extends SubCommand {
); );
return false; return false;
} }
if (ExpireManager.IMP == null) { if (PlotSquared.platform().expireManager() == null) {
plotConsumer.accept(PlotQuery.newQuery().noPlots()); plotConsumer.accept(PlotQuery.newQuery().noPlots());
} else { } else {
plotConsumer.accept(PlotQuery.newQuery().expiredPlots()); plotConsumer.accept(PlotQuery.newQuery().expiredPlots());

View File

@ -282,7 +282,28 @@ public class Merge extends SubCommand {
run.run(); run.run();
} }
} }
if (!force && !isOnline) { if (force || !isOnline) {
if (force || Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_MERGE_OTHER_OFFLINE)) {
if (plot.getPlotModificationManager().autoMerge(direction, maxSize - size, uuids.iterator().next(), player, terrain)) {
if (this.econHandler.isEnabled(plotArea) && price > 0d) {
if (!force && this.econHandler.getMoney(player) < price) {
player.sendMessage(
TranslatableCaption.of("economy.cannot_afford_merge"),
Template.of("money", this.econHandler.format(price))
);
return false;
}
this.econHandler.withdrawMoney(player, price);
player.sendMessage(
TranslatableCaption.of("economy.removed_balance"),
Template.of("money", this.econHandler.format(price))
);
}
player.sendMessage(TranslatableCaption.of("merge.success_merge"));
eventDispatcher.callPostMerge(player, plot);
return true;
}
}
player.sendMessage(TranslatableCaption.of("merge.no_available_automerge")); player.sendMessage(TranslatableCaption.of("merge.no_available_automerge"));
return false; return false;
} }

View File

@ -25,7 +25,6 @@ import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.location.Location; import com.plotsquared.core.location.Location;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.expiration.ExpireManager;
import com.plotsquared.core.plot.world.PlotAreaManager; import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.queue.GlobalBlockQueue; import com.plotsquared.core.queue.GlobalBlockQueue;
import com.plotsquared.core.queue.QueueCoordinator; import com.plotsquared.core.queue.QueueCoordinator;
@ -92,8 +91,8 @@ public class Trim extends SubCommand {
} }
TranslatableCaption.of("trim.trim_starting"); TranslatableCaption.of("trim.trim_starting");
final List<Plot> plots = PlotQuery.newQuery().inWorld(world).asList(); final List<Plot> plots = PlotQuery.newQuery().inWorld(world).asList();
if (ExpireManager.IMP != null) { if (PlotSquared.platform().expireManager() != null) {
plots.removeAll(ExpireManager.IMP.getPendingExpired()); plots.removeAll(PlotSquared.platform().expireManager().getPendingExpired());
} }
result.value1 = new HashSet<>(PlotSquared.platform().worldUtil().getChunkChunks(world)); result.value1 = new HashSet<>(PlotSquared.platform().worldUtil().getChunkChunks(world));
result.value2 = new HashSet<>(); result.value2 = new HashSet<>();

View File

@ -759,6 +759,8 @@ public class Settings extends Config {
@Comment("Also kill any road mobs that are being ridden, or are leashed") @Comment("Also kill any road mobs that are being ridden, or are leashed")
public static boolean public static boolean
KILL_OWNED_ROAD_MOBS = false; KILL_OWNED_ROAD_MOBS = false;
@Comment("Also kill any road mobs that are named")
public static boolean KILL_NAMED_ROAD_MOBS = false;
@Comment("Kill items on roads (Stick, Paper, etc.)") @Comment("Kill items on roads (Stick, Paper, etc.)")
public static boolean KILL_ROAD_ITEMS = false; public static boolean KILL_ROAD_ITEMS = false;
@Comment("Kill vehicles on roads (Boat, Minecart, etc.)") @Comment("Kill vehicles on roads (Boat, Minecart, etc.)")

View File

@ -21,16 +21,15 @@ package com.plotsquared.core.configuration.caption;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.ClickEvent;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.NotNull;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.Set; import java.util.Set;
final class ClickStripTransform implements ComponentTransform { final class ClickStripTransform implements ComponentTransform {
private final Set<ClickEvent.@NotNull Action> actionsToStrip; private final Set<ClickEvent.@NonNull Action> actionsToStrip;
public ClickStripTransform(final Set<ClickEvent.@NotNull Action> actionsToStrip) { public ClickStripTransform(final Set<ClickEvent.@NonNull Action> actionsToStrip) {
this.actionsToStrip = EnumSet.copyOf(actionsToStrip); this.actionsToStrip = EnumSet.copyOf(actionsToStrip);
} }

View File

@ -53,7 +53,10 @@ final class ClassLoaderCaptionProvider implements DefaultCaptionProvider {
try { try {
final InputStream stream = this.classLoader.getResourceAsStream(url); final InputStream stream = this.classLoader.getResourceAsStream(url);
if (stream == null) { if (stream == null) {
LOGGER.warn("No resource for locale '{}' found", locale); LOGGER.info("No resource for locale '{}' found in the plugin file." +
"Please ensure you have placed the latest version of the file messages_{}.json in the 'lang' folder." +
"You may be able to find completed translations at https://intellectualsites.crowdin.com/plotsquared",
locale, locale);
return null; return null;
} }
try (final BufferedReader reader = new BufferedReader(new InputStreamReader(stream))) { try (final BufferedReader reader = new BufferedReader(new InputStreamReader(stream))) {

View File

@ -174,8 +174,9 @@ public class HybridPlotManager extends ClassicPlotManager {
for (int y = 0; y < blocks.length; y++) { for (int y = 0; y < blocks.length; y++) {
if (blocks[y] != null) { if (blocks[y] != null) {
queue.setBlock(x, minY + y, z, blocks[y]); queue.setBlock(x, minY + y, z, blocks[y]);
} else { } else if (!isRoad) {
// This is necessary, otherwise any blocks not specified in the schematic will remain after a clear // This is necessary, otherwise any blocks not specified in the schematic will remain after a clear
// Do not set air for road as this may cause cavernous roads when debugroadregen is used
queue.setBlock(x, minY + y, z, airBlock); queue.setBlock(x, minY + y, z, airBlock);
} }
} }

View File

@ -21,7 +21,6 @@ package com.plotsquared.core.generator;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted; import com.google.inject.assistedinject.Assisted;
import com.intellectualsites.annotations.DoNotUse; import com.intellectualsites.annotations.DoNotUse;
import com.intellectualsites.annotations.NotPublic;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.ConfigurationSection; import com.plotsquared.core.configuration.ConfigurationSection;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
@ -75,6 +74,9 @@ public class HybridPlotWorld extends ClassicPlotWorld {
public short PATH_WIDTH_UPPER; public short PATH_WIDTH_UPPER;
public HashMap<Integer, BaseBlock[]> G_SCH; public HashMap<Integer, BaseBlock[]> G_SCH;
public HashMap<Integer, BiomeType> G_SCH_B; public HashMap<Integer, BiomeType> G_SCH_B;
/**
* The Y level at which schematic generation will start, lowest of either road or plot schematic generation.
*/
public int SCHEM_Y; public int SCHEM_Y;
private Location SIGN_LOCATION; private Location SIGN_LOCATION;
private File root = null; private File root = null;
@ -91,10 +93,10 @@ public class HybridPlotWorld extends ClassicPlotWorld {
@Inject @Inject
public HybridPlotWorld( public HybridPlotWorld(
@Assisted("world") final String worldName, @Assisted("world") final String worldName,
@Nullable @Assisted("id") final String id, @javax.annotation.Nullable @Assisted("id") final String id,
@Assisted final @NonNull IndependentPlotGenerator generator, @Assisted final @NonNull IndependentPlotGenerator generator,
@Nullable @Assisted("min") final PlotId min, @javax.annotation.Nullable @Assisted("min") final PlotId min,
@Nullable @Assisted("max") final PlotId max, @javax.annotation.Nullable @Assisted("max") final PlotId max,
@WorldConfig final @NonNull YamlConfiguration worldConfiguration, @WorldConfig final @NonNull YamlConfiguration worldConfiguration,
final @NonNull GlobalBlockQueue blockQueue final @NonNull GlobalBlockQueue blockQueue
) { ) {
@ -267,34 +269,67 @@ public class HybridPlotWorld extends ClassicPlotWorld {
int oddshift = (this.ROAD_WIDTH & 1); int oddshift = (this.ROAD_WIDTH & 1);
SCHEM_Y = schematicStartHeight(); SCHEM_Y = schematicStartHeight();
// plotY and roadY are important to allow plot and/or road schematic "overflow" into each other without causing AIOOB
// exceptions when attempting either to set blocks to, or get block from G_SCH
// Default plot schematic start height, normalized to the minimum height schematics are pasted from.
int plotY = PLOT_HEIGHT - SCHEM_Y; int plotY = PLOT_HEIGHT - SCHEM_Y;
int minRoadWall = Settings.Schematics.USE_WALL_IN_ROAD_SCHEM_HEIGHT ? Math.min(ROAD_HEIGHT, WALL_HEIGHT) : ROAD_HEIGHT; int minRoadWall = Settings.Schematics.USE_WALL_IN_ROAD_SCHEM_HEIGHT ? Math.min(ROAD_HEIGHT, WALL_HEIGHT) : ROAD_HEIGHT;
// Default road schematic start height, normalized to the minimum height schematics are pasted from.
int roadY = minRoadWall - SCHEM_Y; int roadY = minRoadWall - SCHEM_Y;
int worldHeight = getMaxGenHeight() - getMinGenHeight() + 1; int worldGenHeight = getMaxGenHeight() - getMinGenHeight() + 1;
int maxSchematicHeight = 0;
int plotSchemHeight = 0;
// SCHEM_Y should be normalised to the plot "start" height // SCHEM_Y should be normalised to the plot "start" height
if (schematic3 != null) { if (schematic3 != null) {
if (schematic3.getClipboard().getDimensions().getY() == worldHeight) { plotSchemHeight = maxSchematicHeight = schematic3.getClipboard().getDimensions().getY();
SCHEM_Y = plotY = 0; if (maxSchematicHeight == worldGenHeight) {
SCHEM_Y = getMinGenHeight();
plotY = 0;
} else if (!Settings.Schematics.PASTE_ON_TOP) { } else if (!Settings.Schematics.PASTE_ON_TOP) {
SCHEM_Y = plotY = getMinBuildHeight() - getMinGenHeight(); SCHEM_Y = getMinBuildHeight();
plotY = 0;
} }
} }
int roadSchemHeight;
if (schematic1 != null) { if (schematic1 != null) {
if (schematic1.getClipboard().getDimensions().getY() == worldHeight) { roadSchemHeight = Math.max(
SCHEM_Y = roadY = getMinGenHeight(); schematic1.getClipboard().getDimensions().getY(),
if (schematic3 != null && schematic3.getClipboard().getDimensions().getY() != worldHeight schematic2.getClipboard().getDimensions().getY()
&& !Settings.Schematics.PASTE_ON_TOP) { );
plotY = PLOT_HEIGHT; maxSchematicHeight = Math.max(roadSchemHeight, maxSchematicHeight);
if (maxSchematicHeight == worldGenHeight) {
SCHEM_Y = getMinGenHeight();
roadY = 0; // Road is the lowest schematic
if (schematic3 != null && schematic3.getClipboard().getDimensions().getY() != worldGenHeight) {
// Road is the lowest schematic. Normalize plotY to it.
if (Settings.Schematics.PASTE_ON_TOP) {
plotY = PLOT_HEIGHT - getMinGenHeight();
} else {
plotY = getMinBuildHeight() - getMinGenHeight();
}
} }
} else if (!Settings.Schematics.PASTE_ROAD_ON_TOP) { } else if (!Settings.Schematics.PASTE_ROAD_ON_TOP) {
SCHEM_Y = roadY = getMinBuildHeight(); if (SCHEM_Y == getMinGenHeight()) { // Only possible if plot schematic is enabled
if (schematic3 != null && schematic3.getClipboard().getDimensions().getY() != worldHeight // Plot is still the lowest schematic, normalize roadY to it
&& !Settings.Schematics.PASTE_ON_TOP) { roadY = getMinBuildHeight() - getMinGenHeight();
plotY = PLOT_HEIGHT; } else if (schematic3 != null) {
SCHEM_Y = getMinBuildHeight();
roadY = 0;// Road is the lowest schematic
if (Settings.Schematics.PASTE_ON_TOP) {
// Road is the lowest schematic. Normalize plotY to it.
plotY = PLOT_HEIGHT - getMinBuildHeight();
}
maxSchematicHeight = Math.max(maxSchematicHeight, plotY + plotSchemHeight);
} }
} else {
roadY = minRoadWall - SCHEM_Y;
maxSchematicHeight = Math.max(maxSchematicHeight, roadY + roadSchemHeight);
} }
} }
@ -331,17 +366,15 @@ public class HybridPlotWorld extends ClassicPlotWorld {
y + min.getBlockY(), y + min.getBlockY(),
z + min.getBlockZ() z + min.getBlockZ()
)); ));
if (!id.getBlockType().getMaterial().isAir()) { schem3PopulationNeeded |= id.hasNbtData();
schem3PopulationNeeded |= id.hasNbtData(); addOverlayBlock(
addOverlayBlock( (short) (x + shift + oddshift + centerShiftX),
(short) (x + shift + oddshift + centerShiftX), (short) (y + plotY),
(short) (y + plotY), (short) (z + shift + oddshift + centerShiftZ),
(short) (z + shift + oddshift + centerShiftZ), id,
id, false,
false, maxSchematicHeight
h3 );
);
}
} }
if (blockArrayClipboard3.hasBiomes()) { if (blockArrayClipboard3.hasBiomes()) {
BiomeType biome = blockArrayClipboard3.getBiome(BlockVector2.at( BiomeType biome = blockArrayClipboard3.getBiome(BlockVector2.at(
@ -391,18 +424,23 @@ public class HybridPlotWorld extends ClassicPlotWorld {
y + min.getBlockY(), y + min.getBlockY(),
z + min.getBlockZ() z + min.getBlockZ()
)); ));
if (!id.getBlockType().getMaterial().isAir()) { schem1PopulationNeeded |= id.hasNbtData();
schem1PopulationNeeded |= id.hasNbtData(); addOverlayBlock(
addOverlayBlock((short) (x - shift), (short) (y + roadY), (short) (z + shift + oddshift), id, false, h1); (short) (x - shift),
addOverlayBlock( (short) (y + roadY),
(short) (z + shift + oddshift), (short) (z + shift + oddshift),
(short) (y + roadY), id,
(short) (shift - x + (oddshift - 1)), false,
id, maxSchematicHeight
true, );
h1 addOverlayBlock(
); (short) (z + shift + oddshift),
} (short) (y + roadY),
(short) (shift - x + (oddshift - 1)),
id,
true,
maxSchematicHeight
);
} }
if (blockArrayClipboard1.hasBiomes()) { if (blockArrayClipboard1.hasBiomes()) {
BiomeType biome = blockArrayClipboard1.getBiome(BlockVector2.at(x + min.getBlockX(), z + min.getBlockZ())); BiomeType biome = blockArrayClipboard1.getBiome(BlockVector2.at(x + min.getBlockX(), z + min.getBlockZ()));
@ -430,10 +468,15 @@ public class HybridPlotWorld extends ClassicPlotWorld {
y + min.getBlockY(), y + min.getBlockY(),
z + min.getBlockZ() z + min.getBlockZ()
)); ));
if (!id.getBlockType().getMaterial().isAir()) { schem2PopulationNeeded |= id.hasNbtData();
schem2PopulationNeeded |= id.hasNbtData(); addOverlayBlock(
addOverlayBlock((short) (x - shift), (short) (y + roadY), (short) (z - shift), id, false, h2); (short) (x - shift),
} (short) (y + roadY),
(short) (z - shift),
id,
false,
maxSchematicHeight
);
} }
if (blockArrayClipboard2.hasBiomes()) { if (blockArrayClipboard2.hasBiomes()) {
BiomeType biome = blockArrayClipboard2.getBiome(BlockVector2.at(x + min.getBlockX(), z + min.getBlockZ())); BiomeType biome = blockArrayClipboard2.getBiome(BlockVector2.at(x + min.getBlockX(), z + min.getBlockZ()));
@ -443,6 +486,10 @@ public class HybridPlotWorld extends ClassicPlotWorld {
} }
} }
/**
* @deprecated This method should not be available for public API usage and will be made private.
*/
@Deprecated(forRemoval = true, since = "6.10.2")
public void addOverlayBlock(short x, short y, short z, BaseBlock id, boolean rotate, int height) { public void addOverlayBlock(short x, short y, short z, BaseBlock id, boolean rotate, int height) {
if (z < 0) { if (z < 0) {
z += this.SIZE; z += this.SIZE;
@ -462,13 +509,22 @@ public class HybridPlotWorld extends ClassicPlotWorld {
if (y >= height) { if (y >= height) {
if (y > lastOverlayHeightError) { if (y > lastOverlayHeightError) {
lastOverlayHeightError = y; lastOverlayHeightError = y;
LOGGER.error(String.format("Error adding overlay block. `y > height`. y=%s, height=%s", y, height)); LOGGER.error(
"Error adding overlay block in world {}. `y > height`. y={}, height={}",
getWorldName(),
y,
height
);
} }
return; return;
} }
existing[y] = id; existing[y] = id;
} }
/**
* @deprecated This method should not be available for public API usage and will be made private.
*/
@Deprecated(forRemoval = true, since = "6.10.2")
public void addOverlayBiome(short x, short z, BiomeType id) { public void addOverlayBiome(short x, short z, BiomeType id) {
if (z < 0) { if (z < 0) {
z += this.SIZE; z += this.SIZE;

View File

@ -234,44 +234,52 @@ public class HybridUtils {
Set<BlockType> types = new HashSet<>(); Set<BlockType> types = new HashSet<>();
for (int yIndex = 0; yIndex < height; yIndex++) { for (int yIndex = 0; yIndex < height; yIndex++) {
BlockState old = oldBlocks[yIndex][x][z]; // Nullable BlockState old = oldBlocks[yIndex][x][z]; // Nullable
try { BlockState now = newBlocks[yIndex][x][z]; // Not null
BlockState now = newBlocks[yIndex][x][z]; // Not null if (now == null) {
if (!now.equals(old) && !(old == null && now.getBlockType().equals(BlockTypes.AIR))) { throw new NullPointerException(String.format(
changes[i]++; "\"now\" block null attempting to perform plot analysis. Indexes: x=%d of %d, yIndex=%d" +
} " of %d, z=%d of %d",
if (now.getBlockType().getMaterial().isAir()) { x,
air[i]++; width,
} else { yIndex,
// check vertices height,
// modifications_adjacent z,
if (x > 0 && z > 0 && yIndex > 0 && x < width - 1 && z < length - 1 && yIndex < (height - 1)) { length
if (newBlocks[yIndex - 1][x][z].getBlockType().getMaterial().isAir()) { ));
faces[i]++; }
} if (!now.equals(old) && !(old == null && now.getBlockType().equals(BlockTypes.AIR))) {
if (newBlocks[yIndex][x - 1][z].getBlockType().getMaterial().isAir()) { changes[i]++;
faces[i]++; }
} if (now.getBlockType().getMaterial().isAir()) {
if (newBlocks[yIndex][x][z - 1].getBlockType().getMaterial().isAir()) { air[i]++;
faces[i]++; } else {
} // check vertices
if (newBlocks[yIndex + 1][x][z].getBlockType().getMaterial().isAir()) { // modifications_adjacent
faces[i]++; if (x > 0 && z > 0 && yIndex > 0 && x < width - 1 && z < length - 1 && yIndex < (height - 1)) {
} if (newBlocks[yIndex - 1][x][z].getBlockType().getMaterial().isAir()) {
if (newBlocks[yIndex][x + 1][z].getBlockType().getMaterial().isAir()) { faces[i]++;
faces[i]++;
}
if (newBlocks[yIndex][x][z + 1].getBlockType().getMaterial().isAir()) {
faces[i]++;
}
} }
if (newBlocks[yIndex][x - 1][z].getBlockType().getMaterial().isAir()) {
faces[i]++;
}
if (newBlocks[yIndex][x][z - 1].getBlockType().getMaterial().isAir()) {
faces[i]++;
}
if (newBlocks[yIndex + 1][x][z].getBlockType().getMaterial().isAir()) {
faces[i]++;
}
if (newBlocks[yIndex][x + 1][z].getBlockType().getMaterial().isAir()) {
faces[i]++;
}
if (newBlocks[yIndex][x][z + 1].getBlockType().getMaterial().isAir()) {
faces[i]++;
}
}
if (!now.equals(now.getBlockType().getDefaultState())) { if (!now.equals(now.getBlockType().getDefaultState())) {
data[i]++; data[i]++;
}
types.add(now.getBlockType());
} }
} catch (NullPointerException e) { types.add(now.getBlockType());
e.printStackTrace();
} }
} }
variety[i] = types.size(); variety[i] = types.size();

View File

@ -114,26 +114,14 @@ public abstract class SquarePlotManager extends GridPlotManager {
end = pathWidthLower + squarePlotWorld.PLOT_WIDTH; end = pathWidthLower + squarePlotWorld.PLOT_WIDTH;
} }
int size = squarePlotWorld.PLOT_WIDTH + squarePlotWorld.ROAD_WIDTH; int size = squarePlotWorld.PLOT_WIDTH + squarePlotWorld.ROAD_WIDTH;
int idx; int dx = Math.floorDiv(x, size) + 1;
if (x < 0) { int rx = Math.floorMod(x, size);
idx = x / size; int dz = Math.floorDiv(z, size) + 1;
x = size + (x % size); int rz = Math.floorMod(z, size);
} else { if (rz <= pathWidthLower || rz > end || rx <= pathWidthLower || rx > end) {
idx = (x / size) + 1;
x = x % size;
}
int idz;
if (z < 0) {
idz = z / size;
z = size + (z % size);
} else {
idz = (z / size) + 1;
z = z % size;
}
if (z <= pathWidthLower || z > end || x <= pathWidthLower || x > end) {
return null; return null;
} else { } else {
return PlotId.of(idx, idz); return PlotId.of(dx, dz);
} }
} }
@ -180,24 +168,10 @@ public abstract class SquarePlotManager extends GridPlotManager {
} }
end = pathWidthLower + squarePlotWorld.PLOT_WIDTH; end = pathWidthLower + squarePlotWorld.PLOT_WIDTH;
} }
int dx; int dx = Math.floorDiv(x, size) + 1;
int rx; int rx = Math.floorMod(x, size);
if (x < 0) { int dz = Math.floorDiv(z, size) + 1;
dx = x / size; int rz = Math.floorMod(z, size);
rx = size + (x % size);
} else {
dx = (x / size) + 1;
rx = x % size;
}
int dz;
int rz;
if (z < 0) {
dz = z / size;
rz = size + (z % size);
} else {
dz = (z / size) + 1;
rz = z % size;
}
PlotId id = PlotId.of(dx, dz); PlotId id = PlotId.of(dx, dz);
boolean[] merged = new boolean[]{rz <= pathWidthLower, rx > end, rz > end, rx <= pathWidthLower}; boolean[] merged = new boolean[]{rz <= pathWidthLower, rx > end, rz > end, rx <= pathWidthLower};
int hash = HashUtil.hash(merged); int hash = HashUtil.hash(merged);

View File

@ -36,7 +36,6 @@ import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.PlotTitle; import com.plotsquared.core.plot.PlotTitle;
import com.plotsquared.core.plot.PlotWeather; import com.plotsquared.core.plot.PlotWeather;
import com.plotsquared.core.plot.comment.CommentManager; import com.plotsquared.core.plot.comment.CommentManager;
import com.plotsquared.core.plot.expiration.ExpireManager;
import com.plotsquared.core.plot.flag.GlobalFlagContainer; import com.plotsquared.core.plot.flag.GlobalFlagContainer;
import com.plotsquared.core.plot.flag.PlotFlag; import com.plotsquared.core.plot.flag.PlotFlag;
import com.plotsquared.core.plot.flag.implementations.DenyExitFlag; import com.plotsquared.core.plot.flag.implementations.DenyExitFlag;
@ -163,8 +162,8 @@ public class PlotListener {
if ((last != null) && !last.getId().equals(plot.getId())) { if ((last != null) && !last.getId().equals(plot.getId())) {
plotExit(player, last); plotExit(player, last);
} }
if (ExpireManager.IMP != null) { if (PlotSquared.platform().expireManager() != null) {
ExpireManager.IMP.handleEntry(player, plot); PlotSquared.platform().expireManager().handleEntry(player, plot);
} }
lastPlot.set(plot); lastPlot.set(plot);
} }

View File

@ -162,6 +162,7 @@ public enum Permission {
PERMISSION_LIST_AREA("plots.list.area"), PERMISSION_LIST_AREA("plots.list.area"),
PERMISSION_ADMIN_COMMAND_LOAD("plots.admin.command.load"), PERMISSION_ADMIN_COMMAND_LOAD("plots.admin.command.load"),
PERMISSION_ADMIN_COMMAND_MERGE("plots.admin.command.merge"), PERMISSION_ADMIN_COMMAND_MERGE("plots.admin.command.merge"),
PERMISSION_ADMIN_COMMAND_MERGE_OTHER_OFFLINE("plots.admin.command.merge.other.offline"),
PERMISSION_ADMIN_COMMAND_SET_OWNER("plots.admin.command.setowner"), PERMISSION_ADMIN_COMMAND_SET_OWNER("plots.admin.command.setowner"),
PERMISSION_COMMENT("plots.comment"), PERMISSION_COMMENT("plots.comment"),
PERMISSION_INBOX("plots.inbox"), PERMISSION_INBOX("plots.inbox"),

View File

@ -42,7 +42,6 @@ import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.PlotCluster; import com.plotsquared.core.plot.PlotCluster;
import com.plotsquared.core.plot.PlotId; import com.plotsquared.core.plot.PlotId;
import com.plotsquared.core.plot.PlotWeather; import com.plotsquared.core.plot.PlotWeather;
import com.plotsquared.core.plot.expiration.ExpireManager;
import com.plotsquared.core.plot.flag.implementations.DoneFlag; import com.plotsquared.core.plot.flag.implementations.DoneFlag;
import com.plotsquared.core.plot.world.PlotAreaManager; import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.plot.world.SinglePlotArea; import com.plotsquared.core.plot.world.SinglePlotArea;
@ -618,8 +617,8 @@ public abstract class PlotPlayer<P> implements CommandCaller, OfflinePlotPlayer,
LOGGER.info("Plot {} was deleted + cleared due to {} getting banned", owned.getId(), getName()); LOGGER.info("Plot {} was deleted + cleared due to {} getting banned", owned.getId(), getName());
} }
} }
if (ExpireManager.IMP != null) { if (PlotSquared.platform().expireManager() != null) {
ExpireManager.IMP.storeDate(getUUID(), System.currentTimeMillis()); PlotSquared.platform().expireManager().storeDate(getUUID(), System.currentTimeMillis());
} }
PlotSquared.platform().playerManager().removePlayer(this); PlotSquared.platform().playerManager().removePlayer(this);
PlotSquared.platform().unregister(this); PlotSquared.platform().unregister(this);

View File

@ -40,7 +40,6 @@ import com.plotsquared.core.location.Location;
import com.plotsquared.core.permissions.Permission; import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.player.ConsolePlayer; import com.plotsquared.core.player.ConsolePlayer;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.expiration.ExpireManager;
import com.plotsquared.core.plot.expiration.PlotAnalysis; import com.plotsquared.core.plot.expiration.PlotAnalysis;
import com.plotsquared.core.plot.flag.FlagContainer; import com.plotsquared.core.plot.flag.FlagContainer;
import com.plotsquared.core.plot.flag.GlobalFlagContainer; import com.plotsquared.core.plot.flag.GlobalFlagContainer;
@ -1105,8 +1104,8 @@ public class Plot {
* @return A boolean indicating whether or not the operation succeeded * @return A boolean indicating whether or not the operation succeeded
*/ */
public <V> boolean setFlag(final @NonNull PlotFlag<V, ?> flag) { public <V> boolean setFlag(final @NonNull PlotFlag<V, ?> flag) {
if (flag instanceof KeepFlag && ExpireManager.IMP != null) { if (flag instanceof KeepFlag && PlotSquared.platform().expireManager() != null) {
ExpireManager.IMP.updateExpired(this); PlotSquared.platform().expireManager().updateExpired(this);
} }
for (final Plot plot : this.getConnectedPlots()) { for (final Plot plot : this.getConnectedPlots()) {
plot.getFlagContainer().addFlag(flag); plot.getFlagContainer().addFlag(flag);
@ -2831,11 +2830,11 @@ public class Plot {
Component members = PlayerManager.getPlayerList(this.getMembers(), player); Component members = PlayerManager.getPlayerList(this.getMembers(), player);
Component denied = PlayerManager.getPlayerList(this.getDenied(), player); Component denied = PlayerManager.getPlayerList(this.getDenied(), player);
String seen; String seen;
if (Settings.Enabled_Components.PLOT_EXPIRY && ExpireManager.IMP != null) { if (Settings.Enabled_Components.PLOT_EXPIRY && PlotSquared.platform().expireManager() != null) {
if (this.isOnline()) { if (this.isOnline()) {
seen = TranslatableCaption.of("info.now").getComponent(player); seen = TranslatableCaption.of("info.now").getComponent(player);
} else { } else {
int time = (int) (ExpireManager.IMP.getAge(this, false) / 1000); int time = (int) (PlotSquared.platform().expireManager().getAge(this, false) / 1000);
if (time != 0) { if (time != 0) {
seen = TimeUtil.secToTime(time); seen = TimeUtil.secToTime(time);
} else { } else {

View File

@ -112,7 +112,7 @@ public final class PlotId {
* @return Plot ID copy * @return Plot ID copy
* @deprecated PlotId is immutable, copy is not required. * @deprecated PlotId is immutable, copy is not required.
*/ */
@Deprecated(forRemoval = true, since = "TODO") @Deprecated(forRemoval = true, since = "6.10.2")
public @NonNull PlotId copy() { public @NonNull PlotId copy() {
return this; return this;
} }

View File

@ -18,7 +18,8 @@
*/ */
package com.plotsquared.core.plot; package com.plotsquared.core.plot;
import javax.annotation.Nullable; import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.Objects; import java.util.Objects;
public class PlotTitle { public class PlotTitle {

View File

@ -18,6 +18,8 @@
*/ */
package com.plotsquared.core.plot.expiration; package com.plotsquared.core.plot.expiration;
import com.google.inject.Inject;
import com.plotsquared.core.PlotPlatform;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.caption.Caption; import com.plotsquared.core.configuration.caption.Caption;
import com.plotsquared.core.configuration.caption.Templates; import com.plotsquared.core.configuration.caption.Templates;
@ -60,6 +62,10 @@ import java.util.concurrent.ConcurrentLinkedDeque;
public class ExpireManager { public class ExpireManager {
/**
* @deprecated Use {@link PlotPlatform#expireManager()} instead
*/
@Deprecated(forRemoval = true, since = "6.10.2")
public static ExpireManager IMP; public static ExpireManager IMP;
private final ConcurrentHashMap<UUID, Long> dates_cache; private final ConcurrentHashMap<UUID, Long> dates_cache;
private final ConcurrentHashMap<UUID, Long> account_age_cache; private final ConcurrentHashMap<UUID, Long> account_age_cache;
@ -71,6 +77,7 @@ public class ExpireManager {
*/ */
private int running; private int running;
@Inject
public ExpireManager(final @NonNull EventDispatcher eventDispatcher) { public ExpireManager(final @NonNull EventDispatcher eventDispatcher) {
this.tasks = new ArrayDeque<>(); this.tasks = new ArrayDeque<>();
this.dates_cache = new ConcurrentHashMap<>(); this.dates_cache = new ConcurrentHashMap<>();

View File

@ -18,6 +18,7 @@
*/ */
package com.plotsquared.core.plot.expiration; package com.plotsquared.core.plot.expiration;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.PlotArea;
@ -72,8 +73,9 @@ public class ExpiryTask {
min = false; min = false;
diff = plots.size() - settings.REQUIRED_PLOTS; diff = plots.size() - settings.REQUIRED_PLOTS;
} }
ExpireManager expireManager = PlotSquared.platform().expireManager();
List<Long> entireList = List<Long> entireList =
plots.stream().map(plot -> ExpireManager.IMP.getAge(plot, settings.DELETE_IF_OWNER_IS_UNKNOWN)) plots.stream().map(plot -> expireManager.getAge(plot, settings.DELETE_IF_OWNER_IS_UNKNOWN))
.collect(Collectors.toList()); .collect(Collectors.toList());
List<Long> top = new ArrayList<>(diff + 1); List<Long> top = new ArrayList<>(diff + 1);
if (diff > 1000) { if (diff > 1000) {

View File

@ -116,7 +116,7 @@ public class BlockArrayCacheScopedQueueCoordinator extends ScopedQueueCoordinato
x += offsetX; x += offsetX;
z += offsetZ; z += offsetZ;
if (x >= scopeMinX && x < scopeMaxX && y >= minY && y <= maxY && z >= scopeMinZ && z < scopeMaxZ) { if (x >= scopeMinX && x < scopeMaxX && y >= minY && y <= maxY && z >= scopeMinZ && z < scopeMaxZ) {
blockStates[y - minY][x][z] = id.toImmutableState(); blockStates[y - minY][x - scopeMinX][z - scopeMinZ] = id.toImmutableState();
} }
return false; return false;
} }

View File

@ -20,6 +20,7 @@ package com.plotsquared.core.util;
import com.google.common.eventbus.EventBus; import com.google.common.eventbus.EventBus;
import com.intellectualsites.annotations.DoNotUse; import com.intellectualsites.annotations.DoNotUse;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.events.PlayerAutoPlotEvent; import com.plotsquared.core.events.PlayerAutoPlotEvent;
@ -59,7 +60,6 @@ import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.PlotId; import com.plotsquared.core.plot.PlotId;
import com.plotsquared.core.plot.Rating; import com.plotsquared.core.plot.Rating;
import com.plotsquared.core.plot.expiration.ExpireManager;
import com.plotsquared.core.plot.flag.PlotFlag; import com.plotsquared.core.plot.flag.PlotFlag;
import com.plotsquared.core.plot.flag.implementations.DeviceInteractFlag; import com.plotsquared.core.plot.flag.implementations.DeviceInteractFlag;
import com.plotsquared.core.plot.flag.implementations.MiscPlaceFlag; import com.plotsquared.core.plot.flag.implementations.MiscPlaceFlag;
@ -300,8 +300,8 @@ public class EventDispatcher {
if (player == null) { if (player == null) {
return; //possible future warning message to figure out where we are retrieving null return; //possible future warning message to figure out where we are retrieving null
} }
if (ExpireManager.IMP != null) { if (PlotSquared.platform().expireManager() != null) {
ExpireManager.IMP.handleJoin(player); PlotSquared.platform().expireManager().handleJoin(player);
} }
if (this.worldEdit != null) { if (this.worldEdit != null) {
if (player.getAttribute("worldedit")) { if (player.getAttribute("worldedit")) {

View File

@ -29,7 +29,6 @@ import com.sk89q.worldedit.extension.input.ParserContext;
import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.BlockPattern;
import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.function.pattern.RandomPattern;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockState;
@ -44,7 +43,7 @@ public class PatternUtil {
public static BaseBlock apply(@NonNull Pattern pattern, int x, int y, int z) { public static BaseBlock apply(@NonNull Pattern pattern, int x, int y, int z) {
Preconditions.checkNotNull(pattern, "Pattern may not be null"); Preconditions.checkNotNull(pattern, "Pattern may not be null");
if (pattern instanceof BlockPattern || pattern instanceof RandomPattern if (pattern instanceof BlockPattern
|| pattern instanceof BlockState || pattern instanceof BlockType || pattern instanceof BlockState || pattern instanceof BlockType
|| pattern instanceof BaseBlock) { || pattern instanceof BaseBlock) {
return pattern.applyBlock(BlockVector3.ZERO); return pattern.applyBlock(BlockVector3.ZERO);

View File

@ -0,0 +1,53 @@
/*
* PlotSquared, a land and world management plugin for Minecraft.
* Copyright (C) IntellectualSites <https://intellectualsites.com>
* Copyright (C) IntellectualSites team and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.core.util;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.flag.PlotFlag;
import java.util.Objects;
/**
* Util class for generic methods relating to plot flags.
*
* @since 6.10.4
*/
public final class PlotFlagUtil {
private PlotFlagUtil() {
//No-op
}
/**
* Check if the value of a {@link PlotFlag} matches the given value. If
* road flags are disabled for the given plot area, returns false.
*
* @param flagClass boolean flag to get value of
* @param value boolean value to check flag value against
* @param <T> The flag value type
* @return true if road flag value matches with road flags enabled
* @since 6.10.4
*/
public static <T> boolean isAreaRoadFlagsAndFlagEquals(
PlotArea area, final Class<? extends PlotFlag<T, ?>> flagClass, T value
) {
return area.isRoadFlags() && Objects.equals(area.getRoadFlag(flagClass), value);
}
}

View File

@ -36,7 +36,8 @@ import java.util.regex.Pattern;
public class StringMan { public class StringMan {
private static final Pattern STRING_SPLIT_PATTERN = Pattern.compile("(?<quoted>\"[\\w ]+\")|(?<single>\\w+)"); // Stolen from https://stackoverflow.com/a/366532/12620913 | Debug: https://regex101.com/r/DudJLb/1
private static final Pattern STRING_SPLIT_PATTERN = Pattern.compile("[^\\s\"]+|\"([^\"]*)\"");
public static String replaceFromMap(String string, Map<String, String> replacements) { public static String replaceFromMap(String string, Map<String, String> replacements) {
StringBuilder sb = new StringBuilder(string); StringBuilder sb = new StringBuilder(string);
@ -355,7 +356,7 @@ public class StringMan {
var matcher = StringMan.STRING_SPLIT_PATTERN.matcher(message); var matcher = StringMan.STRING_SPLIT_PATTERN.matcher(message);
List<String> splitMessages = new ArrayList<>(); List<String> splitMessages = new ArrayList<>();
while (matcher.find()) { while (matcher.find()) {
splitMessages.add(matcher.group(0).replaceAll("\"", "")); splitMessages.add(matcher.group(matcher.groupCount() - 1).replaceAll("\"", ""));
} }
return splitMessages; return splitMessages;
} }

View File

@ -18,8 +18,8 @@
*/ */
package com.plotsquared.core.util.query; package com.plotsquared.core.util.query;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.expiration.ExpireManager;
import java.util.Collection; import java.util.Collection;
@ -27,7 +27,7 @@ class ExpiredPlotProvider implements PlotProvider {
@Override @Override
public Collection<Plot> getPlots() { public Collection<Plot> getPlots() {
return ExpireManager.IMP.getPendingExpired(); return PlotSquared.platform().expireManager().getPendingExpired();
} }
} }

View File

@ -101,7 +101,7 @@ public class FlagTest {
public void shouldSuccessfullyParseTitleFlagWithTitleEmptyAndSubTitleSingleWord() { public void shouldSuccessfullyParseTitleFlagWithTitleEmptyAndSubTitleSingleWord() {
Assertions.assertDoesNotThrow(() -> { Assertions.assertDoesNotThrow(() -> {
var title = PlotTitleFlag.TITLE_FLAG_DEFAULT.parse("\"\" \"single\"").getValue(); var title = PlotTitleFlag.TITLE_FLAG_DEFAULT.parse("\"\" \"single\"").getValue();
Assertions.assertEquals(" ", title.title()); Assertions.assertEquals("", title.title());
Assertions.assertEquals("single", title.subtitle()); Assertions.assertEquals("single", title.subtitle());
}, "Should not throw a FlagParseException"); }, "Should not throw a FlagParseException");
} }

View File

@ -32,7 +32,9 @@ public class StringManTest {
new Message("title", List.of("title")), new Message("title", List.of("title")),
new Message("title \"sub title\"", List.of("title", "sub title")), new Message("title \"sub title\"", List.of("title", "sub title")),
new Message("\"a title\" subtitle", List.of("a title", "subtitle")), new Message("\"a title\" subtitle", List.of("a title", "subtitle")),
new Message("\"title\" \"subtitle\"", List.of("title", "subtitle")) new Message("\"title\" \"subtitle\"", List.of("title", "subtitle")),
new Message("\"How <bold>bold</bold> of you\" \"to assume I like <rainbow>rainbows</rainbow>\"",
List.of("How <bold>bold</bold> of you", "to assume I like <rainbow>rainbows</rainbow>"))
); );
for (Message message : messages) { for (Message message : messages) {

View File

@ -19,7 +19,7 @@ plugins {
} }
group = "com.plotsquared" group = "com.plotsquared"
version = "6.10.2-SNAPSHOT" version = "6.10.6-SNAPSHOT"
subprojects { subprojects {
group = rootProject.group group = rootProject.group
@ -65,7 +65,7 @@ subprojects {
} }
dependencies { dependencies {
implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.16")) implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.21"))
} }
dependencies { dependencies {

View File

@ -1,11 +1,10 @@
[versions] [versions]
# Platform expectations # Platform expectations
paper = "1.18.1-R0.1-SNAPSHOT"
guice = "5.1.0" guice = "5.1.0"
spotbugs = "4.7.2" spotbugs = "4.7.3"
# Plugins # Plugins
worldedit = "7.2.12" worldedit = "7.2.13"
placeholderapi = "2.11.2" placeholderapi = "2.11.2"
luckperms = "5.4" luckperms = "5.4"
essentialsx = "2.19.7" essentialsx = "2.19.7"
@ -14,7 +13,7 @@ mvdwapi = "3.1.1"
# Third party # Third party
prtree = "2.0.0" prtree = "2.0.0"
aopalliance = "1.0" aopalliance = "1.0"
cloud-services = "1.7.1" cloud-services = "1.8.0"
arkitektonika = "2.1.1" arkitektonika = "2.1.1"
squirrelid = "0.3.1" squirrelid = "0.3.1"
http4j = "1.3" http4j = "1.3"
@ -26,9 +25,6 @@ licenser = "0.6.1"
nexus = "1.1.0" nexus = "1.1.0"
[libraries] [libraries]
# Platform expectations
paper = { group = "io.papermc.paper", name = "paper-api", version.ref = "paper" }
# Platform expectations # Platform expectations
guice = { group = "com.google.inject", name = "guice", version.ref = "guice" } guice = { group = "com.google.inject", name = "guice", version.ref = "guice" }
guiceassistedinject = { group = "com.google.inject.extensions", name = "guice-assistedinject", version.ref = "guice" } guiceassistedinject = { group = "com.google.inject.extensions", name = "guice-assistedinject", version.ref = "guice" }

Binary file not shown.

View File

@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

12
gradlew vendored
View File

@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop. # Darwin, MinGW, and NonStop.
# #
# (3) This script is generated from the Groovy template # (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project. # within the Gradle project.
# #
# You can find Gradle at https://github.com/gradle/gradle/. # You can find Gradle at https://github.com/gradle/gradle/.
@ -80,10 +80,10 @@ do
esac esac
done done
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # This is normally unused
# shellcheck disable=SC2034
APP_NAME="Gradle"
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #( case $MAX_FD in #(
max*) max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) || MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit" warn "Could not query maximum file descriptor limit"
esac esac
case $MAX_FD in #( case $MAX_FD in #(
'' | soft) :;; #( '' | soft) :;; #(
*) *)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" || ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD" warn "Could not set maximum file descriptor limit to $MAX_FD"
esac esac

1
gradlew.bat vendored
View File

@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=. if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%